Agentic generation of verifiable rules for deterministic, self-expanding reaction classification

arXiv cs.AI Papers

Summary

This paper presents a multi-agent LLM pipeline that automatically generates and verifies reaction rules for chemical synthesis, expanding a standard taxonomy from 68 to 14,073 classes without human curation, achieving 97.7% classification accuracy on unseen reactions.

arXiv:2607.01061v1 Announce Type: new Abstract: Computer-assisted synthesis planning breaks target molecules into accessible precursors using large libraries of reaction rules that assign each transformation a deterministic, interpretable label. But chemistry is long-tailed, making manual encoding intractable, and existing tools rely on fixed rulesets that cannot adapt to new chemistries. Here we present a fully automated pipeline in which a multi-agent framework of large language models (LLMs) classifies reactions and writes the rules themselves across 665,901 US patent reactions, generating each rule under a verification loop that tests it against the corpus. It expands a standard taxonomy from 68 to 14,073 classes without human curation. With a lightweight fingerprint classifier, it classifies 97.7\% of unseen reactions, matching a leading proprietary classifier while resolving chemistry more finely and extending on demand to chemistry outside its training distribution. The result is a living reactivity database and a general route to turning generative models into reliable, self-expanding symbolic systems.
Original Article
View Cached Full Text

Cached at: 07/02/26, 05:41 AM

