# Retrosynthesis Prediction with Local Template Retrieval

arXiv: https://arxiv.org/abs/2306.04123 · HTML: https://mlsanity.com/paper/2306.04123/

## Key facts

- Cited by 16 papers in the map (data through 14 Oct 2026).
- Builds on 20 of its 30 references that are in the map.
- First posted on arXiv 7 Jun 2023.

## Builds on (most cited first, 20 of 20)

- [Neural Message Passing for Quantum Chemistry](https://mlsanity.com/paper/1704.01212/) (2017)
- [Billion-scale similarity search with GPUs](https://mlsanity.com/paper/1702.08734/) (2017)
- [Strategies for Pre-training Graph Neural Networks](https://mlsanity.com/paper/1905.12265/) (2019)
- [Generalization through Memorization: Nearest Neighbor Language Models](https://mlsanity.com/paper/1911.00172/) (2019)
- [Nearest Neighbor Machine Translation](https://mlsanity.com/paper/2010.00710/) (2020)
- [Retrosynthesis Prediction with Conditional Graph Logic Network](https://mlsanity.com/paper/2001.01408/) (2020)
- [Predicting Organic Reaction Outcomes with Weisfeiler-Lehman Network](https://mlsanity.com/paper/1709.04555/) (2017)
- [Efficient Nearest Neighbor Language Models](https://mlsanity.com/paper/2109.04212/) (2021)
- [Molecule Edit Graph Attention Network: Modeling Chemical Reactions as Sequences of Graph Edits](https://mlsanity.com/paper/2006.15426/) (2020)
- [Retrosynthetic reaction prediction using neural sequence-to-sequence models](https://mlsanity.com/paper/1706.01643/) (2017)
- [A Graph to Graphs Framework for Retrosynthesis Prediction](https://mlsanity.com/paper/2003.12725/) (2020)
- [RetroXpert: Decompose Retrosynthesis Prediction like a Chemist](https://mlsanity.com/paper/2011.02893/) (2020)
- [Learning Graph Models for Retrosynthesis Prediction](https://mlsanity.com/paper/2006.07038/) (2020)
- [Adaptive Nearest Neighbor Machine Translation](https://mlsanity.com/paper/2105.13022/) (2021)
- [DGL-LifeSci: An Open-Source Toolkit for Deep Learning on Graphs in Life Science](https://mlsanity.com/paper/2106.14232/) (2021)
- [Fast Nearest Neighbor Machine Translation](https://mlsanity.com/paper/2105.14528/) (2021)
- [Energy-based View of Retrosynthesis](https://mlsanity.com/paper/2007.13437/) (2020)
- [Modern Hopfield Networks for Few- and Zero-Shot Reaction Template Prediction](https://mlsanity.com/paper/2104.03279/) (2021)
- [Retroformer: Pushing the Limits of Interpretable End-to-end Retrosynthesis Transformer](https://mlsanity.com/paper/2201.12475/) (2022)
- [RetCL: A Selection-based Approach for Retrosynthesis via Contrastive Learning](https://mlsanity.com/paper/2105.00795/) (2021)

## Built on by (most cited first, 16 of 16)

- [Re-evaluating Retrosynthesis Algorithms with Syntheseus](https://mlsanity.com/paper/2310.19796/) (2023)
- [LLM-Augmented Chemical Synthesis and Design Decision Programs](https://mlsanity.com/paper/2505.07027/) (2025)
- [RetroGFN: Diverse and Feasible Retrosynthesis using GFlowNets](https://mlsanity.com/paper/2406.18739/) (2024)
- [Equivariant Denoisers Cannot Copy Graphs: Align Your Graph Diffusion Models](https://mlsanity.com/paper/2405.17656/) (2024)
- [RetroDiff: Retrosynthesis as Multi-stage Distribution Interpolation](https://mlsanity.com/paper/2311.14077/) (2023)
- [Chemist-aligned retrosynthesis by ensembling diverse inductive bias models](https://mlsanity.com/paper/2412.05269/) (2024)
- [UAlign: Pushing the Limit of Template-free Retrosynthesis Prediction with Unsupervised SMILES Alignment](https://mlsanity.com/paper/2404.00044/) (2024)
- [Preference Optimization for Molecule Synthesis with Conditional Residual Energy-based Models](https://mlsanity.com/paper/2406.02066/) (2024)
- [When Single Answer Is Not Enough: Rethinking Single-Step Retrosynthesis Benchmarks for LLMs](https://mlsanity.com/paper/2602.03554/) (2026)
- [Molecule-Edit Templates for Efficient and Accurate Retrosynthesis Prediction](https://mlsanity.com/paper/2310.07313/) (2023)
- [Exploiting Pre-trained Models for Drug Target Affinity Prediction with Nearest Neighbors](https://mlsanity.com/paper/2407.15202/) (2024)
- [Reinforced Reasoning for End-to-End Retrosynthetic Planning](https://mlsanity.com/paper/2603.29723/) (2026)
- [ConRetroBert: EMA Stabilized Dual Encoders for Template-Based Single-Step Retrosynthesis](https://mlsanity.com/paper/2605.12736/) (2026)
- [RetroMPA: A Molecular Property-Aware Auxiliary Framework for Enhancing Retrosynthesis Prediction](https://mlsanity.com/paper/2608.16111/) (2026)
- [Training Chemical Plausibility-Aware Large Language Models for Single-Step Retrosynthesis](https://mlsanity.com/paper/2608.18940/) (2026)
- [Single-step Retrosynthesis via Reinforcement Learning from Forward Feedback](https://mlsanity.com/paper/2610.15141/) (2026)

## Abstract (arXiv)

Retrosynthesis, which predicts the reactants of a given target molecule, is an essential task for drug discovery. In recent years, the machine learing based retrosynthesis methods have achieved promising results. In this work, we introduce RetroKNN, a local reaction template retrieval method to further boost the performance of template-based systems with non-parametric retrieval. We first build an atom-template store and a bond-template store that contain the local templates in the training data, then retrieve from these templates with a k-nearest-neighbor (KNN) search during inference. The retrieved templates are combined with neural network predictions as the final output. Furthermore, we propose a lightweight adapter to adjust the weights when combing neural network and KNN predictions conditioned on the hidden representation and the retrieved templates. We conduct comprehensive experiments on two widely used benchmarks, the USPTO-50K and USPTO-MIT. Especially for the top-1 accuracy, we improved 7.1% on the USPTO-50K dataset and 12.0% on the USPTO-MIT dataset. These results demonstrate the effectiveness of our method.
