MolReps: Taking SELFIES, Making SMILES, Teaching LLMs

Ken Deng, Garrett MorrisarXiv 2026 · arXiv

TL;DR

The authors introduce MolReps, a comprehensive pipeline and dataset designed to teach Large Language Models (LLMs) how to translate between different molecular representations (like SMILES, SELFIES, and InChI). While targeted post-training dramatically improves a model's ability to recognize familiar molecules across formats, the study reveals a significant "generalization gap" where models struggle to apply these rules to entirely new chemical structures.

What Problem Does This Paper Address?

In chemistry, a single molecule can be described in many ways: as a 2D image, a compact text string (SMILES), a robust grammar (SELFIES), a standardized identifier (InChI), or a formal name (IUPAC). While LLMs are increasingly used for tasks like drug discovery and property prediction, it remains unclear if they truly "understand" that these different strings represent the same physical object.

Most existing molecular LLMs rely on a single representation or a fixed set of formats. This lack of "chemical literacy"—the ability to relate equivalent encodings—limits a model's flexibility and makes it difficult for researchers to choose the most effective representation for a given task. The authors set out to systematically measure and improve this cross-representation understanding.

Figure 1: Overview of MolReps. (a) Ten representations of one molecule. (b) Six task templates, scored by InChIKey match under molecule-overlap and molecule-disjoint protocols. (c) LoRA post-training of text-only and multimodal Qwen3 models. (d) InChIKey match rises from 4.01% to 75.13% on molecule-overlap. (e) 27.84% average gain on MolRepBench.

Methods

The authors developed the MolReps pipeline, which generates 9,600 question-answer pairs for 200 molecules. The pipeline covers ten different representations across four categories: linear notations, structured markup (CML), natural language (IUPAC), and visual (2D images).

Key methodological choices include:

  • Task Diversity: The dataset includes tasks for Translation (e.g., SMILES to InChI), Normalization (converting randomized strings to canonical ones), and 2D Structure Recognition (Optical Chemical Structure Recognition, or OCSR).
  • Rigorous Evaluation: Instead of simple string matching, the authors use InChIKey Match (IKM). Since different strings can represent the same molecule, they convert the model's output back into a canonical InChIKey to verify structural correctness.
  • Evaluation Protocols: They distinguish between Molecule-Overlap (MO), where the test set contains molecules seen during training (but in different QA pairs), and Molecule-Disjoint (MD), where the test molecules are entirely new. This isolates memorization from true structural generalization.
  • Model Training: They fine-tuned both text-only (Qwen3-4B-Instruct) and multimodal (Qwen3-VL-4B-Instruct) models using LoRA (Low-Rank Adaptation).

Datasets

  • ChEBI-20-MM: A curated subset of the ChEBI database used as the source for molecular structures.
  • MolReps (New): The primary contribution, consisting of 9,600 QA pairs for training/MO testing and 960 pairs for MD testing.
  • MolRepBench: An external benchmark used to evaluate how well "representation training" transfers to downstream tasks like atom counting and property prediction.

Key Insights and Ideas

  • Base Models are "Chemically Illiterate": Before specific post-training, even powerful LLMs fail almost completely at translating between representations (achieving near 0% IKM). They have some inherent ability to normalize strings within the same family, but cross-family translation must be explicitly taught.
  • The Generalization Gap: There is a massive performance drop when moving from seen molecules (MO) to unseen ones (MD). This suggests that models are largely "memorizing" the mappings for specific molecules rather than learning the general syntactic rules of chemical notations.
  • Representation Asymmetry: Some formats are easier to "write" than to "read." For example, models found it much easier to generate an InChI string from a SMILES input than the reverse. This suggests that the layered, hierarchical nature of InChI might be easier for an LLM to produce than to parse.
  • Positive Transfer: Even though the models didn't master generalization for translation, the training significantly boosted their performance on other chemical tasks. This implies that learning to relate different representations helps the model build a more robust internal "concept" of molecular structure.
Token-count distributions for different input types, highlighting the high overhead of CML and images compared to SMILES.

Key Results

  • Massive Gains on Familiar Molecules: On the MO test set, InChIKey Match rose from 4.01% to 75.13% for the text model and from 7.11% to 73.14% for the multimodal model.
  • Struggles with New Structures: On the MD (disjoint) set, IKM remained low (around 2-3%). However, "validity"—the ability to generate a syntactically correct chemical string—improved significantly, jumping from ~20% to nearly 60%.
  • Downstream Success: The MolReps-tuned models achieved a 27.84% average relative improvement over their base models on the MolRepBench benchmark, showing that representation-focused training is a viable strategy for improving general molecular LLMs.
Performance comparison on MolRepBench, showing significant gains across comprehension, discrimination, and generation tasks.

Limitations and Future Work

The primary limitation is the lack of scaffold generalization. The models effectively learned a "lookup table" for the 200 molecules in the training set but failed to derive the underlying "grammar" of chemistry that would allow them to handle entirely new structures.

The authors suggest that scaling the pipeline to a much larger and more diverse set of molecular scaffolds is the necessary next step. They also explored advanced reinforcement learning techniques like GRPO, but found they didn't provide consistent gains over standard supervised fine-tuning at this data scale, suggesting that data diversity may be more important than complex optimization strategies for this specific problem.

Summary updated

Abstract

The same molecule can be expressed in multiple, syntactically distinct representations, yet it remains unclear whether large language models (LLMs) can recognize and relate these equivalent encodings. We introduce MolReps, a pipeline that generates 9,600 question-answer pairs across ten representations for conversion, normalization, and 2D structure recognition. Post-training on MolReps improves text-only and multimodal models, MolQwen3-4B-Instruct (MQ3-4B-I) and MolQwen3-VL-4B-Instruct (MQ3-VL-4B-I), from $4.01\%$ to $75.13\%$ and from $7.11\%$ to $73.14\%$ (InChIKey match) on the molecule-overlap test set, respectively. On the molecule-disjoint test set, post-training increased validity from $20.35\%$ to $58.12\%$ for MQ3-4B-I and from $17.19\%$ to $59.34\%$ for MQ3-VL-4B-I. However, InChIKey match remained low, decreasing from $3.86\%$ to $3.09\%$ and from $6.44\%$ to $2.29\%$, respectively. Furthermore, the resulting models achieve a relative $27.84\%$ improvement in average over their base model on MolRepBench, a comprehensive benchmark for evaluating molecular property prediction. These results show the effectiveness of targeted post-training for enhancing molecular representation understanding and its potential to improve downstream molecular tasks.
BibTeX
@misc{deng2026molreps,
  author = {Ken Deng and Garrett Morris},
  title = {{MolReps: Taking SELFIES, Making SMILES, Teaching LLMs}},
  year = {2026},
  eprint = {2611.20848},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.20848},
}
Figure