When chemists build a dense, many-ringed natural product — the kind with five fused rings and six contiguous stereocenters, where the number of possible 3D arrangements grows as $2^n$ — they rely on reactions whose outcome depends on the whole molecule: global conformational strain, not just the atoms next to the breaking bond. Machine-learning models that predict such reactions do something very different, and a growing body of evidence suggests why: they take shortcuts. A retrosynthesis model trained on patent data learns to recognize the surrounding scaffold — the "background" of the molecule — and to guess the reaction from that context instead of reasoning about the reactive site. The result is models that look excellent on the data they were trained on and fall apart when the scaffold changes, exactly as vision models that recognize cows by grass collapse on unfamiliar backgrounds. This proposal treats the retrosynthesis of complex polycyclic targets as a spurious-correlation problem and asks whether targeted deconfounding, not more data or bigger models, is what closes the gap.
The evidence for a shortcut problem is strong but scattered. Standardized evaluation shows retrosynthesis models scoring roughly 90% on USPTO-50k yet dropping to about 45% on the more diverse Pistachio corpus (Re-evaluating Retrosynthesis Algorithms with Syntheseus), and part of the USPTO-50k number itself is inflated because test reactions can be matched by memorized templates (Retrosynthesis Prediction Revisited). In molecular binding prediction, models reach a perfect Model AUC of 1.0 while their attributions align with the true causal atoms at an Attribution AUC of only 0.11 on DUD-E ADRB2 (Using Attribution to Decode Dataset Bias in Neural Network Models for Chemistry) — high accuracy concealing that the model reads the wrong part of the molecule. Meanwhile, the data that would exercise polycyclic reasoning now exists: TotSyn provides 105,002 literature reactions spanning 30,703 templates, with diversity increasing as routes get longer (TotSyn: A Total Synthesis Reaction Dataset for Machine Learning in Organic Chemistry). Nobody has yet combined the diagnosis with the cure on this data.
Core Claim
The claim is specific: a substantial fraction of the failure of neural retrosynthesis on complex polycyclic targets is caused by scaffold-context shortcuts — spurious correlation between the non-reacting ring framework surrounding a reaction center and the reaction template applied there — and a training scheme that makes template prediction invariant to scaffold context, while preserving stereochemical information that current deconfounding methods destroy, will measurably improve out-of-distribution retrosynthetic accuracy on polycyclic targets under strict stereochemical matching. Equally important is the falsifiable half: if the gap does not shrink, then polycyclic failure is a capacity or data-coverage problem, not a bias problem, and the field should stop spending on invariance methods here.
Three prior results constrain the design rather than merely motivating it. First, direct selection of the invariant causal subgraph fails under strong shortcuts; pruning spurious edges instead beat the best direct-selection baseline by 24.19% on Motif-base (Pruning Spurious Subgraphs for Graph Out-of-Distribution Generalization), so our method must prune or suppress context, not try to attend onto a "true" reactive core. Second, 2D message passing flattens stereoisomers into identical embeddings (Stereochemical Awareness in Molecular Graph Neural Networks), and MolR — which learns representations by enforcing that reactions conserve an embedding sum — explicitly struggles to distinguish stereoisomers (Chemical-Reaction-Aware Molecule Representation Learning); any deconfounding grafted onto a 2D GNN inherits this blindness, which matters because stripping stereochemistry collapses natural-product route prediction from 27.8% to 16.3% top-10 accuracy (BioNavi-NP: Biosynthesis Navigator for Natural Products). Third, MolR's locality assumption — that a reaction changes only atoms within $K$ hops of the center — is violated by cascade reactions that build three rings and three stereocenters at once (Bioinspired Total Synthesis of (+)-Kopsiyunnanine B) and by strain-driven photochemical cycloadditions that forge caged cores (Strategies for Constructing Complex Polycyclic Architectures). So the invariance target cannot be "the local reactive subgraph"; it must be "reactive district plus long-range strain context," with only the decorative, non-reacting scaffold periphery treated as spurious.
Research Program
The program has three parts: a diagnostic, a training scheme, and an evaluation protocol.
The diagnostic asks whether the shortcut actually exists in retrosynthesis, extending the attribution methodology of Using Attribution to Decode Dataset Bias in Neural Network Models for Chemistry from binary binding to template prediction. Unlike that paper, which needed hand-written SMARTS ground-truth rules on simple ZINC molecules, retrosynthesis data comes with atom maps that mark the true reaction center for every training example. We can therefore compute a reaction-center attribution score — the fraction of the model's attribution mass falling on mapped reacting atoms — without any synthetic rule. A model trained on TotSyn that achieves high template-prediction accuracy while placing attribution mass on the scaffold periphery, and whose predictions flip when that periphery is synthetically swapped (analogous to the single-atom perturbation that collapsed binding probability from 0.97 to 0.018 in that paper), is exhibiting the shortcut. This diagnostic doubles as our primary interpretability metric throughout.
The training scheme, which we call scaffold-invariant retrosynthesis, has two components. The first is an encoder split: a stereochemistry-aware molecular encoder (using chirality-tagged atom features and 3D-conformation-derived strain descriptors such as ring-fusion and bridgehead strain estimates) whose representation is divided into a reactive district — atoms within the mapped reaction center and its fused/bridged ring neighborhood, allowed to extend beyond a fixed hop count along ring bonds — and a scaffold context, the remaining periphery. The second is the invariance objective. Borrowing the pruning-not-selection logic of Pruning Spurious Subgraphs for Graph Out-of-Distribution Generalization, but applying it to representation channels rather than graph edges (PrunE prunes edges on 2D property-prediction graphs and was never tested on reactions or stereochemistry), we train an adversary to predict the reaction template from the scaffold-context embedding alone, and suppress the context until it fails:
$$\mathcal{L} = \mathcal{L}_{\text{retro}} + \lambda \, \big(1 - \mathcal{H}(D(g_{\text{scaffold}}(x)))\big)$$
Here $\mathcal{L}_{\text{retro}}$ is the standard template- or product-prediction loss, $g_{\text{scaffold}}$ is the context encoder, $D$ is a small classifier trying to recover the applied template from context alone, and $\mathcal{H}(D(\cdot))$ is that classifier's cross-entropy on its prediction; maximizing the entropy term destroys template-predictive information in the scaffold channel while the retro loss keeps the reactive district fully informative. $\lambda$ is tuned on a validation split. We also build environment-partitioned variants (environments defined by scaffold-cluster identity, with an IRM-style per-environment gradient penalty), because Pruning Spurious Subgraphs warns that residual spuriosity persists when context and label are almost perfectly aligned — a real risk in total-synthesis data, where certain scaffold families are consistently made by certain cascades.
A deliberate scope limit: we do not attempt mechanistic electron-pushing prediction, because Mechanism-Aware Deep Learning for Polar Reaction Prediction covers only polar elementary steps and explicitly excludes the radical and pericyclic cascades that dominate polycyclic synthesis. We treat pericyclic and cascade templates as ordinary prediction targets and leave mechanism extraction to future work.
Proposed Experiments
All evaluation runs through the Syntheseus framework (Re-evaluating Retrosynthesis Algorithms with Syntheseus), which standardizes deduplication and, critically, enforces exact stereochemical matching — the file reports that relaxed stereochemical definitions had been inflating scores such as LocalRetro's. The main dataset is TotSyn, restricted to its polycyclic subset (targets containing fused, bridged, or spiro ring systems and at least three contiguous stereocenters), with scaffold-shift splits: training environments and held-out environments are disjoint scaffold clusters, so test targets present known reaction logic on unseen ring contexts. Complementary transfer tests use CARBO carbohydrate reactions (Transfer learning enables the molecular transformer to predict regio- and stereoselective reactions on carbohydrates) as a second, independently curated domain with dense stereocenters and near-identical hydroxyl groups — a hard test of whether invariance transfers. Metrics are strict-stereochemistry top-1 and top-10 accuracy, the reaction-center attribution score, and scaffold-swap robustness (fraction of predictions unchanged when non-reacting periphery is replaced by a chemically valid alternative). No reported result found on Lacuna for single-step accuracy on TotSyn itself, so our first deliverable is the ERM baseline number on that benchmark; this is a contribution in its own right, since TotSyn reports dataset statistics but no model accuracy.
The decisive comparison set is spelled out in the next section. Success is defined as: on the scaffold-shift split of TotSyn's polycyclic subset, strict-stereo top-1 accuracy beats the strongest baseline by a margin that is large relative to seed variance, the reaction-center attribution score rises substantially, and scaffold-swap flips drop sharply — while in-distribution accuracy degrades by no more than a few points (the learnability caveat raised by Is Spurious Correlation Removal Always Learnable? means we must watch for in-distribution penalties, not just celebrate OOD gains).
Baselines
The do-nothing reference is empirical risk minimization: the same stereo-aware encoder and the same retro loss, trained identically but with $\lambda = 0$ and no context suppression. This isolates whether any gain comes from the deconfounding ingredient rather than from the encoder architecture or the data, and it is also the source of the first published ERM accuracy numbers on TotSyn's polycyclic subset. The strongest existing competitor is sequential transfer learning, which has the best documented track record on specialized stereodense chemistry: the Molecular Transformer pretrained on roughly 1.1 million USPTO reactions and then fine-tuned on 25,000 curated carbohydrate reactions reached 71.2% top-1 accuracy on carbohydrate reaction prediction, versus 43.3% for the general model, and scored 77% (10 of 13 steps) versus 31% (4 of 13) on a 14-step lipid-linked oligosaccharide synthesis (Transfer learning enables the molecular transformer to predict regio- and stereoselective reactions on carbohydrates). We will run this recipe exactly as its authors describe — USPTO pretraining, then fine-tuning on the TotSyn polycyclic subset — with the same compute and the same hyperparameter search budget as our method, evaluated under identical Syntheseus settings and strict stereochemistry. Beating it means a higher strict-stereo top-1 on the scaffold-shift split with no worse in-distribution top-1; because transfer learning is the known-best approach for stereodense domains, this is the comparison a reviewer will actually care about. The third baseline is the strongest graph-deconfounding method adapted to the task: PrunE (Pruning Spurious Subgraphs for Graph Out-of-Distribution Generalization) with its edge-budget and bottom-k suppression objectives applied to the 2D molecular graph before template prediction. It was designed for property prediction on graphs, not reactions, and it discards stereochemistry, so it serves both as a competitor and as an ablation of whether stereo-aware context suppression specifically — rather than deconfounding in general — is what matters. The final ablation removes only the stereochemical and strain features from our own encoder, keeping the invariance loss; the documented collapse from 27.8% to 16.3% top-10 when stereochemistry is stripped (BioNavi-NP) predicts this ablation should hurt badly on polycyclic targets, and if it does not, our story about stereochemistry is wrong.
Why not just…?
Why not just pretrain on more data? Because the file's own evidence says scale does not dissolve the shortcut. Models trained on large USPTO corpora score about 90% on USPTO-50k and drop to roughly 45% on Pistachio (Re-evaluating Retrosynthesis Algorithms with Syntheseus), and USPTO-derived template libraries (2,367 templates in USPTO-50k, 10,601 in PaRoutes) are heavily clustered in narrow chemical regions while total synthesis needs over 30,703 templates with diversity growing along the route (TotSyn). The transfer-learning baseline in the previous section is precisely this alternative done properly, so the head-to-head experiment settles the question directly rather than by argument. If transfer learning matches our method on the scaffold-shift split, the shortcut hypothesis is weakened and we will say so.
Why not just fine-tune on TotSyn with standard supervision? This is the do-nothing baseline, and the attribution literature predicts exactly how it fails: near-perfect accuracy metrics coexisting with attributions on the wrong atoms — Model AUC of 1.0 with Attribution AUC of 0.11 on DUD-E ADRB2, and single-atom perturbations flipping predictions from 0.97 to 0.018 (Using Attribution to Decode Dataset Bias in Neural Network Models for Chemistry). Our diagnostic runs on this baseline will show whether the same pattern holds for template prediction; if its reaction-center attribution score is already high and scaffold swaps do not flip predictions, then fine-tuning is sufficient and the proposal's premise is falsified at low cost.
Why not just apply PrunE or another existing graph OOD method as-is? This is a real threat, not a strawman, and we run it as a full baseline rather than dismissing it. The concrete reasons to expect it to fall short: PrunE prunes edges on 2D topology, and 2D message passing cannot distinguish stereoisomers (Stereochemical Awareness in Molecular Graph Neural Networks) — a fatal gap when strict stereochemical matching is enforced at evaluation, given the documented 27.8%-to-16.3% collapse without stereo information (BioNavi-NP). Its authors also acknowledge failure when spurious edges are almost perfectly aligned with labels. But the honest possibility is that edge pruning recovers much of the gain on topologically distinguishable scaffolds; the head-to-head on the scaffold-shift split, plus the stereo-feature ablation, is designed to settle exactly how much stereo-awareness adds on top of generic deconfounding.
Why not just use template-based expert systems, avoiding black-box shortcuts entirely? Template methods avoid black boxes but inherit a rigidity problem that polycycles make acute: stereochemical and conformational density multiplies context-dependent template variants, and Retrosynthesis Prediction Revisited found template-based models competitive only when test reactions match training templates, struggling on rare and structurally diverse reactions. With template diversity in total synthesis growing along the longest linear sequence up to eleven steps (TotSyn), a static library cannot cover the held-out scaffold environments our evaluation targets. We still report a template-matching baseline as a sanity floor.
Decisive Checks
Three findings would decide the proposal either way. First, if the diagnostic shows high template accuracy with low reaction-center attribution on ERM-trained models, the shortcut exists in retrosynthesis and the premise stands; if attribution is already centered, it does not. Second, if scaffold-invariant training beats the fine-tuned Molecular Transformer on the TotSyn scaffold-shift split under strict stereochemistry while the stereo-stripped ablation collapses, then stereo-aware deconfounding is the operative ingredient. Third, if the in-distribution penalty grows large as $\lambda$ increases — the regime anticipated by Is Spurious Correlation Removal Always Learnable? — we will report the full $\lambda$-sweep frontier and treat the result as a boundary on when unlearning scaffold context is worth its cost, which is itself a publishable answer to an open question the file leaves standing.
References
- Re-evaluating Retrosynthesis Algorithms with Syntheseus
- Retrosynthesis Prediction Revisited
- Using Attribution to Decode Dataset Bias in Neural Network Models for Chemistry
- TotSyn: A Total Synthesis Reaction Dataset for Machine Learning in Organic Chemistry
- Pruning Spurious Subgraphs for Graph Out-of-Distribution Generalization
- Geometry-enhanced molecular representation learning for property prediction
- Chemical-Reaction-Aware Molecule Representation Learning
- BioNavi-NP: Biosynthesis Navigator for Natural Products
- Bioinspired Total Synthesis of (+)-Kopsiyunnanine B
- Synthesis of (–)-Canataxpropellane
- Mechanism-Aware Deep Learning for Polar Reaction Prediction
- Transfer learning enables the molecular transformer to predict regio- and stereoselective reactions on carbohydrates
- Is Spurious Correlation Removal Always Learnable?