Small Molecule Optimization with Large Language Models

Philipp Guevorguian, Menua Bedrosian, Tigran Fahradyan, Hrant Khachatrian, Armen Aghajanyan · Submission to ICLR 2025 · Rejected

TL;DR

This paper introduces Chemlactica (125M, 1.3B) and Chemma (2B)—large language models pre-trained on a rich corpus of over 100 million molecules and their chemical properties. Coupled with an evolutionary optimization algorithm that treats the LLM as both a genetic operator and an oracle-steered generator, the approach sets new state-of-the-art results on the Practical Molecular Optimization (PMO) benchmark and dramatically reduces the number of evaluations needed in multi-property drug docking tasks.

What Problem Does This Paper Address?

Finding viable small-molecule drug candidates requires searching a combinatorial chemical space exceeding $10^{60}$ possibilities while simultaneously balancing binding affinity, drug-likeness, synthetic accessibility, and pharmacokinetics. Traditional computational approaches—such as graph-based genetic algorithms, reinforcement learning, and generative flow networks (GFlowNets)—often suffer from poor sample efficiency or get trapped in local optima.

While generic large language models (LLMs) excel at language and code, standard LLMs lack deep chemical semantics, and SMILES-only models struggle to generalize to multi-objective property optimization. The authors set out to determine whether chemistry-specialized LLMs can serve as guided search engines that efficiently navigate chemical space under tight evaluation budgets.

Methods

The authors' framework pairs domain-adapted language models with an evolutionary optimization loop:

  1. Pre-training on Structured Chemical Documents: The team initialized models from Galactica and Gemma checkpoints and performed continued pre-training on a customized PubChem corpus. Data is formatted into tagged key-value pairs (e.g., [QED]...[/QED], [SIMILAR]...[/SIMILAR], [START_SMILES]...[END_SMILES]). Property tags and SMILES sequences are randomized in order, enabling the models to perform both forward property prediction and inverse, property-conditioned molecular generation.
  2. LLM-Powered Evolutionary Search: Instead of heuristic crossover and mutation operators, the algorithm prompts the model with a subset of high-performing molecules from a candidate pool along with target similarity scores: [SIMILAR]m_1 0.9[/SIMILAR] ... [SIMILAR]m_S 0.8[/SIMILAR][START_SMILES]
  3. Explicit Oracle Modeling via Dynamic Fine-Tuning: When optimization stalls (no improvement over $K$ iterations), the model undergoes lightweight fine-tuning on the top-performing molecules and their oracle scores (rejection sampling). Subsequent generation prompts incorporate an explicit property target tag ([PROPERTY]target[/PROPERTY]).
  4. Generation Conditioning: Sampling utilizes dynamic temperature schedules (linearly increasing from 1.0 to 1.5 to promote late-stage diversity), repetition penalties, token suppression, and chain-of-thought property generation before emitting the SMILES string.
       [ Candidate Pool (Top-P) ]
                   │
      Sample S high-scoring molecules
                   │
                   ▼
     Prompt LLM (Genetic Crossover)
                   │
                   ▼
       Generate N New Molecules
                   │
         Black-Box Oracle Scoring
                   │
      Update Pool & Check Stagnation
                   │
     (If Stagnant: Fine-tune LLM on Pool)

Datasets

  • Pre-training Corpus: Built from PubChem dumps (cutoff January 2023), totaling >110 million molecules. RDKit was used to compute properties (MW, TPSA, CLogP, QED, SAS) and calculate ECFC4 similarities for 4 billion molecular pairs (downsampled from 200 billion).
  • MoleculeNet Benchmarks: Evaluated on regression tasks (ESOL, FreeSolv, Lipophilicity) and classification (BBBP).
  • ADME Benchmark: Evaluated against 6 industrial absorption, distribution, metabolism, and excretion in vitro datasets from Fang et al. via the Polaris Hub.
  • Optimization Benchmarks:
  • PMO (Practical Molecular Optimization): 23 diverse molecular design tasks capped at 10,000 oracle evaluations.
  • Docking Multi-Property Optimization (MPO): Protein targets including DRD2, AChE, MK2 (capped at 5,000 evaluations), alongside PARP1, FA7, 5HT1B, BRAF, and JAK2 (capped at 3,000 evaluations).

Key Insights and Ideas

  • LLMs as Genetic Operators: Prompting an LLM with several candidate molecules plus similarity tags acts as an effective, chemically aware crossover operator, producing valid, drug-like offspring without manual fragment-splicing rules.
  • Novelty over Memorization: Despite pre-training on 110M PubChem structures, the models regularly generated top-scoring molecules with Tanimoto similarity $< 0.3$ to their nearest PubChem neighbors, proving the models explore chemical space rather than regurgitating training samples.
  • Sensitivity to Numerical Precision: Lower precision (bfloat16) caused error accumulation during batched autoregressive generation, which created feedback loops of lower-quality candidates during iterative fine-tuning. Maintaining full FP32 precision during optimization restored search performance.
  • Tag-Conditioned Priors: By training on property tags, the model naturally incorporates prompt hints. Exposing internal oracle properties (like molecular weight or target TPSA) directly within the prompt boosted PMO performance dramatically.

Key Results

  • PMO Benchmark: Chemlactica-125M achieved an aggregate Top-10 AUC of 17.170, Chemlactica-1.3B achieved 17.284, and Chemma-2B achieved 17.534, cleanly surpassing the previous state-of-the-art method, Genetic-Guided GFlowNets (16.213).
  • Sample Efficiency in Docking: On DRD2 and MK2 docking targets, Chemlactica reached reward thresholds ($\ge 0.8$) within tens to hundreds of oracle evaluations—up to 4× faster (lower oracle burden) than prior methods like Augmented Memory and Beam Structure baselines.
  • Hit Rates: On target FA7, Chemlactica-1.3B achieved an 87.03% Hit Ratio and a 68.22% Strict Hit Ratio (vs. Saturn's 14.53% and 13.89%, respectively).
  • Property Prediction: The models achieved competitive RMSE scores without custom prediction heads, outperforming models like GROVER and Chemformer on ESOL ($0.251$ RMSE for Chemlactica-1.3B) and FreeSolv ($0.286$ RMSE).

Limitations and Future Work

  • 1D/2D String Modality Only: The models operate exclusively on 1D SMILES strings. They lack 3D conformational awareness, which limits direct modeling of pocket binding geometries.
  • Synthetic Accessibility Gaps: Although SAS scores can be guided, the algorithm does not explicitly enforce synthetic accessibility routes or reaction feasibility steps.
  • Computational Cost: Iterative online fine-tuning and FP32 generation introduce non-trivial compute overhead compared to simple graph algorithms.
  • Future Directions: Integrating 3D structural constraints directly into tokenization, tightening sample efficiency on expensive wet-lab or DFT oracles, and applying the pipeline to macrocycles or biopolymers.

Summary updated

BibTeX
@inproceedings{guevorguian2024small,
  author = {Philipp Guevorguian and Menua Bedrosian and Tigran Fahradyan and Hrant Khachatrian and Armen Aghajanyan},
  title = {{Small Molecule Optimization with Large Language Models}},
  booktitle = {FM4Science @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=nJCYKdRZXb},
}
Figure