Abstract
Extracting structured materials data from scientific literature is a significant bottleneck in materials informatics. This paper presents an "expert-grounded" framework that automates prompt engineering using a small set of expert-annotated papers and an iterative feedback loop. By applying the TextGrad framework to optimize prompts for Large Language Models (LLMs), the authors achieved a recall improvement from 0.27 to over 0.9 in extracting lattice constants for High-Entropy Alloys (HEAs). The resulting high-fidelity database enables rapid scientific discovery and demonstrates the transferability of optimized prompts across various frontier LLMs.
Introduction
In the field of materials informatics, progress is often bottlenecked by data availability. While thousands of papers contain experimental results, extracting that data into a structured database is a manual, grueling process that doesn't scale. This study specifically targets High-Entropy Alloys (HEAs). To design better HEAs, researchers require "lattice constants" (the physical dimensions of the crystal structure), but existing databases are often incomplete. While LLMs like Claude and GPT show promise for parsing these papers, they frequently struggle with technical nuances, unit conversions, and "hallucinations" without perfectly engineered prompts. Manual prompt engineering is a slow, trial-and-error process that often fails to generalize across different papers or models.
Methodology
The researchers introduced a three-module framework designed to automate the "human-in-the-loop" prompt engineering process:
- Expert Annotation: Domain experts manually label a very small subset (7 papers) to create a "ground truth" training set.
- Iterative Prompt Optimization: Using the TextGrad framework, the system treats the prompt as a set of trainable parameters. It uses an LLM (Claude 3.5 Sonnet) to extract data, compares it to the expert labels, and generates "textual gradients"—critiques explaining why extraction failed. These critiques are used to automatically rewrite and improve the prompt over several iterations.
- Large-Scale Extraction: The final, optimized prompt is deployed across a corpus of thousands of publications.
Key Results and Performance
The optimization process yielded a dramatic improvement in model performance. Initial prompts achieved a dismal recall of 0.273 across all named entities. Following optimization, recall surged to 0.919, while maintaining high precision. For the specific target of "As-cast single-phase BCC" alloys, the system achieved a precision of 0.915 and an F1 score of 0.945.
To validate the scientific utility of the extracted data, the authors built Machine Learning models (eSVR and eLASSO) using the values. These models achieved an $R^2 > 0.95$ in predicting lattice constants, matching the performance of models built on manually curated databases. Furthermore, the optimized prompts proved highly transferable; a prompt optimized for Claude 3.5 performed remarkably well on other frontier models like GPT-5 and Gemini 2.5 Flash.
Discussion and Insights
Several key insights emerged from this study:
- The Power of Small Data: Only seven well-chosen papers were required to transform the LLM from an unreliable tool into an expert-level extractor.
- The "Reasoning" Trap: While extended reasoning in newer models helps solve complex problems, it can lead to "over-inference," where models calculate or guess values not explicitly present in the text, leading to subtle hallucinations.
- Failure Modes: Errors were categorized into three main types: Contextual Hallucination (linking values to the wrong material), Semantic Misinterpretation (confusing distinct physical constants), and Unit Conversion Errors.
Conclusion
This expert-grounded framework demonstrates that automated prompt engineering can effectively bridge the gap between raw scientific literature and structured databases. While unit conversion remains a persistent challenge, the use of iterative feedback loops and small expert-labeled datasets provides a scalable path forward for materials informatics. Future work will focus on expanding training diversity and developing physical plausibility filters to further mitigate LLM hallucinations.
Summary updated