Was the Heat Necessary? Causal Adjustment of Condition Harshness in Reaction Recommendation

When a machine-learning model reads a century of patent chemistry and recommends "heat to 160 °C in dry acetonitrile with a lethal cyanide source," it is doing something subtly wrong: it is repeating what labs did, not estimating what the chemistry required. Modern synthetic chemistry has shown that many transformations long considered brutish — cyanide additions, phosphate activation, C–H oxidation — can run at room temperature with caged reagents, electrodes, or light Eco-friendly conjugate hydrocyanation of 2-aroyl α,β-unsaturated ketones with potassium hexacyanoferrate(II), Ritter-type amination of C(sp3)-H bonds enabled by electrochemistry with SO42−, Direct conversion of various phosphate sources to a versatile P-X reagent [TBA][PO2X2] via redox-neutral halogenation (Direct conversion of various phosphate sources to a versatile P-X reagent [TBA][PO2X2] via redox-neutral halogenation). Meanwhile, condition-recommendation models are trained on observational patent data where conditions were chosen by lab habit, solvent availability, and filing strategy — exactly the setting in which causal inference warns that pooled associations are artifacts. The Simpson's-paradox study of AI-agent pull requests makes the point vividly: a −26 percentage-point pooled effect dissolved to +1.6 pp (p=0.73) once repository and structure confounders were controlled Beyond Simpson's Paradox: A Cascade of Confounders in AI Agent Pull-Request Co-Authorship. Nothing comparable has ever been attempted for reaction conditions.

The proposal: treat condition harshness — a composite of temperature, hazardous reagent class, atmosphere requirements, and stoichiometric oxidants — as a treatment variable, and estimate its causal effect on reaction outcome using the natural stratification already present in chemical databases, then retrain condition recommenders on de-confounded targets. The payoff is a recommender that can distinguish "this transformation causally requires 160 °C" from "the assignee's lab always ran it at 160 °C," and that recommends the mildest condition not statistically penalized by the data.

Core Claim

Condition harshness in observational reaction corpora is confounded by substrate difficulty, reaction class, patent assignee, filing era, and scale; after covariate adjustment within groups of identical transformations, the apparent yield penalty for mild conditions will shrink substantially, and a recommender retrained on adjusted targets will recommend milder conditions at no measured cost in predicted yield. The claim is falsifiable: if adjusted harshness effects match the raw pooled effects, harshness is genuinely causal everywhere, and the de-biased recommender should not differ from existing ones.

This is deliberately different from the closest existing work. Egret Enhancing Generic Reaction Yield Prediction through Reaction Condition-Based Contrastive Learning built the right dataset — Reaxys-MultiCondi-Yield, 11,831 groups of identical reactant-product pairs run under different conditions — but fits a purely predictive contrastive loss; it never defines a harshness treatment, never adjusts for why a given condition was chosen, and never estimates a treatment effect. Parrot Generic Interpretable Reaction Condition Predictions with Open Reaction Condition Datasets and Unsupervised Learning of Reaction Center calls condition prediction a "causal multitask problem" but means autoregressive conditioning, not causal inference, and trains on unadjusted patent records. Chemma-RC Text-Augmented Multimodal LLMs for Chemical Reaction Condition Recommendation moves toward outcome-based ranking via feedback on high-throughput data, but only on a narrow palladium-arylation HTE corpus, with no confounder control on the broad observational data. HiRes HiRes: Inspectable Precedent Memory for Reaction Condition Recommendation is the strongest accurate recommender and the most explicit amplifier of precedent bias, since its k-nearest-neighbor memory retrieves whatever the historical distribution contains. The chemistry papers supply the treatment definition and the existence proof that mild replacements work; none of the ML papers supplies the adjustment.

Research Program

