KnowMol: Advancing Molecular Large Language Models with Multi-Level Chemical Knowledge

Zaifei Yang, Hong Chang, RuiBing Hou, Shiguang Shan, Xilin Chen

TL;DR

Current molecular large language models (Mol-LLMs) frequently hallucinate chemical formulas, misidentify functional groups, and fail to understand structural hierarchies. KnowMol addresses this by pairing a high-quality, multi-level dataset (KnowMol-100K) with chemically-informative 1D and 2D representation strategies. As a result, it achieves state-of-the-art performance across molecular captioning, property prediction, and multi-step chemical generation tasks while significantly reducing pretraining costs.

What Problem Does This Paper Address?

While general-purpose LLMs have shown promise in chemistry, existing Mol-LLMs frequently fail at fundamental chemical reasoning. They miscalculate molecular formulas, hallucinate functional groups, and misinterpret how substructures connect.

The authors identify two root causes behind these failures:

  1. Low-Quality Pretraining Text: Pretraining typically relies on databases like PubChem, where descriptions are brief, coarse, and heavily biased toward a few properties while almost entirely ignoring attributes like polarity, stereochemistry, and electrophilicity.
  2. Suboptimal Molecular Encodings: For 1D representations, models commonly use SMILES with standard text tokenizers, causing token-sharing conflicts between chemical strings and natural language. For 2D representations, standard graph neural networks (GNNs) only output flat, atomic-level tokens, ignoring the hierarchical composition (atoms $\rightarrow$ functional groups $\rightarrow$ whole molecule) essential to chemical reasoning.

Methods

KnowMol solves these issues through a data-centric and architectural overhaul:

                  ┌────────────────────────────────────────┐
                  │          KnowMol Architecture          │
                  └────────────────────────────────────────┘
  1D String:                 2D Graph:
  SELFIES                    GNN (MoleculeSTM)
     │                              │
  Dedicated                  Local & Global Pooling
  Vocabulary                        │
     │                       [Atoms] [Groups] [Molecule]
     │                          │        │        │
     │                       (Separate Linear MLPs)
     │                                  │
     └────────────────►  LLM  ◄─────────┘
                    (Vicuna-7B + LoRA)
  • KnowMol-100K Dataset Construction: Using a diverse sample of 100,000 molecules filtered via the MaxMin algorithm from PubChem, the authors construct four levels of structured annotations:
  • Atomic Level: Ground-truth element counts and formulas parsed from PubChem.
  • Functional Group Level: Deterministic identification of 82 common functional groups using RDKit and the BRICS fragmentation algorithm.
  • Structural Construction Level: GPT-4o synthesizes main-chain, side-chain, and ring connectivity using SMILES, IUPAC names, molecular images, and detected functional groups.
  • Physicochemical Property Level: GPT-4o evaluates six core properties (polarity, acidity/basicity, solubility, reactivity, stereochemistry, electrophilicity) using explicit physical organic chemistry guidelines.
  • Dedicated 1D Tokenization: The authors replace SMILES with SELFIES (which guarantees 100% chemical validity) and introduce a dedicated, non-overlapping vocabulary where each bracketed chemical unit is its own token, eliminating cross-modal token confusion.
  • Hierarchical 2D Graph Encoder: Built on a 5-layer GIN (from MoleculeSTM), KnowMol extracts atomic tokens, uses BRICS-guided local pooling to aggregate atoms into functional group tokens, and applies global pooling for a molecule-level token. Each hierarchy level is mapped into the LLM space via separate single-layer MLPs without adding GNN parameters.
  • Two-Stage Training:
  • Stage 1 (Pretraining): Trains projection MLPs and LLM LoRA weights (freezing the GNN) on two instruction tasks: Multi-Round Question Answering and Description-Guided Molecule Generation.
  • Stage 2 (Task-Specific Fine-Tuning): Adapts LoRA weights to downstream benchmarks.

Datasets

  • KnowMol-100K (New): 100,000 diverse molecules annotated across four chemical levels, yielding 200,000 instruction-following samples.
  • ChEBI-20: Benchmark for molecule captioning (generating natural language descriptions from molecular structures).
  • MoleculeNet (Classification): BACE, BBBP, HIV, MUV, and Tox21 property prediction benchmarks.
  • QM9 (Regression): Quantum mechanical properties, specifically HOMO, LUMO, and HOMO-LUMO gap ($\Delta\epsilon$).
  • Mol-Instructions Benchmark (Generation): Four core tasks: Caption-Guided Molecule Generation, Reagent Prediction, Forward Reaction Prediction, and Retrosynthesis Prediction.

Key Insights and Ideas

  • Chemical Hierarchy Matters for Language Models: Flattening a molecular graph into disconnected atom tokens forces the LLM to infer higher-order chemistry from scratch. Explicitly providing functional group and molecule-level pooled tokens directly improves reasoning about reactivity and properties.
  • Data Quality Beats Pretraining Quantity: Prior state-of-the-art models like UniMoT required multi-stage pretraining over hundreds of thousands of PubChem entries for dozens of epochs. KnowMol outperforms them with just 5 pretraining epochs on 200K curated samples, proving that granularity and multi-perspective annotations dramatically accelerate cross-modal alignment.
  • Separating Chemical and Natural Vocabulary Prevents Modality Confusion: Treating bracketed SELFIES units as discrete, independent tokens avoids interference with standard subword tokenization in LLM vocabularies.

Key Results

Across molecular comprehension and generation tasks, KnowMol consistently outperforms both specialized models and LLM generalists:

Task / Metric Baseline (UniMoT / InstructMol) KnowMol (Ours)
ChEBI-20 Description (BLEU-4) 0.583 (UniMoT) 0.595 (0.518 zero-shot PubChem)
ChEBI-20 Description (ROUGE-2) 0.584 (UniMoT) 0.601
Forward Reaction Prediction (Exact Match) 0.611 (UniMoT) / 0.536 (InstructMol) 0.752
Forward Reaction Prediction (Levenshtein $\downarrow$) 8.297 (UniMoT) 5.662
Retrosynthesis Prediction (Exact Match) 0.478 (UniMoT) / 0.407 (InstructMol) 0.598
QM9 Regression (Average MAE $\downarrow$) 0.0049 (UniMoT) / 0.0050 (InstructMol) 0.0030
MoleculeNet Classification (BACE ROC-AUC) 77.1 (HIGHT) / 64.3 (InstructMol) 85.9

In ablation studies on forward reaction prediction, removing hierarchical graph tokens dropped Exact Match from 0.752 to 0.622, demonstrating the critical impact of multi-level representation.

Limitations and Future Work

  • Reliance on LLM Data Generation: Higher-level structural and property descriptions in KnowMol-100K are generated by GPT-4o. Although human expert evaluations scored descriptions at 2.43/3.0 for quality, automated generation still carries risks of subtle hallucinated rationales.
  • Lack of 3D Conformations: The current pipeline only handles 1D text/SELFIES and 2D topology graphs, omitting 3D stereochemical conformations and spatial coordinates critical for binding affinity and docking.
  • Statistical Significance: Due to the computational demands of fine-tuning 7B-parameter models across multiple benchmarks, error bars and repeated random seeds were not reported.

Summary updated

BibTeX
@inproceedings{yang2025knowmol,
  author = {Zaifei Yang and Hong Chang and RuiBing Hou and Shiguang Shan and Xilin Chen},
  title = {{KnowMol: Advancing Molecular Large Language Models with Multi-Level Chemical Knowledge}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=oLGUJ7OmyE},
}
Figure