DiffER$^2$:基于 SMILES 适配粒子引导的逆合成预测扩散集成模型

arXiv cs.LG 论文

摘要

DiffER² 提出将离散时间和连续时间扩散模型集成,并结合适配 SMILES 的粒子引导来进行逆合成预测,相较于以往基于扩散的方法,提高了独特分子的生成能力和 top-k 准确率。

arXiv:2611.33557v1 Announce Type: new Abstract: Computational retrosynthesis prediction has the potential to reduce development time for newly discovered drugs by automatically generating potential reactions for a target product. Data-driven approaches commonly treat this as a sequence-to-sequence generation task on SMILES strings. In this work, we construct ensembles of discrete-time and continuous-time diffusion models for molecular generation and incorporate guidance mechanisms for improved output diversity. We propose an adaptation of particle guidance to SMILES sequence generation which significantly improves the number of unique molecules generated by diffusion ensembles while increasing top-k accuracy. These results further expand the efficacy of discrete diffusion for SMILES generation, and our empirical analyses offer new insights into the capabilities of diffusion models for chemical retrosynthesis.
查看原文
查看缓存全文

缓存时间: 2026/11/26 09:36

# DiffER2: Diffusion Ensembles for Retrosynthesis Prediction with SMILES Adapted Particle Guidance
Source: [https://arxiv.org/html/2611.33557](https://arxiv.org/html/2611.33557)
Sean F\. CurrentAffiliation:Department of Computer ScienceAffiliation:The Ohio State UniversityAffiliation:Columbus, OH 43202Email:[current\.33@osu\.edu](mailto:)Daniel Adu\-AmpratwumAffiliation:College of PharmacyAffiliation:The Ohio State UniversityAffiliation:Columbus, OH 43202Email:[adu\-ampratwum\.1@osu\.edu](mailto:)Xia NingAffiliation:Department of Computer ScienceAffiliation:Department of Biomedical InformaticsAffiliation:The Ohio State UniversityAffiliation:Columbus, OH 43202Email:[ning\.104@osu\.edu](mailto:)Srinivasan ParthasarathyAffiliation:Department of Computer ScienceAffiliation:The Ohio State UniversityAffiliation:Columbus, OH 43202Email:[srini@cse\.ohio\-state\.edu](mailto:)

###### Abstract

Computational retrosynthesis prediction has the potential to reduce development time for newly discovered drugs by automatically generating potential reactions for a target product\. Data\-driven approaches commonly treat this as a sequence\-to\-sequence generation task on SMILES strings\. In this work, we construct ensembles of discrete\-time and continuous\-time diffusion models for molecular generation and incorporate guidance mechanisms for improved output diversity\. We propose an adaptation of particle guidance to SMILES sequence generation which significantly improves the number of unique molecules generated by diffusion ensembles while increasing top\-k accuracy\. These results further expand the efficacy of discrete diffusion for SMILES generation, and our empirical analyses offer new insights into the capabilities of diffusion models for chemical retrosynthesis\.

## 1Introduction

The goal of retrosynthesis is to construct reactant molecules that can be used to synthesize a target product\. Retrosynthesis prediction constitutes a pivotal step in the drug manufacturing pipeline\. Repeatedly applying single\-step retrosynthesis models to a given problem can result in full synthetic pathway discovery\([Segler et al\., 2018](https://arxiv.org/html/2611.33557#bib.bib21);[Shen et al\., 2021](https://arxiv.org/html/2611.33557#bib.bib22)\), further supporting pharmaceutical advancement for new drug modalities\. However, even single\-step retrosynthesis prediction is difficult, in part due to the diversity of reactant sets that might map to a single product\. While forward synthesis prediction is primarily considered a surjective process with a deterministic output, retrosynthesis prediction is in many ways the opposite, with many possible outputs resulting from a single input\. As a result, researchers have taken a particular interest in deep learning methods that hasten the process of retrosynthesis discovery by quickly and efficiently predicting multiple possible reactant sets from a given product molecule\.

Numerous methodologies have been developed, from template\-based methods that use mined reaction mechanisms to predict reactants to template\-free approaches that directly predict string or graph representations of reactant molecules conditioned on the target product\. The most successful of these template\-free approaches use traditional transformer encoder\-decoder architectures on SMILES\([Weininger, 1988](https://arxiv.org/html/2611.33557#bib.bib1)\)string representations of the molecules, effectively treating the problem as a machine translation task\([Zhong et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib5)\)\. A recent approach, DiffER\([Current et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib39)\), explored the usage of discrete diffusion models for the retrosynthesis task and provided evidence that an ensemble of discrete\-time diffusion models could be a practical approach for sampling from the posterior distribution of reactants\. Differ outperformed the state\-of\-the\-art R\-SMILES\([Zhong et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib5)\)at top\-1 accuracy on the commonly used USPTO\-50k dataset\([Lowe, 2017](https://arxiv.org/html/2611.33557#bib.bib36)\), but suffered from low output diversity due to the nature of posterior sampling\.

In this work, we extend upon the work of DiffER\([Current et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib39)\)by adapting their approach to include continuous\-time discrete diffusion models and applying classifier\-based particle guidance\([Corso et al\., 2023](https://arxiv.org/html/2611.33557#bib.bib42)\)to SMILES string generation\. Both of these changes aim to improve the efficacy and output diversity of models over the original DiffER\. A visual overview of the DiffER2ensemble approach is presented in Figure[1](https://arxiv.org/html/2611.33557#S1.F1)\. The main improvements on the original DiffER methodology are as follows:

1. 1\.We incorporate continuous\-time discrete diffusion models into the DiffER ensemble to leverage different capabilities of discrete\-time and continuous\-time diffusion\.
2. 2\.We explore the efficacy of SMILES\-adapted guidance mechanisms to further enhance the diversity and accuracy of diffusion models for chemical retrosynthesis\.
3. 3\.Finally, we offer an in\-depth exploration into the differing performance capabilities of auto\-regressive and discrete\-space diffusion models on the chemical retrosynthesis task\.

By combining both continuous\-time and discrete\-time diffusion models with classifier\-based particle guidance\([Corso et al\., 2023](https://arxiv.org/html/2611.33557#bib.bib42)\), we significantly improve ensemble performance and reduce oversampling of posterior peaks while maintaining or boosting top\-k accuracy across the board\. Our results enhance the efficacy of diffusion ensembles for SMILES generation while providing an empirical analysis of diffusion performance compared to auto\-regressive approaches for sequence generation\.

![Refer to caption](https://arxiv.org/html/2611.33557v1/images/differ2_schema2.png)Figure 1:Overview of the DiffER2ensemble\. The DiffER2ensemble contains both continuous\-time \(C\-DiffER\) and discrete\-time \(DiffER\) models to leverage differing capabilities between the two diffusion archetypes\. Both normal sampling methods and SMILES adapted particle guidance are used to generate output\. Output SMILES are ranked according to frequency of the canonical form\. DiffERκindicates the value ofκ\\kappaas described in Section[3\.2](https://arxiv.org/html/2611.33557#S3.SS2)\.
## 2Related Work

### 2\.1Retrosynthesis Prediction

Data\-driven models for retrosynthesis prediction are commonly divided into three approaches: template\-based, semi\-template, and template\-free methods\. Common template\-based approaches include GLN\([Dai et al\., 2019](https://arxiv.org/html/2611.33557#bib.bib8)\)and LocalRetro\([Chen and Jung, 2021](https://arxiv.org/html/2611.33557#bib.bib9)\)\. These approaches primarily focus on identifying locations in a molecule where reaction templates can be applied and ranking the efficacy and feasibility of those templates on the target area\. Semi\-template methods include the likes of GraphRetro\([Somnath et al\., 2021](https://arxiv.org/html/2611.33557#bib.bib11)\), G2Retro\([Chen et al\., 2023](https://arxiv.org/html/2611.33557#bib.bib20)\), and GDiffRetro\([Sun et al\., 2025](https://arxiv.org/html/2611.33557#bib.bib45)\)\. These approaches generally work in a two\-step manner: in the first step, a reaction center is first predicted from the product molecule, and the molecule is subsequently split into synthons\. In the second step, each synthon is completed to construct a final reactant molecule\. Notably, GDiffRetro\([Sun et al\., 2025](https://arxiv.org/html/2611.33557#bib.bib45)\)uses discrete\-time diffusion processes to complete predicted synthons\. Finally, template\-free methods such as Chemformer\([Irwin et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib4)\), MEGAN\([Sacha et al\., 2021](https://arxiv.org/html/2611.33557#bib.bib17)\), R\-Smiles\([Zhong et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib5)\), and DiffER\([Current et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib39)\)directly construct reactant molecules from the product molecule\. This is most often done in a sequence\-to\-sequence manner using SMILES strings\([Irwin et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib4);[Zhong et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib5);[Current et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib39)\), though some approaches directly operate on graphs, such as the case of MEGAN\([Sacha et al\., 2021](https://arxiv.org/html/2611.33557#bib.bib17)\), which iteratively builds the reactant molecule\(s\) through a series of edits\. DiffER\([Current et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib39)\)is the first approach to use conditional discrete diffusion to accomplish the retrosynthesis prediction task, although their methodology suffers from reduced output diversity and high computational cost compared to auto\-regressive decoding strategies\. We primarily focus on template\-free methods for performance comparison\.

### 2\.2Discrete\-Space Diffusion

Generative diffusion models have been a significant topic of research in recent years, and have achieved significant success in the realms of image generation\([Croitoru et al\., 2023](https://arxiv.org/html/2611.33557#bib.bib46);[Yang et al\., 2023](https://arxiv.org/html/2611.33557#bib.bib47)\)and signal processing\([Yang et al\., 2023](https://arxiv.org/html/2611.33557#bib.bib47)\)\. Though diffusion models traditionally operate in the continuous regime\([Sohl\-Dickstein et al\., 2015](https://arxiv.org/html/2611.33557#bib.bib29);[Song and Ermon, 2019](https://arxiv.org/html/2611.33557#bib.bib49);[Song et al\., 2020](https://arxiv.org/html/2611.33557#bib.bib48);[Ho et al\., 2020](https://arxiv.org/html/2611.33557#bib.bib28);[Saharia et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib30);[Gu et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib32);[Zhang et al\., 2023](https://arxiv.org/html/2611.33557#bib.bib31)\), significant effort has been made extending diffusion models to discrete spaces\([Hoogeboom et al\., 2021](https://arxiv.org/html/2611.33557#bib.bib27);[Austin et al\., 2021](https://arxiv.org/html/2611.33557#bib.bib34);[Gong et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib24);[Gong et al\., 2023](https://arxiv.org/html/2611.33557#bib.bib25);[He et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib35);[Yuan et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib26);[Dieleman et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib33);[Ghazvininejad et al\., 2019](https://arxiv.org/html/2611.33557#bib.bib23)\)\. Discrete\-space models have demonstrated remarkable performance for molecular generation\([Xu et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib50);[Alakhdar et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib51);[Hoogeboom et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib52);[Xu et al\., 2023](https://arxiv.org/html/2611.33557#bib.bib53);[Schneuing et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib54)\)and protein design\([Gruver et al\., 2023](https://arxiv.org/html/2611.33557#bib.bib41);[Watson et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib56);[Ni et al\., 2023](https://arxiv.org/html/2611.33557#bib.bib57)\), but have struggled to out\-compete their auto\-regressive counterparts on discrete sequence generation\. Furthermore, most work in this space has primarily focused on discrete\-time diffusion\. Only recently has discrete\-space diffusion been extended to continuous\-time implementations\([Campbell et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib43);[Zhao et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib44);[Xu et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib55)\), which demonstrate improved modeling capabilities and sampling efficiency compared to their discrete\-time parallels\. Furthermore, incorporating recent advances in guidance mechanisms during diffusion sampling\([Bansal et al\., 2023](https://arxiv.org/html/2611.33557#bib.bib58);[Liu et al\., 2023](https://arxiv.org/html/2611.33557#bib.bib61);[Epstein et al\., 2023](https://arxiv.org/html/2611.33557#bib.bib60);[Ho and Salimans, 2022](https://arxiv.org/html/2611.33557#bib.bib59)\)remains a challenge, due to the difficulty of applying gradient\-based approaches on a discrete domain\([Schiff et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib40);[Gruver et al\., 2023](https://arxiv.org/html/2611.33557#bib.bib41)\)\.[Schiff et al\. \(2024\)](https://arxiv.org/html/2611.33557#bib.bib40)recently adapted classifier\-free and classifier\-based guidance mechanisms for discrete diffusion and demonstrated promising results on molecular generation tasks, though more work needs to be done constructing and evaluating guidance mechanisms for discrete diffusion tasks\.

## 3Methods

Following the original DiffER\([Current et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib39)\), we treat retrosynthesis prediction as a discrete sequence\-to\-sequence generation task, where the target product is a conditional input to the diffusion generation akin to text\-to\-image models\. We employ both discrete\-time and continuous\-time diffusion models\. Like DiffER, we incorporate length prediction strategies to improve diffusion sampling as well as enable robust model ensembling\. Finally, we adapt classifier\-based particle guidance\([Corso et al\., 2023](https://arxiv.org/html/2611.33557#bib.bib42)\)to SMILES sequence generation to improve output diversity and reduce over\-sampling of posterior peaks\. By applying our techniques to SMILES generation, we are able to offer direct comparisons to prior works, and more clearly demonstrate the effectiveness of our diffusion ensembling and guidance methodologies\. However, we recognize the existence of other molecular string representations such as SELFIES\([Krenn et al\., 2019](https://arxiv.org/html/2611.33557#bib.bib68)\)\. We offer a comparison to a SEFLIES\-based implementation of our work in Appendix[A\.4](https://arxiv.org/html/2611.33557#A1.SS4)\.

### 3\.1Preliminaries

Following the notation of[Zhao et al\. \(2024\)](https://arxiv.org/html/2611.33557#bib.bib44), letx0∼pd​a​t​a​\(x0\)x\_\{0\}\\sim p\_\{data\}\(x\_\{0\}\)be a categorical random variable representing the observed data with discrete distributionpd​a​t​a​\(x0,K\)p\_\{data\}\(x\_\{0\};K\)\. Letxt∼q⁡\(xt\)x\_\{t\}\\sim q\(x\_\{t\}\)be the latent variable at timet∈\[0,1\]t\\in\[0,1\]\(continuous\-time, max timeT=1T=1\) ort∈\{1,…,T\}t\\in\\\{1,\.\.\.,T\\\}\(discrete\-time\) andxt\|s∼q⁡\(xt\|xs\)x\_\{t\|s\}\\sim q\(x\_\{t\}\|x\_\{s\}\)be the conditional random variable\. Letxt1:Lx∈\{0,1\}Lx×Kx\_\{t\}^\{1:L\_\{x\}\}\\in\\\{0,1\\\}^\{L\_\{x\}\\times K\}be a sequence of lengthLxL\_\{x\}at timett, and letxt\[ℓ\]x\_\{t\}^\{\[\\ell\]\}be the sequence indexed at positionℓ\\ell\. We assume each discrete random variable is governed by a categorical distribution𝒞\\mathcal\{C\}with probability distributionp∈\[0,1\]Kp\\in\[0,1\]^\{K\}, where‖p‖1=1\|\|p\|\|\_\{1\}=1, such thatxt∼𝒞⁡\(xt,p\)x\_\{t\}\\sim\\mathcal\{C\}\(x\_\{t\};p\)\. Furthermore, letQt\|s∈\[0,1\]K×KQ\_\{t\|s\}\\in\[0,1\]^\{K\\times K\}represent the transition matrix between timesssandtt, such that\[Qt\|s\]i​j=q⁡\(xt=ei\|xs=ej\)\[Q\_\{t\|s\}\]\_\{ij\}=q\(x\_\{t\}=e\_\{i\}\|x\_\{s\}=e\_\{j\}\), whereeie\_\{i\},ej∈\{0,1\}Ke\_\{j\}\\in\\\{0,1\\\}^\{K\}are one\-hot encoded vectors\.

In the forward diffusion process, noise is added to observed data until it is indistinguishable from a stationary noise distribution\.[Zhao et al\. \(2024\)](https://arxiv.org/html/2611.33557#bib.bib44)show that the forward diffusion process for discrete\-time and continuous\-time diffusion can be unified into a single forward diffusion process defined by the accumulated transition matrixQ¯t\|s\\bar\{Q\}\_\{t\|s\}, witht\>st\>s:

Q¯t\|s=α¯t\|s​I\+\(1−α¯t\|s\)​1​m⊤,\\bar\{Q\}\_\{t\|s\}=\\bar\{\\alpha\}\_\{t\|s\}I\+\(1\-\\bar\{\\alpha\}\_\{t\|s\}\)1m^\{\\top\},\(1\)wheremmis a known probability distribution vector such thatxT∼𝒞⁡\(xT,m\)x\_\{T\}\\sim\\mathcal\{C\}\(x\_\{T\};m\),11is vector of11s, andα¯t\|s\\bar\{\\alpha\}\_\{t\|s\}is the accumulated noise schedule between timettand timess\.

In the backward diffusion process, diffusion models aim to generate samples frompθ​\(xs\|xt\)p\_\{\\theta\}\(x\_\{s\}\|x\_\{t\}\)for some0<s<t≤T0<s<t\\leq T\. This is commonly accomplished by takingpθ​\(xs\|xt\)≈q⁡\(xs\|xt,x0\)p\_\{\\theta\}\(x\_\{s\}\|x\_\{t\}\)\\approx q\(x\_\{s\}\|x\_\{t\},x\_\{0\}\), whereq⁡\(xs\|xt,x0\)q\(x\_\{s\}\|x\_\{t\},x\_\{0\}\)is thess\-step posterior distribution\([Hoogeboom et al\., 2021](https://arxiv.org/html/2611.33557#bib.bib27);[Austin et al\., 2021](https://arxiv.org/html/2611.33557#bib.bib34)\)\. Becausex0x\_\{0\}is unknown, it is approximated by training a neural network modelftθf\_\{t\}^\{\\theta\}such thatpθ​\(x0\|xt\)=𝒞⁡\(x0,ftθ​\(xt\)\)p\_\{\\theta\}\(x\_\{0\}\|x\_\{t\}\)=\\mathcal\{C\}\(x\_\{0\};f\_\{t\}^\{\\theta\}\(x\_\{t\}\)\)\. Thus,pθ​\(xs\|xt\)p\_\{\\theta\}\(x\_\{s\}\|x\_\{t\}\)can be estimated by samplingxs∼q⁡\(xs\|xt,ftθ​\(xt\)\)x\_\{s\}\\sim q\\left\(x\_\{s\}\|x\_\{t\},f\_\{t\}^\{\\theta\}\(x\_\{t\}\)\\right\)\. Analytically, this can be calculated as

q⁡\(xs\|xt,ftθ​\(xt\)\)=𝒞⁡\(xs,Q¯t\|s​xt⊙Q¯s⊤​ftθ​\(xt\)xt⊤​Q¯t⊤​ftθ​\(xt\)\)\.q\\left\(x\_\{s\}\|x\_\{t\},f\_\{t\}^\{\\theta\}\(x\_\{t\}\)\\right\)=\\mathcal\{C\}\\left\(x\_\{s\};\\frac\{\\bar\{Q\}\_\{t\|s\}x\_\{t\}\\odot\\bar\{Q\}\_\{s\}^\{\\top\}f\_\{t\}^\{\\theta\}\(x\_\{t\}\)\}\{x\_\{t\}^\{\\top\}\\bar\{Q\}\_\{t\}^\{\\top\}f\_\{t\}^\{\\theta\}\(x\_\{t\}\)\}\\right\)\.\(2\)This posterior calculation can be further reduced to simplify computation\([Zhao et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib44)\), which we follow in our work as well\. We refer readers to[Zhao et al\. \(2024\)](https://arxiv.org/html/2611.33557#bib.bib44)for a more detailed overview of the unified diffusion methodology\.

The primary point of difference between discrete\-time and continuous\-time diffusion models now lies in the loss functions\. We train both continuous\-time and discrete\-time diffusion models using the simplified variational lower bound loss functions provided by[Zhao et al\. \(2024\)](https://arxiv.org/html/2611.33557#bib.bib44)alongside a cross\-entropy loss\.

### 3\.2DiffER Adapted Unified Diffusion

DiffER\([Current et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib39)\)incorporates the target product as an additional constraint to the diffusion generation process, akin to text\-to\-image generative diffusion models\. Lety01:Ly∈\{0,1\}Ly×Ky\_\{0\}^\{1:L\_\{y\}\}\\in\\\{0,1\\\}^\{L\_\{y\}\\times K\}be the target product sequence associated with the reactant sequencex01:Lxx\_\{0\}^\{1:L\_\{x\}\}\. Here, bothy0y\_\{0\}andx0x\_\{0\}are SMILES strings representing molecular structures, withx0x\_\{0\}containing one or more concatenated reactant SMILES\. Because the target product is known in retrosynthesis prediction, The diffusion problem can be parameterized such that

pθ​\(x0\|xt,y0\)=𝒞⁡\(x0,ftθ​\(xt,y0\)\)\.p\_\{\\theta\}\(x\_\{0\}\|x\_\{t\},y\_\{0\}\)=\\mathcal\{C\}\(x\_\{0\};f\_\{t\}^\{\\theta\}\(x\_\{t\},y\_\{0\}\)\)\.\(3\)This formulation guides the diffusion process by incorporating the target product as an additional input to the model\. Here,ftθf\_\{t\}^\{\\theta\}usually takes the form of an encoder\-decoder model, where the encoder processesy0y\_\{0\}and the decoder acts as the diffusion component onxtx\_\{t\}\.

Notably, one issue remains in that the length of the reactant sequenceLxL\_\{x\}is unknown a priori, which is necessary to properly instantiatexT∼𝒞⁡\(xT,m\)x\_\{T\}\\sim\\mathcal\{C\}\(x\_\{T\};m\)\. Inspired by MaskPredict\([Ghazvininejad et al\., 2019](https://arxiv.org/html/2611.33557#bib.bib23)\), DiffER\([Current et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib39)\)incorporates a length prediction component into the encoder half offtθf\_\{t\}^\{\\theta\}, such thatLxL\_\{x\}can be estimated using some modelfℓϕ:\{0,1\}L×K→ℝLf\_\{\\ell\}^\{\\phi\}:\\\{0,1\\\}^\{L\\times K\}\\rightarrow\\mathbb\{R\}^\{L\}, so thatLx≈arg⁡max​fℓϕ​\(y0\)L\_\{x\}\\approx\\arg\\max f\_\{\\ell\}^\{\\phi\}\(y\_\{0\}\), where,LLis an arbitrary maximum sequence length such thatLx<LL\_\{x\}<LandLy<LL\_\{y\}<Lfor allx0,y0x\_\{0\},y\_\{0\}in the data distribution\. For the chemical retrosynthesis task,LxL\_\{x\}andLyL\_\{y\}are often highly correlated: thus, to encourage active learning,fℓϕf\_\{\\ell\}^\{\\phi\}is instead trained to predict the difference betweenLxL\_\{x\}andLyL\_\{y\}, i\.e\.,

Lx=Ly\+\(arg⁡max​fℓϕ​\(y0\)−Γ\),L\_\{x\}=L\_\{y\}\+\(\\arg\\max f\_\{\\ell\}^\{\\phi\}\(y\_\{0\}\)\-\\Gamma\),\(4\)whereΓ<L\\Gamma<Lis a sufficiently large constant allowingfℓϕf\_\{\\ell\}^\{\\phi\}to effectively predict negative length changes\. In practice, we setΓ=L2\\Gamma=\\frac\{L\}\{2\}, noting that the change in length will never be larger than half of the product sequence\.

[Current et al\. \(2024\)](https://arxiv.org/html/2611.33557#bib.bib39)show experimentally that iffℓϕf\_\{\\ell\}^\{\\phi\}is a perfect length\-prediction model, then discrete\-time diffusion outperforms all other methodologies for top\-1 predictions by a significant margin, exhibiting that sequence length information can be highly informative when predicting reactant SMILES\. However, the authors note that in practice,fℓϕf\_\{\\ell\}^\{\\phi\}cannot be sufficiently trained to accomplish such a notable performance increase due to 1\.\) the distribution of\(Lx−Ly\)\(L\_\{x\}\-L\_\{y\}\)is heavily biased, 2\.\) the SMILES encoding of a molecule can produce sequences of varying length, forcingfℓϕ​\(y0\)f\_\{\\ell\}^\{\\phi\}\(y\_\{0\}\)to learn a one\-to\-many mapping, and 3\.\) accurate length prediction requires complex understanding of chemical reagents, molecular reactivity, and molecular structure, and is itself a nontrivial problem\.

To remedy problems1\.1\.and2\.2\., DiffER\([Current et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib39)\)randomly appendsLp∼𝒰​\{1,κ\}L\_\{p\}\\sim\\mathcal\{U\}\\\{1,\\kappa\\\}padding tokens to the SMILES representations of reactants, whereκ\\kappais a set hyperparameter\. This padding procedure smooths the distribution of\(Lx−Ly\)\(L\_\{x\}\-L\_\{y\}\)and allows flexibility in the output size of generated reactants\. A detailed overview of this procedure is provided in Appendix[A\.1](https://arxiv.org/html/2611.33557#A1.SS1)\. To reduce reliance on the choice ofκ\\kappa, DiffER trains multiple diffusion modelsftθκf\_\{t\}^\{\\theta\_\{\\kappa\}\}with differentκ\\kappa, producing an ensemble of models which generate possible reactants\. This approach provides better coverage of the posterior distribution than a single model\. We follow this same approach, but additionally incorporate continuous\-time models and classifier\-based guidance sampling into the ensemble\.

### 3\.3SMILES Adapted Particle Guidance for Chemical Generation

Aside from the incorporation of continuous\-time diffusion models into the DiffER methodology and the formalization of said methodology, our other primary motivation of this work is to explore the usage of classifier\-based guidance mechanisms on the DiffER ensemble models to improve output diversity\. Classifier\-based guidance steers diffusion sampling toward a specific classificationccby sampling from a tempered distributionpγ​\(xs\|c,xt\)∝p​\(c\|xs\)γ​pθ​\(xs\|xt\)p^\{\\gamma\}\(x\_\{s\}\|c,x\_\{t\}\)\\propto p\(c\|x\_\{s\}\)^\{\\gamma\}p\_\{\\theta\}\(x\_\{s\}\|x\_\{t\}\), wherepθ​\(xs\|xt\)p\_\{\\theta\}\(x\_\{s\}\|x\_\{t\}\)is the diffusion model,p⁡\(c\|xs\)p\(c\|x\_\{s\}\)is a classifier, andγ\\gammais the temperature parameter\([Schiff et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib40)\):

log⁡pγ​\(xs\|c,xt\)=γ​log⁡p⁡\(c\|xs,xt\)\+log⁡p⁡\(xs\|xt\)\.\\log p^\{\\gamma\}\(x\_\{s\}\|c,x\_\{t\}\)=\\gamma\\log p\(c\|x\_\{s\},x\_\{t\}\)\+\\log p\(x\_\{s\}\|x\_\{t\}\)\.\(5\)[Schiff et al\. \(2024\)](https://arxiv.org/html/2611.33557#bib.bib40)formalize classifier\-based guidance for discrete\-space diffusion specifically, with the assumption thatpγ​\(xs\|c,xt\)p^\{\\gamma\}\(x\_\{s\}\|c,x\_\{t\}\)factorizes independently across tokens\. We follow their work to apply classifier\-based guidance to our models\.

#### 3\.3\.1SMILES Adapted Particle Guidance

One of the primary limitations of employing diffusion models for highly conditioned molecular generation tasks lies in the over\-sampling of posterior peaks\([Current et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib39);[Sun et al\., 2025](https://arxiv.org/html/2611.33557#bib.bib45)\), resulting in reduced diversity and number of unique generated molecules\. To this end, we take inspiration from[Corso et al\. \(2023\)](https://arxiv.org/html/2611.33557#bib.bib42)to encourage greater output diversity during sampling through guidance\. Corso et al\. apply the gradient of a potential functionlog⁡Φt​\(xt\(1\),xt\(2\),…,xt\(n\)\)\\log\\Phi\_\{t\}\(x\_\{t\}^\{\(1\)\},x\_\{t\}^\{\(2\)\},\.\.\.,x\_\{t\}^\{\(n\)\}\)to encourage greater output diversity, wherext\(i\)x\_\{t\}^\{\(i\)\}are independent samples from the diffusion model at timett\. The potential function is constructed such that higher scores are given to distant point pairs:

log⁡Φt​\(xt\(1\),xt\(2\),…,xt\(n\)\)=α¯t2​∑i,j𝒦⁡\(xt\(i\),xt\(j\)\),\\log\\Phi\_\{t\}\(x\_\{t\}^\{\(1\)\},x\_\{t\}^\{\(2\)\},\.\.\.,x\_\{t\}^\{\(n\)\}\)=\\frac\{\\bar\{\\alpha\}\_\{t\}\}\{2\}\\sum\_\{i,j\}\\mathcal\{K\}\(x\_\{t\}^\{\(i\)\},x\_\{t\}^\{\(j\)\}\),\(6\)where𝒦\\mathcal\{K\}is a pairwise similarity kernel\. Furthermore, the potential function is weighted by the noise scheduleα¯t\\bar\{\\alpha\}\_\{t\}such that the guidance effect is stronger at earlier timesteps rather than later ones\. Unfortunately, it is non\-trivial to construct a differentiable similarity kernel between noised SMILES strings due to the non\-singular nature of SMILES representations: the same molecule may be represented by many different SMILES sequences of various atom orderings\.

To remedy this, we construct the potential function such that it maximizes the probability thatXt=\{xt\(1\),xt\(2\),…,xt\(n\)\}X\_\{t\}=\\\{x\_\{t\}^\{\(1\)\},x\_\{t\}^\{\(2\)\},\.\.\.,x\_\{t\}^\{\(n\)\}\\\}are noisy variants of different molecules,\. Letm0\(i\)m\_\{0\}^\{\(i\)\}be the molecular form of the denoised sequencex0\(i\)x\_\{0\}^\{\(i\)\}\. Then we aim to maximize the probability

⋃i≠jp⁡\(m0\(i\)≠m0\(j\)\|xt\(i\),xt\(j\)\)=∏i≠jp⁡\(m0\(i\)≠m0\(j\)\|xt\(i\),xt\(j\)\),\\bigcup\_\{i\\neq j\}p\(m\_\{0\}^\{\(i\)\}\\neq m\_\{0\}^\{\(j\)\}\|x\_\{t\}^\{\(i\)\},x\_\{t\}^\{\(j\)\}\)=\\prod\_\{i\\neq j\}p\(m\_\{0\}^\{\(i\)\}\\neq m\_\{0\}^\{\(j\)\}\|x\_\{t\}^\{\(i\)\},x\_\{t\}^\{\(j\)\}\),\(7\)Which factors as a result of the independence of generated SMILES\. Taking thelog\\log, we can construct the potential function as

log⁡Φt​\(Xt\)=∑i≠jlog⁡p⁡\(m0\(i\)≠m0\(j\)\|xt\(i\),xt\(j\)\)\.\\log\\Phi\_\{t\}\(X\_\{t\}\)=\\sum\_\{i\\neq j\}\\log p\(m\_\{0\}^\{\(i\)\}\\neq m\_\{0\}^\{\(j\)\}\|x\_\{t\}^\{\(i\)\},x\_\{t\}^\{\(j\)\}\)\.\(8\)We train a classifier to estimatep⁡\(m0\(i\)≠m0\(j\)\|xt\(i\),xt\(j\)\)p\(m\_\{0\}^\{\(i\)\}\\neq m\_\{0\}^\{\(j\)\}\|x\_\{t\}^\{\(i\)\},x\_\{t\}^\{\(j\)\}\)\. Recognizing that the parameterized diffusion modelftθf\_\{t\}^\{\\theta\}is already trained to produce an estimate of the de\-noised sequences, we train an additional classifierf𝒦Φf\_\{\\mathcal\{K\}\}^\{\\Phi\}to detect ifx^0,t\(i\)=ftθ​\(xt\(i\)\)\\hat\{x\}\_\{0,t\}^\{\(i\)\}=f\_\{t\}^\{\\theta\}\(x\_\{t\}^\{\(i\)\}\)andx^0,t\(j\)=ftθ​\(xt\(j\)\)\\hat\{x\}\_\{0,t\}^\{\(j\)\}=f\_\{t\}^\{\\theta\}\(x\_\{t\}^\{\(j\)\}\)represent the same denoised molecular structure, i\.e\.,

p⁡\(m0\(i\)≠m0\(j\)\|xt\(i\),xt\(j\)\)=f𝒦Φ​\(x^0,t\(i\),x^0,t\(j\)\)=\(f𝒦Φ∘ftθ\)​\(xt\(i\),xt\(j\)\)\.p\(m\_\{0\}^\{\(i\)\}\\neq m\_\{0\}^\{\(j\)\}\|x\_\{t\}^\{\(i\)\},x\_\{t\}^\{\(j\)\}\)=f\_\{\\mathcal\{K\}\}^\{\\Phi\}\(\\hat\{x\}\_\{0,t\}^\{\(i\)\},\\hat\{x\}\_\{0,t\}^\{\(j\)\}\)=\(f\_\{\\mathcal\{K\}\}^\{\\Phi\}\\circ f\_\{t\}^\{\\theta\}\)\(x\_\{t\}^\{\(i\)\},x\_\{t\}^\{\(j\)\}\)\.\(9\)This parameterization results in the final potential function

log⁡Φt​\(Xt\)=∑i≠jlog⁡\(\(f𝒦Φ∘ftθ\)​\(xt\(i\),xt\(j\)\)\)\.\\log\\Phi\_\{t\}\(X\_\{t\}\)=\\sum\_\{i\\neq j\}\\log\\left\(\(f\_\{\\mathcal\{K\}\}^\{\\Phi\}\\circ f\_\{t\}^\{\\theta\}\)\(x\_\{t\}^\{\(i\)\},x\_\{t\}^\{\(j\)\}\)\\right\)\.\(10\)

#### 3\.3\.2Applying Potential Functions via Classifier\-based Guidance

Rather than using this potential function directly, we instead construct a classifier onxt\(i\)x\_\{t\}^\{\(i\)\}alone, recognizing that applying the classifier individually for allxt\(i\)∈Xtx\_\{t\}^\{\(i\)\}\\in X\_\{t\}reproduces the potential function:

logpΦ\(𝕀\[m^0,t\(i\)∉M^t/\{m^0,t\(i\)\}\]\|xt\(i\),Xt\)=∑j≠ilog\(\(f𝒦Φ∘ftθ\)\(xt\(i\),xt\(j\)\)\)\.\\log p\_\{\\Phi\}\(\\mathbb\{I\}\[\\hat\{m\}\_\{0,t\}^\{\(i\)\}\\notin\\hat\{M\}\_\{t\}/\\\{\\hat\{m\}\_\{0,t\}^\{\(i\)\}\\\}\]\|x\_\{t\}^\{\(i\)\},X\_\{t\}\)=\\sum\_\{j\\neq i\}\\log\\left\(\(f\_\{\\mathcal\{K\}\}^\{\\Phi\}\\circ f\_\{t\}^\{\\theta\}\)\(x\_\{t\}^\{\(i\)\},x\_\{t\}^\{\(j\)\}\)\\right\)\.\(11\)Here,m^0,t\(i\)\\hat\{m\}\_\{0,t\}^\{\(i\)\}is the molecular form ofx^0,t\(i\)\\hat\{x\}\_\{0,t\}^\{\(i\)\},M^t\\hat\{M\}\_\{t\}is the set of molecules\{m^0,t\(1\),…,m^0,t\(n\)\}\\\{\\hat\{m\}\_\{0,t\}^\{\(1\)\},\.\.\.,\\hat\{m\}\_\{0,t\}^\{\(n\)\}\\\}associated withXtX\_\{t\}, and𝕀\\mathbb\{I\}is the indicator function\. For the sake of clarity, we will refer to𝕀\[m^0,t\(i\)∉M^t/\{m^0,t\(i\)\}\]\\mathbb\{I\}\[\\hat\{m\}\_\{0,t\}^\{\(i\)\}\\notin\\hat\{M\}\_\{t\}/\\\{\\hat\{m\}\_\{0,t\}^\{\(i\)\}\\\}\]as the guidance classcc\. We add the further stipulation that ifx^0,t\(i\)\\hat\{x\}\_\{0,t\}^\{\(i\)\}is not a valid SMILES string or ifm^0,t\(i\)\\hat\{m\}\_\{0,t\}^\{\(i\)\}is not a valid molecule, then the indicator function defaults to False\.

We finalize our guidance strategy by follow the approach of[Schiff et al\. \(2024\)](https://arxiv.org/html/2611.33557#bib.bib40)to apply classifier guidance to discrete sequences\. This results in the posterior estimate

log⁡pΦ,θγ​\(xs\|c,xt\)=∑ℓ=1Llog⁡\(pΦ​\(c\|x~\)γ​pθ​\(xs\[ℓ\]\|xt\)∑x~pΦ​\(c\|x~\)γ​pθ​\(xs\[ℓ\]\|xt\)\),\\log p^\{\\gamma\}\_\{\\Phi,\\theta\}\(x\_\{s\}\|c,x\_\{t\}\)=\\sum\_\{\\ell=1\}^\{L\}\\log\\left\(\\frac\{p\_\{\\Phi\}\(c\|\\tilde\{x\}\)^\{\\gamma\}p\_\{\\theta\}\(x\_\{s\}^\{\[\\ell\]\}\|x\_\{t\}\)\}\{\\sum\_\{\\tilde\{x\}\}p\_\{\\Phi\}\(c\|\\tilde\{x\}\)^\{\\gamma\}p\_\{\\theta\}\(x\_\{s\}^\{\[\\ell\]\}\|x\_\{t\}\)\}\\right\),\(12\)wherex~=\[xt1:ℓ−1,xsℓ,xtℓ\+1:L\]\\tilde\{x\}=\[x\_\{t\}^\{1:\\ell\-1\},x\_\{s\}^\{\\ell\},x\_\{t\}^\{\\ell\+1:L\}\]is the sequence such thatx~\\tilde\{x\}andxtx\_\{t\}are equal at all positionsℓ′≠ℓ\\ell^\{\\prime\}\\neq\\ellandx~\\tilde\{x\}andxsx\_\{s\}are equal at positionℓ\\ell\. We setγ=α¯t\\gamma=\\bar\{\\alpha\}\_\{t\}to weight the guidance effect similarly to Equation[6](https://arxiv.org/html/2611.33557#S3.E6)\. Finally, we use the first\-order Taylor approximation oflog⁡pΦ\\log p\_\{\\Phi\}to efficiently compute the classifierpΦ​\(c\|x~\)p\_\{\\Phi\}\(c\|\\tilde\{x\}\)using only a single forward pass\([Schiff et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib40)\):

log⁡pΦ​\(c\|x~\)=\(x~−xt\)⊤​∇xt​log⁡pΦ​\(c\|xt\)\+log⁡pΦ​\(c\|xt\)\.\\log p\_\{\\Phi\}\(c\|\\tilde\{x\}\)=\(\\tilde\{x\}\-x\_\{t\}\)^\{\\top\}\\nabla\_\{x\_\{t\}\}\\log p\_\{\\Phi\}\(c\|x\_\{t\}\)\+\\log p\_\{\\Phi\}\(c\|x\_\{t\}\)\.\(13\)We refer readers to[Schiff et al\. \(2024\)](https://arxiv.org/html/2611.33557#bib.bib40)for detailed proofs of this result\.

Training and implementation details forf𝒦Φf\_\{\\mathcal\{K\}\}^\{\\Phi\}are provided in Appendix[A\.2](https://arxiv.org/html/2611.33557#A1.SS2)\. During inference,f𝒦Φf\_\{\\mathcal\{K\}\}^\{\\Phi\}is incorporated in a manner reminiscent of reinforcement learning, allowing the model to learn and adapt throughout the diffusion process\.

## 4Experiments

##### Experimental Setup\.

We train and test our models on the USPTO\-50K dataset\([Lowe, 2017](https://arxiv.org/html/2611.33557#bib.bib36)\), a commonly used set of patented reactions that provides SMILES strings for both reactants and products and widely regarded as the benchmark dataset for retrosynthesis prediction\. Reaction solvents are not included in the retrosynthesis task\. Each pair of products and reactants is augmented 20 times according to[Zhong et al\. \(2022\)](https://arxiv.org/html/2611.33557#bib.bib5), producing a final dataset of 1M root\-aligned SMILES pairs\. We use the augmented train, validation, and test sets provided by Zhong et al\.111[https://github\.com/otori\-bird/retrosynthesis](https://github.com/otori-bird/retrosynthesis)

The DiffER2ensemble contains eight individually trained diffusion models, depicted in Figure[1](https://arxiv.org/html/2611.33557#S1.F1)\. Each model shares the same network architecture, differentiated only by the diffusion parameters and padding augmentation described in Section[3\.2](https://arxiv.org/html/2611.33557#S3.SS2)\. Four of the diffusion models follow the original DiffER training\([Current et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib39)\)with losses adjusted according to[Zhao et al\. \(2024\)](https://arxiv.org/html/2611.33557#bib.bib44): these models operate in discrete\-time with padding parameterκ∈\{20,40,60,80\}\\kappa\\in\\\{20,40,60,80\\\}\. The remaining four models operate in continuous\-time, each paralleling their discrete\-time counterparts with a padding parameterκ∈\{20,40,60,80\}\\kappa\\in\\\{20,40,60,80\\\}\. Further details on model architecture are provided in Appendix[A\.3](https://arxiv.org/html/2611.33557#A1.SS3)\. Models which include particle guidance described in Section[3\.3](https://arxiv.org/html/2611.33557#S3.SS3)are denoted DiffER2PG and DiffER2PG\+\. In DiffER2PG, guidance sampling is run instead of the standard sampling procedure\. In DiffER2PG\+, guidance sampling is run alongside standard sampling procedures, resulting in an output distribution that combines DiffER2and DiffER2PG\.

##### Evaluation Metrics\.

We evaluate our models using standard top\-kkaccuracy metrics\. The DiffER2ensemble is run on each product in the test set and generated reactants are ranked by frequency, with the most generated reactant having the highest ranking\. The top\-kkaccuracy is defined as the proportion of reactions in which the ground\-truth reactant is in the top\-kkranks\. Top\-k accuracy is reported fork∈\{1,3,5,10\}k\\in\\\{1,3,5,10\\\}\. We compare the DiffER2ensemble with a wide range of template\-based, semi\-template, and template\-free methods for retrosynthesis prediction\. However, we primarily focus on comparing performance against other template\-free methods\. In addition to top\-k accuracy, we include results for round\-trip accuracy using a forward synthesis model in Appendix[A\.5](https://arxiv.org/html/2611.33557#A1.SS5)and provide a case study on a ring\-forming reaction in the main results and three other reactions in Appendix[A\.8](https://arxiv.org/html/2611.33557#A1.SS8)\.

##### Property\-Specific Performance Analysis\.

We additionally analyze how model performance compares against various structural properties of the SMILES sequences to better understand model performance\. These properties include the target length difference between product and reactant SMILES, the edit distance between product and reactant SMILES, if the target reaction is ring adding/ring removing, and the number of branches in the target SMILES, each detailed in Appendix[A\.7](https://arxiv.org/html/2611.33557#A1.SS7)\. For each property, we calculate the slope and significance of a regression between the property statistic and the top\-kkaccuracy\. In addition to these results, we report the performance of DiffER2PG across different reaction types in Appendix[A\.6](https://arxiv.org/html/2611.33557#A1.SS6)\. We analyze how different molecular structures correlate with model performance in Appendix[A\.9](https://arxiv.org/html/2611.33557#A1.SS9)\. Finally, we analyze the attention maps for a non\-ensemble diffusion model in Appendix[A\.10](https://arxiv.org/html/2611.33557#A1.SS10)\.

## 5Results

![Refer to caption](https://arxiv.org/html/2611.33557v1/images/num_samples_boxplot.png)Figure 2:Box plot showing the number of unique molecules produced by the various DiffER2ensembles\. "K=1 is False" indicates reactions that do not have an accurate top\-1 reactant\. "K=1 is True" indicates reactions that do have an accurate top\-1 reactant\. "Overall" includes all reactions\.Top\-K accuracies for the DiffER2ensemble are reported in Table[1](https://arxiv.org/html/2611.33557#S5.T1)\. DiffER2PG\+ achieves the best top\-1, top\-3, and top\-5 \(statistically tied with R\-SMILES\) among template\-free models and the second\-best top\-10 accuracy behind R\-SMILES\([Zhong et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib5)\)\. R\-SMILES achieves the best top\-5 and top\-10 performance, but lags behind DiffER2PG\+ fork=1,3k=1,3\. DiffER2PG\+ may better estimate posterior peaks for SMILES sequences than R\-SMILES, but it still struggles to sample from lower probability regions in the posterior\. This result is paralleled in GDiffRetro\([Sun et al\., 2025](https://arxiv.org/html/2611.33557#bib.bib45)\), a semi\-template method that utilizes diffusion sampling techniques\. GDiffRetro achieves remarkablek=1k=1accuracy, the highest of all baseline models, but struggles to produce strong results for higher values ofkkcompared to other methods\.[Sun et al\. \(2025\)](https://arxiv.org/html/2611.33557#bib.bib45)suggest this may be due to the oversampling of posterior peaks, which is also observed in our models\. By employing an ensemble of diffusion models and incorporating SMILES\-adapted particle guidance, DiffER2PG\+ can mitigate some of this bias and provide greater coverage of the posterior, as evidenced by our stronger performance fork\>1k\>1compared to GDiffRetro\. Compared to the original DiffER\([Current et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib39)\), the DiffER2ensembles all achieve stronger results than the discrete\-time only ensemble, particularly for higher values ofkk\. This suggests that including continuous\-time models greatly improves the diversity of output reactants\. Notably, there is minimal difference between all DiffER methodologies for top\-1 accuracy, indicating that the location of posterior peaks for the various ensembles may be similar, but that the shape of the distribution for lower probability samples is different\. Interestingly, the top\-k performances of DiffER2and DiffER2PG are remarkably similar despite the latter ensemble producing more reactants\.

Figure[2](https://arxiv.org/html/2611.33557#S5.F2)shows box plots of the unique reactants generated by each ensemble for products in the test set\. The greater number of unique molecules produced by DiffER2PG indicates that the SMILES\-adapted particle guidance methodology does result in greater output diversity and reduced sampling of posterior peaks\. The combined result of DiffER2PG\+ has an even greater number of unique molecules, indicating that the difference between sample sets generated from DiffER2and DiffER2PG is substantial\. Notably, this result may be impacted by the limited number of samples taken from each model in the ensemble, which may not reflect the full posterior distribution for each model\. Regardless, DiffER2PG is an effective approach to improving output diversity while maintaining comparable performance to DiffER2\. This is desirable because multiple reactants could produce the same product, thus validating accuracy, and output diversity is critical\. Like[Current et al\. \(2024\)](https://arxiv.org/html/2611.33557#bib.bib39), we observe that fewer molecules are sampled when the top\-1 result is accurate, indicating that the models still over\-sample from posterior peaks to the deficit of output diversity\. However, these effects are lessened compared to DiffER\.

Table 1:Top\-K accuracy for a select set of baseline models\. A full table of results can be found in Appendix[A\.4](https://arxiv.org/html/2611.33557#A1.SS4)\. The best performing model in each category isbolded, while the second\-best performing model isunderlined\. A†\\daggerindicates results that are statistically significant from DiffER at the 95% level\.CategoryModelK=13510Template\-basedGLN\([Dai et al\., 2019](https://arxiv.org/html/2611.33557#bib.bib8)\)52\.569\.075\.683\.7LocalRetro\([Chen and Jung, 2021](https://arxiv.org/html/2611.33557#bib.bib9)\)53\.477\.585\.992\.4Semi\-templateRetroPrime\([Wang et al\., 2021](https://arxiv.org/html/2611.33557#bib.bib12)\)51\.470\.874\.076\.1G2Retro\([Chen et al\., 2023](https://arxiv.org/html/2611.33557#bib.bib20)\)53\.974\.680\.786\.6GDiffRetro\([Sun et al\., 2025](https://arxiv.org/html/2611.33557#bib.bib45)\)58\.979\.181\.9\-Template\-freeMEGAN\([Sacha et al\., 2021](https://arxiv.org/html/2611.33557#bib.bib17)\)48\.170\.778\.486\.1R\-SMILES\([Zhong et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib5)\)56\.379\.286\.291\.0DiffER\([Current et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib39)\)57\.679\.084\.187\.4DiffER257\.679\.585\.3†88\.2DiffER2PG57\.479\.485\.4†88\.6†DiffER2PG\+57\.779\.886\.1†89\.9†##### Case Study\.

A case study on an N\-heterocyclization reaction with dihalides for the DiffER2PG\+ ensemble is presented in Figure[3](https://arxiv.org/html/2611.33557#S5.F3)\. Additional case studies are presented in Appendix[A\.8](https://arxiv.org/html/2611.33557#A1.SS8)\. The target reaction is a reaction of a primary amine with a dihalide in an alkaline aqueous medium to form a heterocyclic ring\([Ju and Varma, 2006](https://arxiv.org/html/2611.33557#bib.bib64)\)\. While the ensemble model predicts this reaction, it is only predicted 4% of the time, making it the third most frequently predicted reaction\. The top\-ranked predicted reaction is a Borch reductive amination\([Borch, 2003](https://arxiv.org/html/2611.33557#bib.bib38)\)in which a carbonyl group is reacted with a secondary amine in the presence of a reducing agent to produce a tertiary amine\. Unfortunately, due to the presence of multiple carbonyl groups in the predicted reactant, this reaction will likely produce unwanted byproducts\. The second\-ranked reaction is a substitution reaction with a mesylate ester and a secondary amide nucleophile\. Again, this reaction does produce the desired product, but may produce byproducts due to the electrophilicity of the carbamate group, which may react with the amine nucleophile\.

![Refer to caption](https://arxiv.org/html/2611.33557v1/images/case5.jpg)Figure 3:Case study on a N\-heterocyclization reaction with dihalides\. From left to right: the source product, the ground\-truth reactant\(s\), and the top\-3 predicted reactant\(s\) for the DiffER2PG\+ ensemble\. Red highlighting indicates differences between the source product and the reactants\. The value in parentheses indicates the rate at which the reactant\(s\) are produced by the ensemble\.To recap, all three top\-ranked reactions could be used to form the target product, but only the 3rd reaction, which matches the ground truth, would limit the creation of byproducts\. Notably, this reactant is not produced by the original DiffER ensemble\([Current et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib39)\), demonstrating that DiffER2PG\+ significantly improves output diversity to benefit performance\. In this case study, as well as those presented in Appendix[A\.8](https://arxiv.org/html/2611.33557#A1.SS8), DiffER2PG\+ demonstrates significant capability to predict reactants that could be used to produce the desired product, though some reactions may be suboptimal due to the possibility of undesirable side products\. Thus, while the models can learn appropriate reaction mechanisms and patterns, the predicted forward reaction’s purity may not be considered by the models\. Future work should consider approaches that include reducing the possibility of side products as an objective\. Furthermore, ambiguity in the optimality of reactants could be mitigated by providing additional guidance to the model in a human\-in\-the\-loop setting\.

##### Property Results\.

Figure[4](https://arxiv.org/html/2611.33557#S5.F4)shows the results of the property\-specific performance analysis described in Section[4](https://arxiv.org/html/2611.33557#S4)for top\-1 accuracy, with additional results available in Appendix[A\.7](https://arxiv.org/html/2611.33557#A1.SS7)\. These results highlight substantial differences in the capabilities of DiffER2PG\+ and R\-SMILES\. DiffER2PG\+ is significantly more capable at predicting reactant SMILES with a larger increase in sequence length than the auto\-regressive model\. This result also helps explain the increased capability of diffusion models to predict ring\-removing reactions, as these are often reactions with a high increase in sequence length\. This difference in capability can be understood via the attention maps for the diffusion models: rather than building up the sequence token\-by\-token like an auto\-regressive model, the diffusion models work backward, attending to the full\-sequence length in early layers then decreasing the attended length as the model goes deeper \(see Appendix[A\.10](https://arxiv.org/html/2611.33557#A1.SS10)\)\. Thus, diffusion models may be "less inclined" to produce shorter sequences\.

In contrast, diffusion models seem less capable of modeling ring\-adding reactions than auto\-regressive models, though this difference is only significant fork\>1k\>1\. Both models have a negative association with the edit distance between product and reactant SMILES, except for top\-1 accuracy, in which DiffER2PG\+ has no significant relationship with the edit distance\. This suggests that some reactions with large edits remain "easy" for DiffER2PG\+ to predict\. Both models struggle to generate sequences with highly non\-sequential behavior, as evidenced by the negative relationship between performance and branch count\. Overall, DiffER2PG\+ outperforms R\-SMILES conditioned on all properties except for ring\-adding reactions\.

![Refer to caption](https://arxiv.org/html/2611.33557v1/images/lines_k1.png)Figure 4:Lines of best fit between top\-k accuracy and reactant properties for the DiffER2PG\+ and R\-SMILES\([Zhong et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib5)\)models\. All slopes are significantly different from 0 \(p<0\.01p<0\.01\) except Edit Distance\.

## 6Conclusion

In this work, we introduce SMILES\-adapted particle guidance to encourage output diversity in diffusion models for SMILES generation on the chemical retrosynthesis task\. Combining this guidance mechanism with the ensemble approach of DiffER\([Current et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib39)\), we can significantly increase the number of unique molecules generated while improving top\-k accuracy metrics on benchmark datasets\. Furthermore, we offer an in\-depth empirical analysis on the capabilities and limitations of discrete diffusion for SMILES generation compared to traditional auto\-regressive approaches\. In future work, we aim to investigate additional guidance methods for SMILES diffusion models to reduce byproducts and explore applications of rectified linear flows for SMILES generation\.

#### Reproducibility

We detail all model architectures and hyperparameters used to produce DiffER2in Appendix[A\.3](https://arxiv.org/html/2611.33557#A1.SS3)\. We follow the methods outlined in Section[3](https://arxiv.org/html/2611.33557#S3)and Appendix[A\.2](https://arxiv.org/html/2611.33557#A1.SS2)alongside the experimental setup in Section[4](https://arxiv.org/html/2611.33557#S4)to train and evaluate our models\. All code used to produce the results of DiffER2will be made publicly available\.

## References

- A\. Alakhdar, B\. Poczos, and N\. WashburnDiffusion models in de novo drug design\.Journal of Chemical Information and Modeling64\(19\),pp\. 7238–7256\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Austinet al\.\(2021\)J\. Austin, D\. D\. Johnson, J\. Ho, D\. Tarlow, and R\. Van Den BergStructured denoising diffusion models in discrete state\-spaces\.Advances in Neural Information Processing Systems34,pp\. 17981–17993\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1),[§3\.1](https://arxiv.org/html/2611.33557#S3.SS1.p3.1)\.
- Bansalet al\.\(2023\)A\. Bansal, H\. Chu, A\. Schwarzschild, S\. Sengupta, M\. Goldblum, J\. Geiping, and T\. GoldsteinUniversal guidance for diffusion models\.InProceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition,pp\. 843–852\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Borch \(2003\)R\. F\. BorchReductive amination with sodium cyanoborohydride: n, n\-dimethylcyclohexylamine: cyclohexanamine, 4, 4\-dimethyl\-\.Organic Syntheses52,pp\. 124–124\.Cited by:[§5](https://arxiv.org/html/2611.33557#S5.SS0.SSS0.Px1.p1.1)\.
- Campbellet al\.\(2022\)A\. Campbell, J\. Benton, V\. De Bortoli, T\. Rainforth, G\. Deligiannidis, and A\. DoucetA continuous time framework for discrete denoising models\.Advances in Neural Information Processing Systems35,pp\. 28266–28279\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Chen and Jung \(2021\)S\. Chen and Y\. JungDeep retrosynthetic reaction prediction using local reactivity and global attention\.JACS Au1\(10\),pp\. 1612–1620\.Cited by:[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.5.1.1),[§2\.1](https://arxiv.org/html/2611.33557#S2.SS1.p1.1),[Table 1](https://arxiv.org/html/2611.33557#S5.T1.6.3.1)\.
- Chenet al\.\(2023\)Z\. Chen, O\. R\. Ayinde, J\. R\. Fuchs, H\. Sun, and X\. NingG 2 retro as a two\-step graph generative models for retrosynthesis prediction\.Communications Chemistry6\(1\),pp\. 102\.Cited by:[§A\.6](https://arxiv.org/html/2611.33557#A1.SS6.p1.1),[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.10.1.1),[§2\.1](https://arxiv.org/html/2611.33557#S2.SS1.p1.1),[Table 1](https://arxiv.org/html/2611.33557#S5.T1.6.5.1)\.
- Clogget al\.\(1995\)C\. C\. Clogg, E\. Petkova, and A\. HaritouStatistical methods for comparing regression coefficients between models\.American Journal of Sociology100\(5\),pp\. 1261–1293\.External Links:ISSN 00029602, 15375390,[Link](http://www.jstor.org/stable/2782277)Cited by:[§A\.7](https://arxiv.org/html/2611.33557#A1.SS7.p1.2)\.
- Coleyet al\.\(2017\)C\. W\. Coley, L\. Rogers, W\. H\. Green, and K\. F\. JensenComputer\-assisted retrosynthesis based on molecular similarity\.ACS central science3\(12\),pp\. 1237–1245\.Cited by:[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.2.2.1)\.
- Corsoet al\.\(2023\)G\. Corso, Y\. Xu, V\. De Bortoli, R\. Barzilay, and T\. JaakkolaParticle guidance: non\-iid diverse sampling with diffusion models\.arXiv preprint arXiv:2310\.13102\.Cited by:[§1](https://arxiv.org/html/2611.33557#S1.p3.1),[§1](https://arxiv.org/html/2611.33557#S1.p3.2),[§3\.3\.1](https://arxiv.org/html/2611.33557#S3.SS3.SSS1.p1.1),[§3](https://arxiv.org/html/2611.33557#S3.p1.1)\.
- Croitoruet al\.\(2023\)F\. Croitoru, V\. Hondru, R\. T\. Ionescu, and M\. ShahDiffusion models in vision: a survey\.IEEE Transactions on Pattern Analysis and Machine Intelligence45\(9\),pp\. 10850–10869\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Currentet al\.\(2024\)S\. Current, Z\. Chen, X\. Ning,et al\.DiffER: categorical diffusion models for chemical retrosynthesis\.InNeurIPS 2024 Workshop on AI for New Drug Modalities,Cited by:[§A\.1](https://arxiv.org/html/2611.33557#A1.SS1.p1.1),[§A\.6](https://arxiv.org/html/2611.33557#A1.SS6.p1.1),[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.22.1.1),[Table 3](https://arxiv.org/html/2611.33557#A1.T3.5.3.1.1),[§1](https://arxiv.org/html/2611.33557#S1.p2.1),[§1](https://arxiv.org/html/2611.33557#S1.p3.1),[§2\.1](https://arxiv.org/html/2611.33557#S2.SS1.p1.1),[§3\.2](https://arxiv.org/html/2611.33557#S3.SS2.p1.1),[§3\.2](https://arxiv.org/html/2611.33557#S3.SS2.p2.1),[§3\.2](https://arxiv.org/html/2611.33557#S3.SS2.p3.1),[§3\.2](https://arxiv.org/html/2611.33557#S3.SS2.p4.1),[§3\.3\.1](https://arxiv.org/html/2611.33557#S3.SS3.SSS1.p1.1),[§3](https://arxiv.org/html/2611.33557#S3.p1.1),[§4](https://arxiv.org/html/2611.33557#S4.SS0.SSS0.Px1.p2.1),[§5](https://arxiv.org/html/2611.33557#S5.SS0.SSS0.Px1.p2.1),[Table 1](https://arxiv.org/html/2611.33557#S5.T1.6.9.1),[§5](https://arxiv.org/html/2611.33557#S5.p1.1),[§5](https://arxiv.org/html/2611.33557#S5.p2.1),[§6](https://arxiv.org/html/2611.33557#S6.p1.1)\.
- Daiet al\.\(2019\)H\. Dai, C\. Li, C\. Coley, B\. Dai, and L\. SongRetrosynthesis prediction with conditional graph logic network\.Advances in Neural Information Processing Systems32\.Cited by:[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.4.1.1),[§2\.1](https://arxiv.org/html/2611.33557#S2.SS1.p1.1),[Table 1](https://arxiv.org/html/2611.33557#S5.T1.6.2.2)\.
- Dielemanet al\.\(2022\)S\. Dieleman, L\. Sartran, A\. Roshannai, N\. Savinov, Y\. Ganin, P\. H\. Richemond, A\. Doucet, R\. Strudel, C\. Dyer, C\. Durkan,et al\.Continuous diffusion for categorical data\.arXiv preprint arXiv:2211\.15089\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Epsteinet al\.\(2023\)D\. Epstein, A\. Jabri, B\. Poole, A\. Efros, and A\. HolynskiDiffusion self\-guidance for controllable image generation\.Advances in Neural Information Processing Systems36,pp\. 16222–16239\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Ghazvininejadet al\.\(2019\)M\. Ghazvininejad, O\. Levy, Y\. Liu, and L\. ZettlemoyerMask\-predict: parallel decoding of conditional masked language models\.arXiv preprint arXiv:1904\.09324\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1),[§3\.2](https://arxiv.org/html/2611.33557#S3.SS2.p2.1)\.
- Gonget al\.\(2022\)S\. Gong, M\. Li, J\. Feng, Z\. Wu, and L\. KongDiffuseq: sequence to sequence text generation with diffusion models\.arXiv preprint arXiv:2210\.08933\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Gonget al\.\(2023\)S\. Gong, M\. Li, J\. Feng, Z\. Wu, and L\. KongDiffuSeq\-v2: bridging discrete and continuous text spaces for accelerated seq2seq diffusion models\.arXiv preprint arXiv:2310\.05793\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Gruveret al\.\(2023\)N\. Gruver, S\. Stanton, N\. Frey, T\. G\. Rudner, I\. Hotzel, J\. Lafrance\-Vanasse, A\. Rajpal, K\. Cho, and A\. G\. WilsonProtein design with guided discrete diffusion\.Advances in neural information processing systems36,pp\. 12489–12517\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Guet al\.\(2022\)S\. Gu, D\. Chen, J\. Bao, F\. Wen, B\. Zhang, D\. Chen, L\. Yuan, and B\. GuoVector quantized diffusion model for text\-to\-image synthesis\.InProceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition,pp\. 10696–10706\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Heet al\.\(2022\)Z\. He, T\. Sun, K\. Wang, X\. Huang, and X\. QiuDiffusionbert: improving generative masked language models with diffusion models\.arXiv preprint arXiv:2211\.15029\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Hendrycks and Gimpel \(2016\)D\. Hendrycks and K\. GimpelGaussian error linear units \(gelus\)\.arXiv preprint arXiv:1606\.08415\.Cited by:[§A\.3](https://arxiv.org/html/2611.33557#A1.SS3.p1.1)\.
- Hoet al\.\(2020\)J\. Ho, A\. Jain, and P\. AbbeelDenoising diffusion probabilistic models\.Advances in neural information processing systems33,pp\. 6840–6851\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Ho and Salimans \(2022\)J\. Ho and T\. SalimansClassifier\-free diffusion guidance\.arXiv preprint arXiv:2207\.12598\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Hoogeboomet al\.\(2021\)E\. Hoogeboom, D\. Nielsen, P\. Jaini, P\. Forré, and M\. WellingArgmax flows and multinomial diffusion: learning categorical distributions\.Advances in Neural Information Processing Systems34,pp\. 12454–12465\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1),[§3\.1](https://arxiv.org/html/2611.33557#S3.SS1.p3.1)\.
- Hoogeboomet al\.\(2022\)E\. Hoogeboom, V\. G\. Satorras, C\. Vignac, and M\. WellingEquivariant diffusion for molecule generation in 3d\.InInternational conference on machine learning,pp\. 8867–8887\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Irwinet al\.\(2022\)R\. Irwin, S\. Dimitriadis, J\. He, and E\. J\. BjerrumChemformer: a pre\-trained transformer for computational chemistry\.Machine Learning: Science and Technology3\(1\),pp\. 015022\.Cited by:[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.18.1.1),[§2\.1](https://arxiv.org/html/2611.33557#S2.SS1.p1.1)\.
- Ju and Varma \(2006\)Y\. Ju and R\. S\. VarmaAqueous n\-heterocyclization of primary amines and hydrazines with dihalides: microwave\-assisted syntheses of n\-azacycloalkanes, isoindole, pyrazole, pyrazolidine, and phthalazine derivatives\.The Journal of organic chemistry71\(1\),pp\. 135–141\.Cited by:[§5](https://arxiv.org/html/2611.33557#S5.SS0.SSS0.Px1.p1.1)\.
- Kimet al\.\(2021\)E\. Kim, D\. Lee, Y\. Kwon, M\. S\. Park, and Y\. ChoiValid, plausible, and diverse retrosynthesis using tied two\-way transformers with latent variables\.Journal of Chemical Information and Modeling61\(1\),pp\. 123–133\.Cited by:[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.20.1.1)\.
- Krennet al\.\(2019\)M\. Krenn, F\. Häse, A\. Nigam, P\. Friederich, and A\. Aspuru\-GuzikSELFIES: a robust representation of semantically constrained graphs with an example application in chemistry\.CoRRabs/1905\.13741\.External Links:[Link](http://arxiv.org/abs/1905.13741),1905\.13741Cited by:[§A\.4](https://arxiv.org/html/2611.33557#A1.SS4.p2.1),[§3](https://arxiv.org/html/2611.33557#S3.p1.1)\.
- Leonet al\.\(2024\)M\. Leon, Y\. Perezhohin, F\. Peres, A\. Popovič, and M\. CastelliComparing smiles and selfies tokenization for enhanced chemical language modeling\.Scientific Reports14\(1\),pp\. 25016\.Cited by:[§A\.4](https://arxiv.org/html/2611.33557#A1.SS4.p2.1)\.
- Liuet al\.\(2017\)B\. Liu, B\. Ramsundar, P\. Kawthekar, J\. Shi, J\. Gomes, Q\. Luu Nguyen, S\. Ho, J\. Sloane, P\. Wender, and V\. PandeRetrosynthetic reaction prediction using neural sequence\-to\-sequence models\.ACS central science3\(10\),pp\. 1103–1113\.Cited by:[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.12.2.1)\.
- Liuet al\.\(2023\)X\. Liu, D\. H\. Park, S\. Azadi, G\. Zhang, A\. Chopikyan, Y\. Hu, H\. Shi, A\. Rohrbach, and T\. DarrellMore control for free\! image synthesis with semantic diffusion guidance\.InProceedings of the IEEE/CVF winter conference on applications of computer vision,pp\. 289–299\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Lowe \(2017\)D\. LoweChemical reactions from US patents \(1976\-Sep2016\)\.External Links:[Link](https://figshare.com/articles/dataset/Chemical_reactions_from_US_patents_1976-Sep2016_/5104873),[Document](https://dx.doi.org/10.6084/m9.figshare.5104873.v1)Cited by:[§1](https://arxiv.org/html/2611.33557#S1.p2.1),[§4](https://arxiv.org/html/2611.33557#S4.SS0.SSS0.Px1.p1.1)\.
- Morgan \(1965\)H\. L\. MorganThe generation of a unique machine description for chemical structures\-a technique developed at chemical abstracts service\.\.Journal of chemical documentation5\(2\),pp\. 107–113\.Cited by:[§A\.9](https://arxiv.org/html/2611.33557#A1.SS9.p1.1)\.
- Najmiet al\.\(2022\)A\. A\. Najmi, R\. Bischoff, and H\. P\. PermentierN\-dealkylation of amines\.Molecules27\(10\),pp\. 3293\.Cited by:[§A\.8](https://arxiv.org/html/2611.33557#A1.SS8.SSS0.Px1.p1.1)\.
- Niet al\.\(2023\)B\. Ni, D\. L\. Kaplan, and M\. J\. BuehlerGenerative design of de novo proteins based on secondary\-structure constraints using an attention\-based diffusion model\.Chem9\(7\),pp\. 1828–1849\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Rameshet al\.\(2003\)C\. Ramesh, N\. Ravindranath, and B\. DasSimple, efficient, and selective deprotection of phenolic methoxymethyl ethers using silica\-supported sodium hydrogen sulfate as a heterogeneous catalyst1\.The Journal of Organic Chemistry68\(18\),pp\. 7101–7103\.Cited by:[§A\.8](https://arxiv.org/html/2611.33557#A1.SS8.SSS0.Px3.p1.1)\.
- Sachaet al\.\(2021\)M\. Sacha, M\. Błaz, P\. Byrski, P\. Dabrowski\-Tumanski, M\. Chrominski, R\. Loska, P\. Włodarczyk\-Pruszynski, and S\. JastrzebskiMolecule edit graph attention network: modeling chemical reactions as sequences of graph edits\.Journal of Chemical Information and Modeling61\(7\),pp\. 3273–3284\.Cited by:[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.17.1.1),[§2\.1](https://arxiv.org/html/2611.33557#S2.SS1.p1.1),[Table 1](https://arxiv.org/html/2611.33557#S5.T1.6.7.2)\.
- Sahariaet al\.\(2022\)C\. Saharia, W\. Chan, S\. Saxena, L\. Li, J\. Whang, E\. L\. Denton, K\. Ghasemipour, R\. Gontijo Lopes, B\. Karagol Ayan, T\. Salimans,et al\.Photorealistic text\-to\-image diffusion models with deep language understanding\.Advances in neural information processing systems35,pp\. 36479–36494\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Schiffet al\.\(2024\)Y\. Schiff, S\. S\. Sahoo, H\. Phung, G\. Wang, S\. Boshar, H\. Dalla\-torre, B\. P\. de Almeida, A\. Rush, T\. Pierrot, and V\. KuleshovSimple guidance mechanisms for discrete diffusion models\.arXiv preprint arXiv:2412\.10193\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1),[§3\.3\.2](https://arxiv.org/html/2611.33557#S3.SS3.SSS2.p2.1),[§3\.3\.2](https://arxiv.org/html/2611.33557#S3.SS3.SSS2.p2.2),[§3\.3\.2](https://arxiv.org/html/2611.33557#S3.SS3.SSS2.p2.3),[§3\.3](https://arxiv.org/html/2611.33557#S3.SS3.p1.1),[§3\.3](https://arxiv.org/html/2611.33557#S3.SS3.p1.2)\.
- Schneideret al\.\(2016\)N\. Schneider, N\. Stiefl, and G\. A\. LandrumWhat’s what: the \(nearly\) definitive guide to reaction role assignment\.Journal of chemical information and modeling56\(12\),pp\. 2336–2346\.Cited by:[§A\.6](https://arxiv.org/html/2611.33557#A1.SS6.p1.1)\.
- Schneuinget al\.\(2024\)A\. Schneuing, C\. Harris, Y\. Du, K\. Didi, A\. Jamasb, I\. Igashov, W\. Du, C\. Gomes, T\. L\. Blundell, P\. Lio,et al\.Structure\-based drug design with equivariant diffusion models\.Nature Computational Science4\(12\),pp\. 899–909\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Segleret al\.\(2018\)M\. H\. Segler, M\. Preuss, and M\. P\. WallerPlanning chemical syntheses with deep neural networks and symbolic ai\.Nature555\(7698\),pp\. 604–610\.Cited by:[§1](https://arxiv.org/html/2611.33557#S1.p1.1)\.
- Segler and Waller \(2017\)M\. H\. Segler and M\. P\. WallerNeural\-symbolic machine learning for retrosynthesis and reaction prediction\.Chemistry–A European Journal23\(25\),pp\. 5966–5971\.Cited by:[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.3.1.1)\.
- Seoet al\.\(2021\)S\. Seo, Y\. Y\. Song, J\. Y\. Yang, S\. Bae, H\. Lee, J\. Shin, S\. J\. Hwang, and E\. YangGTA: graph truncated attention for retrosynthesis\.InProceedings of the AAAI Conference on Artificial Intelligence,Vol\.35,pp\. 531–539\.Cited by:[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.14.1.1)\.
- Shenet al\.\(2021\)Y\. Shen, J\. E\. Borowski, M\. A\. Hardy, R\. Sarpong, A\. G\. Doyle, and T\. CernakAutomation and computer\-assisted planning for chemical synthesis\.Nature Reviews Methods Primers1\(1\),pp\. 1–23\.Cited by:[§1](https://arxiv.org/html/2611.33557#S1.p1.1)\.
- Shiet al\.\(2020\)C\. Shi, M\. Xu, H\. Guo, M\. Zhang, and J\. TangA graph to graphs framework for retrosynthesis prediction\.InInternational conference on machine learning,pp\. 8818–8827\.Cited by:[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.6.2.1)\.
- Sohl\-Dicksteinet al\.\(2015\)J\. Sohl\-Dickstein, E\. Weiss, N\. Maheswaranathan, and S\. GanguliDeep unsupervised learning using nonequilibrium thermodynamics\.InInternational conference on machine learning,pp\. 2256–2265\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Somnathet al\.\(2021\)V\. R\. Somnath, C\. Bunne, C\. Coley, A\. Krause, and R\. BarzilayLearning graph models for retrosynthesis prediction\.Advances in Neural Information Processing Systems34,pp\. 9405–9415\.Cited by:[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.7.1.1),[§2\.1](https://arxiv.org/html/2611.33557#S2.SS1.p1.1)\.
- Song and Ermon \(2019\)Y\. Song and S\. ErmonGenerative modeling by estimating gradients of the data distribution\.Advances in neural information processing systems32\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Songet al\.\(2020\)Y\. Song, J\. Sohl\-Dickstein, D\. P\. Kingma, A\. Kumar, S\. Ermon, and B\. PooleScore\-based generative modeling through stochastic differential equations\.arXiv preprint arXiv:2011\.13456\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Sumneret al\.\(2020\)D\. Sumner, J\. He, A\. Thakkar, O\. Engkvist, and E\. J\. BjerrumLevenshtein augmentation improves performance of smiles based deep\-learning synthesis prediction\.Cited by:[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.13.1.1)\.
- Sunet al\.\(2021\)R\. Sun, H\. Dai, L\. Li, S\. Kearnes, and B\. DaiTowards understanding retrosynthesis by energy\-based models\.Advances in Neural Information Processing Systems34,pp\. 10186–10194\.Cited by:[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.16.1.1)\.
- Sunet al\.\(2025\)S\. Sun, W\. Yu, Y\. Ren, W\. Du, L\. Liu, X\. Zhang, Y\. Hu, and C\. MaGDiffRetro: retrosynthesis prediction with dual graph enhanced molecular representation and diffusion generation\.arXiv preprint arXiv:2501\.08001\.Cited by:[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.11.2.1),[§2\.1](https://arxiv.org/html/2611.33557#S2.SS1.p1.1),[§3\.3\.1](https://arxiv.org/html/2611.33557#S3.SS3.SSS1.p1.1),[Table 1](https://arxiv.org/html/2611.33557#S5.T1.6.6.1),[§5](https://arxiv.org/html/2611.33557#S5.p1.1)\.
- Tu and Coley \(2022\)Z\. Tu and C\. W\. ColeyPermutation invariant graph\-to\-sequence model for template\-free retrosynthesis and reaction prediction\.Journal of chemical information and modeling62\(15\),pp\. 3503–3513\.Cited by:[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.15.1.1)\.
- Wanet al\.\(2022\)Y\. Wan, C\. Hsieh, B\. Liao, and S\. ZhangRetroformer: pushing the limits of end\-to\-end retrosynthesis transformer\.InInternational Conference on Machine Learning,pp\. 22475–22490\.Cited by:[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.19.1.1)\.
- Wanget al\.\(2021\)X\. Wang, Y\. Li, J\. Qiu, G\. Chen, H\. Liu, B\. Liao, C\. Hsieh, and X\. YaoRetroprime: a diverse, plausible and transformer\-based method for single\-step retrosynthesis predictions\.Chemical Engineering Journal420,pp\. 129845\.Cited by:[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.9.1.1),[Table 1](https://arxiv.org/html/2611.33557#S5.T1.6.4.2)\.
- Watsonet al\.\(2022\)J\. L\. Watson, D\. Juergens, N\. R\. Bennett, B\. L\. Trippe, J\. Yim, H\. E\. Eisenach, W\. Ahern, A\. J\. Borst, R\. J\. Ragotte, L\. F\. Milles,et al\.Broadly applicable and accurate protein design by integrating structure prediction networks and diffusion generative models\.BioRxiv,pp\. 2022–12\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Weininger \(1988\)D\. WeiningerSMILES, a chemical language and information system\. 1\. introduction to methodology and encoding rules\.Journal of chemical information and computer sciences28\(1\),pp\. 31–36\.Cited by:[§1](https://arxiv.org/html/2611.33557#S1.p2.1)\.
- Xuet al\.\(2023\)M\. Xu, A\. S\. Powers, R\. O\. Dror, S\. Ermon, and J\. LeskovecGeometric latent diffusion models for 3d molecule generation\.InInternational Conference on Machine Learning,pp\. 38592–38610\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Xuet al\.\(2022\)M\. Xu, L\. Yu, Y\. Song, C\. Shi, S\. Ermon, and J\. TangGeodiff: a geometric diffusion model for molecular conformation generation\.arXiv preprint arXiv:2203\.02923\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Xuet al\.\(2024\)Z\. Xu, R\. Qiu, Y\. Chen, H\. Chen, X\. Fan, M\. Pan, Z\. Zeng, M\. Das, and H\. TongDiscrete\-state continuous\-time diffusion for graph generation\.arXiv preprint arXiv:2405\.11416\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Yanet al\.\(2020\)C\. Yan, Q\. Ding, P\. Zhao, S\. Zheng, J\. Yang, Y\. Yu, and J\. HuangRetroxpert: decompose retrosynthesis prediction like a chemist\.Advances in Neural Information Processing Systems33,pp\. 11248–11258\.Cited by:[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.8.1.1)\.
- Yanget al\.\(2023\)L\. Yang, Z\. Zhang, Y\. Song, S\. Hong, R\. Xu, Y\. Zhao, W\. Zhang, B\. Cui, and M\. YangDiffusion models: a comprehensive survey of methods and applications\.ACM Computing Surveys56\(4\),pp\. 1–39\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Yuanet al\.\(2022\)H\. Yuan, Z\. Yuan, C\. Tan, F\. Huang, and S\. HuangSeqdiffuseq: text diffusion with encoder\-decoder transformers\.arXiv preprint arXiv:2212\.10325\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Zhanget al\.\(2023\)L\. Zhang, A\. Rao, and M\. AgrawalaAdding conditional control to text\-to\-image diffusion models\.InProceedings of the IEEE/CVF International Conference on Computer Vision,pp\. 3836–3847\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1)\.
- Zhaoet al\.\(2024\)L\. Zhao, X\. Ding, L\. Yu, and L\. AkogluUnified discrete diffusion for categorical data\.arXiv preprint arXiv:2402\.03701\.Cited by:[§2\.2](https://arxiv.org/html/2611.33557#S2.SS2.p1.1),[§3\.1](https://arxiv.org/html/2611.33557#S3.SS1.p1.1),[§3\.1](https://arxiv.org/html/2611.33557#S3.SS1.p2.1),[§3\.1](https://arxiv.org/html/2611.33557#S3.SS1.p3.2),[§3\.1](https://arxiv.org/html/2611.33557#S3.SS1.p4.1),[§4](https://arxiv.org/html/2611.33557#S4.SS0.SSS0.Px1.p2.1)\.
- Zhonget al\.\(2022\)Z\. Zhong, J\. Song, Z\. Feng, T\. Liu, L\. Jia, S\. Yao, M\. Wu, T\. Hou, and M\. SongRoot\-aligned smiles: a tight representation for chemical reaction prediction\.Chemical Science13\(31\),pp\. 9023–9034\.Cited by:[Figure 5](https://arxiv.org/html/2611.33557#A1.F5),[§A\.10](https://arxiv.org/html/2611.33557#A1.SS10.p4.1),[§A\.5](https://arxiv.org/html/2611.33557#A1.SS5.p1.1),[§A\.7](https://arxiv.org/html/2611.33557#A1.SS7.p1.2),[Table 2](https://arxiv.org/html/2611.33557#A1.T2.13.21.1.1),[Table 3](https://arxiv.org/html/2611.33557#A1.T3.5.2.1.1),[Table 5](https://arxiv.org/html/2611.33557#A1.T5),[§1](https://arxiv.org/html/2611.33557#S1.p2.1),[§2\.1](https://arxiv.org/html/2611.33557#S2.SS1.p1.1),[§4](https://arxiv.org/html/2611.33557#S4.SS0.SSS0.Px1.p1.1),[Figure 4](https://arxiv.org/html/2611.33557#S5.F4),[Table 1](https://arxiv.org/html/2611.33557#S5.T1.6.8.1),[§5](https://arxiv.org/html/2611.33557#S5.p1.1),[2](https://arxiv.org/html/2611.33557#alg1.l2)\.

## Appendix AAppendix

### A\.1Details on DiffER’s Padding Procedure

During training, DiffER\([Current et al\., 2024](https://arxiv.org/html/2611.33557#bib.bib39)\)randomly appends padding tokens to the SMILES representations of reactants\. The target reactant sequencex01:Lxx\_\{0\}^\{1:L\_\{x\}\}is randomly padded on the right by a sequence of padding tokens with random length, such that

x0′=\[x01:Lx,ep1:Lp\]andxt∼q\(xt\|x0′\),x\_\{0\}^\{\\prime\}=\\left\[x\_\{0\}^\{1:L\_\{x\}\},e\_\{p\}^\{1:L\_\{p\}\}\\right\]~\\text\{and\}~x\_\{t\}\\sim q\(x\_\{t\}\|x\_\{0\}^\{\\prime\}\),\(14\)whereepe\_\{p\}is the one\-hot encoder vector of the pad token andLp∼𝒰​\{1,κ\}L\_\{p\}\\sim\\mathcal\{U\}\\\{1,\\kappa\\\}, with𝒰​\{1,κ\}\\mathcal\{U\}\\\{1,\\kappa\\\}being the discrete uniform distribution between11and some constantκ\>1∈ℕ\\kappa\>1\\in\\mathbb\{N\}\. The choice ofκ\\kappaallows the diffusion model to strike a balance between effective length prediction withfℓϕf\_\{\\ell\}^\{\\phi\}and allowingftθf\_\{t\}^\{\\theta\}to determine the sequence length by predicting padding tokens during sampling\.

We can show that the variant padding methodology is in effect a moving average kernel on the distribution of\(Lx−Ly\)\(L\_\{x\}\-L\_\{y\}\)with widthκ\\kappa\. LetLx−y∈\[−L/2,L/2\]L\_\{x\-y\}\\in\[\-L/2,L/2\]denote the difference\(Lx−Ly\)\(L\_\{x\}\-L\_\{y\}\)with probability distributionLx−y∼𝒞⁡\(Lx−y,pℓ\)L\_\{x\-y\}\\sim\\mathcal\{C\}\(L\_\{x\-y\};p\_\{\\ell\}\), where the probability vectorpℓp\_\{\\ell\}is calculated from the training data distribution\. LetLx−y′∼𝒞⁡\(Lx−y′,pℓ′\)L\_\{x\-y\}^\{\\prime\}\\sim\\mathcal\{C\}\(L\_\{x\-y\}^\{\\prime\};p\_\{\\ell\}^\{\\prime\}\)represent the difference distribution after random padding with probability vectorpℓ′p\_\{\\ell\}^\{\\prime\}, and letPi\|j=P⁡\(Lx−y′=i\|Lx−y=j\)P\_\{i\|j\}=P\(L\_\{x\-y\}^\{\\prime\}=i\|L\_\{x\-y\}=j\)be the probability that a sequence pair with differencejjmaps to a difference ofiifor the padded sequence\. Then

pℓ′i=∑j=1LPi\|j⋅pℓj=1κ∑j=1Lpℓj𝕀\[i−κ≤j<i\]=1κ∑j=i−κi−1pℓj\.\{p\_\{\\ell\}^\{\\prime\}\}\_\{i\}=\\sum\_\{j=1\}^\{L\}P\_\{i\|j\}\\cdot\{p\_\{\\ell\}\}\_\{j\}=\\frac\{1\}\{\\kappa\}\\sum\_\{j=1\}^\{L\}\{p\_\{\\ell\}\}\_\{j\}\\mathbb\{I\}\[i\-\\kappa\\leq j<i\]=\\frac\{1\}\{\\kappa\}\\sum\_\{j=i\-\\kappa\}^\{i\-1\}\{p\_\{\\ell\}\}\_\{j\}\.\(15\)Thus,pℓ′p\_\{\\ell\}^\{\\prime\}is a moving average of the previousκ\\kappaindices ofpℓp\_\{\\ell\}\. In effect, the padding methodology reduces the heavy bias observed in the distribution ofLx−yL\_\{x\-y\}by smoothing the probability vectorpℓp\_\{\\ell\}\.

### A\.2Training Details for Particle Guidance Model

Algorithm 1Pseudocode for particle guidance sampling procedure\.Inputs: target producty0y\_\{0\}, timestepsTT, number of samplesNN, diffusion model encoderfe​n​c​o​d​e​rθf\_\{encoder\}^\{\\theta\}, diffusion model decoderfd​e​c​o​d​e​rθf\_\{decoder\}^\{\\theta\}, noise scheduleα¯t\\bar\{\\alpha\}\_\{t\} Output: Sampled reactants\{x^0\(1\),x^0\(2\),…,x^0\(N\)\}\\\{\\hat\{x\}\_\{0\}^\{\(1\)\},\\hat\{x\}\_\{0\}^\{\(2\)\},\.\.\.,\\hat\{x\}\_\{0\}^\{\(N\)\}\\\}

1:for

iiin

11to

NNdo

2:Initialize

y0\(i\)=y\_\{0\}^\{\(i\)\}=Augment

\(y0\)\(y\_\{0\}\)according to Zhong et al\.[Zhong et al\. \(2022\)](https://arxiv.org/html/2611.33557#bib.bib5)

3:Initialize

xT\(i\)=𝒞⁡\(xT,m\)x\_\{T\}^\{\(i\)\}=\\mathcal\{C\}\(x\_\{T\};m\)from noise distribution

4:Compute encoder memory

Hi=fe​n​c​o​d​e​rθ​\(y0\(i\)\)H\_\{i\}=f\_\{encoder\}^\{\\theta\}\(y\_\{0\}^\{\(i\)\}\)
5:endfor

6:for

ttin

TTto

11do

7:

s=t−1s=t\-1
8:Let

Xt=\{xt\(1\),xt\(2\),…,xt\(n\)\}X\_\{t\}=\\\{x\_\{t\}^\{\(1\)\},x\_\{t\}^\{\(2\)\},\.\.\.,x\_\{t\}^\{\(n\)\}\\\}
9:for

iiin

11to

NNdo

10:Predict

x^0\(i\)←fd​e​c​o​d​e​rθ​\(xt\(i\),Hi,t\)\\hat\{x\}\_\{0\}^\{\(i\)\}\\leftarrow f\_\{decoder\}^\{\\theta\}\(x\_\{t\}^\{\(i\)\},H\_\{i\},t\)
11:Compute

pΦ​\(c=1\|xt\(i\),Xt\)p\_\{\\Phi\}\(c=1\|x\_\{t\}^\{\(i\)\},X\_\{t\}\)according to equation[11](https://arxiv.org/html/2611.33557#S3.E11)

12:Compute

xs\(i\)x\_\{s\}^\{\(i\)\}according to equations[12](https://arxiv.org/html/2611.33557#S3.E12)and[13](https://arxiv.org/html/2611.33557#S3.E13)

13:Update

f𝒦Φf\_\{\\mathcal\{K\}\}^\{\\Phi\}and

fe​n​c​o​d​e​rθf\_\{encoder\}^\{\\theta\}using classifier loss \(Binary Cross Entropy\)

14:endfor

15:endfor

16:

x^0\(i\)←fd​e​c​o​d​e​rθ​\(xt\(i\),Hi,t\)\\hat\{x\}\_\{0\}^\{\(i\)\}\\leftarrow f\_\{decoder\}^\{\\theta\}\(x\_\{t\}^\{\(i\)\},H\_\{i\},t\)
17:Return

\{x^0\(1\),x^0\(2\),…,x^0\(N\)\}\\\{\\hat\{x\}\_\{0\}^\{\(1\)\},\\hat\{x\}\_\{0\}^\{\(2\)\},\.\.\.,\\hat\{x\}\_\{0\}^\{\(N\)\}\\\}

The guidance modelf𝒦Φf\_\{\\mathcal\{K\}\}^\{\\Phi\}is trained in a reinforcement learning paradigm during inference with no explicit pretraining\. Recognizing that the encoder portion of the diffusion modelfe​n​c​o​d​e​rθf\_\{encoder\}^\{\\theta\}is time\-independent and already adept at recognizing molecular structure, we constructf𝒦Φf\_\{\\mathcal\{K\}\}^\{\\Phi\}as an additional classification head following anfe​n​c​o​d​e​rθf\_\{encoder\}^\{\\theta\}\. LetH1:Lii∈ℝLi×dH^\{1:L\_\{i\}\}\_\{i\}\\in\\mathbb\{R\}^\{L\_\{i\}\\times d\}be the hidden representation of a SMILES sequencex\(i\)∈\{0,1\}Li×Kx^\{\(i\)\}\\in\\\{0,1\\\}^\{L\_\{i\}\\times K\}with hidden sizeddand lengthLiL\_\{i\}obtained from the encoder model, i\.e\.,Hi1:Li=fe​n​c​o​d​e​rθ\(x\(i\)\)H\_\{i\}^\{1:L\_\{i\}\}=f\_\{encoder\}^\{\\theta\}\(x^\{\(i\)\}\)\. LetH\(i\)=1Li​∑ℓ=1LiHi\[ℓ\]H^\{\(i\)\}=\\frac\{1\}\{L\_\{i\}\}\\sum\_\{\\ell=1\}^\{L\_\{i\}\}H\_\{i\}^\{\[\\ell\]\}be the hidden representation average over the sequence length\. The classifier model is constructed as a function of the difference between the mean hidden representations for stringsx\(i\),x\(j\)x^\{\(i\)\},x^\{\(j\)\}along the sequence length:

f𝒦Φ​\(x\(i\),x\(j\)\)=σ⁡\(Φ⊤​\(H\(i\)−H\(j\)\)\),f\_\{\\mathcal\{K\}\}^\{\\Phi\}\(x^\{\(i\)\},x^\{\(j\)\}\)=\\sigma\\left\(\\Phi^\{\\top\}\\left\(H^\{\(i\)\}\-H^\{\(j\)\}\\right\)\\right\),\(16\)whereΦ∈ℝd\\Phi\\in\\mathbb\{R\}^\{d\}are the model parameters\. By averaging over the sequence lengthLiL\_\{i\}to constructH\(i\)H^\{\(i\)\}, we help remove the effect of sequence ordering on the classification\. This is desirable due to non\-singular nature of SMILES representations\.

During inference, we trainf𝒦Φf\_\{\\mathcal\{K\}\}^\{\\Phi\}in a manner akin to reinforcement learning\. Note thatf𝒦Φf\_\{\\mathcal\{K\}\}^\{\\Phi\}is not explicitly pretrained aside from the encoder modelfe​n​c​o​d​e​rθf\_\{encoder\}^\{\\theta\}\. We allow both the classifier weightsΦ\\Phiand the encoder weightsθe​n​c​o​d​e​r\\theta\_\{encoder\}to be optimized during sampling\. Note that because the encoder model is only run once at the beginning of sampling, changing the weights offe​n​c​o​d​e​rθf\_\{encoder\}^\{\\theta\}during future sampling steps does not directly affect the overall diffusion modelftθf\_\{t\}^\{\\theta\}\. Pseudocode for the joint training/sampling procedure forf𝒦Φf\_\{\\mathcal\{K\}\}^\{\\Phi\}is provided in algorithm[1](https://arxiv.org/html/2611.33557#alg1)\.

### A\.3Details on Model Architectures and Diffusion Parameters

All models in the DiffER2ensembles take the form of standard encoder\-decoder transformers with 6 layers, 8 attention heads, a latent size of 512, a feed\-forward layer of size 2048, and GeLU activation[Hendrycks and Gimpel \(2016\)](https://arxiv.org/html/2611.33557#bib.bib37)\. All models are trained using an Adam optimizer with learning rate0\.00010\.0001and a dropout rate of0\.10\.1for 90 epochs\. Both discrete\-time and continuous\-time models are trained using a log\-linear noise schedule and are sampled over 100 diffusion timesteps\. All models are trained on a single Nvidia A6000 GPU with 48GB memory\.

### A\.4Complete Table of Top\-K Accuracy

Table 2:Complete top\-K accuracy comparison to baseline models\. DiffER2is the ensemble model and C\-DiffER are the individual continuous\-time diffusion models\. The best performing model in each category isbolded, while the second\-best performing model isunderlined\.A full table of top\-k metrics is provided in table[2](https://arxiv.org/html/2611.33557#A1.T2)\. This table includes additional baseline approaches for computerized retrosynthesis prediction from prior literature as well as results for the singular C\-DiffER and C\-DiffER20diffusion models\. These results highlight the advantages of the ensemble approaches, which produce sample distributions with higher top\-k accuracy than the singular diffusion models\. Notably, C\-DiffER does achieve stronger performance than C\-DiffER20\(which includes the DiffER adapted length prediction described in section[3\.2](https://arxiv.org/html/2611.33557#S3.SS2)\), demonstrating the inherent bias in the length prediction model, but still shows reduced performance compared to R\-SMILES, indicating that a single diffusion model may be an insufficient approximation of the reactant posterior\. These results may also change if a greater number of samples were taken from the C\-DiffER models\.

C\-DiffERSelfies\{\}\_\{\\text\{Selfies\}\}indicates the C\-DiffER model trained using SELFIES molecular representations\([Krenn et al\., 2019](https://arxiv.org/html/2611.33557#bib.bib68)\), an alternative to SMILES string representations\. Unlike SMILES, SELFIES is 100% robust, with every SELFIES string representing a valid molecular structure\. SELFIES has been proposed as an alternative to SMILES for molecular generation tasks due to the guaranteed validity of outputs, which do not suffer from the harsh syntactic constraints of SMILES\. Notably, however, the SELFIES\-based implementation of C\-DiffER does not seem to significantly improve performance compared to SMILES\-based models, and in fact exhibits a lower top\-1 accuracy than the SMILES\-based version\. Askkincreases, the performances become more similar, with the SELFIES\-based implementation exhibiting a slightly stronger top\-10 accuracy\. This indicates that the choice of string\-encoding has little impact on the performance of the retrosynthetic diffusion model\. This is likely due to the already high per\-sample validity \(89\.4%\) of SMILES strings produced by C\-DiffER, which limits the impact of SELFIES’ guaranteed validity on the model’s performance\. Furthermore, these results support the findings of[Leon et al\. \(2024\)](https://arxiv.org/html/2611.33557#bib.bib69), which found that SMILES\-based models often perform better than their SELFIES counterparts on a variety of molecular prediction tasks\.

### A\.5Round\-Trip Accuracy

Table 3:Top\-K round\-trip accuracy for select models\.A†\\daggerindicates results that are significantly different from DiffER at the 95% level\.ModelK=13510R\-SMILES[Zhong et al\. \(2022\)](https://arxiv.org/html/2611.33557#bib.bib5)53\.866\.773\.782\.1DiffER[Current et al\. \(2024\)](https://arxiv.org/html/2611.33557#bib.bib39)53\.864\.770\.175\.6DiffER254\.165\.270\.675\.5DiffER2PG54\.466\.071\.877\.6DiffER2PG\+54\.466\.172\.0†78\.4†to further evaluate our models, we compute the top\-k round\-trip accuracy score using the forward model of R\-Smiles\([Zhong et al\., 2022](https://arxiv.org/html/2611.33557#bib.bib5)\)\. The round\-trip accuracy is calculated by running a forward synthesis prediction model on the predicted reactants of the retrosynthesis model and computing the rate at which the original input product is recovered\. We use the forward prediction model of R\-Smiles, which achieves a top\-1 accuracy of 91% on the USPTO\-50K dataset\. However, we note that the accuracy of the forward model is likely lower for retrosynthesis predictions due to the lack of reagent predictions in the retrosynthesis benchmark, which are generally included as input to the forward model\. Due to the lack of reagent information amongst retrosynthesis models, the forward model must make assumptions about reagents used, possibly reducing the performance of the model when applied to the outputs of present retrosynthesis models\.

The top\-k round\-trip accuracy results are presented in table[3](https://arxiv.org/html/2611.33557#A1.T3)\. These scores support the conclusions obtained from the ground\-truth top\-k accuracy presented in table[1](https://arxiv.org/html/2611.33557#S5.T1): DiffER2PG\+ consistently obtains the highest accuracy scores among the proposed models, significantly improving upon DiffER fork=5k=5andk=10k=10\. Furthermore, DiffER2PG\+ maintains the best top\-1 accuracy among the tested models, though the round\-trip accuracies fork=1k=1differ only slightly\. Notably, the difference in performance between DiffER2and DiffER2PG is significantly greater when analyzing round\-trip accuracy versus ground\-truth accuracy, indicating that the output distribution obtained using SMILES\-adapted particle guidance sampling maintains not only improves output diversity but also predicts quality reactions\. These results further support the conclusion that the proposed DiffER2changes significantly improve the output diversity and efficacy of diffusion models for template\-free retrosynthesis prediction\.

### A\.6Reaction Type Performance

Table 4:Top\-K accuracy metrics by reaction type for the DiffER2PG\+ ensemble\. Support indicates the number of reactions of the associated type in the test set\.Table[4](https://arxiv.org/html/2611.33557#A1.T4)reports the results of the DiffER2PG\+ ensemble across reaction types as determined by Schneider et al\.[Schneider et al\. \(2016\)](https://arxiv.org/html/2611.33557#bib.bib66)\. Notably, the performance of the ensemble model is inconsistent across reaction types\. This has been similarly observed in other literature[Chen et al\. \(2023\)](https://arxiv.org/html/2611.33557#bib.bib20);[Current et al\. \(2024\)](https://arxiv.org/html/2611.33557#bib.bib39), and is an unsurprising result due to the differing degree of structural changes across different reaction types\. The performance of the ensemble model for is lowest for heterocycle formation, functional group interconversion, and C\-C bond formation\. While all three reaction types exhibit low top\-1 accuracy \(<40%<40\\%\), functional group interconversion and C\-C bond formation are able to achieve moderately strong results \(\>75%\>75\\%\) for top\-10 accuracy, a significant increase in performance\. This suggests that the models are capable of learning reaction patterns associated with these reaction types, but may be unable to discern when they are appropriate to be used without additional guidance\. In contrast, heterocycle formation still achieves limited performance \(∼65%\\sim 65\\%accuracy\) fork=10k=10, indicating that the reaction patterns of heterocycle formation may be less understood by the diffusion models\.

In all three cases, much of the difficulty in predicting patented reactions may be attributed to ambiguity in the goals of the single\-step retrosynthesis task\. Unlike multi\-step retrosynthetic planning, which aims to produce a reaction pathway from a core set of available reactions, single\-step retrosynthesis models are generally unaware of the availability of reactants\. Furthermore, as exemplified in the case studies later presented in appendix[A\.8](https://arxiv.org/html/2611.33557#A1.SS8), there are multiple possible reactants that could be used to produce the target product, and ambiguity in why one reactant may be preferential over another makes training a capable retrosynthesis model a daunting task\. If we can develop methods to better inform the retrosynthesis model when one reaction may be beneficial over another, we may be better able to construct robust and useful retrosynthesis predictors\.

In contrast to the poor performance of heterocycle formation, functional group interconversion, and C\-C bond formation, all other reactions types achieve strong \(∼90%\\sim 90\\%or greater\) top\-10 accuracy, with some even achieving considerable top\-1 accuracy \(\>70%\>70\\%\)\. Many of these reaction types utilize common or routine reactions: functional group addition, for instance, has extremely low diversity in reactants\. While the target product is different for each sample, the vast majority of functional group additions in the test set are bromination reactions featuring N\-bromosuccinimide as a reactant, a commonly used reagent for its bromine\-donating properties\. This commonality of reactants is also observed in the protections subset\. In contrast, the high\-support acyclation and related processes and heteroatom alkylation and arylation subsets exhibits a wider diversity of reactants, but all with a shared mechanism which is effectively learned by the ensemble models, with the main point of decision being where to "split" the product\. As there are generally few locations where small molecules may be "split" effectively, these reaction subsets will tend toward higher performance, particularly askkincreases\. Overall, reaction types that are learned well by the DiffER2PG\+ tend to have consistent and common reaction patterns with limited possible locations for a reaction center\.

### A\.7Property Coefficient Analysis for DiffER2Models

In this appendix, we offer an analysis of the DiffER2models by regressing model performance with a variety of target reaction properties\. These properties were selected due to the insight they give into the comparable and contrasting capabilities of diffusion and auto\-regressive models on SMILES reactions\. These properties are:

1. 1\.Target Length Difference: the difference in sequence lengthLx−LyL\_\{x\}\-L\_\{y\}between the product SMILES and the target reactant SMILES\. This property was chosen to characterize differing capabilities between diffusion models and auto\-regressive models and can serve as a proxy for the leaving group size\.
2. 2\.Edit Distance: the Levenshtein distance between the product and reactant SMILES\. This property characterizes how sequence similarity between the product and reactant affects performance\.
3. 3\.Ring Adding: If the number of rings in the product is greater than the number of rings in the reactant\. This is indicative of ring formation\. This represents a significant change in molecular and SMILES structure\.
4. 4\.Ring Removing: If the number of rings in the product is less than the number of rings in the reactant\. Oftentimes, this is indicative of a large leaving group containing a ring structure rather than a true ring opening\. This represents a significant change in molecular and SMILES structure\.
5. 5\.Branch Count: the number of branches in the target reactant SMILES\. This is computed as the number of ‘\(’ tokens in the SMILES string\. This represents structural complication in the SMILES string and molecular structure\.

For each property, we report the slope of a line of best fit between the property statistic and the top\-kkaccuracy\. A positive slope indicates that the model tends to perform well when the property statistic is high, and a negative slope indicates worse performance\. In addition, we report the significance of each coefficient compared to the coefficients achieved by Root\-aligned SMILES[Zhong et al\. \(2022\)](https://arxiv.org/html/2611.33557#bib.bib5)to highlight significant differences between auto\-regressive and diffusion models\. This is accomplished by constructing the z\-statisticz=\(βD​i​f​f​E​R−βR​S​m​i​l​e​s\)/S​ED​i​f​f​E​R2\+S​ER​S​m​i​l​e​s2z=\(\\beta\_\{DiffER\}\-\\beta\_\{RSmiles\}\)/\\sqrt\{SE\_\{DiffER\}^\{2\}\+SE\_\{RSmiles\}^\{2\}\}, whereβ\\betais the slope andS​ESEis the standard error[Clogg et al\. \(1995\)](https://arxiv.org/html/2611.33557#bib.bib62)\. These results are reported for the DiffER2ensemble and the continuous\-time C\-DiffER and C\-DiffER20models in table[5](https://arxiv.org/html/2611.33557#A1.T5), with a visualization of the best fit lines for each property provided in figure[5](https://arxiv.org/html/2611.33557#A1.F5)\.

Table 5:Coefficients between reaction properties and performance metrics for the DiffER2ensemble and the C\-DiffER model\. The value in parenthesis indicates the change in coefficient compared to coefficients obtained using R\-Smiles[Zhong et al\. \(2022\)](https://arxiv.org/html/2611.33557#bib.bib5)\. Values that are significantly different from00areunderlinedat the95%95\\%level andboldedat the99%99\\%level\.![Refer to caption](https://arxiv.org/html/2611.33557v1/images/lines.png)Figure 5:Lines of best fit between model performance and reactant properties for the DiffER2PG\+ and R\-SMILES[Zhong et al\. \(2022\)](https://arxiv.org/html/2611.33557#bib.bib5)models\.Table[5](https://arxiv.org/html/2611.33557#A1.T5)reports the slope coefficients, significance, and difference in coefficient values compared to R\-SMILES for each property for each of the DiffER2models as well as the C\-DiffER models\. Figure[5](https://arxiv.org/html/2611.33557#A1.F5)offers a visualization of the lines of best fit fork=1k=1,k=3k=3, andk=10k=10performance conditioned on each of the analyzed properties\. The results fork=3k=3andk=10k=10support the same conclusions discussed in the main text fork=1k=1, primarily that:

1. 1\.Diffusion models with length prediction are significantly more capable at predicting ground\-truth reactions with larger increases in reactant SMILES length from the product SMILES compared to auto\-regressive methods;
2. 2\.Diffusion ensembles are significantly more capable at predicting ring\-removing reactions compared to auto\-regressive methods, but struggle to predict ring\-adding reactions;
3. 3\.Both diffusion models and auto\-regressive models are negatively impacted by an increased edit distance between product and reactant SMILES as well as an increased branch count in the target reactant\.

Notably, however, many of the observed performance differences between R\-SMILES and the DiffER2models become more significant at largerkk, indicating that the trends observed atk=1k=1remain consistent across when more unique molecules are generated by the models\. Furthermore, this highlights the capability for both model archetypes to predict common reaction rules that are likely to be used with high probability, resulting ink=1k=1distributions that perform more similarly than the more diversek=10k=10molecule sets\.

One interesting difference between DiffER2PG\+ and R\-SMILES that becomes more significant atk=10k=10is the effect of branch count on model performance\. While DiffER2PG\+ has higher slope for all values ofkk, the difference is only significant fork=10k=10, as shown in Table[5](https://arxiv.org/html/2611.33557#A1.T5)\. This difference in performance however is better observed in Figure[5](https://arxiv.org/html/2611.33557#A1.F5), which also shows the difference in bias between DiffER2PG\+ and R\-SMILES\. Notably, when the branch count is low, R\-SMILES performs slightly better than DiffER2PG\+, indicating the auto\-regressive model may be stronger when the reactant SMILES has a highly sequential nature\. However, as the number of branch terms in the reactant SMILES increases, the non\-auto\-regressive diffusion ensembles begin to exhibit stronger performance\. This suggests that the diffusion models may be slightly more capable of generating SMILES sequences with non\-sequential properties compared to state\-of\-the\-art auto\-regressive models\.

### A\.8Case Study

Table 6:Case Studies\. From left to right: the source product, the ground\-truth reactant\(s\), and the top\-3 predicted reactant\(s\) for the DiffER2PG\+ ensemble\. Red highlighting in the source molecule indicates the ground truth change\. Red highlighting in the true and predicted reactant\(s\) indicates differences between the source product and the reactants\.Case 1: Nitro Reduction to Aniline![[Uncaptioned image]](https://arxiv.org/html/2611.33557v1/images/case3.jpg)Case 2: Carbonyl Reduction to Alcohol![[Uncaptioned image]](https://arxiv.org/html/2611.33557v1/images/case4.jpg)Case 3: Deprotection using Methoxymethyl Ether![[Uncaptioned image]](https://arxiv.org/html/2611.33557v1/images/case2.jpg)In this section, we present three additional case studies on the DiffER2PG\+ ensemble\. These reactions were selected to demonstrate the strengths and weakness of the ensemble\. Table[6](https://arxiv.org/html/2611.33557#A1.T6)displays the source product, target reactant\(s\), and top\-3 reactant\(s\) predicted by the DiffER2PG\+ ensemble\.

##### Case 1: Nitro Reduction to Aniline\.

Case 1 presents a reduction of a nitro group \(O=N\-O\-\) to a primary aromatic amine \(NH2\)\. This is a common reaction that is generally achieved through metal catalyzed reduction of the nitro group, often using Pd, Zn, Fe, or Ni\. This same reaction is the most commonly predicted reaction by the ensemble model, encompassing 78\.7% of all generated reactions\. Instead of the nitro reduction, the second and third ranked reactions both take the form of an N\-dealkylation to form a secondary amine\. The rank 2 reaction is a proposed desterification in which the tert\-butyl ester is reacted with a strong base such as NaOH to form an intermediate carboxylic acid and subsequently heated to decarboxylize, resulting in the target product\. This is a viable alternative to the target reaction\. The rank 3 reaction may be accomplished by Pt\-catalyzed reaction with O2or by acid hydrolysis with hydrobromic or hydroiodic acid[Najmi et al\. \(2022\)](https://arxiv.org/html/2611.33557#bib.bib63)\. This reaction is also a viable alternative to the target reaction\. Each of the top\-3 reactions proposed by the ensemble is a viable way to synthesize the desired product\. Reactions may be limited by the availability of the generated reactant\(s\)\.

##### Case 2: Carbonyl Reduction to Alcohol\.

Case 2 presents a common carbonyl reduction to an alcohol, in which a carbonyl group \(C=O\) is reacted with LiAlH4or NaBH4to form an alcohol \(C\-OH\)\. This reaction is the third\-most popular reaction produced by the ensemble model, appearing 15\.3% of the time\. In contrast to the target reaction, The proposed rank 1 and rank 2 reactions add larger structural changes to core molecule, and may be reactions that could have been used during prior synthesis of the ground truth reactant\. The rank 1 reaction is an aldehyde reaction with a Grignard reagent\. This is a common and viable method to produce the product molecule\. The rank 2 reaction is a proposed Suzuki cross\-coupling, in which a boronic ester \(R1\-B\(OR\)2\) is reacted with an organohalide \(R2\-X\) using a Palladium catalyst in the presence of a base to produce the target product \(R1\-R2\)\. The Suzuki coupling may also be a viable alternative to the ground truth reaction\. Like case 1, each of the top\-3 reactants may be suitable methods to synthesize the desired product, limited primarily by the availability of reactants\.

##### Case 3: Deprotection using Methoxymethyl Ether\.

Finally, case 3 presents a deprotection reaction in which a Methoxymethyl ether is removed via a silica\-supported sodium hydrogen sulfate catalyst in dichloromethane solution[Ramesh et al\. \(2003\)](https://arxiv.org/html/2611.33557#bib.bib65)\. Unfortunately, this reaction is not one of the top\-3 reactions predicted by the ensemble, instead being produced at rank 7\. The rank 1 prediction of the ensemble is a hydrolysis reaction in which a ketone is reduced to an alcohol, and is generally considered a common and trivial reaction\. The rank 2 reaction is also a deprotection reaction involving a benzyl ether, which is removed using a metal catalyst in a hydrogen atmosphere\. This is also a common and trivial reaction\. Finally, the rank 3 predicted reaction is a acidic cleavage of a methyl ester\. However, because this reaction is often done in an acidic environment, the presence of a ester group in the product/reactant may lead to unwanted byproducts\. This reaction is non\-trivial and is likely suboptimal compared to the rank 1, rank 2, and ground\-truth reactions\.

These case studies demonstrate both the effectiveness and pitfalls of the DiffER2PG\+ ensemble\. As evidenced in all cases, the diffusion ensemble is capable of learning many common reaction patterns, but struggles to predict the ground\-truth when many possible alternatives are present\. While the reactions proposed by the DiffER2ensembles will generally produce the target, the model does not necessarily account for the availability of reactants or for the possible formation of side products, which may limit the models effectiveness\. Furthermore, as evidenced by cases 2 and 3, it is not always clear what type of reaction is being desired: the model may be prone to larger structural changes \(such as the top\-2 reactants of case 2\) over smaller changes that are necessary for preparing the molecule for future synthesis steps, such as protections, deprotections, and reductions\. Moreover, the model may be biased toward reaction patterns that result in "easier" structural changes of the molecule, such as the top\-2 reactions in the main case study \(Figure[3](https://arxiv.org/html/2611.33557#S5.F3)\), in which the ensemble prefers reactants in which two structures are “added” together over the more “advanced” ring\-forming reaction\. Nevertheless, for each product in the case studies, DiffER2PG\+ does generate the target reactant\(s\) within the top\-10 predictions, and in many cases provides viable alternate reactions\. These case studies demonstrate that the diffusion ensemble is capable of learning effective reaction processes\.

### A\.9Performance Analysis with Molecular Fingerprints

Morgan fingerprints[Morgan \(1965\)](https://arxiv.org/html/2611.33557#bib.bib67)are a commonly used methodology for constructing feature vectors from molecule structures\. The core of the method is built around substructure matching: each feature vector is a set number of bits, which each bit in the feature indicating whether or not a specific substructure is present in the molecule\. These substructures capture the environment of atoms in a set radius and are generated using a hashing algorithm provided by the original authors[Morgan \(1965\)](https://arxiv.org/html/2611.33557#bib.bib67)\. Because Morgan fingerprints capture many important characteristics of a molecule structure, we aim to investigate how the performance of the DiffER2models may be impacted by the presence of specific fingerprints in the target reactant\(s\), which could highlight specific substructures the ensembles may be biased against\. Additionally, we note that because Morgan fingerprints are constructed using a hashing function, Morgan bits are not necessarily unique indicators, as multiple substructures may map to a single index\. However, they are still a useful tool for visualizing how performance relates to particular substructures\.

We generate Morgan fingerprints with 2048 bits and a radius of 2 for the target reactants and analyze the correlation between the top\-10 performance of the DiffER2PG\+ model and each bit in the generated fingerprint\. We visualize the Morgan bits that have the most positive correlation with model performance as well as the Morgan bits that have the most negative correlation with model performance\. All analyzed correlations are statistically significant at the99%99\\%\(p<0\.01p<0\.01\) level\. Visuals are produced by randomly selecting a reactant from the test set that has the associated fingerprint bit and visualizing the atom and neighborhood that produced the positive bit value\. Atoms highlighted blue represent the central atom, while atoms highlighted yellow represent atoms in an aromatic ring\. Atoms with gray highlights are in aliphatic rings\.

![Refer to caption](https://arxiv.org/html/2611.33557v1/images/top_10_fingerprints.jpg)Figure 6:The 10 Morgan fingerprints with the highest positive correlation to Top\-10 accuracy for the DiffER2PG\+ ensemble\. "r" is the correlation value and "N" is the number of reactants in the test set that have the corresponding fingerprint\. All correlations are statistically significant \(p<0\.01p<0\.01\)\.Figure[6](https://arxiv.org/html/2611.33557#A1.F6)visualizes the Morgan fingerprints that have the most positive correlation with model performance fork=10k=10\. These bits tend to be substructures with well\-known and highly utilized reaction mechanisms and reactivity rules\. For instance, fingerprintA1has the highest correlation with model performance, and represents an aliphatic secondary amine\. Reactions with aliphatic secondary amines are well known and highly studied in organic synthesis, appearing in∼25%\\sim 25\\%of the test set\. These reactions are commonly alyklation reactions, in which the amine is reacted with an alkyl halide to form new bonds and larger structures\. Many fingerprints containing amines also exhibit positive correlation with model performance \(A3,B2,B4,B5\)\. Other notable fingerprints with positive correlation include: aryl halides \(A2\), which are commonly used in substitution reactions and as directing groups; carboxylic acids \(A5\) and alcohols \(B3\), two of the most studied functional groups in organic chemistry; halides \(B3\); and sulfonyl chlorides \(A4\), all of which are commonly used groups in organic synthesis\.

![Refer to caption](https://arxiv.org/html/2611.33557v1/images/bottom_10_fingerprints.jpg)Figure 7:The 10 Morgan fingerprints with the highest negative correlation to Top\-10 accuracy for the DiffER2PG\+ ensemble\. "r" is the correlation value and "N" is the number of reactants in the test set that have the corresponding fingerprint\. All correlations are statistically significant \(p<0\.01p<0\.01\)\.In contrast, fingerprints that have significant negative correlation with model performance tend to be rarer, have ambiguity in the reaction, or introduce complexity in the SMILES sequence structure\. Figure[7](https://arxiv.org/html/2611.33557#A1.F7)visualizes the Morgan fingerprints that have the most negative correlation with model performance fork=10k=10\. Many of these structures have a large number of branches or structural complexity \(C3,C5,D2,D3,D4,D5\), requiring SMILES structures with high non\-sequential behavior\. Many of these fingerprints may also require SMILES strings which detail stereochemistry of the molecule \(D1,D2\), further compounding the complexity of the SMILES string\. In other cases, the fingerprint may require complexity in the SMILES string, but rather may represent ambiguity in the reactant\. This is likely the case withC2, which represents a halide in the form of iodine\. For many reactions, the explicit halide used may be interchangeable between Cl, Br, and I, as many chemical properties are shared between the three halogens with only subtle differences in reactivity and stability\. A similar ambiguity may explainC4\. Many reactions with alkenes result in the elimination of the C=C bond and the addition of new functional groups\. To "reverse" this reaction, the retrosynthesis model would be have to identify a specific C\-C bond as the reaction center\. Because C\-C bonds are extremely common, the model may have difficulty choosing these bonds as reaction centers, opting instead to target groups that are more commonly used in reactions\. This behavior is readily observed in Appendix[A\.6](https://arxiv.org/html/2611.33557#A1.SS6), Table[4](https://arxiv.org/html/2611.33557#A1.T4), which shows that the DiffER2PG\+ ensemble exhibits a reduced capability to predict reactions which form C\-C bonds\.

### A\.10Attention Map Analysis

Our final results are an analysis of the attention maps for a single continuous\-time diffusion model with full sequence padding \(C\-DiffER\)\. This model was used to better understand how the attention of the model changes throughout the diffusion process without the bias of a length\-prediction component as described in Section[3\.2](https://arxiv.org/html/2611.33557#S3.SS2)\. We provide visualizations of the attention maps for both the self attention and attention on the input product for each layer in the transformer model fort=0\.5t=0\.5\. Additionally, we map the attention on specific atoms in the SMILES sequences to the atoms they represent in the input and output molecular structures\.

Figures[8](https://arxiv.org/html/2611.33557#A1.F8)and[9](https://arxiv.org/html/2611.33557#A1.F9)show the attention maps for layers 1, 2, 3 and 4, 5, 6, respectively for a amine alkylation reaction\. This reaction reacts an alkyl halide with an amine and is successfully produced as a top\-1 reactant by the C\-DiffER model\. These attention maps demonstrate how the construction of the SMILES sequence differs from auto\-regressive methods\. Rather than building the sequence from the beginning, the attention maps suggest that the diffusion model works backward, attending to the full\-length sequence initially and decreasing the attended sequence length as the model goes deeper\. This helps explain why the diffusion models may have a stronger affinity for generating reactants with a larger change in sequence length over the product SMILES: unlike auto\-regressive models, which may be likely to predict a STOP token earlier in the sequence, diffusion models attend to the maximum possible sequence at each step in the diffusion process, allowing for the full sequence to be predicted over during each estimate ofx0x\_\{0\}\. As the iteration number increases, the diffusion model becomes more confident in its output of padding tokens at later timesteps, attending to those positions less after the first couple layers\.

In the early self attention layers, the diffusion model appears to try and understand the general structure of the SMILES string, estimating the level of noise and confidence in the inputxtx\_\{t\}\. This can be observed in the way sequence attention is spread across the entire sequence for each token rather than focused on tokens with similar locality\. After the first layer, the self attention mechanism places much more emphasis on nearby positions, but still attends very little to each tokens’ own position, indicating that the model is not confident in the fidelity of a one\-to\-one input mapping betweenxtx\_\{t\}andxsx\_\{s\}\. Interestingly, in the final self attention layer, significant attention is placed around the reaction centers in the generated reactants\. Source attention layers tend to place attention near non\-carbon atoms in the target product early on, expanding to carbon atoms only in the later layers\. While this may simply be an indication that these atoms are "unique" in the molecule compared to the carbon atoms, they may also be used as "anchors" to build the generated reactant\(s\) around\. This could also explain why the models struggle to predict C\-C bond formation reactions, as it would require the model to identify a common C\-C bond as a reaction center, which may not have any significant uniqueness compared to other structures in the product molecule\.

Another interesting feature of note is the repetitive attention patterns the predicted padding tokens place on the end of the product SMILES, notable in layers 2 and 3\. Rather than the padding tokens placing attention on a single end token, the attention is stratified in a diagonal formation in groups of 10\-12 tokens, attending primarily to the last 10\-12 tokens of the product SMILES\. This pattern is also observed in attention maps for other reactions, suggesting consistency in this behavior, which fades in the last couple layers\. Repetition is a common phenomena also observed in large language models, which may repeat during inference time\. The model only begins to reduce attention on later timesteps after this repetition begins, suggesting that it may use the repetition to "detect" padding locations\. In the final layers of the transformer, attention on the source sequence is rather sparse and closely matches the attention maps observed by R\-SMILES[Zhong et al\. \(2022\)](https://arxiv.org/html/2611.33557#bib.bib5), with the attention patterns "matching" tokens between the input and output SMILES\.

The attention map analysis offers some insight into the workings of the diffusion models, and may help inform future model creation\. While we offer some theories behind the meaning of these attention maps as it relations to SMILES generation for chemical retrosynthesis, significantly more investigation and experimentation needs to be done before our theories can be confirmed\. We hope these attention maps provide some insight into the capabilities and methods of transformer diffusion models and promote further research into the explainability of transformer diffusion models\.

![Refer to caption](https://arxiv.org/html/2611.33557v1/images/attention_maps_0.png)Figure 8:C\-DiffER attention maps for layers 1, 2, and 3 on a reaction from the test set halfway through sampling,t=0\.5t=0\.5\. From left to right: attention on the input product SMILESy0y\_\{0\}, attention on the noisy samplextx\_\{t\}, attention mapped to the input product molecule, and attention mapped to the final predicted output molecule\.![Refer to caption](https://arxiv.org/html/2611.33557v1/images/attention_maps_1.png)Figure 9:C\-DiffER attention maps for layers 4, 5, and 6 on a reaction from the test set halfway through sampling,t=0\.5t=0\.5\. From left to right: attention on the input product SMILESy0y\_\{0\}, attention on the noisy samplextx\_\{t\}, attention mapped to the input product molecule, and attention mapped to the final predicted output molecule\.

相似文章

通过口袋条件扩散和属性感知优化生成可开发的3D分子

arXiv cs.LG

本文介绍了一种新颖的基于扩散的生成模型,用于基于结构的药物设计。该模型解耦了口袋和配体的表示学习,并融入了多尺度相互作用信号和属性感知优化,以生成具有更强结合亲和力和更优ADMET属性的可开发3D分子。

分类器引导的用于小分子生成的潜在扩散模型

arXiv cs.LG

该论文提出了一种由分类器引导的潜空间扩散流程,用于以性质为导向的小分子生成。该流程使用冻结的 ChemBERTa 编码器、用于 SELFIES 重构的 Transformer 解码器,以及可微分的性质预测器,引导采样朝向血脑屏障(BBB)通透性和 BACE-1 抑制活性等药物相关终点。

eDMD:面向少步扩散蒸馏的端点分布匹配

Hugging Face Daily Papers

eDMD 提出端点分布匹配蒸馏(Endpoint Distribution Matching Distillation),仅在学生的最终输出上训练一个共享的 fake 模型,并加入精确的教师监督,从而在 SD3-Medium、FLUX.2-klein 和 Qwen-Image-2.1 上实现了更好的 4 步扩散蒸馏效果。

PairIT:用于低数据量分子优化的自回归 Transformer

arXiv cs.LG

Genentech/Prescient Design 推出 PairIT,这是一种面向 SMILES 序列自回归 Transformer 的训练框架,通过学习结构相似的分子对,在数据稀缺场景下以种子分子为起点进行分子优化,并利用提示词元实现多属性控制,还可选择进行强化学习后训练。