# Agentic generation of verifiable rules for deterministic, self-expanding reaction classification
Source: [https://arxiv.org/html/2607.01061](https://arxiv.org/html/2607.01061)
Daniel Armstrong École Polytechnique Fédérale de Lausanne \(EPFL\) Lausanne, Switzerland &Maarten Dobbelaere École Polytechnique Fédérale de Lausanne \(EPFL\) Laboratory for Chemical Technology, Ghent University &Valentas Olikauskas École Polytechnique Fédérale de Lausanne \(EPFL\) NCCR Catalysis, Switzerland &Helena Avila École Polytechnique Fédérale de Lausanne \(EPFL\) NCCR Catalysis, Switzerland Octavian Susanu École Polytechnique Fédérale de Lausanne \(EPFL\) &Jérôme Waser École Polytechnique Fédérale de Lausanne \(EPFL\) NCCR Catalysis, Switzerland &Philippe Schwaller École Polytechnique Fédérale de Lausanne \(EPFL\) NCCR Catalysis, Switzerland

###### Abstract

Computer\-assisted synthesis planning breaks target molecules into accessible precursors using large libraries of reaction rules that assign each transformation a deterministic, interpretable label\. But chemistry is long\-tailed, making manual encoding intractable, and existing tools rely on fixed rulesets that cannot adapt to new chemistries\. Here we present a fully automated pipeline in which a multi\-agent framework of large language models \(LLMs\) classifies reactions and writes the rules themselves across 665,901 US patent reactions, generating each rule under a verification loop that tests it against the corpus\. It expands a standard taxonomy from 68 to 14,073 classes without human curation\. With a lightweight fingerprint classifier, it classifies 97\.7% of unseen reactions, matching a leading proprietary classifier while resolving chemistry more finely and extending on demand to chemistry outside its training distribution\. The result is a living reactivity database and a general route to turning generative models into reliable, self\-expanding symbolic systems\.

## 1Introduction

Chemical synthesis planning, in which a complex target molecule is decomposed recursively into simpler building blocks, remains a core challenge in drug discovery and materials design\. In their seminal 1969 work, Corey and Wipke proposed computer\-assisted synthesis planning \(CASP\), applying encoded mechanistic rules to suggest synthetic pathways\(corey1967general;corey1969computer;corey1972computer;corey1985computer\)\. To date, this rule\-based approach remains common; the most comprehensive implementations contain tens of thousands of manually designed reaction rules with hardcoded protection and incompatibility logic\(grzybowski2018chematica\)\. Yet the distribution of chemical reactions follows a power law\(zipf2013psycho;szymkuc2016computer\), and the long tail of rare transformations, each demanding the same careful encoding as a commonplace amide coupling, makes exhaustive manual coverage practically intractable\. Automating the extraction and generalisation of reaction rules is particularly timely, as the utilisation of Large Language Models \(LLMs\) in chemistry matures\(bran2023chemcrow;jablonka2023gpt\)\. Such models may offer a new way to encode the synthetic toolbox, replacing human logic with the automatic inference of symbolic reaction transforms from chemical data\.

The automation of reaction rule generation requires solving two distinct problems\. First, a reaction must be assigned to a named class within a structured taxonomy\.carey2006analysisintroduced a semantic hierarchy of ten superclasses to analyse common industrial pharmaceutical transformations, and together with the subsequent medicinal chemistry analysis byroughley2011medicinal, this work informed the Royal Society of Chemistry’s RXNO ontology of named reactionsrxno\. Second, the generalised transformation within each class must be encoded as a computable reaction rule\. Such rules are typically expressed as SMIRKS, a text based format which encodes a graph transformation around the reaction centre and its local atomic environmentdaylightsmirks\. However, constructing these patterns depends heavily on chemical intuition; even a single transformation requires careful specification of atom mappings, stereochemical constraints, and functional group compatibility, and the effort scales poorly to the thousands of reaction types observed in practice\.

Data\-driven approaches to reaction classification have emerged over the past decade, enabled in large part by the publicly available USPTO reaction dataset introduced byLowe2012;Lowe2017\. This corpus, which has also supported work on outcome predictionJin2017predicting;coley2017prediction;Schwaller2018found;schwaller2019molecularand multistep route planningcoley2017computer;Segler2017neural;segler2018planning;schwaller2020predicting, provides the scale of labelled data needed to train and evaluate classifiers\(probst2021molecular;Schwaller2021mapping\); yet these methodologies still depend on a proprietary tool to determine their ground\-truth labels\. This dependence exposes a deeper limitation, since existing classification tools, whether thede factostandard NameRXN\(schneider2016big;Jin2017predicting;joung2025electron\)or open\-source alternatives such as Rxn\-INSIGHT\(rxn\-insight\), fail on both fronts: they rely on fixed ontologies that cannot accommodate transformations absent from their original design, and on manually encoded rule sets with inherently limited template coverage\. This sparsity directly impairs generative molecular design; because synthesisability\-constrained generation relies on template libraries to steer models, tools tethered to static rule sets restrict exploration to historically established chemical space\. A dynamically expandable, granular reaction naming and encoding system could address this bottleneck\. By generating rules for novel chemistry on demand, researchers could explicitly condition generative models to sample and map the previously inaccessible regions of chemical space unlocked by newly discovered transformations\.

The second problem, scalable rule encoding, remains unsolved\. Template\-free methods, which employ graph\- or language\-based models to predict reactants directly from a target product, have shown strong performance for reaction outcome predictionJin2017predicting;Schwaller2018found;schwaller2019molecularand retrosynthetic planningcoley2017computer;Segler2017neural;segler2018planning;schwaller2020predicting, bypassing template creation entirely\(schwaller2022machine\)\. However, these approaches suffer from generating physically invalid molecules and transformations\(gil2023holistic\), a weakness that is particularly consequential for reaction classification\. Here, rule\-based matching retains a distinctive advantage: a SMIRKS pattern either matches a reaction or it does not, so a successful match provides an unambiguous, deterministic assignment\. Neural reaction classifiers, by contrast, return probability distributions over classes, and even highly accurate models will occasionally mis\-assign a reaction, with such errors propagating silently into downstream tasks\. This makes rule\-based matching especially attractive for classification, provided the rule library can be made sufficiently comprehensive; yet no automated method has yet produced a validated library at the scale required\.

A further challenge lies in the redundancy of reaction templates: a single transformation such as amide bond formation may be captured by hundreds of distinct templates in a corpus, each with subtle structural variations, yet only a handful are needed to minimally describe the chemistry\. LLMs offer a natural mechanism to automate this rule distillation process\(vaswani2017attention;radford2019language;openai\_gpt4;google\_gemini\)\. While these models demonstrate strong knowledge of chemical synthesis, including structure, reaction feasibility, and strategic planning\(bran2025chemical;xuan2025synthelite;armstrong2025synthstrategy;hassen2025atom\), they have shown notable difficulty with the related SMILES notation\(bran2025chemical\), and the generation of valid reaction SMARTS has not been demonstrated\. Furthermore, it has not been proven whether this knowledge can be applied with sufficient precision and consistency across hundreds of thousands of reactions\. Even where such precision is achievable, the per\-reaction inference cost of current LLMs makes real\-time classification impractical, motivating hybrid approaches that combine LLM\-distilled knowledge with fast neuro\-symbolic matching\.

Here we show that LLMs can perform detailed reaction classification and reaction SMARTS generation across a large section of the USPTO corpus \(665,901665\{,\}901reactions\) with near\-human label accuracy\. Starting from the RXNO ontology as a seed, we employ an LLM to iteratively classify reactions while dynamically expanding the taxonomy to capture chemistry not represented in the original hierarchy, growing from6868seed classes to14,07314\{,\}073through successive refinement\. For each class, the LLM generalises reaction SMIRKS at intermediate hierarchical tiers; these are validated against the corpus through an autonomous refinement loop that eliminates false positives without sacrificing recall\. The resulting SMIRKS, combined with a lightweight MLP and template matching, enable a fast, deterministic assignment of reactions to their taxonomical position at97\.7%97\.7\\%strict\-match accuracy at the third hierarchical level\. This two\-layer architecture addresses the competing demands of coverage and speed: the deterministic SMIRKS layer provides rapid classification suitable for integration into real\-time synthesis planning and molecular design workflows, while the LLM layer can be invoked on demand to classify reactions that fall outside existing template coverage, automatically proposing new taxonomy entries as needed\.

![Refer to caption](https://arxiv.org/html/2607.01061v1/x1.png)Figure 1:a\. The multi\-agent LLM framework for dynamic taxonomy expansion\. Raw reaction data and a seed hierarchy are evaluated by sequential high\-level and detailed classification agents\. A verifier agent audits the proposed labels; when existing categories are insufficient or imprecise, a label generation agent proposes new classifications\. A taxonomy updater integrates these proposals, dynamically expanding the hierarchy to capture unrepresented chemistry without human intervention, resulting in an expanded reaction taxonomy\. b\. The iterative refinement loop for reaction template generation\. An LLM drafts initial, broad SMIRKS patterns \(low specificity, high recall\) which undergo automated validation against reaction data\. Through successive iterations, the LLM applies chemically grounded structural mutations to minimize false positives while maximizing true positive recall, yielding a robust database of generalized, high\-specificity reaction templates\.
## 2Results and Discussion

### 2\.1Large language model analysis of chemical data

The core challenge in applying LLMs to large\-scale reaction annotation is that a single model call cannot reliably classify hundreds of thousands of reactions in one pass\. Even state\-of\-the\-art long\-context models exhibit systematic degradation when retrieving and reasoning over information positioned deep within their input window where accuracy follows a U\-shaped curve, peaking for content at the beginning and end of the context while dropping sharply in the middle\(liu2024lost\)\. Subsequent work has shown that this performance loss is not solely positional but scales with input length itself, persisting even when the relevant evidence is placed immediately before the query\(du2025context\)\. For a corpus of millions of reactions that encompass thousands of mechanistically distinct transformation types, it is therefore expected that naïvely embedding the entire taxonomy and reaction set into a single prompt produces unreliable assignments\.

To minimise such errors, we decompose the classification task into five specialised LLM agents, with the overall architecture shown in Figure[1](https://arxiv.org/html/2607.01061#S1.F1)a\. This design leverages the Chain\-of\-Verification paradigm\(dhuliawala2024chain\), drawing on the principle that isolating initial generation from independent verification significantly reduces factual hallucination\. To ensure mechanistically equivalent transformations yield identical labels, reactions are first grouped into template\-level cohorts based on shared retrosynthetic templates, as extracted by RDChiral in AiZynthTrain\(3aizynthtrain\)\. A coarse\-grained hierarchy agent then maps each cohort to one of 68 core sub\-classes, which a detailed agent refines to the finest applicable level of detail in the full taxonomy\. If the cohort cannot be assigned to an entry in the taxonomy, it is flagged as such\. A separate verification agent then checks these assignments against the reaction SMILES and template\. The verifier either accepts the detailed classification, or rejects it and passes it on to the next stage\.

Following verification, processing a reaction corpus requires a dynamic taxonomy\. Fixed classification schemes, such as the RXNO ontology or NameRXN, inevitably encounter novel chemistry that forces uninformative "unclassified" tags or outright mis\-assignments\. We overcome this by allowing the taxonomy to expand adaptively based on emergent data patterns rather than relying solely on the model’s prior knowledge\(kargupta2025taxoadapt\)\. To achieve this, we developed a generator\-aggregator architecture: when a reaction is failed by the verifier, a generator agent proposes a new taxonomy entry complete with a code, name, and hierarchical position\. This cannot modify the existing taxonomy, only add to it\. An aggregator agent then deduplicates these proposals, resolves structural conflicts, and atomically updates the living hierarchy\. This automated loop allowed our system to expand organically from the initial 68 sub classes defined by\(carey2006analysis\)to 14,073 distinct class labels\.

The pipeline classified 179,495 reactions across 42,125 templates\. Assuming that all reactions sharing a template inherit the same taxonomic classification, we extrapolate via template identity to yield 665,901 labeled reactions in the full dataset\. The result is a hierarchical classification with granularity greater than manual expert annotation, but at a scale and speed that would be infeasible by hand\.

To validate the LLM labelling, we aimed to gain an estimate of the labelling noise compared to a human expert baseline, NameRXN\. As finer taxonomies may incur higher per\-label noise, before evaluating classification accuracy, we first controlled for this granularity effect by truncating the LLM\-generated hierarchy to match the breadth of NameRXN \(version 3\.7\.0\) over an identical reaction set\. This truncation yielded 823 classes for the LLM pipeline versus 1,029 for NameRXN, enabling a direct comparison of label reliability without requiring complex semantic alignment between the two distinct systems\.With the taxonomies aligned, we assess the residual annotation error using the confident learning framework\(northcutt2021confident\)\. A lightweight neural classifier, trained on reaction fingerprints via five\-fold stratified cross\-validation, generated out\-of\-fold class probabilities\. Because each reaction was scored by a model instance that had never seen its original label, the classifier could flag anomalous examples based purely on structural patterns without memorising the pipeline’s assignments\. This self\-confidence procedure estimated a label noise rate of 2\.19% for the LLM taxonomy \(97\.81% accuracy\), compared with 0\.59% for NameRXN \(99\.41%\)\.However, statistical confidence limit often confuse genuine misclassification with ambiguity at taxonomy boundaries\.

Table 1:Estimated label noise from confident learning\. Noise rate denotes the fraction of training examples flagged as likely mislabelled; accuracy is the complementary\.![Refer to caption](https://arxiv.org/html/2607.01061v1/x2.png)Figure 2:Ina\.we show an example of a set of reactions classified into a single bucket by NameRXN, alongside distinct classes proposed by our LLM based methodology\. In partb\.we show how the taxonomy is adapted by the LLM to observed chemical data\.To determine how much of this apparent noise reflects genuine errors versus taxonomy\-boundary ambiguity, we focused on the LLM\-labelled test set \(n = 30,802\) and applied an LLM\-as\-judge framework\. A label\-prediction conflict arises when the MLP classifier’s predicted class diverges from the original label assigned by the LLM pipeline\. Of the 600 reactions flagged by confident learning \(1\.95%\), 321 exhibited such conflicts and were used for adjudication\. For each pair, the judge model was provided with the two class definitions and asked to assess whether the classes share genuine mechanistic or substrate overlap\. To mitigate the circularity of using an LLM to adjudicate labels originally generated by the Gemini\-based pipeline, the judge operated without access to the original classifier’s reasoning and was prompted only with the taxonomy definitions; however such a mitigation is not perfect and the full set of judge adjudications is provided in Supplementary Information, Section 4\. The majority of flagged conflicts \(81\.2%\) involved classes with substantial chemical overlap \- for instance,*Amination of Heteroaryl Halides*and*Nucleophilic Aromatic Substitution*\. The remaining 102 of 600 flagged reactions \(17\.0%\) involved mechanistically distinct classes and represent genuine failures of the classifier\. Adjusting for boundary ambiguity yields an estimated true mislabelling rate of approximately 0\.33% across the full test set, comparable to the 0\.59% obtained for NameRXN by the same method\. Thus indicating that the fully automated pipeline may achieve label reliability on par with human expert curation\.

#### 2\.1\.1Cross\-taxonomy agreement with NameRXN

The cleanlab analysis above estimates internal label consistency but does not address whether the LLM\-derived labels cluster reactions in a way similar to that of an expert\-designed taxonomy\. We use NameRXN, an expert\-curated classification, as our reference, and ask how closely the two taxonomies agree on the same reactions\. As the label sets share no common vocabulary, a conventional confusion matrix is unavailable, so we measured agreement through two complementary procedures\. Greedy modal mapping was performed in both directions, for each NameRXN class taking the modal LLM class among its reactions and vice versa, yielding two mapping functions whose accuracies lower\-bound the recoverability of each taxonomy from the other\. We also computed adjusted mutual information \(AMI\), which compares partitions of unequal granularity without a shared label space and corrects for chance agreement; the closely related V\-measure is tabulated alongside\.

We repeated this analysis at successive depths of the LLM hierarchy to test how cross\-taxonomy agreement varies with granularity \(Table[2](https://arxiv.org/html/2607.01061#S2.T2)\)\. The AMI remains essentially flat, moving from 0\.837 at L3 to 0\.849 at L4 and 0\.842 at L5; the partitions stay mutually informative at every depth\. This flatness is the signature expected when two taxonomies describe the same chemistry at different resolutions\.

The directional taxonomy to taxonomy mapping accuracies show how that agreement is structured, and how the structure changes with depth\. At L3, where the LLM taxonomy is coarser than NameRXN, NRX→\\rightarrowLLM accuracy is high \(85\.97%\) because multiple NameRXN classes collapse cleanly onto single LLM parents; for example, NameRXN’s separate*bromo*,*chloro*, and*iodo N\-alkylation*entries all map to a single LLM class covering N\-alkylation\. The reverse direction, LLM→\\rightarrowNRX, is correspondingly lower \(70\.23%\) because the LLM class contains reactions that NameRXN partitions further\. Moving to L4 and L5, the asymmetry inverts: NRX→\\rightarrowLLM falls to 56\.27% at L5 while LLM→\\rightarrowNRX rises to 91\.56%\. The deeper LLM classes are finer than NameRXN’s, with each one contained almost entirely within a single NameRXN class \(high LLM→\\rightarrowNRX\), but each NameRXN class spreads across several LLM children \(low NRX→\\rightarrowLLM\)\.

These results indicate that the LLM\-derived hierarchy is not in disagreement with NameRXN but is describing the same chemistry at a finer resolution\. Where NameRXN distinguishes N\-alkylation by leaving group at its finest level, the LLM hierarchy reaches that distinction at L4 and continues to subdivide at L5 into reagent\- and condition\-specific variants that NameRXN does not represent\.

We then applied the same comparison to Rxn\-INSIGHT\(rxn\-insight\), the leading open\-source reaction classification tool, to test whether the patterns observed against NameRXN generalise to alternative reference taxonomies\. The directional accuracies follow the same inverting pattern as for NameRXN, with LLM→\\rightarrowRxn\-INSIGHT rising from 71\.6% at L3 to 93\.8% at L5 as the LLM hierarchy becomes successively finer than the reference partition\. However, AMI behaves qualitatively differently: against NameRXN, AMI is essentially flat across depths \(0\.837 to 0\.849 to 0\.842\), whereas against Rxn\-INSIGHT it declines monotonically \(0\.724 to 0\.720 to 0\.691\)\. A declining AMI indicates that the finer LLM partitions are no longer recoverable from Rxn\-INSIGHT at all; since the same partitions remain recoverable from NameRXN, this reflects the limited resolution of Rxn\-INSIGHT’s smaller template set rather than spurious structure in the LLM hierarchy\.

Together, these comparisons indicate that the LLM hierarchy agrees with expert\-curated chemistry at matched resolution and resolves reactions more finely than either reference\.

Table 2:Cross\-taxonomy agreement between the LLM\-derived hierarchy and two reference taxonomies \(NameRXN, proprietary; Rxn\-INSIGHT, open\-source\), at successive depths of the LLM hierarchy\. Greedy accuracies measure recoverability in each direction; AMI and V\-measure compare partitions without requiring a shared label space\. Train fold \(538k reactions\); test\-fold numbers in parentheses\.

### 2\.2Autonomous Reaction Template Generation

![Refer to caption](https://arxiv.org/html/2607.01061v1/x3.png)Figure 3:Ina\.we demonstrate a worked example of the template generalisation approach for pyrazolo\[1,5\-a\]pyrimidine synthesis\. The coloured molecules after the bottom arrows are the result of applying the generated template to the reactants\. Inb\.we highlight a scheme demonstrating the template ordering\. in \(i\) the valuenassigned to an edge from A to B indicates thatntemplates of Class A produce a false positive on class B\.Expert\-curated synthesis and reaction classification tools such as Synthia and Rxn\-INSIGHT, respectively, rely on the manual authoring of reaction SMIRKS, a labor\-intensive bottleneck\. In raw data corpora, a single transformation category often manifests as dozens of overly specific, templates due to artefacts of the algorithmic rules used for extraction\. Distilling these into a minimal set of generalised SMIRKS simplifies the computational representation and provides robust, broad coverage at intermediate taxonomic levels\. An obvious choice for this task is am LLM, however while LLMs possess broad chemical knowledge, their ability to author syntactically valid and chemically precise SMIRKS remains unproven\. Successfully automating this curation process would demonstrate that LLMs can reliably translate high\-level chemical intent into rigid, deterministic rules, effectively automating a major cheminformatics workload\.

To achieve this, we developed an iterative, LLM\-driven generalization pipeline\. To mitigate the over\-generalization inherent in purely generative approaches, we implemented a five\-stage validated learning loop\. Each reaction class was partitioned into an 80/20 train/test split\. The LLM generated candidate SMIRKS using the training set, which were subsequently screened against the broader corpus of different reaction classes to identify false positives\. These false positives were fed back into an autonomous refinement phase, where the LLM iteratively modifies the SMIRKS patterns in response to qualitative accuracy and false positive metrics and qualitative examples of failure cases\.

We validated this pipeline on a filtered subset of 665,901 reactions, requiring a minimum of five reactions per template\. Performance on the held\-out test set was evaluated at several different hierarchy levels\.

### 2\.3SMIRKS Database Ordering for First\-Match Classification

The generalised SMIRKS patterns enable fast, deterministic reaction classification via a first\-match\-wins strategy: given a query reaction, the database is traversed in order and the first SMIRKS that fires correctly determines the predicted class\. However, when class A’s SMIRKS also fires correctly on class B’s reactions \(a false positive\), the ordering determines which class is assigned\. To reduce false positives, we use an ordering algorithm detailed in section[4\.5](https://arxiv.org/html/2607.01061#S4.SS5)\. Testing 665,901 reactions against all 4,964 SMIRKS patterns revealed the complete false\-positive graph; the ordering algorithm eliminated 95\.8% of false positives, with the remaining 4\.2% arising from unavoidable mutual relationships within 215 strongly connected components \(SCCs\)\. The end\-to\-end classification accuracy of the ordered database, alongside its hybrid MDP\-gated counterpart, is evaluated against the held\-out test fold and an out\-of\-distribution academic corpus in Section[2\.4](https://arxiv.org/html/2607.01061#S2.SS4)\.

### 2\.4A deterministic reaction classifier

Table 3:In\-distribution accuracy by hierarchical tier on two held\-out USPTO splits\. Each cell reports*overall*accuracy \(correct over all test reactions\) with*covered*accuracy \(correct over reactions on which a template fired\) in parentheses\.*Templates*is the size of the template library each mode draws on\. Split A is frequency\-weighted \(per\-template80/2080/20\); Split B is template\-balanced \(one held\-out reaction per template\)\. Generalised SMIRKS is shown under the false\-positive\-minimising order and, for reference, under an arbitrary order of the identical4,9644\{,\}964\-pattern set \(mean of three random shuffles\), which isolates the effect of ordering\. A correct prediction equals the ground\-truth code truncated to the given tier\.The LLM\-derived hierarchy, the generalised SMIRKS database, and the false\-positive\-aware ordering algorithm developed in the preceding subsections were assembled into a single classification system, ReactionClassifier\. The system supports two inference modes that lie at opposite ends of a granularity–robustness trade\-off\. In the first, termed*Hybrid strict*, a lightweight multilayer perceptron trained on differential reaction fingerprints \(MDP\) predicts a tier\-3 class for the query reaction\. This prediction restricts the matching procedure to the corresponding class\-specific subset of the44,44944\{,\}449exact reaction templates, and the predicted label is accepted only when at least one template within the subset fires on the input reactants and produces the correct ground truth product\. The subsetting step removes many false positives associated with global first\-match strategies and preserves the deepest hierarchical detail represented in the template library\. In the second mode,*Generalised SMIRKS*, the MDP gate is omitted and the database of4,9644\{,\}964generalised SMIRKS is applied in the global false\-positive\-minimising order of Section[4\.5](https://arxiv.org/html/2607.01061#S4.SS5), returning the first class whose SMIRKS matches the reaction\. Generalised SMIRKS does not reach the deepest tiers but is less sensitive to gate error and to deviations from the training distribution of the MLP\. The MDP prediction is used only as a gate; standalone MDP classification accuracies are not reported, as the prediction is probabilistic and hence does not provide a strong guarantee of correctness

Classification accuracy depends on how the held\-out set is constructed; rather than treating a single test distribution as definitive, we report two complementary splits of the labelled USPTO reactions \(628,870628\{,\}870reactions\)\. In the*frequency\-weighted*split \(Split A\), each retrosynthetic template contributes80%80\\%of its reactions to training and20%20\\%to the test fold, so that common transformations dominate the test set in proportion to their natural abundance \(n=127,282n=127\{,\}282\), establishing a baseline for everyday synthetic utility\. In the*template\-balanced*split \(Split B\), a single reaction is held out per template, weighting every template equally and over\-representing the long tail of rare transformations \(n=17,097n=17\{,\}097\) to stress\-test the classifier’s absolute breadth\. Both splits retain the remaining reactions of each template in the training fold, and a separate MDP gate was trained on each split’s training fold; the two splits therefore measure accuracy on novel substrates of templates seen during training rather than extrapolation to unseen chemistry, the latter being assessed on the out\-of\-distribution corpora below\.

We report two metrics \(Table[3](https://arxiv.org/html/2607.01061#S2.T3)\)\.*Overall accuracy*is the fraction of all test reactions assigned the correct code at a given tier, while*covered accuracy*restricts this fraction to reactions on which at least one template fired and therefore measures reliability once the classifier commits to a label\. Hybrid strict reaches97\.9%97\.9\\%overall at tier 3 on the frequency\-weighted split and94\.1%94\.1\\%on the template\-balanced split, at a median of66–77ms per reaction; its covered accuracy is higher still \(98\.7%98\.7\\%and97\.5%97\.5\\%\), so that a committed classification is rarely wrong and the residual error is dominated by abstention rather than misclassification\. Generalised SMIRKS is lower overall \(85\.9%85\.9\\%and75\.0%75\.0\\%at tier 3\) because, without the neural gate, fewer reactions are covered and a pattern ordered ahead of the correct class can fire on reactions the gate would otherwise have routed elsewhere; its covered accuracy at tier 3 \(90\.1%90\.1\\%and86\.8%86\.8\\%\) is correspondingly closer to that of Hybrid strict\. Accuracy declines at tiers 4 and 5 for both modes, where classes are distinguished by reagent and condition information that substrate structure alone does not determine\.

The ordering of the generalised SMIRKS database is itself a substantial contributor to classifier performance\. Applying the identical4,9644\{,\}964\-pattern set in an arbitrary order lowers tier\-3 covered accuracy from90\.1%90\.1\\%to70\.5%70\.5\\%on Split A and from86\.8%86\.8\\%to77\.5%77\.5\\%on Split B, with the gap widening at deeper tiers\. Because coverage is unchanged by reordering, this difference reflects only which class is returned when several patterns match a reaction: the false\-positive\-minimising order recovers roughly1010–2020percentage points of coverage\-conditional accuracy compared to arbitrary ordering\.

### 2\.5Out\-of\-distribution coverage

The held\-out evaluation above is an in\-distribution test: every reaction belongs to a template that the LLM pipeline labelled, so the two splits measure internal consistency on novel substrates of known templates rather than true generalisation\. We therefore evaluate on two out\-of\-distribution \(OOD\) test sets, benchmarking against the established tools NameRXN \(proprietary\) and Rxn\-INSIGHT\(rxn\-insight\)\(open\-source\) \(Table[4](https://arxiv.org/html/2607.01061#S2.T4)\)\.

CRD\-2025 is a single\-reaction\-centre subset of reactions reported in academic publications dated 2025 and later \(n=9,296n=9\{,\}296\)chemicalreactiondatabase\. It is out\-of\-distribution along two axes: temporally, it lies entirely beyond the 1976–2016 USPTO window, and chemically, it reflects the priorities of academic methodology development rather than the process\- and scale\-oriented chemistry that dominates the patent record\. As no ground\-truth labels are available for these reactions, we report only coverage \(the fraction assigned a non\-null label\) and latency\. For the second test set, we choose ring forming reactions \(RingBreaker\) derived from the AiZynthTrain retrosynthesis pipeline\(3aizynthtrain\)\. Ring forming reactions offer an interesting area for our approaches \- due to complex stereo and regio chemical constraints, retrosynthesis tools can struggle to apply known ring forming reactions to novel chemical contexts, and hence the ability of a SMIRKS set to model such chemistry indicates how well they have been generalised\. We construct a set comprising \(n=57,234n=57\{,\}234\) ring\-forming reactions from the USPTO corpus for this test\.

Table 4:Coverage and median per\-reaction inference latency on two out\-of\-distribution corpora\. CRD\-2025: single\-reaction\-centre academic reactions published in 2025 and later \(n=9,296n=9\{,\}296\)\. RingBreaker: ring\-forming USPTO reactions that existing retrosynthesis pipelines were unable to classify \(n=57,234n=57\{,\}234\)\. Latency measured under 16\-core multiprocessed inference on a workstation CPU\.On the academic corpus, NameRXN attains the highest coverage \(89\.3%89\.3\\%\), reflecting the long\-tail entries accumulated in its rule library over more than a decade of manual curation\(schneider2016big\)\(Supplementary Figure ?? reports the per\-template coverage distribution\)\. Among the data\-derived methods, however, Generalised SMIRKS attains the highest coverage \(68\.3%68\.3\\%\), above both Hybrid strict \(64\.0%64\.0\\%\) and Rxn\-INSIGHT \(64\.8%64\.8\\%\)\. This is direct evidence of generalisation: Generalised SMIRKS draws on only4,9644\{,\}964patterns, roughly a tenth of the44,44944\{,\}449exact templates available to Hybrid strict, yet reaches more of the novel academic chemistry, because abstracting away substrate\-specific detail lets a compact rule set match transformations generalise well to a greater diversity of substrates\. The effect is most pronounced on the ring\-forming corpus, where our modes \(80\.6%80\.6\\%and77\.3%77\.3\\%\) exceed NameRXN \(73\.7%73\.7\\%\) and far exceed Rxn\-INSIGHT \(6\.9%6\.9\\%, whose rule set is dominated by acyclic functional\-group transformations\)\. As ring formation can be the limiting step in retrosynthetic planning, an80%80\\%classifiable fraction approaches complete coverage of the template space encountered in single\-step retrosynthesis\. Both modes operate at a median of66–99ms per reaction, roughly twofold faster than Rxn\-INSIGHT, while assigning labels at three additional taxonomic tiers \(Table[2](https://arxiv.org/html/2607.01061#S2.T2)\)\.

For both deterministic modes the primary failure mode on out\-of\-distribution input is abstention: a reaction for which no template fires is returned unclassified, so the determinism guarantee of the symbolic layer is preserved\. The roughly one\-third of CRD\-2025 reactions on which the deterministic layer abstains corresponds to transformations that fall outside the existing hierarchy, for which no generalised or specific SMIRKS matches the recorded product\. The following subsection applies the multi\-agent pipeline of Section[4\.2](https://arxiv.org/html/2607.01061#S4.SS2)to the remaining data\.

### 2\.6LLM fallback on unclassified academic chemistry

The reactions on which the deterministic layer abstains are not a random sample of chemical space\. We hypothesise that such failures likely fall into categories of chemistry that are either novel or poorly represented in industrial process chemistry\. Adapting a taxonomy to such reactions has conventionally required extensive manual curation, as in fixed tools such as NameRXN and Rxn\-INSIGHT\. The two\-layer architecture automates this step: reactions that the symbolic layer cannot place are routed to the LLM pipeline, which classifies them and extends the taxonomy on demand\.

We then quantified how much of this coverage reflected assignment to existing classes rather than expansion of the taxonomy\. We note the template database does not necessarily cover all reactions that could be placed into the existing taxonomy; coverage records only whether a reaction received a label, not whether that label already existed in the hierarchy\. As the pipeline can create new classes as well as assign existing ones, the fraction of cohorts routed to the generator agent measures how far the academic corpus extends beyond the patent\-derived hierarchy\.

##### Classification outcome\.

A final classification was assigned to2,9112\{,\}911of the2,9902\{,\}990processed single\-center reactions \(97\.4%97\.4\\%\); the remaining7979\(2\.6%2\.6\\%\) did not receive a final label and are candidates for a targeted rerun\. Combined with the64\.0%64\.0\\%coverage of Hybrid strict on the parent CRD\-2025 corpus, the two\-layer architecture classifies8,8618\{,\}861of the9,2969\{,\}296reactions \(95\.3%95\.3\\%\), exceeding the89\.3%89\.3\\%coverage of NameRXN on the same corpus without recourse to manually authored rules for post\-2016 academic chemistry\.

##### Taxonomy growth\.

The fallback was applied both to the single\-center abstention set and to a further960960multicenter reactions that are excluded from the symbolic classifier’s evaluation\. Across both sets, a total of1,9421\{,\}942entries were appended to the hierarchy \(Table[5](https://arxiv.org/html/2607.01061#S2.T5)\)\. Of these,135135were located at the third hierarchical tier, the level of named reaction types such as*N\-arylation with aryl halides*or*Suzuki–Miyaura coupling*; the remaining additions were distributed across deeper tiers, with687687at L4,836836at L5, and284284at the condition\-level \(L6/L7\) tiers\. Of the3,8273\{,\}827cohorts processed,37\.0%37\.0\\%were routed to the generator agent and therefore required the creation of a new taxonomy entry rather than assignment to an existing class\. The magnitude of this fraction is consistent with the interpretation that the academic literature sampled in CRD\-2025 occupies a region of chemical space distinct from that represented in the patent corpus on which the hierarchy was originally generalised\.

Table 5:Hierarchy entries added by the LLM fallback on the CRD\-2025 single\-center and multicenter abstention sets\.
##### Origin of the new taxonomy entries\.

The135135L3 entries introduced during the fallback correspond to established synthetic methodologies that are underrepresented in the USPTO corpus, rather than to transformations first reported in 2025\. Theα\\alpha\-selenenylation of carbonyl compounds is one such case: introduced in the 1970s and routinely employed in academic total synthesis as the entry step into the selenoxide elimination sequence toα,β\\alpha,\\beta\-unsaturated carbonyls, the reaction is largely absent from pharmaceutical patent corpora, a pattern consistent with the regulated status of selenium as an elemental impurity in drug substances\(ich2022q3dr2;santoro2014green\)\. The pre\-fallback taxonomy contained selenium chemistry only at the SeO2/Riley oxidation and selenoxide elimination stages; the upstream C\-Se bond\-forming step was added during the present run as a new L3 class with three L4 substrate variants\. The amination of aryl nonaflates by secondary aliphatic amines provides a second case\. Nonaflate substrates were already represented in the taxonomy in the context of Suzuki\-Miyaura coupling and the amination of heteroaryl nonaflates; the corresponding aryl\-amination class, which appears more frequently in academic methodology work than in pharmaceutical process chemistry, was not, and was added on demand\. In both cases the taxonomy expansion reflects a distributional difference between the patent corpus on which the hierarchy was generalised and the academic corpus on which it was subsequently applied, rather than the emergence of new chemistry\. Full hierarchical pathways for both examples are provided in Supplementary Information

##### C–H functionalisation and reductive cross\-coupling\.

Beyond isolated substrate classes, the entries introduced during the fallback include a coherent set of recognisable, well\-established synthetic methodologies\. The two largest families are direct C–H functionalisation, which appears in2323of298298source DOI’s \(7\.7%7\.7\\%\), and reductive or radical cross\-coupling, which appears in2121\(7\.0%7\.0\\%\)\. For C–H functionalisation, the emergent classes include the direct, halide\-free C–H borylation of \(hetero\)arenes \(the Ishiyama–Miyaura–Hartwig reaction\), directed C\(sp3\)–H arylation of amides , and intramolecular carbene C–H insertion of diazo compounds \. For reductive cross\-coupling, they include the decarboxylative coupling ofNN\-hydroxyphthalimide \(redox\-active\) esters including the construction of bicyclo\[1\.1\.1\]pentane bioisosteres and the nickel\-catalysed reductive cross\-electrophile coupling of alkenyl and alkyl halides\. The classes generated are identifiable, named methodologies rather than ad hoc groupings, an indication that the fallback recovers meaningful synthetic chemistry absent in the USPTO corpus\.

### 2\.7Expert\-chemist validation of classification accuracy

Table 6:Expert\-chemist adjudication of reaction classifications, comparing the LLM\-derived taxonomy against NameRXN across two evaluation pools\. Equal\-weighted across three chemists: each of the 69 reactions was graded by all three raters \(207 gradings\); percentages are the mean across raters\. Inter\-rater agreement was moderate \(Fleissκ≈0\.40\\kappa\\approx 0\.40for the LLM labels,0\.450\.45for NameRXN\)\.To benchmark the taxonomy against thede factostandard, NameRXN, we conducted a blind, dual\-label expert evaluation by three chemists on a common stratified sample of the out\-of\-distribution CRD\-2025 corpus \(n=69n=69reactions, each graded by all three raters\)\. Raters graded blinded, randomised label pairs asCorrect,Acceptable but imprecise, orWrong, and all statistics are weighted equally across raters\. The results in Table[6](https://arxiv.org/html/2607.01061#S2.T6)indicate that the LLM\-derived hierarchy achieves absolute correctness comparable to NameRXN, with a statistically insignificant difference in outright error rates \(8\.2%8\.2\\%vs\.7\.2%7\.2\\%, respectively\)\. Neither system is meaningfully more prone to absolute misclassification\.

Turning to label precision, the LLM labels were graded fullyCorrectin82\.6%82\.6\\%of cases, whereas NameRXN achieved aCorrectrating in only61\.8%61\.8\\%of cases, with17\.9%17\.9\\%of its labels penalised asAcceptable but imprecise\. In paired head\-to\-head assessments, the LLM assignment was strictly preferred over NameRXN in4747out of6161discordant reactions\. This demonstrates that the primary failure mode of fixed taxonomies relative to human preference is under\-specification rather than error\.

We also observed a notable performance variance between the two sampling pools\. LLM assignments for reactions covered by rules extracted from the USPTO corpus were gradedCorrectin90\.1%90\.1\\%of cases, compared to66\.7%66\.7\\%for previously unclassified reactions routed to the LLM generator\. We propose several hypotheses for this gap: original\-pool labels used cohort\-based regularisation in the naming process \(up to five reactions per template\), which stabilises the LLM’s output, whereas fallback labels were assigned from a single reaction; the academic methodology literature over\-represented in the “new” pool features highly specific or unusual transformations that are inherently more ambiguous to classify; and the common USPTO reactions comprising the “original” pool are likely better represented in the LLM’s pre\-training corpus than the novel academic reactions in the fallback pool\.

## 3Conclusion

Recent work has established that LLMs display a strong understanding of the language of chemistry; here we demonstrate that they can also write its grammar, performing at scale a detail\-orientated and labour intensive task previously the preserve of cheminformaticians\. What previously required years of expert curation can now be performed on demand at costs affordable to academic research laboratories\.

Reaction classification poses a dual challenge; assignments must be deterministic and reliable, while the underlying taxonomy should be dynamically adaptable to the creative research which defines the frontier of organic chemistry\. The architecture presented here resolves this tension by separating the two tasks; a deterministic symbolic layer, realised as a database of named reaction SMIRKS, classifies known chemistry quickly, while a generative language\-model layer is invoked on demand to categorise novel transformations and propose new taxonomic entries where required\. This pattern need not be specific to chemistry; any domain in which a long\-tailed, evolving body of knowledge must be both deterministically applied and continuously expanded could benefit from the same abstract architecture\.

The taxonomy resolves reactions more finely than existing classifiers \(Table[2](https://arxiv.org/html/2607.01061#S2.T2)\), which is useful both to chemists and to downstream methods\. For the former, reaction collections can be searched and filtered at the level of specific named transformations rather than broad categories\. For the latter, the finer resolution gives class\-conditioned generative methods more specific control\. Synthesisability\-constrained generation can be steered only as precisely as its reaction labels allow\. Rather than being restricted to existing patent data, the ability to generate rules on demand allows generative models to be conditioned directly on novel chemistry, enabling the exploration and mapping of the chemical space accessible via newly discovered transformations\. Finally, the taxonomy is not a fixed artefact: local aliases, proprietary chemistry, and institution\-specific nomenclature can be added, enabling cheap customisation to proprietary preferences\.

The pipeline presented here is tuned to the USPTO corpus, which over\-represents pharmaceutical chemistry and under\-represents organometallic, materials, and process\-scale transformations; extending it to specialised reaction corpora, such as those covering electrochemistry, flow chemistry, or biocatalysis, will require additional curation effort, although the underlying methodology transfers directly\. The pipeline depends on a reasonable seed hierarchy to bootstrap from, and while it grows that hierarchy organically, it cannot reliably construct one from nothing\. Looking further, the present work is fundamentally retrospective; it organises and generalises chemistry that has already been recorded\. Preliminary results suggest that language models can also move from curating known reactions to proposing transformations absent from any existing corpus, and we are pursuing this in ongoing work\. Together, curation and generation suggest a route toward synthesis planners that are no longer bounded by the coverage of their training data and would enable CASP tools to begin approaching the synthesis of complex molecules whose synthesis currently requires bespoke methodology development\.

## 4Methods

### 4\.1Dataset and preprocessing

#### 4\.1\.1Working dataset

Our starting point was the USPTO reaction corpus of\(Lowe2012;Lowe2017\), comprising approximately 1\.8 million chemical reactions extracted from US patent filings between 1976 and 2016, encoded as SMILES strings of the formreactants\>reagents\>products\. The corpus was processed with the AiZynthTrain pipeline\(3aizynthtrain\)\.

We further restricted the dataset to reactions whose templates occur at least three times in the filtered corpus, providing the minimal redundancy required for cohort\-level analysis and downstream template generalisation\. After these filters, 860,675 reactions covering 42,125 distinct templates remained and constitute the working dataset throughout this study\.

#### 4\.1\.2Cohort grouping by template hash

Reactions sharing an identical template hash undergo the same core structural transformation by construction\. We exploited this redundancy by grouping such reactions into*cohorts*that received a single, jointly\-determined classification label\. From each cohort we drew up to five reactions \(or all reactions, when fewer than five were available\) for inclusion in the LLM prompts; this provides the agents with substrate diversity and functions as a form of regularisation to noise present in individual reaction samples\. In aggregate, 179,495 reactions across the 42,125 cohorts were sampled and submitted to the language\-model pipeline, with each cohort’s assigned label subsequently broadcast to every reaction sharing its template hash\.

#### 4\.1\.3Stratified train/test split

For SMIRKS template generation and held\-out evaluation we performed an 80/20 stratified split at the finest available tier of the LLM\-derived hierarchy, using a fixed random seed of210,995210\{,\}995for reproducibility\. Class\-level filtering criteria specific to template generalisation, including the minimum\-class\-size threshold, are described together with the SMIRKS pipeline in Section[4\.4](https://arxiv.org/html/2607.01061#S4.SS4)\.

#### 4\.1\.4Out\-of\-distribution evaluation corpora

To probe generalisation beyond the USPTO timeframe and beyond acyclic chemistry, we assembled two evaluation corpora that are disjoint from the training data\.

##### Chemical Reaction Database \(CRD\-2025\)\.

Reactions extracted from chemistry publications dated 2025 and later were scraped from the publicly maintained Chemical Reaction Database \(CRD\) \([https://kmt\.vander\-lingen\.nl](https://kmt.vander-lingen.nl/)\), yielding an initial raw scrape size of 11,088 reactions\. Records were canonicalised using RDKit\(rdkit\)and atom\-mapped with RXNMapper\(schwaller2021extraction\)\. We subsequently applied a*single\-reaction\-centre*filter, retaining only reactions for which the mapper assigned a single connected component of changed atoms and for which every reactant\-side molecule contributed at least one heavy atom to the product\. This pipeline removes multi\-stage transcriptions, charge\-transfer artefacts, and misplaced reagents, leaving a final evaluation set of 9,296 reactions\.

##### RingBreaker template library\.

The second OOD corpus was the USPTO RingBreaker template library distributed with AiZynthTrain\(3aizynthtrain;thakkar2020ring\)\. This set comprises 57,234 ring\-forming reactions retained on the criterion that the underlying retrosynthetic template occurs at least three times across the full USPTO corpus\. This dataset isolates ring\-forming chemistry that demands complex stereochemical and regiochemical constraints\.

### 4\.2Multi\-agent LLM classification pipeline

#### 4\.2\.1Architecture overview

We decomposed reaction classification into a sequence of five specialised language\-model agents \(Figure[1](https://arxiv.org/html/2607.01061#S1.F1)\)\. Each cohort, defined in Section[4\.1](https://arxiv.org/html/2607.01061#S4.SS1), is passed through the pipeline in turn: a hierarchy agent assigns a coarse two\-level code, a detailed agent refines it to the deepest applicable tier, a verifier agent audits the assignment, a generator agent proposes a new taxonomy entry whenever verification fails, and an aggregator agent reconciles the new proposals against the existing hierarchy\. This structure follows the Chain\-of\-Verification paradigm of Dhuliawala et al\.\(dhuliawala2024chain\), in which separating proposal from verification reduces the propagation of self\-consistent but factually incorrect claims\. Throughout the run, the taxonomy itself is treated as an expandable object: the aggregator appends new entries to a dynamic mapping that all subsequent agent calls consult, so the hierarchy grows organically as the pipeline encounters chemistry that is not represented in the seed taxonomy\.

#### 4\.2\.2Hierarchy agent

The hierarchy agent assigns each cohort to one of 68 fixed sub\-classes drawn from the RXNO ontology\(rxno\)and the analyses of Carey et al\.\(carey2006analysis\)and Roughley et al\.\(roughley2011medicinal\)\. The complete two\-level seed taxonomy is embedded in the system prompt as nine super\-classes spanning heteroatom alkylation, acylation, C–C bond formation, heterocycle formation, protections, reductions, oxidations, functional\-group interconversion, and functional\-group addition\. The agent receives the cohort’s reaction SMILES and the shared retrosynthetic template, and returns a single`<reaction\_class\>X\.Y</reaction\_class\>`tag\. The level\-1 and level\-2 codes are immutable across the run; later agents are not permitted to alter them\.

#### 4\.2\.3Detailed agent

The detailed agent refines the assignment to the deepest applicable tier of a seven\-level taxonomy\. Given the L2 code from the previous stage, the agent receives the corresponding subtree of the dynamic mapping as context, together with the cohort SMILES and the shared retrosynthetic template\. Classification follows a strict two\-path algorithm\. In Path A, the agent first searches the hierarchy for a class whose reactant functional groups exactly match those present in the cohort, then optionally descends to a deeper reagent\-specific variant\. In Path B, applicable when no precise functional\-group match can be found, classification terminates immediately at the nearest valid parent class with the suffix\.Otherappended\. The agent emits five XML tags encoding the level\-1 through level\-4\+ labels and the complete hierarchical code\. Levels 3 and 4 are required to be derivable from reactants and products alone; reagent identity is admitted as a discriminator only at level 5 and beyond\.

#### 4\.2\.4Verifier agent

The verifier audits the proposed classification without access to the detailed agent’s reasoning, which removes the bias toward reproducing the original assignment\. The agent returns one of three outcomes\. A valid classification is reported as`<match\>true</match\>`with actioncontinue\. A standard mismatch, in which the high\-level category is correct but the specific reactant or reagent identity is wrong, is reported with`<match\>false</match\>`and actioncontinue, routing the cohort to the generator\. A fatal hierarchy error, in which the proposed L1/L2 category is fundamentally incompatible with the reaction \(for example, an alkene reduction misplaced under N\-acylation\), is reported with actionincorrect\_hierarchy\. Cohorts flagged in this way are excluded from further processing and labelledHIERARCHY\_MISMATCHin the output, preventing downstream code conflicts that would otherwise arise when chemically unrelated reactions are forced into a shared parent class\.

#### 4\.2\.5Generator agent

The generator proposes a new taxonomy entry for any cohort that exits the verifier with actioncontinueand`<match\>false</match\>`\. The agent is instructed to follow a “what versus how” naming principle: levels 3 and 4 must describe the core transformation in reagent\-agnostic terms \(the reactant functional groups and the product functional groups\), while levels 5 and deeper encode named reactions or generalisable condition sets and are prefixed withcond:for downstream parsing\. Proposals are emitted as a single hierarchy line of the form`code label`together with any required new parent levels, a suggested parent code, and a free\-text rationale\. The agent is forbidden from proposing modifications to level\-1 or level\-2 codes\.

#### 4\.2\.6Aggregator agent

Generator proposals are noisy at the cohort level: distinct cohorts that describe the same novel transformation will independently propose nearly identical entries with arbitrary placeholder codes\. The aggregator consolidates a batch of proposals, grouped by their shared L2 parent, into a coherent set of additions\. It deduplicates chemically overlapping proposals, assigns sequential codes that fit the existing hierarchy, and emits both a list of new hierarchy lines and a JSON map from in\-batch proposal indices to the final assigned codes\. The dynamic mapping is updated atomically after each aggregator call, so cohorts processed later in the same run see and reuse the new entries rather than re\-proposing them\. A code conflict, defined as the same code already present in the mapping under a different label, is recorded and the conflicting line is skipped, with the affected cohort markedCONFLICT:for post\-hoc resolution\.

#### 4\.2\.7Models and inference

Both Gemini 3 Flash and Gemini 3 Pro were used for inference, accessed through the Google GenAI SDK\. Lower\-cost classification stages were assigned to Gemini 3 Flash and the verification, generation, and aggregation stages to Gemini 3 Pro, reflecting the larger reasoning budget required to audit and extend the taxonomy\. All agents were run with a sampling temperature of0\.10\.1\. Cohorts were processed in batches with inter\-cohort parallelism implemented via a thread pool of up to eight workers\. The pipeline is fully resumable: intermediate stage artefacts are checkpointed after each batch, allowing a run to be restarted from any stage without re\-issuing already\-completed model calls\.

### 4\.3Label\-noise estimation

#### 4\.3\.1Confident learning with out\-of\-fold predictions

We estimated the residual annotation error in both the LLM and NameRXN \(version 3\.7\.0\) label sets using the confident learning framework of Northcutt et al\.\(northcutt2021confident\), implemented in thecleanlabpackage\. For each reaction we computed a Morgan Difference Fingerprint \(MDP\) and trained a multilayer perceptron classifier on the resulting fingerprint vectors\. To prevent the classifier from memorising potentially noisy labels, predicted class probabilities were obtained by 5\-fold stratified cross\-validation: each reaction was scored by a model instance trained on a fold that excluded its own label\. The cleanlab self\-confidence procedure was then applied to these out\-of\-fold probabilities to flag examples whose original label disagrees with the model’s confident prediction\.

#### 4\.3\.2Hierarchy depth alignment

The LLM\-derived hierarchy is finer than the NameRXN taxonomy by construction\. Because finer classifications naturally incur higher baseline label noise, comparing the two raw outputs directly would conflate taxonomy resolution with classification accuracy\. To enable a like\-for\-like comparison, we truncated the LLM labels to a depth yielding a class count comparable to the NameRXN classification over the identical reaction set \(level 3 of the LLM hierarchy\)\. This allowed for a direct statistical comparison of label noise without requiring explicit mapping between the two ontologies\. All baseline labels were generated using NameRXN version 3\.7\.0; we note that newer versions of NameRXN contain a higher number of reaction classes, which would require truncation to a correspondingly deeper level\.

#### 4\.3\.3LLM\-as\-judge adjudication

Confident\-learning noise estimates conflate genuine mislabelling with ambiguity at taxonomy boundaries, so we further adjudicated the flagged reactions in the LLM\-labelled test set \(n=30,802n=30\{,\}802\)\. Of the 600 reactions flagged by cleanlab \(1\.95%1\.95\\%of the test set\), 321 exhibited a direct conflict between the MLP’s predicted class and the original LLM label and were submitted to a separate language\-model judge\. The judge was provided with the two class definitions only and was asked to determine whether the classes share substantive mechanistic or substrate overlap; it had no access to the original classifier’s reasoning\. Both systems share broadly similar pre\-training corpora, so this adjudication is not strictly independent, but the absence of the original chain\-of\-thought substantially reduces direct contamination\. The judge classified81\.2%81\.2\\%of the adjudicated conflicts \(261 of 321\) as taxonomy\-boundary ambiguities\. Across the full set of 600 cleanlab\-flagged reactions,17\.0%17\.0\\%\(102 reactions\) were judged mechanistically distinct misclassifications, giving an estimated true mislabel rate of approximately0\.33%0\.33\\%relative to the full test set\.

### 4\.4Autonomous SMIRKS generalisation

#### 4\.4\.1Class filtering and template screening

SMIRKS template generation requires several reactions per class to support a reliable generalisation, so we restricted template training to classes containing at least five reactions in the training fold\. This filter dropped 943 of the rarest classes, accounting for approximately15\.1%15\.1\\%of reactions\. For each retained class, the most frequentTEMPLATE\_rr0rp1\_ring0templates were selected by a top\-NNprocedure that begins withN=10N=10and doubles until the cumulative template coverage reaches 90% orNNexceeds 50\. The shortest training\-fold reaction matching each selected template was retained as a worked example accompanying it in the prompt\.

#### 4\.4\.2Few\-shot generalisation prompts

The selected templates and worked examples for each class were submitted to the language model together with a system prompt that combines a SMARTS notation reference, six rules for generalising over templates \(atom\-map handling, context\-atom abstraction, leaving\-group merging, reaction\-centre\-only versus contextual SMIRKS, splitting into multiple SMIRKS when the reaction\-centre transformation itself differs, and charge handling\), and a six\-step reasoning procedure \(identify the core transformation, find reaction\-centre atoms, check for distinct patterns, identify variable positions, decide context level, write and verify the SMIRKS\)\. The prompt also includes three worked examples covering the principal cases: an RC\-only minimal generalisation, halide\-list merging with context generalisation, and an instance requiring multiple SMIRKS for a single class\. Outputs were constrained to a Pydantic schema with two fields, a free\-text reasoning trace and a list of SMIRKS strings\.

#### 4\.4\.3Validation against worked examples

Each returned SMIRKS was applied to the corresponding worked examples using RDKit’sRunReactants\. To handle templates with fewer reactant components than the recorded reaction, all subsets and permutations of the reactant molecules were tried\. A SMIRKS was treated as correct on a given example if at least one permutation produced a product that, after non\-isomeric canonicalisation, matched the recorded product; non\-isomeric comparison was used to avoid spurious failures arising from differences inEE/ZZencoding\. The combined coverage of all returned SMIRKS for a class was required to exceed50%50\\%; if it did not, the failing reaction together with the diagnostic returned by RDKit was appended to the prompt and the model was queried again, for up to three retry rounds\.

#### 4\.4\.4Cross\-class false\-positive testing

After training, each SMIRKS was tested against the training\-fold reactions of every other class\. A false positive was recorded when a SMIRKS from class A produced the correct product for a reaction from class B\. Tests against reactions belonging to the SMIRKS’ own class, or to ancestor or descendant classes within the hierarchy, were skipped, as were reactions with fewer reactant components than the SMIRKS requires\. Testing was parallelised across eight worker processes viajoblibwith reactions chunked at 200 per worker; each worker compiled its own RDKit reaction objects locally because compiled reactions cannot be transferred between processes\. Each false\-positive record was annotated with the deepest shared ancestor of the SMIRKS class and the true class, which allows false positives to be categorised as same\-tier\-2 \(closely related\), same\-tier\-1 \(within the same superclass\), or cross\-tier\-1 \(between unrelated super\-classes\)\.

#### 4\.4\.5Iterative refinement with rollback

Classes with at least one false positive were re\-prompted with a refinement\-specific system prompt that instructs the model to add context\-atom constraints, tighten hydrogen and degree descriptors, restrict ring membership, or split overly broad patterns into narrower ones\. The user prompt included the current SMIRKS, up to ten training examples that the refined SMIRKS must continue to cover, and up to twenty false\-positive examples grouped by true class\. After each round the refined SMIRKS was re\-validated on the training examples; if training\-fold coverage dropped below80%80\\%of the original recall, the refinement was rolled back and the original SMIRKS retained\. Otherwise the false\-positive examples were re\-tested against the refined SMIRKS and any eliminated false positives were removed from the working list\. Refinement proceeded for up to three rounds per class\.

#### 4\.4\.6Per\-class tier\-depth selection

Different reaction classes are best described at different hierarchical depths: well\-defined transformations such as Suzuki coupling admit a single broad SMIRKS at level 3, whereas finer distinctions, for example condition\-dependent variants of an amidation, require level 4 or level 5 patterns\. We therefore pre\-computed a recommended tier depth per class based on the cumulative coverage of the top\-NNtemplates at each level, retaining the shallowest level at which90%90\\%template coverage was attainable\. The resulting mixed\-depth SMIRKS database contains 896, 1,498, and 1,360 classes generalised at tier 3, tier 4, and tier 5 respectively\.

#### 4\.4\.7Held\-out evaluation

Final SMIRKS, refined where applicable and otherwise as originally generated, were evaluated against the20%20\\%held\-out test fold\. For each class, recall is the fraction of own\-class test reactions matched by at least one of its SMIRKS\. Cross\-class false\-positive testing was repeated on the test fold to obtain per\-class precision, specificity,F1F\_\{1\}score, and balanced accuracy\.

### 4\.5SMIRKS database ordering

#### 4\.5\.1First\-match\-wins inference

Given the validated SMIRKS database, classification of an unseen reaction proceeds by iterating the database in order and returning the class of the first SMIRKS that fires correctly on the reaction\. This first\-match\-wins strategy is fully deterministic but its accuracy depends on the database ordering: when class A’s SMIRKS also fires correctly on reactions belonging to class B, the ordering of A and B determines whether the reaction is correctly attributed to B or incorrectly attributed to A\.

#### 4\.5\.2False\-positive graph

We modelled these inter\-class dependencies as a weighted directed graph in which nodes are reaction classes and an edgeA→BA\\to Bwith weightwwrecords that class A’s SMIRKS fire correctly onwwreactions whose true label is class B\. The graph was built by testing every reaction in the database against every SMIRKS, amounting to approximately3\.3×1093\.3\\times 10^\{9\}individual SMIRKS applications across 665,675 reactions and 4,964 SMIRKS patterns\. The procedure mirrors the cross\-class false\-positive test used during refinement \(Section[4\.4](https://arxiv.org/html/2607.01061#S4.SS4)\) but is applied without skipping ancestor or descendant relationships, so that the resulting graph captures all SMIRKS\-level interactions present in the corpus\.

#### 4\.5\.3Ordering algorithm

Finding a permutation that minimises the total weight of remaining false positives is a weighted minimum\-feedback\-arc\-set problem and is NP\-hard in general\. We approached it in three stages\. First, the strongly connected components of the false\-positive graph were identified using an iterative implementation of Tarjan’s algorithm, chosen over the recursive form to accommodate the depth of the graph without exhausting the Python call stack\. Each strongly connected component corresponds to a group of classes whose mutual false positives cannot be resolved by reordering\. Second, the components were collapsed to single nodes and the resulting directed acyclic graph was topologically sorted using Kahn’s algorithm; among components ready for placement at a given step, the component depended on by the largest number of others was selected first as a tie\-breaker\. Third, within each non\-trivial component, classes were ordered by a greedy heuristic in which the node with the largest difference between incoming and outgoing edge weights was placed first, with weights updated after each placement to reflect edges removed from the residual graph\. Classes that participate in no false\-positive edge were appended at the end, where their position has no effect on accuracy\.

### 4\.6Deterministic ReactionClassifier

The ordered SMIRKS database and the LLM\-derived hierarchy are combined into a single deployable artefact exposing two inference modes:*Ordered SMIRKS*and*Hybrid strict*\. This subsection details the architecture of the gating model, the class–template index, and the inference execution logic\.

#### 4\.6\.1Reaction difference fingerprint MLP

The gating classifier is a multilayer perceptron trained on reaction difference fingerprints \(MDP\) For each reaction we concatenate two folded20482048\-bit fingerprints computed with the reference Morgan Fingerprint implementation at radiusr=2r=2: the product fingerprint, capturing the substructural context of the product, and the difference fingerprint, encoding the symmetric difference between reactant and product substructures\. The resulting40964096\-dimensional binary vector is the sole model input\. The MLP has one hidden layer of512512GELU units with dropout0\.10\.1, followed by a linear classification head that emits one logit per class at the deepest available tier of the LLM hierarchy\. The model was trained on the train fold described in Section[4\.1](https://arxiv.org/html/2607.01061#S4.SS1)using AdamW \(learning rate3×10−43\\times 10^\{\-4\}, weight decay10−410^\{\-4\}, batch size10241024,4040epochs, label smoothing disabled\)\. To prevent leakage between chemically near\-identical reactions, train/validation partitioning was performed at the level of the retrosynthetic template hash: reactions sharing a template were placed jointly in the train or validation fold\. Inference returns the argmax class labelc^\\hat\{c\}and its softmax confidencep​\(c^\)p\(\\hat\{c\}\); neither value is treated as a final classification on its own, and we do not report standalone MDP accuracy because its predictions lack the determinism guarantee required by the deployment use case\.

#### 4\.6\.2Class–template index

The hybrid classifier requires a lookup from class code to the templates that compactly represent that class\. We use theTEMPLATE\_rr0rp1\_ring0retrosynthetic templates extracted during preprocessing \(radius 0 on the reactant side, radius 1 on the product side, ring expansion disabled\)\. For each unique class code in the LLM\-derived hierarchy at the deepest available tier \(6,2816\{,\}281codes at L5\), we collect all distinct templates whose underlying reactions were labelled with that code, yielding a mappingclass\_to\_templates:code→\{templatei\}\\texttt\{class\\\_to\\\_templates\}:\\ \\mathrm\{code\}\\to\\\{\\mathrm\{template\}\_\{i\}\\\}\. This index is computed once from the working dataset \(Section[4\.1](https://arxiv.org/html/2607.01061#S4.SS1)\) and held in memory for inference\.

#### 4\.6\.3Hybrid strict inference

Given a query reactionrr, hybrid strict proceeds in three steps\.\(i\) Gate: the MDP MLP produces a predicted classc^\\hat\{c\}at the deepest hierarchical tier\.\(ii\) Subset: the candidate template pool is restricted to the44,44944\{,\}449exact reaction templates that share a common tier\-3 prefix withc^\\hat\{c\}\(the defaultsubset\_tier=3=3\)\.\(iii\) Match: the subsetted templates are applied via RDKit’sRunReactants, evaluating all subsets and permutations of the reactant molecules\. The predicted label is accepted only when at least one template within the subset fires and produces the correct canonicalised product\. If no template fires correctly on the reaction, the strict\-match acceptance rule defaults the system to returnOtherReactionrather than the MDP prediction, recording an abstention\.

#### 4\.6\.4Latency measurement

Per\-reaction latency was measured under 16 parallel workers multiprocessed inference on a workstation CPU \(AMD Ryzen 9 7900X \(12 cores / 24 threads\), 64 GB RAM\)\. Each method was timed end\-to\-end including any model warm\-up on the first query, with the warm\-up call excluded from the distribution\. Latency statistics \(mean, median, p95\) are computed across the full evaluation set after parallel collection\.

### 4\.7Evaluation methodology

#### 4\.7\.1Hierarchical match definitions

Predictions were compared to ground\-truth labels at each tier \(level 1 through level 5\) using two complementary criteria\. A*strict match*at tierkkrequires the predicted code and the ground\-truth code to agree exactly when both are truncated tokklevels\. An*ancestor match*at tierkkaccepts the prediction whenever the predicted code is an ancestor or a descendant of the ground\-truth code at any depth, on the basis that the prediction lies on the same branch of the hierarchy and differs only in granularity\. The two scores coincide except when a generic SMIRKS at tierkkis applied to a reaction whose ground\-truth label sits at a deeper tier, or vice versa\.

#### 4\.7\.2Coverage categories

For each evaluated reaction we recorded one of the following outcomes\.*Correct*indicates either a strict match or agreement after applying the structurally\-indistinguishable class merges described below\.*Mismatch*indicates that a SMIRKS fired but predicted the wrong class\.*Missed*indicates that no SMIRKS in the database fired on the reaction even though its class is represented in the database\.*Uncovered*indicates that the reaction’s class was excluded from training because it contained fewer than five reactions; these reactions are retained in the corpus but excluded from accuracy denominators\.*Conflict*indicates that the ground\-truth label carries aCONFLICT:prefix from the aggregator stage and is therefore ambiguous; these are also excluded from accuracy denominators\.

#### 4\.7\.3Class merges for indistinguishable transformations

A small number of class pairs in the LLM\-derived hierarchy encode the same molecular transformation but appear under different parent super\-classes due to mechanistic or strategic context\. Buchwald\-Hartwig amination, nucleophilic aromatic substitution, and heteroaryl amination, for example, all proceed through formation of a C–N bond between the same functional groups, and ester hydrolysis appears both as a deprotection step and as a stand\-alone functional\-group interconversion\. We curated 16 such pairs manually and treated predictions within each merged group as equivalent during evaluation\. The full list is provided in the Supplementary Information\.

### 4\.8Software, hardware, and reproducibility

The classification pipeline was implemented in Python\. Inference was carried out through the Google GenAI SDK; chemical structure handling and SMIRKS application used RDKit\(rdkit\); atom\-to\-atom mapping used RXNMapper\(schwaller2021extraction\); and label\-noise estimation used thecleanlab\(northcutt2021confident\)package\. Reaction and molecular fingerprints were computed with the referencerdkitimplementation\(rdkit\)\. Generalisation, false\-positive testing, and ordering usedjoblibfor parallelism andPydanticfor structured LLM output, with the strongly\-connected\-component and topological\-sort routines implemented directly\. A fixed random seed of210,995210\{,\}995was used wherever stochastic behaviour is involved \(cross\-validation folds, train/test splits\)\. Inference parallelism was set to eight worker processes or threads throughout\.

## Acknowledgments and Disclosure of Funding

Acknowledgements\.The authors thank collaborators in EPFL Laboratory of Artificial Chemical Intelligence \(LAIC\) for helpful discussions

Funding\.This work was supported by the Swiss National Science Foundation through the National Centre of Competence in Research \(NCCR\) Catalysis, grant number 180544\. Maarten Dobbelaere acknowledges financial support from the Research Foundation – Flanders \(FWO Vlaanderen\) through postdoctoral fellowship grant 1266226N and travel grant V414426N\.

Competing interests\.The authors declare no competing interests\.

## References

Supporting Information

S1: Label Diversity

## Appendix AClassification Summary Statistics

A total of 179,495 unique reactions across 42,125 retrosynthetic templates were classified into 12,650 distinct class codes, drawn from a label vocabulary of 14,073 hierarchical class labels \(plus 9,654 condition labels\)\. By assigning each template its majority class and extrapolating to the full template occurrence count, the classification covers an estimated 860,675 reactions\. The hierarchy spans 7 levels: 19 super\-classes \(L1\), 106 sub\-classes \(L2\), 1,546 types \(L3\), 6,224 subtypes \(L4\), and progressively finer distinctions at L5–L7\. Within templates, classification is highly consistent: 99\.97% of templates \(42,112/42,125\) are assigned a single unique class code across all their classified reactions\.

### A\.1Class\-size distributions

Figure[4](https://arxiv.org/html/2607.01061#A1.F4)shows the distribution of extrapolated reaction counts per class at three hierarchy levels \(L3, L4, L5\)\. All three exhibit a power\-law shape: the majority of classes contain fewer than 50 reactions, while a long tail of high\-frequency classes dominates the total reaction count\.

![Refer to caption](https://arxiv.org/html/2607.01061v1/x4.png)Figure 4:Distribution of extrapolated reactions per class at three hierarchy levels\. L3 \(Type\): 1,545 classes, median 20, max 74,276\. L4 \(Subtype\): 6,223 classes, median 13, max 26,024\. L5 \(Sub\-subtype\): 5,935 classes, median 13, max 23,459\.
### A\.2Label diversity across L3 classes

To quantify how uniformly the LLM assigns fine\-grained subtypes within a given reaction type, we define the*label diversity ratio*for each L3 class as the number of unique finest\-level class codes divided by the number of templates\. A ratio of 1\.0 indicates maximal diversity \(every template received a unique subtype\), while low ratios indicate uniform assignment\. Figure[5](https://arxiv.org/html/2607.01061#A1.F5)shows the distribution: the median diversity ratio is 0\.667, 617 L3 classes achieve maximal diversity \(ratio = 1\.0\), and only 22 fall below 0\.1\.

![Refer to caption](https://arxiv.org/html/2607.01061v1/x5.png)Figure 5:Label diversity across L3 classes\.Left:scatter plot of template count vs\. unique class codes per L3 class, coloured by diversity ratio \(green = diverse, red = uniform\)\. The dashed line indicates maximal diversity \(y=xy=x\)\.Right:histogram of diversity ratios across all 1,545 L3 classes\.

## Appendix BMaximally Diverse L3 Classes: Worked Examples

We present two L3 classes with maximal label diversity \(ratio = 1\.0\) as illustrative examples\. In both cases, every classified template maps to a unique subtype code, reflecting genuine chemical variation within the reaction family\.

### B\.13\.10\.3 Aromatic Formylation

This L3 class contains 7 classified templates, each assigned a unique subtype code\. All reactions install an aldehyde \(–CHO\) onto an aromatic ring, but the reagent, mechanism, and substrate scope differ for every template\.

Table 7:Aromatic Formylation subtypes \(3\.10\.3\)\. Each template maps to a unique class code\.![Refer to caption](https://arxiv.org/html/2607.01061v1/x6.png)\(a\)3\.10\.3\.2\.2\.1Vilsmeier–Haack formylation of a pyrrolo\[1,2\-a\]pyrimidine with DMF/POCl3\.
![Refer to caption](https://arxiv.org/html/2607.01061v1/x7.png)\(b\)3\.10\.3\.4Lithiation–formylation of an imidazole withn\-BuLi then DMF\.
![Refer to caption](https://arxiv.org/html/2607.01061v1/x8.png)\(c\)3\.10\.3\.5Rieche formylation of a pyrrole ester with MOM\-Cl/AlCl3\.
![Refer to caption](https://arxiv.org/html/2607.01061v1/x9.png)\(d\)3\.10\.3\.5\.1Rieche formylation of a thiophene with MOM\-Cl/AlCl3\.

![Refer to caption](https://arxiv.org/html/2607.01061v1/x10.png)\(a\)3\.10\.3\.6Rieche formylation of a phenol with MOM\-Cl/TiCl4\.
![Refer to caption](https://arxiv.org/html/2607.01061v1/x11.png)\(b\)3\.10\.3\.6\.1Duff\-type formylation using ethyl acetate as formyl source\.
![Refer to caption](https://arxiv.org/html/2607.01061v1/x12.png)\(c\)3\.10\.3\.7Vilsmeier–Haack formylation using toluene, DMF, and POCl3\.

Figure 7:Representative reactions for each subtype in class 3\.10\.3 \(Aromatic Formylation\)\.
### B\.29\.1\.1 Hydrohalogenation of Alkenes

This L3 class contains 6 templates, each with a unique code\. All reactions add halogen\(s\) across a C=C double bond, but they span Markovnikovvs\.anti\-Markovnikov selectivity, different halogens \(Br, F\), radicalvs\.ionic mechanisms, and multi\-component additions \(azidohalogenation\)\.

Table 8:Hydrohalogenation subtypes \(9\.1\.1\)\. Each template maps to a unique class code\.![Refer to caption](https://arxiv.org/html/2607.01061v1/x13.png)\(a\)9\.1\.1\.3\.1\.2Markovnikov HBr addition to a styrenyl alkene \(benzylic bromide product\)\.
![Refer to caption](https://arxiv.org/html/2607.01061v1/x14.png)\(b\)9\.1\.1\.3\.2Anti\-Markovnikov HBr addition to a terminal alkene \(toluene solvent, radical conditions\)\.
![Refer to caption](https://arxiv.org/html/2607.01061v1/x15.png)\(c\)9\.1\.1\.3\.3HF addition across a perfluoroalkene\.
![Refer to caption](https://arxiv.org/html/2607.01061v1/x16.png)\(d\)9\.1\.1\.1\.2Bromofluorination: NBS \+ HF gives vicinal bromo\-fluoro product\.
![Refer to caption](https://arxiv.org/html/2607.01061v1/x17.png)\(e\)9\.1\.1\.6Radical Br2addition with benzoyl peroxide \(BPO\) initiator; anti\-Markovnikov terminal bromide\.
![Refer to caption](https://arxiv.org/html/2607.01061v1/x18.png)\(f\)9\.1\.1\.7\.1Azidohalogenation: NBS introduces Br while azide adds to give vicinal azido\-bromide on a uracil substrate\.

Figure 8:Representative reactions for each subtype in class 9\.1\.1 \(Hydrohalogenation of Alkenes\)\.

## Appendix CClassification Pipeline

### C\.1Overview

We developed a five\-stage agentic classification pipeline in which each stage is a specialised large language model \(LLM\) call \(Gemini 2\.5 Flash or Pro via Google Vertex AI, temperature 0\.1–0\.2\)\. The pipeline takes as input a set of atom\-mapped reaction SMILES, each associated with a retrosynthetic template hash and a SMARTS\-encoded retro\-template, and produces a hierarchical class code together with human\-readable names at every level of the taxonomy\. A central design principle is the*two\-phase context strategy*: a lightweight first stage classifies every reaction against the full \(but compact\) two\-level hierarchy \(∼\\sim100 entries\), after which all subsequent stages operate on only the relevant*subtree*of the full taxonomy\. This is necessary because the complete taxonomy, which grows to over 14 000 entries during a run, far exceeds the context window that an LLM can use effectively; by routing first to a two\-level parent code, the detailed agent receives a focused subtree of at most a few hundred entries, enabling precise fine\-grained classification without dilution from irrelevant branches\.

### C\.2Template\-level cohort batching

Reactions are grouped into*cohorts*by retrosynthetic template hash before entering the pipeline\. All reactions that share the same template undergo the same core bond disconnection and therefore, by construction, represent the same mechanistic transformation regardless of peripheral substituents\. Each cohort contains up to 5 representative reactions; the pipeline classifies the cohort once and broadcasts the result to all members\. This methodology we hypothesise acts as a "batch regularisation" and increases the likelyhood of a correct classification\.

### C\.3Stage 1: Hierarchy classification

The hierarchy agent receives the full two\-level reaction taxonomy \(9 super\-classes, 52 sub\-classes\) as part of its system prompt, together with the reaction SMILES \(optionally with atom\-mapping numbers stripped via RDKit to reduce input complexity\)\. The agent is instructed to identify the key bonds formed or broken and the functional groups involved, and to classify the reaction into the most appropriate sub\-class using a*reagent\-agnostic*analysis: the core structural transformation must be identifiable without reference to catalysts or reagents\. The output is a single two\-level code \(e\.g\.,2\.1\) per cohort, returned in XML format \(<reaction\_class\>X\.Y</reaction\_class\>\)\.

### C\.4Stage 2: Detailed classification

The detailed agent receives only the*subtree*of the hierarchy rooted at the two\-level parent code assigned in Stage 1\. This subtree is typically 10–200 entries and contains all known types \(L3\), subtypes \(L4\), sub\-subtypes \(L5\), and condition variants \(L6\+\) beneath the parent\. The agent follows a strict two\-path decision algorithm:

Path A \(match found\):Step 1 identifies the Level 3/4 branch by examining*only*reactant and product functional groups \(reagent\-agnostic\)\. Step 2 then examines reagents and catalysts to select a Level 5\+ condition variant within the already\-locked branch\.

Path B \(no match\):If no existing Level 3/4 entry matches the core transformation, the agent terminates with an\.Othersuffix appended to the parent code, signalling that a new entry is needed\.

The reaction is presented with explicit role labels \(reactants:,reagents:,product:\) together with the retrosynthetic SMARTS template\. The output consists of five XML tags:<reaction\_super\_class\>,<reaction\_sub\_class\>,<reaction\_type\>,<reaction\_subtype\>, and<class\_number\>\.

### C\.5Stage 3: Verification

A verification agent audits each detailed classification\. It performs two checks in sequence:

1. 1\.Hierarchy integrity\(primary check\): Does the reaction fundamentally belong in this super\-class and sub\-class? Fatal errors such as a reduction classified under oxidation, or a C–C bond formation under protection/deprotection trigger anincorrect\_hierarchyflag, and the cohort is excluded from further processing entirely\.
2. 2\.Functional specificity\(secondary check\): Do the named functional groups in the class label precisely match the reactant structures? Do the Level 5\+ condition labels match the reagents present? If not, the classification is marked as a mismatch \(match=false\) with a one\-sentence reason, and the cohort is routed to the generator stage\.

Cohorts that pass both checks \(match=true\) exit the pipeline with their Stage 2 classification as final\.

### C\.6Stage 4: Proposal generation

For cohorts flagged as mismatches, a generator agent proposes new taxonomy entries\. The agent receives the same hierarchy subtree and reaction data as the detailed agent, plus the failed classification and the verifier’s reason for rejection\. It follows a “What vs\. How” principle:

- •Levels 1–4 \(“What”\):Describe the reagent\-agnostic core transformation by specifying the reactant functional groups and the bond\(s\) formed\.
- •Levels 5\+ \(“How”\):Describe the specific reagent system, named reaction, or condition set \(e\.g\., “cond: EDC/HOBt Coupling”\)\.

The output includes a suggested parent code, a new entry code and name, the exact hierarchy line to append, and a rationale\. The agent may also propose intermediate parent entries if they are missing from the current subtree\.

### C\.7Stage 5: Aggregation and dynamic mapping

The aggregator agent receives all proposals for a given two\-level parent code \(chunked into groups of up to 50 cohorts\) and consolidates them into a unified set of new hierarchy entries plus a mapping from each cohort to its final class code\. The aggregator deduplicates overlapping proposals, for example “Acid chloride \+ primary amine to secondary amide” entry are merged into a single canonical Level 3/4 class, with separate Level 5\+ condition variants if their reagent systems differ\.

The resulting new hierarchy lines are applied to the*dynamic mapping*; an in\-memory dictionary keyed by two\-level parent code, where each value is a sorted list of descendant entries\. This update happens*immediately*, so that subsequent aggregator calls within the same pipeline run see the newly created entries and can assign cohorts to them rather than creating duplicates\. The mapping is also persisted to disk via an atomic write \(temporary file→\\tofsync→\\torename\) to ensure crash safety\.

#### C\.7\.1Conflict detection and resolution

A global code\-to\-label lookup table tracks every class code assigned during the run\. When a new hierarchy line is proposed whose code already exists but with a*different label*, the line is rejected and recorded as a conflict\. Any cohort whose final assignment points to a conflicting code receives aCONFLICT:X\.Y\.Z\.Wprefix in the outputLLM class numbercolumn, with all text label columns left empty\. This makes conflicts trivially filterable in downstream analysis and flags them for manual resolution\. Conflicts are intentionally*not*retried automatically: because the same code with two different labels indicates genuine taxonomic ambiguity, automated resolution risks silently merging chemically distinct categories\.

#### C\.7\.2Hierarchy growth

The taxonomy is not static\. Over the course of a classification run, the verify→\\togenerate→\\toaggregate loop extends the hierarchy with new entries proposed by the LLM and validated by the aggregator\. In the present dataset, the label vocabulary grew from an initial seed of∼\\sim2 000 entries to 14 073 class labels and 9 654 condition annotations \(23 727 total\), spanning seven hierarchy levels\. This closed\-loop design enables the system to handle novel chemistry that falls outside the initial taxonomy without human intervention, while the conflict detection mechanism ensures that growth remains consistent\.

### C\.8Output format

The pipeline produces a CSV file with one row per input reaction and the following classification columns:LLM reaction super class\(L1 name\),LLM reaction sub class\(L2 name\),LLM reaction type\(L3 name\),LLM reaction subtype\(L4\+ name\),LLM class number\(full numeric code, e\.g\.,2\.1\.1\.3\), andclassification\(type\-level label, e\.g\.,2\.1\.1 Amide Schotten\-Baumann\)\. A companion dynamic mapping JSON file records the final state of the taxonomy, keyed by two\-level parent code\.

## Appendix DLLM label noise analysis

We applied the confident learning framework \(cleanlab;northcutt2021confident\) to estimate label noise for both the LLM \(level\-3\) and NameRXN annotations independently\. A two\-layer MLP \(512 hidden units, SELU activation, dropout 0\.1\) was trained on concatenated difference and product DRFP fingerprints with five\-fold stratified cross\-validation; out\-of\-fold softmax probabilities were used to rank suspected mislabels by self\-confidence\. On the training set, cleanlab flagged 2\.19% of LLM labels and 0\.59% of NameRXN labels as likely incorrect \(Table[1](https://arxiv.org/html/2607.01061#S2.T1)\)\.

To distinguish genuine errors from taxonomy\-boundary ambiguity in the LLM labels, we inspected all 321 confusion pairs among the 600 reactions flagged on the held\-out test set \(n=30,802n=30\{,\}802\)\. We classified each pair into one of three categories: \(i\)*boundary ambiguity*, where both the given and predicted labels describe the same underlying transformation and differ only in taxonomic granularity or naming convention; \(ii\)*partial overlap*, where the two classes share a common mechanistic step but differ in scope; and \(iii\)*genuine error*, where the given and predicted classes are mechanistically distinct\. Representative examples of each category are listed in Supplementary TableLABEL:tab:llm\_confusion\_pairs\.

Of the 600 flagged reactions, 487 \(81\.2%\) fell into category \(i\), 11 LLM confusion pairs into category \(ii\), and 102 \(17\.0%\) into category \(iii\)\. The most frequent boundary\-ambiguity pair was1\.3\.6*Amination of Heteroaryl Halides*↔\\leftrightarrow1\.3\.5*Nucleophilic Aromatic Substitution*\(117 reactions combined\), both of which describe displacement of a leaving group on an electron\-poor aromatic ring by a nitrogen nucleophile but differ in whether the taxonomy privileges substrate identity or mechanism\. Other recurrent boundary pairs included5\.1\.9*Cleavage of Phenol Protecting Groups*→\\to5\.1\.1*Cleavage of Alcohol Protecting Groups*\(14 reactions\), reflecting phenols being a subset of alcohols\. Category \(iii\) errors were diverse and included reductions mislabelled as oxidations and\\chSNAr reactions confused withNN\-alkylation\. After restricting to category \(iii\) only, the adjusted mislabelling rate is 0\.33%, comparable to the 0\.59% noise estimated for NameRXN by the same method\.

Table 9:LLM level\-3 label confusion pairs identified by cleanlab on the training set \(n = 538,029\)\.*Verdict*:FAIR= taxonomy boundary ambiguity \(classes are genuinely similar\);SUSPECT= reaction types are mechanistically distinct, indicating a probable labelling error;UNCLEAR= one class code unmapped\.\#nnVerdictGiven label→\\toModel prediction172FAIR1\.3\.6Amination of Heteroaryl Halides1\.3\.5SNAr†245FAIR1\.3\.5SNAr1\.3\.6Amination of Heteroaryl Halides†314FAIR5\.1\.9Cleavage of Phenol PGs5\.1\.1Cleavage of Alcohol PGs†412FAIR6\.1\.16Reduction of nitrobenzylamines6\.1\.11Reduction of nitrobenzenes to anilines†512FAIR6\.5\.5Reduction of aryl ketones6\.5\.1Hydride Reduction†69FAIR6\.1NO2to amine6\.1\.11Reduction of nitrobenzenes to anilines78FAIR1\.6\.5N\-Alkylation of Pyridones/Uracils1\.6\.1N\-Alkylation ofπ\\pi\-Excessive Heterocycles†87FAIR1\.7\.7O\-Alkylation for PG Formation1\.7\.1Williamson Ether Synthesis†96FAIR5\.1\.4Cleavage of COOH PGs8\.7\.2Carboxylic Acid Derivative Interconversions106FAIR8\.7\.7Synthesis of Organoboron Compounds3\.5\.8Pd\-Catalyzed Borylation115FAIR1\.1\.1Alkylation1\.5\.1N\-Alkylation with alkyl halides125FAIR7\.1\.2Oxidation of Secondary Alcohols to Ketones7\.8\.7Oxidation of Alcohols135FAIR7\.8\.7Oxidation of Alcohols7\.1\.2Oxidation of Secondary Alcohols to Ketones144FAIR1\.5\.1N\-Alkylation with alkyl halides1\.1\.1Alkylation SN2154FAIR3\.11\.24Condensation of ketones with amide acetals1\.1\.9Condensation with Amide Acetals164FAIR3\.3\.5Coupling of Heteroaryl Halides3\.3\.1Coupling of Aryl/Vinyl Halides†174FAIR6\.1\.7Reduction of nitrobenzenesulfonamides6\.1\.11Reduction of nitrobenzenes†183FAIR1\.3\.1Buchwald\-Hartwig1\.3\.5SNAr†193FAIR1\.3\.1Buchwald\-Hartwig1\.3\.6Amination of Heteroaryl Halides†203FAIR1\.3\.2Ullmann1\.3\.8Amination of Aryl Halides†213FAIR1\.3\.6Amination of Heteroaryl Halides1\.3\.1Buchwald\-Hartwig†223FAIR1\.3\.8Amination of Aryl Halides1\.3\.1Buchwald\-Hartwig†233FAIR1\.4\.2N\-Alkylation of Lactams1\.4\.1N\-Alkylation of Amides†243FAIR1\.6\.33N\-Alkylation with Benzyl Halides1\.6\.1N\-Alkylation ofπ\\pi\-Excessive Heterocycles†253FAIR1\.7\.1Williamson Ether1\.7\.7O\-Alkylation for PG Formation†263UNCLEAR3\.10\.1Friedel\-Crafts Acylation3\.Other???273FAIR3\.11\.10Cyanation of aryl halides3\.5\.7Pd\-Catalyzed Cyanation283FAIR3\.11\.69Borylation of aryl/heteroaryl halides3\.5\.8Pd\-Catalyzed Borylation293FAIR3\.2Heck Reaction3\.2\.1Standard Heck reaction303SUSPECT6\.2\.4Condensation of oxindoles3\.11\.5Aromatic Aldehyde Condensations313FAIR6\.5\.1Hydride Reduction6\.5\.5Reduction of aryl ketones†323FAIR6\.6\.1Catalytic Hydrogenation6\.6\.4Reduction of styrenes†333FAIR6\.6\.4Reduction of styrenes6\.6\.1Catalytic Hydrogenation†343SUSPECT6\.9\.2Reductive Cleavage and Decarboxylation1\.3\.6Amination of Heteroaryl Halides353SUSPECT9\.1\.4Halogenation of Heteroarenes8\.7\.4Amine Derivatizations363FAIR9\.1\.4Halogenation of Heteroarenes9\.1\.5Halogenation of Arenes†372FAIR1\.1\.1SN21\.2\.8N\-alkylation with benzyl halides382FAIR1\.1\.1SN21\.4\.3N\-Alkylation of Imides392FAIR1\.1\.9Condensation with Amide Acetals3\.11\.24Condensation of ketones with amide acetals402FAIR1\.2\.12Chlorination of heteroaryl hydroxy compounds8\.1\.5Heteroaromatic Alcohol to Heteroaryl Chloride412FAIR1\.3\.6Amination of Heteroaryl Halides1\.3\.8Amination of Aryl Halides†422FAIR1\.3\.8Amination of Aryl Halides1\.3\.6Amination of Heteroaryl Halides†432FAIR1\.3\.8Amination of Aryl Halides1\.3\.5SNAr†442UNCLEAR1\.3\.Other1\.3\.1Buchwald\-Hartwig†452FAIR1\.6\.1N\-Alkylation ofπ\\pi\-Excessive Heterocycles1\.6\.33N\-Alkylation with Benzyl Halides†462FAIR1\.6\.28N\-Alkylation with Secondary Alkyl Halides1\.6\.1N\-Alkylation ofπ\\pi\-Excessive Heterocycles \(Pyrrole\-type\)†472FAIR1\.6\.29N\-Alkylation with Allyl Halides1\.6\.1N\-Alkylation ofπ\\pi\-Excessive Heterocycles \(Pyrrole\-type\)†482FAIR1\.7\.5O\-Alkylation of COOH to form Esters2\.6\.4Esterification via Alkylation of Carboxylates492FAIR1\.8\.2Thia\-Michael Addition1\.8\.1Thioether Formation†502FAIR2\.1\.1Amidation using Acyl Halides2\.4\.1Carbamate Formation512SUSPECT2\.1\.2Amidation using Carboxylic Acids5\.1\.2Cleavage of Amine PGs522FAIR2\.2\.3Sulfamide from Sulfamoyl Halides2\.2\.1Sulfonamide from Sulfonyl Halides†532SUSPECT2\.6\.1Esterification5\.1\.4Cleavage of COOH PGs542FAIR2\.7\.6O\-sulfonylation of heteroaromatic lactams2\.7\.3Sulfonate ester from phenols†552FAIR3\.11\.113Cyanation of heteroaryl methyl halides3\.11\.22Cyanation of benzyl halides†562FAIR3\.11\.16Formylation of arenes3\.9\.1Organolithium Reactions572FAIR3\.5\.8Pd\-Catalyzed Borylation8\.7\.7Synthesis of Organoboron Compounds582FAIR4\.1\.4Six\-membered N\-Heterocycle Synthesis4\.1\.3Five\-membered N\-Heterocycle Synthesis†592FAIR5\.1\.13Decarboxylation and Decarbalkoxylation8\.7\.8Decarboxylation602FAIR5\.1\.18Simultaneous Deprotections5\.1\.2Cleavage of Amine PGs†612FAIR6\.1\.11Reduction of nitrobenzenes to anilines6\.1\.14Reduction of nitroquinolines†622FAIR6\.1\.11Reduction of nitrobenzenes to anilines6\.1\.1Catalytic Hydrogenation†632FAIR6\.1\.14Reduction of nitroquinolines and fused nitropyridines to aminoquinolines and fused aminopyridines6\.1\.11Reduction of nitrobenzenes to anilines†642FAIR6\.4\.1Reduction by Complex Metal Hydrides5\.1\.1Cleavage of Alcohol PGs652FAIR6\.6Alkene to alkane6\.6\.4Reduction of styrenes662SUSPECT6\.9\.2Reductive Cleavage8\.7\.4Amine Derivatizations672FAIR8\.6\.5Enaminone Formation1\.5\.11Condensation with activated vinyl ethers682FAIR8\.7\.2COOH Derivative Interconversions8\.4\.2Nitrile to Ester692SUSPECT8\.7\.4Amine Derivatizations1\.3\.6Amination of Heteroaryl Halides702SUSPECT8\.7\.6Miscellaneous FGIs1\.1\.5Alkylation with Alcohols712FAIR9\.1\.5Halogenation of Arenes9\.1\.4Halogenation of Heteroarenes†722UNCLEAR9\.3\.4Chlorosulfonation of Arenes9\.7\.5???731SUSPECT1\.1\.1SN23\.9\.1Organolithium Reactions741FAIR1\.1\.1SN21\.6\.5N\-Alkylation of Pyridones751FAIR1\.1\.26Alkylation with Alkyl Sulfones1\.1\.1SN2†761FAIR1\.1\.27N\-cyanation with Cyanogen Halides8\.7\.4Amine Derivatizations771SUSPECT1\.1\.4Aza\-Michael Addition6\.6\.41Reduction ofα,β\\alpha,\\beta\-unsaturated sulfonamides781SUSPECT1\.2\.1Reductive Amination1\.3\.5SNAr791SUSPECT1\.2\.1Reductive Amination1\.1\.1SN2801FAIR1\.2\.10N\-arylation with heteroaryl halides1\.3\.1Buchwald\-Hartwig811FAIR1\.2\.10N\-arylation with heteroaryl halides1\.3\.6Amination of Heteroaryl Halides821FAIR1\.2\.11N\-arylation with heteroaryl sulfones1\.3\.5SNAr831FAIR1\.2\.8N\-alkylation with benzyl halides1\.1\.1SN2841SUSPECT1\.3\.1Buchwald\-Hartwig1\.1\.1SN2851SUSPECT1\.3\.1Buchwald\-Hartwig2\.1\.1Amidation using Acyl Halides861FAIR1\.3\.10N\-arylation of Cyclic Ureas1\.3\.6Amination of Heteroaryl Halides†871FAIR1\.3\.11N\-arylation with Arylboronic Acids1\.3\.3Chan\-Lam Coupling†881FAIR1\.3\.15Amination of Phenols1\.3\.1Buchwald\-Hartwig†891FAIR1\.3\.19N\-arylation of Lactams1\.3\.1Buchwald\-Hartwig†901SUSPECT1\.3\.2Ullmann1\.1\.1SN2911FAIR1\.3\.21N\-arylation of Sulfonamides1\.3\.1Buchwald\-Hartwig†921FAIR1\.3\.23Amination of Heteroaryl N\-oxides4\.1\.3Five\-membered N\-Heterocycle Synthesis931FAIR1\.3\.4Goldberg1\.3\.8Amination of Aryl Halides†941FAIR1\.3\.4Goldberg1\.3\.19N\-arylation of Lactams†951FAIR1\.3\.40Amination of 2\-Halo\-1,3\-diazines1\.3\.6Amination of Heteroaryl Halides†961FAIR1\.3\.5SNAr1\.3\.19N\-arylation of Lactams†971SUSPECT1\.3\.5SNAr5\.1\.2Cleavage of Amine PGs981FAIR1\.3\.6Amination of Heteroaryl Halides1\.2\.10N\-arylation with heteroaryl halides991SUSPECT1\.3\.6Amination of Heteroaryl Halides1\.1\.1SN21001UNCLEAR1\.3\.8Amination of Aryl Halides1\.3\.Other???1011FAIR1\.3\.8Amination of Aryl Halides1\.3\.2Ullmann†1021FAIR1\.3\.9Amination of Heteroaryl\-ones1\.3\.6Amination of Heteroaryl Halides†1031FAIR1\.4\.1N\-Alkylation of Amides1\.1\.1SN21041FAIR1\.4\.16N\-Alkylation of Imidazolidinones1\.4\.1N\-Alkylation of Amides†1051FAIR1\.4\.21N\-Alkylation of Hydantoins1\.1\.1SN21061FAIR1\.4\.3N\-Alkylation of Imides1\.1\.1SN21071FAIR1\.4\.3N\-Alkylation of Imides1\.1\.3Alkylation with Epoxides1081UNCLEAR1\.4\.31N\-Alkylation of N\-Benzylic Amides1\.4\.Other???1091FAIR1\.4\.4N\-Alkylation of Sulfonamides1\.1\.5Alkylation with Alcohols1101FAIR1\.4\.7N\-Alkylation of Cyclic Ureas1\.6\.1N\-Alkylation ofπ\\pi\-Excessive Heterocycles1111SUSPECT1\.4\.7N\-Alkylation of Cyclic Ureas1\.3\.6Amination of Heteroaryl Halides1121SUSPECT1\.5\.7N\-Alkylation with Alcohols1\.3\.5SNAr1131FAIR1\.6\.1N\-Alkylation ofπ\\pi\-Excessive Heterocycles \(Pyrrole\-type\)1\.6\.5N\-Alkylation of Pyridones†1141FAIR1\.6\.1N\-Alkylation ofπ\\pi\-Excessive Heterocycles \(Pyrrole\-type\)1\.6\.13N\-Alkylation with Epoxides†1151FAIR1\.6\.1N\-Alkylation ofπ\\pi\-Excessive Heterocycles \(Pyrrole\-type\)1\.1\.3Alkylation with Epoxides1161SUSPECT1\.6\.1N\-Alkylation ofπ\\pi\-Excessive Heterocycles1\.3\.6Amination of Heteroaryl Halides1171FAIR1\.6\.1N\-Alkylation ofπ\\pi\-Excessive Heterocycles \(Pyrrole\-type\)1\.1\.1SN21181FAIR1\.6\.11N\-Alkylation with Sulfonates1\.6\.1N\-Alkylation ofπ\\pi\-Excessive Heterocycles \(Pyrrole\-type\)†1191FAIR1\.6\.15N\-Alkylation with Halomethyl Heterocycles1\.6\.1N\-Alkylation ofπ\\pi\-Excessive Heterocycles \(Pyrrole\-type\)†1201FAIR1\.6\.16N\-Heteroarylation of N\-Heterocycles1\.3\.1Buchwald\-Hartwig1211FAIR1\.6\.19N\-Alkylation of Exocyclic Heteroarylamines1\.1\.1SN21221FAIR1\.6\.29N\-Alkylation with Allyl Halides1\.6\.8N\-Alkylation withα\\alpha\-Halo Carbonyls†1231FAIR1\.6\.39N\-Alkylation with Methyl Halides1\.6\.1N\-Alkylation ofπ\\pi\-Excessive Heterocycles \(Pyrrole\-type\)†1241SUSPECT1\.6\.39N\-Alkylation with Methyl Halides1\.3\.6Amination of Heteroaryl Halides1251FAIR1\.6\.5N\-Alkylation of Pyridones and Uracils1\.6\.29N\-Alkylation with Allyl Halides†1261FAIR1\.6\.5N\-Alkylation of Pyridones and Uracils1\.6\.50N\-Alkylation with Primary Alkyl Halides†1271FAIR1\.6\.6N\-Alkylation with Enol Ethers1\.5\.8Condensation with alkoxymethylene malonates1281FAIR1\.6\.7N\-Alkylation withα\\alpha\-Haloethers1\.6\.1N\-Alkylation ofπ\\pi\-Excessive Heterocycles \(Pyrrole\-type\)†1291FAIR1\.6\.8N\-Alkylation withα\\alpha\-Halo Carbonyls1\.6\.1N\-Alkylation ofπ\\pi\-Excessive Heterocycles \(Pyrrole\-type\)†1301SUSPECT1\.7\.1Williamson Ether Synthesis8\.7\.2COOH Derivative Interconversions1311SUSPECT1\.7\.10O\-Alkylation with Diazo Compounds5\.1\.1Cleavage of Alcohol PGs1321FAIR1\.7\.12O\-Alkylation with Oxonium Salts1\.7\.1Williamson Ether Synthesis \(Alkoxide \+ Organohalide/Sulfonate\)†1331SUSPECT1\.7\.14O\-Glycosylation2\.6\.1Esterification1341FAIR1\.7\.18O\-Alkylation via Conjugate Addition1\.7\.1Williamson Ether Synthesis \(Alkoxide \+ Organohalide/Sulfonate\)†1351FAIR1\.7\.23O\-Alkylation of Stabilized Enols1\.7\.3O\-Alkylation using Alcohols as Electrophiles†1361SUSPECT1\.7\.26Transetherification6\.8\.1Complete Hydrogenation of Aromatic Systems1371FAIR1\.7\.28Hydrolysis of Primary Aromatic Amines8\.7\.4Amine Derivatizations1381FAIR1\.7\.30O\-Methylation with DMF2\.6\.18Esterification with DMF1391FAIR1\.7\.4Ring\-opening of Epoxides with O\-Nucleophiles1\.7\.3O\-Alkylation using Alcohols as Electrophiles†1401FAIR1\.7\.4Ring\-opening of Epoxides2\.6\.1Esterification1411FAIR1\.7\.6O\-Silylation1\.7\.2O\-Arylation†1421SUSPECT1\.7\.7O\-Alkylation for PG Formation8\.7\.6Miscellaneous FGIs1431SUSPECT1\.7\.7O\-Alkylation for PG Formation5\.1\.3Cleavage of Carbonyl PGs1441FAIR1\.7\.8Cleavage of Ether PGs5\.1\.1Cleavage of Alcohol PGs1451SUSPECT2\.1\.1Amidation using Acyl Halides1\.3\.6Amination of Heteroaryl Halides1461FAIR2\.1\.2Amidation4\.1\.3Five\-membered N\-Heterocycle Synthesis1471FAIR2\.1\.2Amidation8\.7\.2COOH Derivative Interconversions1481FAIR2\.1\.3Amidation using Anhydrides2\.6\.3Acylation of Alcohols with Anhydrides1491FAIR2\.1\.3Amidation using Anhydrides2\.4\.1Carbamate Formation1501FAIR2\.1\.3Amidation using Anhydrides4\.1\.4Six\-membered N\-Heterocycle Synthesis1511FAIR2\.1\.3Amidation using Anhydrides2\.1\.2Amidation using Carboxylic Acids†1521FAIR2\.1\.4Amidation using Esters4\.1\.3Five\-membered N\-Heterocycle Synthesis1531SUSPECT2\.1\.5Other N\-Acylation1\.3\.5SNAr1541FAIR2\.1\.5Other N\-Acylation8\.7\.2COOH Derivative Interconversions1551FAIR2\.1\.5Other N\-Acylation1\.3\.13Amination of Squarate Esters1561FAIR2\.1\.6Transamidation2\.1\.2Amidation using Carboxylic Acids†1571FAIR2\.2\.5Sulfonamide from Sulfonic Acids2\.1\.2Amidation1581FAIR2\.3\.20Urea from Ureas2\.1\.2Amidation1591FAIR2\.3\.4Urea from Carbamates5\.1\.2Cleavage of Amine PGs1601FAIR2\.3\.8Urea from Carbamic Acids2\.1\.2Amidation1611SUSPECT2\.4\.1Carbamate Formation5\.1\.22Cleavage of Oxazolidinones1621FAIR2\.4\.3Carbamate Cleavage5\.1\.2Cleavage of Amine PGs1631SUSPECT2\.5\.13Isothiourea Formation1\.3\.5SNAr1641SUSPECT2\.5\.2Amidine from Imidoyl Chlorides1\.3\.6Amination of Heteroaryl Halides1651FAIR2\.5\.3Amidine from Amide/Thioamide2\.1\.1Amidation using Acyl Halides1661FAIR2\.5\.6Amidine from Imidates2\.1\.4Amidation using Esters1671FAIR2\.6\.1Esterification2\.1\.2Amidation1681FAIR2\.6\.2Acylation of Alcohols with Acyl Halides2\.1\.1Amidation using Acyl Halides1691FAIR2\.6\.4Esterification via Alkylation5\.1\.4Cleavage of COOH PGs1701FAIR2\.6\.4Esterification via Alkylation of Carboxylates2\.1\.2Amidation1711FAIR2\.8\.13Isothiocyanate Formation8\.7\.4Amine Derivatizations1721SUSPECT2\.8\.15Anhydride Formation3\.6\.5Condensation of COOH with Malonic Acid1731FAIR2\.8\.15Anhydride Formation2\.4\.2Carbonate Formation1741FAIR2\.8\.2S\-Acylation2\.1\.2Amidation1751FAIR2\.8\.8Isocyanate Formation8\.7\.4Amine Derivatizations1761SUSPECT3\.1\.1C\(sp2\)\-C\(sp2\) Coupling3\.5\.11Reductive Coupling1771SUSPECT3\.1\.1C\(sp2\)\-C\(sp2\) Coupling1\.3\.1Buchwald\-Hartwig1781FAIR3\.1\.3C\(sp3\)\-C\(sp2\) Coupling3\.1\.1C\(sp²\)\-C\(sp²\) Coupling \(e\.g\., Biaryl or Styrene Synthesis\)†1791SUSPECT3\.10\.1Friedel\-Crafts Acylation8\.4\.1Nitrile to Carboxylic Acid1801SUSPECT3\.11\.1Aldol Reactions1\.7\.1Williamson Ether1811SUSPECT3\.11\.14Condensation of aliphatic aldehydes with active methylene2\.1\.2Amidation1821FAIR3\.11\.16Formylation of arenes3\.11\.9Formylation of phenols†1831SUSPECT3\.11\.17Alkylation of arenes6\.9\.1Deoxygenation1841FAIR3\.11\.22Cyanation of benzyl halides3\.11\.11Cyanation of alkyl halides†1851FAIR3\.11\.23Formylation of aryl halides3\.9\.1Organolithium Reactions1861FAIR3\.11\.25Alkylation of active methylene1\.1\.1SN21871FAIR3\.11\.26Alkylation of carboxylic acids1\.7\.5O\-Alkylation of COOH to form Esters1881FAIR3\.11\.3Mannich Reaction1\.2\.6Mannich Reaction1891SUSPECT3\.11\.35Hydrosilylation4\.1\.3Five\-membered N\-Heterocycle Synthesis1901FAIR3\.11\.38Acylation of active methylene3\.9\.1Organolithium Reactions1911FAIR3\.11\.5Aromatic Aldehyde Condensations6\.2\.4Condensation of oxindoles1921FAIR3\.11\.53Alkylation of esters3\.11\.29Alkylation of amides and imides†1931SUSPECT3\.11\.6Olefin Metathesis6\.6\.1Catalytic Hydrogenation1941SUSPECT3\.11\.6Olefin Metathesis5\.1\.1Cleavage of Alcohol PGs1951SUSPECT3\.11\.9Formylation of phenols1\.2\.1Reductive Amination1961FAIR3\.2\.1Standard Heck reaction3\.2Heck Reaction1971FAIR3\.3\.1Coupling of Aryl/Vinyl Halides3\.3\.5Coupling of Heteroaryl Halides†1981FAIR3\.5\.1Negishi Coupling3\.9\.1Organolithium Reactions1991SUSPECT3\.5\.2Kumada Coupling3\.7\.11,2\-Addition to Carbonyls2001SUSPECT3\.6\.2Mixed Claisen Condensation3\.11\.29Alkylation of amides and imides2011SUSPECT3\.6\.2Mixed Claisen Condensation3\.9\.1Organolithium Reactions2021FAIR3\.6\.3Dieckmann Condensation2\.1\.4Amidation using Esters2031FAIR3\.6\.7Condensation of malonate esters with acyl chlorides3\.11\.38Acylation of active methylene2041SUSPECT3\.7\.4Nucleophilic Aromatic Substitution3\.5\.2Kumada Coupling2051UNCLEAR3\.9\.1Organolithium6\.Other\.1???2061SUSPECT3\.9\.1Organolithium4\.1\.3Five\-membered N\-Heterocycle Synthesis2071SUSPECT3\.9\.1Organolithium1\.7\.1Williamson Ether Synthesis2081SUSPECT3\.9\.1Organolithium6\.9\.1Deoxygenation2091FAIR3\.9\.1Organolithium3\.6\.2Mixed Claisen Condensation2101FAIR3\.9\.1Organolithium3\.11\.16Formylation of arenes2111FAIR4\.1\.3Five\-membered N\-Heterocycle Synthesis2\.1\.3Amidation using Anhydrides2121FAIR4\.1\.3Five\-membered N\-Heterocycle Synthesis2\.3\.2Urea from Phosgene2131SUSPECT4\.1\.4Six\-membered N\-Heterocycle Synthesis1\.3\.6Amination of Heteroaryl Halides2141FAIR4\.1\.4Six\-membered N\-Heterocycle Synthesis2\.1\.3Amidation using Anhydrides2151FAIR4\.1\.5Seven\-membered N\-Heterocycle Synthesis4\.1\.3Five\-membered†2161FAIR4\.2\.1Epoxide Synthesis7\.7\.1Epoxidation2171FAIR5\.1\.1Cleavage of Alcohol PGs5\.1\.9Cleavage of Phenol PGs†2181FAIR5\.1\.1Cleavage of Alcohol PGs6\.4\.1Reduction by Complex Metal Hydrides2191SUSPECT5\.1\.1Cleavage of Alcohol PGs1\.7\.1Williamson Ether Synthesis2201SUSPECT5\.1\.13Decarboxylation3\.11\.28Alkylation of nitriles2211FAIR5\.1\.13Decarboxylation8\.7\.2COOH Derivative Interconversions2221SUSPECT5\.1\.13Decarboxylation2\.1\.4Amidation using Esters2231FAIR5\.1\.15Cleavage of Thiocarboxylic Acid PGs8\.7\.2COOH Derivative Interconversions2241FAIR5\.1\.18Simultaneous Deprotections6\.1NO2to amine2251FAIR5\.1\.2Cleavage of Amine PGs8\.7\.2COOH Derivative Interconversions2261SUSPECT5\.1\.2Cleavage of Amine PGs1\.3\.5SNAr2271SUSPECT5\.1\.2Cleavage of Amine PGs2\.1\.2Amidation2281SUSPECT5\.1\.2Cleavage of Amine PGs2\.3\.1Urea from Isocyanates2291SUSPECT5\.1\.2Cleavage of Amine PGs1\.2\.1Reductive Amination2301SUSPECT5\.1\.9Cleavage of Phenol PGs1\.7\.1Williamson Ether2311SUSPECT5\.1\.9Cleavage of Phenol PGs4\.1\.4Six\-membered N\-Heterocycle Synthesis2321FAIR6\.1\.11Reduction of nitrobenzenes to anilines6\.1\.16Reduction of nitrobenzylamines to aminobenzylamines†2331FAIR6\.1\.11Reduction of nitrobenzenes to anilines6\.1NO2to amine2341SUSPECT6\.1\.11Reduction of nitrobenzenes1\.3\.5SNAr2351FAIR6\.1\.18Reductive alkoxycarbonylation of nitro2\.4\.1Carbamate Formation2361FAIR6\.1\.24Reduction of nitrobenzyl ethers6\.1\.11Reduction of nitrobenzenes to anilines†2371FAIR6\.1\.5Reduction of nitropyrazoles6\.1\.11Reduction of nitrobenzenes to anilines†2381FAIR6\.1\.8Reduction of nitrobenzoic acid esters6\.1\.1Catalytic Hydrogenation†2391FAIR6\.1\.8Reduction of nitrobenzoic acid esters to aminobenzoic acid esters6\.1\.11Reduction of nitrobenzenes to anilines†2401FAIR6\.1\.8Reduction of nitrobenzoic acid esters to aminobenzoic acid esters6\.1\.16Reduction of nitrobenzylamines to aminobenzylamines†2411FAIR6\.2\.1Complex Metal Hydride Reduction6\.2\.7Reduction of cyclic imides to cyclic amines†2421FAIR6\.2\.1Complex Metal Hydride Reduction5\.1\.2Cleavage of Amine PGs2431FAIR6\.2\.14Reduction of N\-Aryl Amides to N\-Aryl Amines6\.2\.1Complex Metal Hydride Reduction†2441FAIR6\.2\.7Reduction of cyclic imides to cyclic amines6\.2\.1Complex Metal Hydride Reduction†2451SUSPECT6\.3\.1Nitrile Reduction5\.1\.2Cleavage of Amine PGs2461FAIR6\.4\.1Reduction by Complex Metal Hydrides6\.9\.1Deoxygenation2471FAIR6\.5\.1Hydride Reduction6\.5\.12Reduction ofα,β\\alpha,\\beta\-unsaturated ketones†2481FAIR6\.5\.10Reduction of amino ketones6\.5\.1Hydride Reduction†2491FAIR6\.5\.12Reduction ofα,β\\alpha,\\beta\-unsaturated ketones6\.5\.1Hydride Reduction†2501SUSPECT6\.5\.5Reduction of aryl ketones7\.1\.2Oxidation of Secondary Alcohols to Ketones2511SUSPECT6\.5\.5Reduction of aryl ketones4\.1\.3Five\-membered N\-Heterocycle Synthesis2521FAIR6\.5\.6Reduction ofβ\\beta\-keto esters6\.5\.1Hydride Reduction†2531FAIR6\.6Alkene to alkane6\.6\.1Catalytic Hydrogenation2541FAIR6\.6\.1Catalytic Hydrogenation6\.6\.3Reduction of Tetrahydropyridines†2551FAIR6\.6\.1Catalytic Hydrogenation6\.6\.5Reduction of cinnamates†2561SUSPECT6\.6\.1Catalytic Hydrogenation7\.1\.2Oxidation of Secondary Alcohols to Ketones2571FAIR6\.6\.10Reduction of benzylidene ketones6\.6\.1Catalytic Hydrogenation†2581FAIR6\.6\.12Reduction of N\-heteroarylalkenes6\.6\.39Reduction of dihydropyrans†2591FAIR6\.6\.14Reduction ofα,β\\alpha,\\beta\-unsat esters6\.6\.5Reduction of cinnamates†2601FAIR6\.6\.16Reduction of cinnamic acids6\.6\.1Catalytic Hydrogenation†2611FAIR6\.6\.27Reduction of internal alkenes6\.4\.1Reduction by Complex Metal Hydrides2621SUSPECT6\.6\.30Reduction ofα,β\\alpha,\\beta\-unsat amides6\.8\.1Complete Hydrogenation of Aromatic Systems2631FAIR6\.6\.4Reduction of styrenes6\.6Alkene to alkane2641SUSPECT6\.6\.4Reduction of styrenes6\.9\.1Deoxygenation2651FAIR6\.6\.4Reduction of styrenes to alkylarenes6\.5\.1Hydride Reduction2661FAIR6\.6\.7Reduction of terminal alkenes6\.6\.1Catalytic Hydrogenation†2671FAIR6\.8\.1Complete Hydrogenation of Aromatic Systems6\.9\.12Reduction of Aromatic Rings2681SUSPECT6\.9\.1Deoxygenation7\.8\.1Oxidation of Carbonyl Compounds2691SUSPECT6\.9\.1Deoxygenation1\.3\.8Amination of Aryl Halides2701SUSPECT6\.9\.1Deoxygenation1\.2\.1Reductive Amination2711SUSPECT6\.9\.1Deoxygenation2\.1\.2Amidation2721FAIR6\.9\.1Deoxygenation of Alcohols and Carbonyls6\.9\.2Reductive Cleavage†2731SUSPECT6\.9\.1Deoxygenation1\.7\.2O\-Arylation2741FAIR6\.9\.10Reduction of Acyl Halides6\.9\.8Reduction of Esters†2751SUSPECT6\.9\.12Reduction of Aromatic Rings5\.1\.4Cleavage of COOH PGs2761FAIR6\.9\.2Reductive Cleavage6\.9\.1Deoxygenation of Alcohols and Carbonyls†2771SUSPECT6\.9\.2Reductive Cleavage7\.8\.1Oxidation of Carbonyl Compounds2781SUSPECT6\.9\.2Reductive Cleavage1\.1\.3Alkylation with Epoxides2791FAIR6\.9\.2Reductive Cleavage and Decarboxylation5\.1\.1Cleavage of Alcohol PGs2801FAIR6\.9\.2Reductive Cleavage and Decarboxylation8\.7\.2COOH Derivative Interconversions2811SUSPECT6\.9\.2Reductive Cleavage1\.7\.1Williamson Ether2821FAIR6\.9\.3Reduction of N\-Containing FGs5\.1\.2Cleavage of Amine PGs2831FAIR6\.9\.3Reduction of Nitrogen\-Containing Functional Groups8\.7\.4Amine Derivatizations2841SUSPECT6\.9\.5Reduction of Sulfur FGs1\.2\.11N\-arylation with heteroaryl sulfones2851SUSPECT6\.9\.5Reduction of Sulfur Functional Groups1\.3\.2Ullmann Condensation2861UNCLEAR6\.Other\.1???6\.9\.11Reduction of Aldehydes2871SUSPECT7\.1\.2Oxidation of Secondary Alcohols6\.9\.1Deoxygenation2881SUSPECT7\.1\.2Oxidation of Secondary Alcohols1\.7\.3O\-Alkylation using Alcohols as Electrophiles2891FAIR7\.2\.2Oxidation of Sulfoxides to Sulfones7\.2\.1Oxidation of Sulfides†2901FAIR7\.6\.1Oxidation of Benzylic C\-H Bonds3\.11\.16Formylation of arenes2911FAIR7\.6\.3Oxidation of Benzylic/Allylic Alcohols7\.8\.7Oxidation of Alcohols2921FAIR7\.6\.4Halogenation of Benzylic C\-H Bonds9\.1\.6Benzylic Halogenation2931SUSPECT7\.8\.1Oxidation of Carbonyl Compounds6\.9\.6Reduction of Carboxylic Acids2941SUSPECT7\.8\.1Oxidation of Carbonyl Compounds2\.6\.1Esterification2951SUSPECT7\.8\.7Oxidation of Alcohols5\.1\.3Cleavage of Carbonyl PGs2961SUSPECT7\.8\.9Oxidation of N\-Heterocycles6\.8\.1Complete Hydrogenation of Aromatic Systems2971SUSPECT7\.8\.9Oxidation of N\-Heterocycles1\.3\.5SNAr2981FAIR8\.1\.5Heteroaromatic Alcohol to Heteroaryl Chloride8\.2\.4Deoxychlorination of Lactams2991FAIR8\.4\.1Nitrile to Carboxylic Acid8\.7\.2COOH Derivative Interconversions3001SUSPECT8\.5\.1Dehydration of Alcohols to Alkenes7\.1\.2Oxidation of Secondary Alcohols3011SUSPECT8\.5\.1Dehydration1\.1\.4Aza\-Michael Addition3021FAIR8\.6\.18Imidate Formation8\.7\.2COOH Derivative Interconversions3031FAIR8\.6\.4Semicarbazone Formation8\.6\.8Acyl Hydrazone Formation†3041FAIR8\.6\.5Enaminone Formation1\.5\.8Condensation with alkoxymethylene malonates3051FAIR8\.7\.10Synthesis of Organotin Compounds3\.11\.140Stannylation of arenes3061FAIR8\.7\.2COOH Derivative Interconversions5\.1\.4Cleavage of COOH PGs3071FAIR8\.7\.2Carboxylic Acid Derivative Interconversions8\.6\.9Amidoxime Formation3081FAIR8\.7\.3Rearrangements2\.1\.2Amidation3091FAIR8\.7\.4Amine Derivatizations2\.8\.13Isothiocyanate Formation3101FAIR8\.7\.4Amine Derivatizations8\.6\.25Hydrazone from active methylene3111SUSPECT8\.7\.4Amine Derivatizations9\.1\.4Halogenation of Heteroarenes3121FAIR8\.7\.6Miscellaneous FGIs5\.1\.3Cleavage of Carbonyl PGs3131FAIR8\.7\.6Miscellaneous FGIs1\.7\.20Hydrolysis of Aryl/Heteroaryl Halides3141FAIR8\.7\.6Miscellaneous FGIs1\.7\.1Williamson Ether3151FAIR8\.7\.6Miscellaneous FGIs6\.1\.11Reduction of nitrobenzenes3161FAIR8\.7\.6Miscellaneous FGIs8\.5\.1Dehydration3171FAIR8\.7\.8Decarboxylation5\.1\.13Decarboxylation and Decarbalkoxylation3181SUSPECT8\.7\.8Decarboxylation6\.9\.6Reduction of Carboxylic Acids3191SUSPECT9\.1\.5Halogenation of Arenes1\.7\.2O\-Arylation of Alcohols and Phenols3201SUSPECT9\.1\.5Halogenation of Arenes6\.9\.2Reductive Cleavage and Decarboxylation3211FAIR9\.1\.6Benzylic Halogenation7\.6\.4Halogenation of Benzylic C\-H Bonds†Sibling classes \(same parent node\)\.
## Appendix EPer\-Template Coverage Distribution

Figure[9](https://arxiv.org/html/2607.01061#A5.F9)shows the individual contribution of each SMIRKS template to coverage of the NNNS\-2025 single\-reaction\-centre evaluation set \(n=9,296n=9\{,\}296\), ranked in descending order of reactions classified\. The distribution follows a steep power law: the two most frequent templates \(Boc carbamate cleavage and Suzuki–Miyaura BPin coupling\) together account for10%10\\%of all reactions, 43 templates suffice to reach50%50\\%, and 113 templates are required for60%60\\%\. Beyond rank∼\\sim200 each additional template contributes fewer than0\.03%0\.03\\%of reactions, illustrating the long\-tail character of reaction\-type frequency in modern medicinal chemistry and motivating the LLM fallback described in the main text\.

![Refer to caption](https://arxiv.org/html/2607.01061v1/x19.png)Figure 9:Per\-template coverage on the NNNS\-2025 single\-reaction\-centre subset \(n=9,296n=9\{,\}296; 465 templates with at least one match\)\. Each bar represents one Ordered SMIRKS template ranked by the number of reactions it classifies; bar colour encodes cumulative coverage reached at that rank \(dark purple: low cumulative coverage; orange–yellow: approaching the68\.3%68\.3\\%ceiling\)\. Milestone lines mark the top\-2 \(10%10\\%\), top\-12 \(30%30\\%\), top\-43 \(50%50\\%\), and top\-113 \(60%60\\%\) thresholds\. The x\-axis is truncated at rank 250; templates ranked 251–465 each contribute≤0\.03%\\leq 0\.03\\%individually\.

Similar Articles

Can Agents Price a Reaction? Evaluating LLMs on Chemical Cost Reasoning

arXiv cs.AI

This paper introduces ChemCost, a benchmark for evaluating how well LLM agents can estimate chemical procurement costs by grounding identities, retrieving quotes, and handling noise. It reveals that current agents struggle with robustness and precise arithmetic reasoning in scientific workflows.

Beyond Consensus: Trace-Level Synthesis in Mixture of Agents

arXiv cs.AI

This paper reveals that aggregating complete reasoning traces from multiple LLM agents, rather than just their final answers, can correct errors even when agents unanimously agree, introducing the 'aggregation paradox' and the Self-Consistent Mixture of Agents method.

Counterexample Guided Learning in the Large using Reasoning Agents

arXiv cs.LG

This paper proposes using counterexample-guided learning for LLMs to perform regular-expression induction, where a verifier provides counterexamples to refine candidate expressions. The method significantly improves sample efficiency and success rates on challenging tasks, demonstrating that LLMs can benefit from structured feedback beyond treating it as additional data.