The first workstream builds a harshness taxonomy. Each condition record (temperature, catalyst, solvent, reagent, atmosphere, current/light input) is mapped to a graded harshness score, with categories anchored by the mild-chemistry literature: free HCN/KCN versus hexacyanoferrate caging Eco-friendly conjugate hydrocyanation of 2-aroyl α,β-unsaturated ketones with potassium hexacyanoferrate(II), stoichiometric oxidants versus anodic sulfate radicals Ritter-type amination of C(sp3)-H bonds enabled by electrochemistry with SO42−, thermal activation versus 365 nm decatungstate HAT Tetrabutylammonium decatungstate-catalyzed hydroalkylation/alkoxylation of 3-methyleneisoindolin-1-ones with alcohols/ethers through hydrogen atom transfer process, and P₄ reduction versus redox-neutral halogenation Direct conversion of various phosphate sources to a versatile P-X reagent [TBA][PO2X2] via redox-neutral halogenation (Direct conversion of various phosphate sources to a versatile P-X reagent [TBA][PO2X2] via redox-neutral halogenation). The taxonomy is deliberately coarse and auditable so a chemist can check any single assignment.

The second workstream is causal estimation on stratified observational data. Reaxys-MultiCondi-Yield provides the identification strategy for free: within a group g of identical reactants and products, substrate identity is held fixed, so the within-group comparison of conditions approximates a randomized comparison once we adjust for the remaining reasons a chemist picked one condition over another (assignee, year, scale, batch context). The estimating equation is a within-group fixed-effect regression:

$$Y_{ig} = \tau H_{ig} + \gamma_g + \boldsymbol{\beta}^{\top} \boldsymbol{Z}_{ig} + \varepsilon_{ig},$$

where $Y_{ig}$ is the yield of instance $i$ in group $g$, $H_{ig}$ its harshness score (the treatment), $\gamma_g$ a group fixed effect that absorbs everything constant within an identical transformation, and $\boldsymbol{Z}_{ig}$ observed instance-level confounders. The coefficient $\tau$ is the adjusted effect of harshness on yield; the unadjusted within-group estimate (dropping $\boldsymbol{Z}$) and the fully pooled estimate bracket how much confounding moves the answer, mirroring the stepwise cascade in the pull-request study Beyond Simpson's Paradox: A Cascade of Confounders in AI Agent Pull-Request Co-Authorship. Where strata are thin, we supplement fixed effects with Frisch–Waugh–Lovell residualization of condition embeddings against confounder embeddings — the same orthogonal-projection logic as the London built-environment propensity study, which matched wards across 13 covariates to isolate a facility-density effect Understanding the Effects of the Neighbourhood Built Environment on Public Health with Open Data — and with inverse-propensity weighting of harsh-condition assignment, using the trimming safeguards documented in Weight Trimming and Propensity Score Weighting.

The third workstream is experimental validation against randomized grids. High-throughput experimentation datasets, principally the 4,608-reaction Buchwald–Hartwig screen, are genuinely randomized condition arrays: they provide unconfounded harshness-yield slopes in the reaction classes they cover. The decisive check is whether observational causal estimates (transferable reaction classes only) reproduce the sign and rough magnitude of the HTE slopes. This is the step that separates this proposal from all prior work: Egret and DRFP are scored on predictive fit to confounded data, never against an experimental counterfactual.

The fourth workstream is the de-biased recommender. Retrain a Parrot-style encoder-decoder (and, as a second architecture, a HiRes-style retrieval hybrid) with two changes: the training loss is inverse-propensity weighted so that harsh conditions chosen for non-causal reasons contribute less, and the ranking objective includes an explicit mildness term — among condition sets with statistically indistinguishable adjusted expected yield, prefer the milder. The recommender is what makes the causal work usable; the causal estimates are what make it trustworthy.

Baselines

The naive reference point is majority-precedent recommendation: predict, for each reaction, the modal condition set among the most similar historical precedents, with no model at all. On USPTO-Condition this is what any untrained retrieval system degenerates to, and it represents the raw observational distribution — including its harshness bias. It sets the floor on both accuracy and harshness, and any causal adjustment that cannot beat it on accuracy while lowering harshness has no practical claim.

