TL;DR
Large language models (LLMs) are increasingly used in materials science, but how do they actually encode and retrieve scientific knowledge? By testing 28 LLMs across four tasks, this paper reveals a sharp divide: fine-tuning makes models consistent on symbolic tasks (like classifying crystal systems), but leaves them noisy and inconsistent on numerical predictions (like bandgap)—even when their internal layers actually hold better answers than their text outputs. Worse, API-served models like GPT-4o can drift by up to 43% over 18 months, posing a major reproducibility headache for science.
What Problem Does This Paper Address?
Materials scientists are rapidly adopting LLMs because, unlike traditional machine learning models (which require painstakingly engineered structural descriptors or graphs), LLMs accept plain-text chemical formulas and questions. Yet fundamental questions remain: How much materials science do base models actually know? Does fine-tuning teach them real physical understanding or just statistical pattern-matching? And how reliable are their answers?
Methods
The authors evaluated 28 LLMs—spanning open-weights models (Llama, Mistral, Gemma, DeepSeek/Qwen, Zephyr, Phi) and proprietary APIs (GPT, Claude)—across more than 400 base, fine-tuned, and cross-task configurations. Each prompt was run 10 times at low temperature ($T = 0.1$) to measure both accuracy and response entropy (how consistent the model is from run to run).
Beyond standard text generation, the authors used two additional probes:
- Layer-wise probing: Extracting internal embeddings from intermediate transformer layers of fine-tuned models and training simple ridge regression or two-layer neural networks to see if the model "knows" more internally than it can express in text.
- Longitudinal tracking: Running identical bandgap evaluations on four API-served GPT models over 18 months to measure temporal drift.
Datasets
The study spans four tasks across two output modalities, drawn from two public resources:
- Symbolic tasks: MatKG link prediction (9,418 training and 2,355 test examples from the MatKG literature knowledge graph, where models generate five entities given a subject and relation) and crystal system classification (33,648 compositions from the Materials Project assigned to one of seven crystal systems).
- Numerical tasks: Bandgap prediction (17,073 entries from the Materials Project) and dielectric constant prediction (4,870 entries from the Materials Project), both predicted from chemical formula alone.
Key Insights and Ideas
- Output modality governs behavior: On symbolic tasks, fine-tuning collapses run-to-run variance onto a single verifiable answer. On numerical tasks, accuracy improves, but run-to-run disagreement stays high—meaning response entropy is a useful confidence signal for symbolic tasks, but useless for numerical ones.
- The "LLM head bottleneck": For bandgap prediction, intermediate transformer layers encode more predictive information than the model's final text output, suggesting the language modeling head degrades numerical precision during verbalization.
- Statistical landscape over physical understanding: In MatKG link prediction, a simple subject-blind baseline that just guesses the most frequent answers for a given relation hits 32.2% Top-1 accuracy. Fine-tuning teaches models the statistical answer landscape (with object frequency strongly driving accuracy), rather than causal materials relationships.
- Scale matters less after fine-tuning: Once models pass a ~7B parameter floor (below which models like Gemma-2B and Phi-3-mini struggle), small fine-tuned models frequently match or beat much larger ones.
- Cross-task transfer is modality-bound: Fine-tuning on one numerical task helps the other, but transferring between symbolic and numerical tasks consistently fails.
Key Results
- MatKG link prediction: Base models scored 0.0–9.9% Top-1 accuracy; fine-tuning boosted this to 59–68% (led by GPT-4.1-mini at 67.6%), while slashing mean response entropy by 91% (0.49 to 0.05).
- Crystal system classification: Most base models sat at or below the 23.9% majority-class baseline, except Claude 5 models—
claude-fable-5hit 68.4% without fine-tuning, beating every fine-tuned model (16.8–65.8%). - Numerical regression: Fine-tuning cut bandgap RMSE from 0.96–2.74 eV (base) down to 0.70–1.69 eV (led by Llama-3-70B at 0.70 eV), and dielectric constant RMSE from 3.6–238 down to 1.77–11.7 (led by GPT-4o at 1.77). Yet mean entropy barely budged (falling only from 1.67 to 1.31 for bandgap, and 2.22 to 1.66 for dielectric).
- Temporal drift: Over 18 months, API-served GPT models showed 9–43% performance variation on identical bandgap tasks (9% for GPT-4, 19% for GPT-3.5, 13% for fine-tuned GPT-FT, and 43% for GPT-4o following a November 2024 endpoint update).
Limitations and Future Work
- Chemical formulas alone are not sufficient descriptors for properties like bandgap or dielectric constant, which also depend on crystal structure, processing, and microstructure.
- The dielectric dataset is relatively small (4,870 samples) and heavily right-skewed, which may limit embedding probes on high-dielectric outliers.
- For reproducible science, the authors recommend using frozen open-weights checkpoints over drifting APIs, extracting intermediate-layer embeddings for numerical tasks, and building multi-task benchmarks with better-calibrated reliability metrics.
Summary updated