Trustworthy Retrosynthesis: Eliminating Hallucinations with a Diverse Ensemble of Reaction Scorers

Michał Sadowski, Tadija Radusinović, Maria Wyrzykowska, Lukasz Sztukiewicz, Jan Rzymkowski, Piotr Kozakowski, Mikołaj Sacha, Ruard van Workum, Stanislaw Kamil JastrzebskiNeurIPS 2026

TL;DR

Generative AI is great at proposing step-by-step recipes to build complex drug molecules, except when it quietly hallucinates impossible chemistry that ruins the entire plan. This paper introduces RetroTrim, a system that pairs a standard reaction generator with a diverse, three-part ensemble of "plausibility filters" to prune bad ideas mid-search. Tested by human PhD chemists on challenging new drug targets, it is the only evaluated system that eliminates 100% of hallucinated pathways while simultaneously finding the highest number of reliable syntheses.

What Problem Does This Paper Address?

Imagine trying to bake a wedding cake by working backward from the finished product to raw ingredients like flour and eggs. In chemistry, this is called retrosynthesis: breaking down a complex target molecule into simpler, commercially available precursors through a sequence of valid chemical reactions.

Deep generative models have transformed this process, iteratively predicting single-step reactions inside tree-search algorithms. However, generative models hallucinate. In chemistry, a hallucination isn't just a funny extra finger on an image—it’s a reaction with unstable reagents or zero precedent in physical reality. Worse, synthetic routes are fragile chains: a single impossible step invalidates an entire multi-step pathway. Unlike code or math proofs, you can't easily run an automated compiler to check if a reaction actually works in a wet lab, leaving researchers without a reliable way to automatically catch and filter out chemical nonsense.

Figure 1: An example of grossly incorrect (hallucinated) reaction generated by a Single-Step Ret- rosynthesis model. A PhD-level chemist recognizes that the only reasonable atom mapping between the substrates and the product is one where the reaction center is an ortho-amino benzoate converting into a triazole (highlighted in yellow). It does not belong to any commonly known reaction class, and further investigation involving extensive searches of synthetic databases yields no examples that would inform what reagents and conditions could induce such a reaction.

Methods

RetroTrim uses a standard, off-the-shelf setup for proposing reactions and searching routes: a BART-based sequence model (called RootAligned) generates candidate precursors, and the classic Retro* A* search algorithm builds the synthesis tree.

The core innovation is the MetaScorer, an external validator that sits inside the search loop and prunes implausible branches before they can expand. Instead of relying on a single filter, MetaScorer combines three distinct, complementary strategies:

  1. Reaction Prior (RP): A novel autoregressive BART decoder that mimics a chemist’s intuition by combining three probabilities: overall sequence likelihood, confidence at the specific reactive site (reaction center), and regioselectivity (whether competing sites on the molecule might accidentally react instead).
  2. Reaction Graph Plausibility (RGP): A Graph Attention Network (GAT) trained to spot fake reactions. While training classifiers on synthetic "negative" examples is standard, the authors generate much richer negatives by applying random reaction templates both forward and backward, catching subtle selectivity and functional-group clashes.
  3. Reference Reaction Scorer (RRS): A two-tiered database lookup tool. It maps bond changes at the reaction center (both coarsely and with surrounding aromatic/conjugated rings) to check if experimental precedent actually exists in literature.

During search, a proposed reaction only survives if it clears thresholds for both RP and RGP and has at least one precedent match in RRS.

Figure 2: Visualization of RetroTrim (above) and retrosynthetic search with plausibility filtering (below). RetroTrim encompasses a generator, which proposes precursor molecules for a given target, and a scorer, which evaluates the plausibility of the generated reaction. In the search process, plausible precursors are expanded further, until we arrive at commercially available starting materials. Implausible reactions terminate the search branch. The search concludes when a complete synthetic route from commercially-available starting materials to the target molecule is found.

Datasets

  • Training Data: Models and reference indices were built using ~4 million cleaned reactions from the proprietary Pistachio patent dataset. To support open science, the authors also retrained and released comparable checkpoints using the public USPTO-Full dataset.
  • New Benchmarks: Because automated metrics (like top-$k$ accuracy) fail to measure real-world chemical validity, 12 PhD synthetic chemists spent over 300 hours manually annotating 4,500+ model-generated reactions across four confidence tiers (Safe bet, Worthwhile, Rather not, and Nonsense) and seven specific failure modes (e.g., Magic, Selectivity). The authors publicly release 500 expert-labeled reactions alongside 32 novel, unpublished drug-like target molecules designed by recombining modern drug fragments to prevent train-test literature leakage.

