Abstract: Single-step retrosynthesis is a fundamental task in computer-aided synthesis planning. While template-free models offer greater flexibility than traditional template-based methods, they often struggle with "chemical illiteracy," producing results that violate basic chemical principles. We present PMSR (Pre-trained Model for Single-step Retrosynthesis), a framework that integrates chemical knowledge into template-free models through targeted pre-training tasks. By teaching models to recover masked molecular fragments and classify reaction types, PMSR achieves state-of-the-art accuracy and generates chemically valid precursors with high reliability.
Introduction
Retrosynthesis—the process of identifying precursors for a target molecule—is essential for drug discovery and materials science. Modern AI approaches generally follow two paradigms: template-based methods, which are constrained by a fixed library of known transformations, and template-free methods, which treat retrosynthesis as a sequence-to-sequence translation task. While template-free models generalize better, they often lack an inherent understanding of chemistry, leading to "hallucinated" reactions that are physically impossible.
The Challenge of Chemical Illiteracy
Template-free models frequently fail in three critical ways:
- Invalidity: Generating molecules with impossible valency, such as a fluorine atom with three bonds.
- Conservation Failures: Violating the Law of Conservation of Atoms, where atoms appear or disappear between the product and reactants.
- Selectivity Errors: Identifying the wrong reaction center, suggesting transformations that are chemically incompatible with the molecule's specific functional group arrangement.
The PMSR Framework
To address these issues, the authors propose PMSR, a Transformer-based model enhanced with three pre-training tasks designed to instill "chemical grammar":
- Molecule Recovery (MR): Similar to masked language modeling, the model learns to recover masked atoms or entire functional groups (fragments). This forces the model to respect valence rules and maintain consistency between the target and its precursors, effectively baking the Law of Conservation of Atoms into the model's weights.
- Auto-regression (AR): Standard next-token prediction ensures the model masters the syntax of SMILES strings, the standard text representation of chemicals.
- Contrastive Classification (CC): Using a supervised contrastive loss, the model learns to group reactions of the same type in its embedding space. This encourages the model to focus on "reaction centers" rather than "spectator" groups that remain unchanged during a reaction.
Furthermore, PMSR incorporates a pointer-generator network, allowing it to copy rare atoms directly from the product string to the reactant string. This is more chemically intuitive than standard translation, as most atoms in a product must originate from the reactants.
Experimental Results
The model was pre-trained on the Pistachio dataset (3.74 million reactions) and evaluated on industry-standard benchmarks like USPTO-50K and USPTO-FULL.
- State-of-the-Art Accuracy: On USPTO-50K with unknown reaction types, PMSR achieved a 62.0% top-1 accuracy, significantly outperforming previous template-free leaders like DualTF (53.6%).
- Enhanced Reliability: PMSR dramatically reduced the generation of "illegal" molecules. Human chemists verified that 99% of PMSR’s generated results obeyed atom conservation, compared to only 88% for standard Transformer baselines.
- Robustness: The model demonstrated strong domain adaptivity, maintaining high performance even when the pre-training data distribution differed from the test sets.
Conclusion
PMSR demonstrates that "chemical illiteracy" in template-free models can be overcome by explicitly teaching chemical rules during pre-training. By treating retrosynthesis as a rule-constrained conditional generation task rather than simple translation, PMSR bridges the gap between the flexibility of template-free methods and the reliability of template-based ones. Future work will focus on extending this chemically aware approach to multi-step synthesis planning and improving the handling of complex reagents and catalysts.
Summary updated