Regression with Large Language Models for Materials and Molecular Property Prediction

Ryan Jacobs, Maciej P. Polak, Lane E. Schultz, Hamed Mahdavi, Vasant G. Honavar, Dane Morgan · DOI

Introduction

Recent research explores the potential of Large Language Models (LLMs), specifically LLaMA 3, to serve as effective regression engines for chemical and materials science. By fine-tuning these models on textual representations of molecular structures, researchers have achieved property prediction accuracies that compete with traditional machine learning baselines, offering a streamlined alternative to complex feature engineering.

The Challenge of Property Prediction

Predicting physical and chemical properties—such as stability or electronic bandgaps—is vital for discovering new materials. Traditional methods rely on "featurization," where chemical structures are manually converted into mathematical formats. While specialized models like Graph Neural Networks (GNNs) are highly accurate, they often require precise 3D atomic coordinates. This study investigates whether LLMs can bypass complex feature engineering by performing high-precision numerical regression using only "textual" chemistry descriptions, such as SMILES strings.

Methodology

The researchers utilized the LLaMA 3 (8B variant), fine-tuned via Low-Rank Adaptation (LoRA) to minimize computational overhead. Unlike standard regression models that use Mean Squared Error, this approach leverages the model's native generative cross-entropy loss. The model essentially learns to predict numerical values as a sequence of characters. Performance was benchmarked against GPT-3.5, GPT-4o, Random Forest (RF) baselines, and specialized state-of-the-art (SOTA) architectures like PAMNet and Roost.

Datasets

The study employed an extensive range of data spanning molecular and materials science. Key benchmarks included the QM9 Dataset (~134,000 organic molecules) and the Open Quantum Materials Database (OQMD) (over 600,000 data points). Additionally, 24 diverse materials datasets were used to test the model's versatility across various physical properties.

Table summarizing the diverse molecular and materials property datasets used in the study.

Key Insights

Several critical factors influenced the success of LLM-based regression:

  • Textual Representation: SMILES strings proved highly effective. Interestingly, adding 3D coordinates did not significantly boost performance, suggesting LLMs currently excel more at sequence-based patterns than spatial ones.
  • Tokenization Strategy: LLaMA 3's digit-by-digit tokenization likely contributed to its superior performance over GPT models, which often group digits and lose numerical precision.
  • Language Choice: SMILES strings outperformed InChI strings by 15-20%, likely due to their more compact and parseable nature for the model.

Results

LLaMA 3 demonstrated competitive performance across several benchmarks:

  • QM9 Performance: The model achieved a Mean Absolute Error (MAE) of 0.100 eV for formation energy. While trailing specialized SOTA models (0.0059 eV), it remained competitive with standard neural networks.
  • Comparison with GPT: LLaMA 3 (8B) consistently outperformed GPT-4o-mini, which exhibited error rates approximately 1.5x higher.
  • Materials Versatility: In comparisons with Random Forest models across 23 materials datasets, LLaMA 3 performed equally or better in nearly half the cases, despite lacking domain-specific features.
  • Scaling: The model exhibited "power-law scaling," indicating that accuracy improves predictably with increased training data.

Conclusion and Future Directions

While LLMs show great promise as "generalist" models for chemistry, they do not yet replace specialized 3D-aware architectures, which remain 5-10x more accurate. Furthermore, the computational cost of fine-tuning an 8B parameter model is significantly higher than traditional baselines. Future research will likely focus on larger models (e.g., LLaMA 3 70B), improving 3D geometric understanding, and utilizing multitask learning to further enhance predictive accuracy.

Summary updated

BibTeX
@misc{jacobs2024regression,
  author = {Ryan Jacobs and Maciej P. Polak and Lane E. Schultz and Hamed Mahdavi and Vasant G. Honavar and Dane Morgan},
  title = {{Regression with Large Language Models for Materials and Molecular Property Prediction}},
  year = {2024},
  eprint = {2409.06080},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.06080},
}
Figure