Fine-Tuned LLMs Predict Molecular Geometries Better Than Specialized Deep Learning Models

Large language models have transformed how machines process text, but their ability to learn the “language of molecular geometry”, the spatial arrangement of atoms in three dimensions, has remained largely unexplored. A new preprint from a team led by Joseph Cavanagh and Teresa Head-Gordon at the University of California, Berkeley, suggests the answer is: remarkably well.

The researchers fine-tuned frontier LLMs on molecular geometries and found that the approach outperforms specialized deep learning models for predicting equilibrium structures and generating diverse conformers of small organic and drug-like molecules, while retaining the model’s pretrained natural language abilities.

Cartesian coordinates vs. Z-matrices

Molecules can be described in three dimensions in two principal ways. Cartesian coordinates (x, y, z positions for each atom) are intuitive and widely used, but they are not invariant under rotation or translation, the same molecule described in a different orientation looks like a different structure to the model.

Z-matrices, an older representation common in computational chemistry, specify each atom’s position relative to previously placed atoms using bond lengths, bond angles, and dihedral angles. This representation inherently captures the relational structure of a molecule, which atoms are bonded to which, at what distances, and in what orientation relative to neighbors.

The team found that both representations worked, but the Z-matrix was clearly superior. “The inherent invariances and relational nature of geometries represented as Z-matrices provides a better grammar for LLM adaptation,” the authors write.

Performance and practical implications

The fine-tuned LLMs outperformed specialized deep learning models, including graph neural networks and equivariant networks, on predicting equilibrium structures (the lowest-energy geometry a molecule adopts) and generating diverse, chemically plausible conformers (alternative three-dimensional arrangements with similar energies).

The approach is also remarkably simple: no complex architecture changes, no custom loss functions, no domain-specific feature engineering. The standard LLM fine-tuning process, treating molecular geometries as sequences of tokens, works with minimal modification.

Crucially, the team showed that mixing small amounts of natural language prompt-response pairs into the fine-tuning data preserves nearly all of the model’s pretrained language abilities. This means the same model can both predict molecular geometries and answer questions about chemistry, a dual-use capability that opens the door to multi-task scientific agents.

A new tool for drug discovery

Accurate molecular geometries are a prerequisite for computational drug discovery: predicting how a drug candidate binds to a protein target, how it behaves in solution, and what conformations it can adopt all depend on knowing its three-dimensional structure. Current methods, density functional theory (accurate but slow) and specialized machine-learning models (fast but limited by training data), each have trade-offs.

An LLM that can generate high-quality geometries while retaining general language capabilities could act as a flexible front end for computational chemistry, generating candidate structures that can then be refined with more expensive methods.

Caveats

As a preprint posted to arXiv on July 15, 2026, this work has not yet undergone peer review. The study focuses on small organic and drug-like molecules; performance on larger systems, peptides, proteins, or inorganic complexes, has not been demonstrated. The comparison with specialized models is promising but will need independent validation.


Sources:

1. Cavanagh, J.M. et al. “How Well Can Frontier Large Language Models Generate Structures? High Quality Prediction of Molecular Geometries with Help from Fine-Tuning.” arXiv:2607.13350 (2026). https://arxiv.org/abs/2607.13350

Scroll to Top