Key Insights and Ideas

  • No single filter catches every lie: Different model architectures have different blind spots. RRS is unbeatable at catching "Magic" (gross structural mismatches with zero precedent), RGP excels at catching Selectivity and Reactivity clashes, and RP offers strong, balanced intuition. Across all failure categories, the overlap of false positives among all three scorers drops to near zero.
  • Ensembling generators isn't enough: A popular baseline (RetroChimera) ensembles multiple reaction generators to boost quality. Yet on novel targets, it still hallucinated frequently—proving you need explicit, diverse validators to eliminate nonsense.
  • Knowing when to fold: Unfiltered generators find pathways for 100% of targets, but many are useless fantasies. Strict filtering trades a tiny bit of target coverage for massive gains in trustworthiness—a worthwhile trade when a single bad step wastes weeks in a lab.

Key Results

  • Path-level evaluation (32 novel targets): Each multi-step route was graded by its weakest link. RetroTrim achieved 0 Nonsense pathways and 18 Safe bet pathways (plus 5 Worthwhile, 4 Rather not, and 5 unfound). Every external baseline produced hallucinations (AiZynthFinder: 7, RetroChimera: 7, LocalRetro: 6, IBM RXN: 2) while finding fewer Safe bet routes (ranging from 8 to 14).
  • Reaction-level classification: On individual reactions, MetaScorer outperformed all standalone components, achieving 0.81 ROC-AUC and 0.93 PR-AUC (compared to 0.78 / 0.92 for RP, 0.73 / 0.90 for RRS, and 0.73 / 0.89 for RGP).
Figure 3: Comparison of RootAligned variants with IBM RXN, AiZynthFinder, LocalRetro, and RetroChimera. External baselines either miss many targets or return hallucinated routes; RootAligned without scoring has high coverage but unreliable outputs. Individual scorers improve reliability at the cost of coverage, while RetroTrim’s MetaScorer gives the most trustworthy routes, maintaining zero Nonsense pathways while increasing Safe Bet results.

Limitations and Future Work

  • Expert review vs. wet-lab execution: Routes were validated by human experts rather than physical lab synthesis (which is prohibitively slow and expensive at benchmark scale).
  • Domain scope: RetroTrim is tailored for small-molecule medicinal chemistry; it has not been validated on polymers, cyclopeptides, or inorganic chemistry.
  • Top-1 focus & error attribution: Evaluation only examined the single best path per target, leaving impacts on route diversity for future study. Furthermore, when RetroTrim fails to find a route (5 of 32 targets), it remains an open question whether the generator missed a valid disconnection, the ML scorers drifted out-of-distribution, or the RRS lookup penalized rare-but-valid novel chemistry.

Summary updated

Abstract

Retrosynthesis is one of the domains transformed by the rise of generative models, and it is one where the problem of nonsensical or erroneous outputs (hallucinations) is particularly insidious: reliable assessment of synthetic plans is time-consuming, with automatic methods lacking. In this work, we present RetroTrim, a retrosynthesis system that successfully avoids nonsensical plans on a set of challenging drug-like targets. Compared to common baselines in the field, our system is not only the sole method that succeeds in filtering out hallucinated reactions, but it also results in the highest number of high-quality paths overall. The key insight behind RetroTrim is the combination of diverse reaction scoring strategies, based on machine learning models and existing chemical databases. We show that our scoring strategies capture different classes of hallucinations by analyzing them on a dataset of labeled retrosynthetic intermediates. To measure the performance of retrosynthesis systems, we propose a novel evaluation protocol for reactions and synthetic paths based on a structured review by expert chemists. Using this protocol, we compare systems on a set of 32 novel targets, curated to reflect recent trends in drug structures. While the insights behind our methodology are broadly applicable to retrosynthesis, our focus is on targets in the drug-like domain. By releasing our benchmark targets and the details of our evaluation protocol, we hope to inspire further research into reliable retrosynthesis.
BibTeX
@inproceedings{sadowski2026trustworthy,
  author = {Michał Sadowski and Tadija Radusinović and Maria Wyrzykowska and Lukasz Sztukiewicz and Jan Rzymkowski and Piotr Kozakowski and Mikołaj Sacha and Ruard van Workum and Stanislaw Kamil Jastrzebski},
  title = {{Trustworthy Retrosynthesis: Eliminating Hallucinations with a Diverse Ensemble of Reaction Scorers}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=QnViF2joi3},
}
Figure