From Words to Molecules: A Survey of Large Language Models in Chemistry

Chang Liao, Yemin Yu, Yu Mei, Ying WeiarXiv 2024 · DOI

Introduction

The rapid advancement of Large Language Models (LLMs) has fundamentally altered the landscape of Natural Language Processing. However, applying these models to chemistry introduces unique complexities. Unlike natural language, the "language" of chemistry is structural, spatial, and governed by rigid physical laws. Molecules are represented through various formats, including SMILES strings, molecular graphs, and 3D coordinates, each possessing distinct semantic rules. This survey provides a systematic framework for understanding the integration of LLMs into chemical research, moving beyond their role as mere feature extractors to explore their potential as interactive assistants and autonomous agents.

Taxonomy of Chemical LLMs

The field of Chemical LLMs can be categorized through several dimensions, including encoding methods, model taxonomy, and training objectives.

A comprehensive taxonomy of Chemical LLMs, covering encoding methods, model types, training objectives, and applications.

The survey identifies three primary model types:

  1. Single-domain models: Pretrained exclusively on chemical strings (e.g., SMILES-BERT).
  2. Multi-domain models: Trained on a combination of chemical data and natural language (e.g., MolT5, BioT5).
  3. Multi-modal models: Integrating non-textual data such as molecular graphs or 3D conformations (e.g., MolCA, GIT-Mol).

Tokenization Strategies

A critical step in adapting LLMs for chemistry is tokenization—the process of decomposing a molecule into discrete units. The survey highlights three main strategies:

  • Character-level: Treating each character in a SMILES string (e.g., 'C', '(', '=') as an individual token.
  • Atom-level: Segmenting by chemical elements, ensuring that multi-character elements like 'Br' or 'Cl' are treated as single units.
  • Motif-level: Utilizing chemical intuition (functional groups) or data-driven algorithms like Byte-Pair Encoding (BPE) to identify recurring sub-structures.
Illustration of different tokenization levels for a SMILES string, from character-level to motif-level.

Motif-level tokenization, such as the BRICS method, is particularly advantageous as it produces "chemically sound" sub-units, aligning the model's internal representations more closely with human chemical knowledge.

Datasets and Pretraining Objectives

Training effective Chemical LLMs requires diverse datasets. These include large molecular corpora like PubChem and ZINC20, as well as text-molecule pairs (e.g., ChEBI-20, PCDes) for cross-modal tasks. Instruction-tuning datasets like Mol-Instructions are essential for teaching models to follow complex chemical commands. Furthermore, reaction data such as USPTO-50k serves as the benchmark for retrosynthesis and reaction prediction.

Pretraining objectives extend beyond standard next-token prediction. Techniques like Molecule Property Prediction (MPP) and Cross-modal Contrastive (XMC) learning are employed to align textual descriptions with molecular structures, enhancing the model's understanding of chemical properties.

Key Insights and Emerging Paradigms

The survey posits that chemical reactions are analogous to linguistic syntax, where bonds are broken and atoms exchanged according to physical "grammar" rules. A significant shift is occurring from models that merely "know" chemistry to agents that "do" chemistry. Systems like ChemCrow and Coscientist leverage LLMs to autonomously plan syntheses, search literature, and control laboratory hardware. Additionally, general-purpose LLMs like GPT-4 have shown remarkable "in-context learning" capabilities, performing chemical tasks with minimal examples and sometimes rivaling specialized models.

Benchmark results indicate that multi-modal models, which combine graph and text data, generally outperform text-only models in tasks like molecule captioning and retrieval. While incorporating MPP into pretraining improves convergence, it does increase initial training overhead. Furthermore, LLMs demonstrate significant potential in "Experimental Action Extraction," converting unstructured lab procedures into structured, actionable steps without specific fine-tuning.

Limitations and Future Directions

Despite significant progress, several challenges remain. Retrosynthesis of complex multi-step reactions is still difficult, and current datasets may not fully capture the vastness of the chemical universe. Interpretability is another hurdle; while Chain-of-Thought prompting provides some insight, the underlying logic of property predictions often remains opaque. Future work must focus on continual learning to incorporate new experimental data and the integration of LLMs with quantum chemistry and physics-based simulations to move beyond 2D representations.

Summary updated

BibTeX
@misc{liao2024from,
  author = {Chang Liao and Yemin Yu and Yu Mei and Ying Wei},
  title = {{From Words to Molecules: A Survey of Large Language Models in Chemistry}},
  year = {2024},
  eprint = {2402.01439},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.01439},
}
Figure