The strongest existing competitor depends on the task. For condition-slot accuracy on USPTO-Condition it is HiRes HiRes: Inspectable Precedent Memory for Reaction Condition Recommendation, which fuses parametric heads with k-nearest-neighbor retrieval over a six-stream reaction embedding and reports top-1 primary-slot accuracy of 0.929 for catalyst, 0.534 for solvent, and 0.530 for reagent — the best numbers on Lacuna for that benchmark. For zero-shot generalization to unseen transformations it is Chemma-RC Text-Augmented Multimodal LLMs for Chemical Reaction Condition Recommendation, which reports 25.9% top-1 accuracy on USPTO_500MT (against 1.0% for GPT-4o). For yield prediction across condition-varying groups it is Egret Enhancing Generic Reaction Yield Prediction through Reaction Condition-Based Contrastive Learning, which reports 60.16% multiclass yield-tier accuracy on Reaxys-MultiCondi-Yield. Each will be rerun under identical conditions: same train/test splits of USPTO-Condition and Reaxys-MultiCondi-Yield, same compute budget, and the same tuning search width, with their published hyperparameters as the starting point so the comparison is not gamed by unequal search. Beating HiRes means matching its slot accuracies within one accuracy point on USPTO-Condition while reducing the harshness score of the recommended condition set by a margin pre-registered as chemically meaningful (for example, a median recommended-temperature drop of at least 25 °C or replacement of a stoichiometric hazardous reagent in at least 10% of recommendations) with no loss in adjusted expected yield. Beating Egret means exceeding 60.16% yield-tier accuracy on Reaxys-MultiCondi-Yield after adjustment, and, more importantly, achieving calibrated within-group yield differences — Egret makes no such predictions. Beating Chemma-RC means exceeding 25.9% top-1 on USPTO_500MT.

The critical ablation isolates the causal ingredient: the de-biased recommender trained on raw observational data with no propensity weighting and no mildness term, with architecture, data, and tuning held identical. Any accuracy or mildness gain must be attributable to the adjustment, not to extra capacity — the same discipline the CASP re-evaluation study used when it showed that MCTS and Retro* differences largely vanish under a unified codebase and matched caching Re-Evaluating Chemical Synthesis Planning Algorithms. DRFP with XGBoost Reaction classification and yield prediction using the differential reaction fingerprint DRFP, which reports an average R² of 0.786 on Buchwald–Hartwig yields, serves as the simple-tabular baseline for the yield models.

Why not just…?

Why not just train a bigger supervised model? The direct evidence says supervised models on pooled observational data learn the artifact, not the mechanism: the pull-request study found a −26.0 pp pooled merge penalty that dissolved under stratification Beyond Simpson's Paradox: A Cascade of Confounders in AI Agent Pull-Request Co-Authorship, and generative scaling does not fix extrapolation — GPT-4o manages only 1.0% top-1 on USPTO_500MT while the fine-tuned Chemma-RC reaches 25.9% Text-Augmented Multimodal LLMs for Chemical Reaction Condition Recommendation. A bigger model with more capacity fits the confounded distribution better, not differently. That said, this is a real threat to the accuracy claims, and the head-to-head rerun against Chemma-RC at matched compute is designed to settle it: if the unadjusted model matches both accuracy and mildness, the causal machinery is unnecessary.

Why not just retrieve mild precedents with nearest-neighbor search? HiRes already shows retrieval helps slot accuracy (+1.1 solvent, +1.0 reagent over parametric heads alone) HiRes: Inspectable Precedent Memory for Reaction Condition Recommendation, so the mechanism is sound. The problem is density: legacy harsh protocols dominate the patent record, while the mild paradigms — caged cyanide, sulfate-radical electrochemistry, decatungstate photoredox, redox-neutral phosphate activation — are a vanishingly small fraction of indexed reactions Eco-friendly conjugate hydrocyanation of 2-aroyl α,β-unsaturated ketones with potassium hexacyanoferrate(II), Ritter-type amination of C(sp3)-H bonds enabled by electrochemistry with SO42−. Retrieval returns what exists, so a "retrieve-mild-only" filter would either return almost nothing or return the few mild precedents regardless of whether they causally transfer. The proposal's answer is different in kind: it uses the causal estimates to decide when a mild precedent is informative, which is precisely what retrieval cannot do.

