MolReps: Taking SELFIES, Making SMILES, Teaching LLMs
Organizations: Department of Statistics, University of Oxford, Oxford, United Kingdom
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 to and from to (InChIKey match) on the molecule-overlap test set, respectively. On the molecule-disjoint test set, post-training increased validity from to for MQ3-4B-I and from to for MQ3-VL-4B-I. However, InChIKey match remained low, decreasing from to and from to , respectively. Furthermore, the resulting models achieve a relative 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.
Figures & tables
| Valid. (%) | IKM (%) | TS | |||
| Conversion Task (text) | |||||
| MO | LLM | Q3-4B-I | 20.15 ±1.31 | 4.01 ±0.67 | 0.06 ±0.01 |
| MQ3-4B-I | 90.69 ±1.00 | 75.13 ±1.50 | 0.81 ±0.01 | ||
| MLLM | Q3-VL-4B-I | 16.91 ±1.30 | 7.11 ±0.84 | 0.09 ±0.01 | |
| MQ3-VL-4B-I OCSR | 25.50 ±1.51 | 5.01 ±0.78 | 0.09 ±0.01 | ||
| MQ3-VL-4B-I Conv. | 89.39 ±1.04 | 70.84 ±1.55 | 0.78 ±0.01 | ||
| Valid. (%) | IKM (%) | TS | |||
|---|---|---|---|---|---|
| Base | Q3-4B-I | Rep. Trans. | 15.11 ±2.26 | 0.00 ±0.00 | 0.01 ±0.00 |
| IUPAC Und. | 27.34 ±5.23 | 0.00 ±0.00 | 0.02 ±0.01 | ||
| CML Und. | 11.86 ±3.66 | 0.00 ±0.00 | 0.00 ±0.00 | ||
| Intra Norm. | 49.12 ±4.71 | 30.79 ±4.46 | 0.39 ±0.04 | ||
| Cross Norm. | 15.21 ±1.84 | 0.00 ±0.00 | 0.01 ±0.00 | ||
| Q3-VL-4B-I | Rep. Trans. | 5.59 ±1.46 | 0.40 ±0.40 | 0.01 ±0.00 |
| IKM (%) | |||||
|---|---|---|---|---|---|
| Input\Output Rep. | SMILES | SELFIES | DeepSMILES | InChI | |
| Base | SMILES | – | 0.00 ±0.00 | 0.00 ±0.00 | 0.00 ±0.00 |
| SELFIES | 0.00 ±0.00 | – | 0.00 ±0.00 | 0.00 ±0.00 | |
| DeepSMILES | 2.22 ±2.21 | 0.00 ±0.00 | – | 0.00 ±0.00 | |
| InChI | 0.00 ±0.00 | 0.00 ±0.00 | 0.00 ±0.00 | – | |
| R. SMILES | 30.68 ±5.54 | 0.00 ±0.00 | 0.00 ±0.00 | 0.00 ±0.00 | |
| k | pass@k (%) | pass@k (%) | valid@k (%) | AC@k (%) | AW@k (%) |
|---|---|---|---|---|---|
| 1 | 67.89 | 67.89 | 87.09 | 67.89 | 32.11 |
| 2 | 76.11 | 8.23 | 87.89 | 60.46 | 23.89 |
| 4 | 80.11 | 4.00 | 87.89 | 54.06 | 19.89 |
| 8 | 84.34 | 4.23 | 88.21 | 46.17 | 15.66 |
| 16 | 86.74 | 2.40 | 88.29 | 39.09 | 13.26 |
| Task | Source | Metrics | |
|---|---|---|---|
| Comprehension | |||
| Atom Counting (B1) | ChEBI-20 | Exact match | |
| Group identification (B2) | ChEBI-20 | Macro-F1 | |
| Property estimation (B3) | ChEBI-20 | , Exact match | |
| Molecule Retrieval (B4) | ChEBI-20 | Top-1 | |
| Discrimination |
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| Representation | Source | Tool |
|---|---|---|
| 1D: linear notations | ||
| Canonical SMILES | – | rdkit |
| Randomized SMILES | canonical SMILES | rdkit |
| SELFIES | canonical SMILES | selfies |
| Randomized SELFIES | rand. SMILES | selfies |
| DeepSMILES | canonical SMILES | deepsmiles |
| Task | Input Output | #/mol |
| Cross-representation translation | ||
| Std. translation | ; , | 12 |
| IUPAC understanding | IUPAC name | 4 |
| CML understanding | CML | 4 |
| Normalization | ||
| Intra-rep. norm. | same-family std. | |
| Split | # Src. Mol. | # QA Pairs |
|---|---|---|
| QA-level split (molecule-overlap) | ||
| Training set | 200 † | 7680 |
| Validation set | 200 † | 960 |
| Test set | 200 † | 960 |
| Subtotal | 200 | 9600 |
| Molecule-level hold-out (molecule-disjoint) | ||
| Hyperparameter | SFT | GRPO |
|---|---|---|
| Learning rate | 1e-4 | 1e-5 |
| Batch size | 16 | 32 |
| Maximum epochs | 10 | 10 |
| Optimizer | AdamW | AdamW |
| KL coefficient | – | 0 |
| Group size | – | 8 |
| Representation | Value |
|---|---|
| Canonical SMILES | CC(C)CCCCCCCCCCC(=O)[O-] |
| Randomized SMILES | CC(CCCCCCCCCCC([O-])=O)C |
| SELFIES | [C][C][Branch1][C][C][C][C][C][C][C][C][C][C][C][C][C][=Branch1][C][=O][O-1] |
| Randomized SELFIES | [C][C][Branch1][S][C][C][C][C][C][C][C][C][C][C][C][Branch1][C][O-1][=O][C] |
| DeepSMILES | CCC)CCCCCCCCCCC=O)[O-] |
| Randomized DeepSMILES | CCCCCCCCCCCCC[O-])=O))))))))))))C |
| Example | Content |
|---|---|
| 1: R. DeepSMILES SELFIES | User: Clean up the randomized DeepSMILES O=CCCCCCCCCCCCCCCC)))))))))))))))[O-] and give me the SELFIES. Just provide the SELFIES without any explanation. |
| Assistant: [C][C][C][C][C][C][C][C][C][C][C][C][C][C][C][C][=Branch1][C][=O][O-1] | |
| 2: R. DeepSMILES SELFIES | User: Take [C@@]C)[C@H]CCC=C[C@H]6[C@@H]CC%10))CC)C)))))C)))))O (a noisy DeepSMILES) and express it as proper SELFIES. Return only the SELFIES representation. |
| Assistant: [C][C][=C][C@H1][C@H1][Branch1][=Branch1][C][Branch1][C][C][C][C][C][C@][Branch1][C][C][Branch1][C][O][C@H1][Ring1][O][C][C][Ring1][#C] | |
| 3: R. DeepSMILES InChI | User: This DeepSMILES CO)[C@H]O[C@H]O)[C@H][C@@H]O[C@H]O[C@H]C)[C@H]O)C[C@H]6O))))))))[C@@H]6O)))O[C@@H][C@@H][C@H][C@H][C@@H]CO))O6))O))O))O may not be canonical. Normalize it and output as InChI. Please output the InChI representation only. |
| Assistant: InChI=1S/C18H32O14/c1-5-6(21)2-7(22)17(28-5)31-14-11(24)9(4-20)29-16(27)15(14)32-18-13(26)12(25)10(23)8(3-19)30-18/h5-27H,2-4H2,1H3/t5-,6-,7-,8-,9-,10+,11-,12+,13-,14+,15+,16+,17-,18-/m1/s1 |