Manuscript Offprint

arXiv:2611.03767

Quantifying out-of-distribution data severity with Wasserstein distances: benchmarking large language models for alloy property prediction

YuJie Liu, Dezhen Xue, Jun Sun, Xiangdong Ding, Zhibin Gao, Turab Lookman

Abstract

As general-purpose Large Language Models (LLMs), such as Gemini and DeepSeek, exhibit increasingly advanced reasoning capabilities, a critical question arises: how do their property prediction abilities compare to those of domain-specific pretrained materials models? In this study, we evaluate predictions for Ti, steels, high-entropy alloy (HEA) and Al, demonstrating that general-purpose LLMs surprisingly outperform SteelBERT, MatSciBERT, and SciBERT. To further enhance performance, we introduce a hybrid approach that utilizes numerical priors from a prior model, such as CatBoost or SteelBERT, to guide the general LLMs (Deepseek V3.1, Gemini-2.5-Flash). By inputting these initial estimates from a prior model as prompts, the LLM acts as a reasoning corrector, achieving accuracy superior to the prior model and “unguided mode”. Furthermore, we investigate the impact of data strategy using a similarity-based metric, revealing that data quality dominates quantity; using merely 5% of high-similarity reference data of training set as input yields performance similar to the results of using 100% of training set. Additionally, the LLMs demonstrate excellent uncertainty calibration, where self-reported "high" confidence strongly correlates with minimal deviation from ground truth. Our findings suggest that synergizing general-purpose LLMs with prior model numerical baselines and high-quality data curation creates a cost-effective and accurate paradigm for materials discovery, reducing the need for expensive domain-specific pretraining.

1 Introduction

The rapid advancement of machine learning in materials science has traditionally emphasized domain-specific models pretrained on vast corpora of specialized literature, such as journal articles, reports, and databases 1−7^{1-7}. This approach stems from the prevailing view that extensive, targeted data is essential for accurate predictions, with techniques such as fine-tuning 8−10^{8-10} and Retrieval-Augmented Generation (RAG) 11^{11} further refining these models for specific tasks 12−15^{12-15}. Pretrained models tailored to materials classes—such as SteelBERT 4^{4} for steels, MatSciBERT 16^{16} for broader materials science, and SciBERT 17^{17} for scientific text—have shown promise in encoding domain knowledge, enabling downstream tasks such as property prediction 18−20^{18-20} and synthesis protocol extraction 1,21−27^{1,21-27}.

However, recent developments in natural language processing have shifted this landscape. Optimization strategies, such as Reinforcement Learning (RL) during fine-tuning or pretraining, have endowed general-purpose Large Language Models (LLMs) with superior reasoning capabilities 28−31^{28-31}. Trained on diverse, internet-scale datasets encompassing trillions of tokens, Gemini and DeepSeek can perform complex inference without explicit domain adaptation 21,32^{21,32}. Recent studies suggest that a key to unlocking general-purpose LLMs lies in advanced prompt engineering and in-context learning (ICL). Few-shot learning shows that providing LLMs with a small number of high-quality examples can significantly mitigate data scarcity, allowing models to identify patterns without extensive retraining 33,34^{33,34}. For example, Polak and Morgan utilized conversational redundancy to extract accurate data from text without fine-tuning 25^{25}, while the MatAgent framework demonstrated that LLMs could orchestrate external tools for property retrieval 35^{35}. Despite these successes in text-based reasoning, applying general LLMs to direct numerical regression remains a complex hurdle. Nevertheless, Wang et al. 36^{36} evaluated the robustness of LLMs in predicting steel yield strengths, to reveal that while retrieving "nearest neighbor" examples improves accuracy, pretrained LLMs often suffer from "mode collapse"—a tendency to default to high-frequency training values when the input distribution shifts. Critically, their approach relies on the LLM to perform the regression task purely from the provided context, which exposes the model's inherent weakness in precise arithmetic and extrapolation. This raises a key question: can these general LLMs rival or surpass models pretrained for materials property prediction, particularly for metallic alloys where data scarcity and compositional and processing complexity pose challenges?

In this work, we address this issue by systematically comparing general-purpose LLMs against domain-specific pretrained models across datasets for several alloys including Titanium (Ti), High-entropy alloy (HEA), Aluminum (Al) and Steels. Unlike Wang et al., where ICL is used for direct prediction, we introduce a hybrid "Guided Mode" framework. This approach integrates computationally inexpensive prior models (e.g., CatBoost or pretrained encoders) to provide initial numerical priors as prompts to the LLM. This "guided mode" transforms the role of the LLM from a standalone calculator into a reasoning-based corrector, leveraging its semantic understanding of physical principles and strength-ductility trade-offs to refine estimates. We also employ RAG with semantic similarity or "Querying for Maximally Informative Samples" (via all-MiniLM-L6-v2 embeddings) to prioritize data quality over quantity, demonstrating that 5% of highly relevant reference samples can match or exceed the performance of full datasets. Our findings reveal that general-purpose LLMs not only match but often outperform domain-specific models, achieving R² values up to 0.886 for ultimate tensile strength (UTS) in Ti alloys—comparable to traditional ML baselines—while excelling in properties such as elongation (R² = 0.798) that are experimentally more difficult to measure accurately. This suggests that emergent reasoning from broad pretraining can implicitly capture materials knowledge without costly domain-specific efforts. In addition, for LLM predictions with self-reported confidence, we find that with multi-target prediction, the ultimate threshold strength (UTS) for which reliable data is available, outperforms its counterpart in the single-target setting. Moreover, the self-reported confidence indicates that higher confidence is associated with a larger proportion of low-error predictions. The impact on materials discovery is that this approach enables rapid, low-cost screening of alloys for applications in aerospace, energy, and biomedicine, democratizing access to predictive tools and accelerating innovation in data-limited fields.

Despite these advances, limitations exist. LLMs exhibit inherent stochasticity even at zero temperature, stemming from architectural factors which can introduce variability in outputs. The uncertainty primarily stems from non-deterministic computations inherent in the inference process, including floating-point rounding errors, differences in parallelism across distributed inference nodes, variable system cache states, and minor variations in tokenization boundaries. Additionally, performance dips in heterogeneous datasets (e.g., steels with inconsistent processing descriptions), highlights the need for standardized data formats. While our self-reported confidence calibration correlates well with accuracy, it relies on prompt engineering, which may not generalize across all models or tasks. Nonetheless, by synergizing general LLMs with given data strategies, this study paves the way for a more efficient, reasoning-driven approach in materials science.

References (43)