Why not just use high-throughput experimentation data and skip observational causal inference entirely? HTE grids are randomized and clean, but confined: Buchwald–Hartwig and Suzuki–Miyaura screens are palladium cross-couplings, and Egret's authors note they lack the diversity needed for real-world application Enhancing Generic Reaction Yield Prediction through Reaction Condition-Based Contrastive Learning; no HTE corpus spans electrochemistry, photoredox, or caged-reagent activation. This proposal uses HTE exactly where it is strong — as held-out experimental ground truth for validating the observational estimates — and observational data where it is unavoidable, which is everywhere else.

Why not just add condition tokens to a representation model? MolR deliberately enforces condition-free reaction equivalence, so a room-temperature photoredox route and a 200 °C pyrolysis to the same product are identical embeddings Chemical-Reaction-Aware Molecule Representation Learning, and DRFP's symmetric difference merges reagents into reactants and is commutative, so it cannot isolate a condition swap Reaction classification and yield prediction using the differential reaction fingerprint DRFP. Adding condition inputs fixes blindness but not bias: the model would still learn which conditions co-occur with which substrates observationally. Egret already adds condition inputs and still cannot estimate treatment effects. Conditioning and adjustment are different operations; only the second addresses confounding.

Proposed Experiments and Decisive Checks

Experiment one is the cascade analysis on Reaxys-MultiCondi-Yield: estimate the harshness-yield association at three levels — fully pooled, within identical-transformation group, and within group plus covariate adjustment (assignee, year, scale, reaction class). The pre-registered question is whether the pooled estimate reverses or attenuates under stratification, the chemical analogue of the +33.5 pp to +1.6 pp collapse in the pull-request data Beyond Simpson's Paradox: A Cascade of Confounders in AI Agent Pull-Request Co-Authorship. A substantial collapse is evidence that harsh conditions are over-prescribed by habit; no collapse falsifies the core claim.

Experiment two is the HTE transfer check: on reaction classes covered by the Buchwald–Hartwig screen, compare the observational adjusted slope $\hat{\tau}$ against the randomized HTE slope, and against DRFP+XGBoost's reported average R² of 0.786 as the predictive reference on that dataset Reaction classification and yield prediction using the differential reaction fingerprint DRFP. Agreement in sign within a stated tolerance is the pass condition; disagreement means the observational confounders are not the ones we modeled, and strong ignorability fails. For Suzuki–Miyaura yields, no reported result found on Lacuna for a comparable reference number, so that dataset is used only for internal consistency checks.

Experiment three is the recommender bake-off on USPTO-Condition (slot accuracies against HiRes's 0.929/0.534/0.530), USPTO_500MT (zero-shot top-1 against Chemma-RC's 25.9%), and a new metric — mildness at equal adjusted yield — which no existing system optimizes, alongside the unadjusted-retraining ablation. Experiment four is a paired audit: for a sample of transformations where the de-biased recommender proposes a milder condition than the historical precedent, a chemist panel checks each proposal against the mechanistic literature, including whether the mild alternative belongs to a paradigm with demonstrated scope, such as the 71–86% caged-cyanide additions Eco-friendly conjugate hydrocyanation of 2-aroyl α,β-unsaturated ketones with potassium hexacyanoferrate(II) or the up-to-93% electrochemical aminations Ritter-type amination of C(sp3)-H bonds enabled by electrochemistry with SO42−.

Two limitations are acknowledged rather than argued away. Strong ignorability — that all confounders are observed — cannot be proven for patent data, as the propensity-score literature makes clear Understanding the Effects of the Neighbourhood Built Environment on Public Health with Open Data; the HTE validation is the partial answer, and where it fails we report failure. And positivity is genuinely violated for the newest mild paradigms, which have too few precedents for stable propensity estimation in some strata On Positivity Condition for Causal Inference; there the honest output is "insufficient evidence for a mild replacement," not a forced recommendation. The contribution is not that every harsh condition is unnecessary — some, like the 160 °C activation step still required to release benzoyl cyanide from the caged iron complex Eco-friendly conjugate hydrocyanation of 2-aroyl α,β-unsaturated ketones with potassium hexacyanoferrate(II), are causally real — but that the chemistry literature finally lets us tell the two cases apart, and the causal toolkit finally lets us do it at corpus scale.