Manuscript Offprint
arXiv:2610.12067MAST: Motif-Augmented Diffusion with Search Tree for Spectroscopic Molecular Structure Elucidation
Abstract
Elucidating molecular structures from spectra is a foundational problem in chemical and materials characterization, yet remains challenging due to spectral ambiguity and the vast molecular space. Although recent diffusion-based generators show strong promise for spectra-conditioned elucidation, existing methods struggle to learn robust spectra-structure relationships from limited paired data when relying solely on global spectral representation. Moreover, the repeated full sampling inference strategy incurs substantial computation overhead. To address these limitations, we propose MAST, a Motif-Augmented diffusion framework with Search Tree, for joint 2D-3D spectroscopic molecular structure elucidation. MAST introduces explicit, interpretable motif priors as intermediate evidences throughout denoising, reducing conditional ambiguity and facilitating spectra-conditioned optimization. We further cast diffusion sampling as reward-guided tree search to prioritize high-reward denoising trajectories, yielding a compact set of spectra-consistent candidates under limited budgets. On the QM9S multi-spectra benchmark, MAST achieves 94.89% exact recovery and improves 3D fidelity, while preserving high chemical validity and stability. Code is available at https://github.com/Jia040223/MAST.
1. Introduction
Molecular structure elucidation is a long-standing and central problem in chemical and materials characterization, which underpins a wide range of applications, including unknown identification, metabolome annotation, natural-product discovery, and impurity/degradant analysis in drug development (Görög, 2006; Dunn et al., 2013; Coates et al., 2000). Spectra (e.g., Raman, IR and UV-Vis) provide indirect yet informative fingerprints of local chemical environments and bonding patterns, enabling inference of underlying molecular structures. However, molecular elucidation remains underexplored due to the inherently challenging one-to-many problem: distinct molecular structures may exhibit very similar spectral signatures. In practice, common spectral-to-structure workflows still rely heavily on spectral library search, expert interpretation, and iterative experimental validation, which limits automation and scalability.
Recent years have witnessed notable attempts for this problem. Early automation largely relied on spectral library matching and rule-driven structure elucidation pipelines, which generate candidate structures and prune them using spectral constraints and heuristic rules. With the growth of data scale and learning capacity, model-based approaches were adopted to predict interpretable intermediate cues (e.g., functional groups) from spectra to facilitate downstream reasoning (Fine et al., 2020; Enders et al., 2021). More recently, end-to-end methods made significant progress by directly mapping spectra to molecular representations (SMILES or graphs) through conditional generative frameworks—most notably diffusion models (Alberts et al., 2024; Kanakala et al., 2024; Wang et al., 2025b).
Despite high potential for spectra-conditioned structure generation, current methods still face crucial limitations. First, most end-to-end methods condition generation on a single global spectral representation (Alberts et al., 2024; Wang et al., 2025b), which can hardly convey sufficient, discriminative, and chemically meaningful cues. Moreover, it leaves the generator to implicitly recover fine-grained chemical evidence from this compressed representation, making robust spectra-conditioned generation difficult, especially when paired spectra–structure data is limited. Second, current inference methods, which rely on repeated full-chain sampling followed by post hoc selection (Cheng et al., 2024; Wang et al., 2025b; Alberts et al., 2025), is computationally expensive and difficult to control. As illustrated in Figure 1, it may repeatedly explore similar trajectories, and even when early intermediates deviate, the entire denoising chain is still
State Key Laboratory of AI Safety, Institute of Computing Technology, Chinese Academy of Sciences, China University of Chinese Academy of Sciences, China. Correspondence to: Hong Chang changhong@ict.ac.cn.
Proceedings of the International Conference on Machine Learning, Seoul, South Korea. PMLR 306, 2026. Copyright 2026 by the author(s).
A

B
(a) Repeated Sampling
(b) MCTS-Diffusion

Figure 1. (A) Motif priors provide interpretable local evidence to filter mismatched candidates and sharpen spectra-consistent generation. (B) Repeated sampling explores full reverse-diffusion trajectories, wasting computation on redundant paths and low-consistency prefixes; MCTS-Diffusion performs checkpointed search, expands high-reward intermediates, and prunes low-value branches early.
executed. Third, existing works mainly focus on 1D and 2D molecular elucidation, whereas 3D structure is more crucial for many downstream applications. Since 3D recovery is inherently harder due to more complex spectra-geometry relationships and vastly larger search space, direct predicting 3D geometry from spectra remains comparatively scarce.
To address all these limitations, we propose MAST (Motif-Augmented diffusion with Search Tree), a framework for joint 2D-3D molecular elucidation from spectra by leveraging motif-augmented diffusion with tree-search. Specifically, we learn a probabilistic spectra-to-motif prior that externalizes implicit spectral cues into interpretable, composable discrete evidence, and inject this evidence throughout joint denoising process to shrink the effective hypothesis space. On the inference side, we cast reverse diffusion as a segmented decision process with checkpoints, and introduce a Monte Carlo Tree Search (MCTS) mechanism to adaptively allocate computation between exploration and exploitation—expanding high-reward intermediates while pruning low-value branches early. Finally, we incorporate differentiable conditional guidance at the segment level to adaptively tune guidance strength, thereby improving spectral consistency while preserving the diffusion prior.
Empirically, we conduct comprehensive evaluations on the QM9S (Zou et al., 2023) benchmark. MAST achieves state-of-the-art performance, delivering substantially improved exact recovery while maintaining high chemical validity and stability. Further experiments highlight that the probabilistic motif prior is a key contributor. Moreover, MCTS-guided tree search over diffusion markedly boosts exact recovery under the same denoising-step budget.
In summary, our contributions are as follows:
-
We propose MAST, a motif-augmented diffusion framework for spectroscopic molecular elucidation, with an explicit spectra-to-motif prior as interpretable intermediate evidence.
-
We propose an MCTS-guided diffusion inference algorithm for molecular generation that searches denoising trajectories with segment-wise adaptive guidance.
-
We demonstrate that MAST achieves state-of-the-art performance on QM9S in Top-1 recovery, and that MCTS-guided inference enables test-time scaling to improve spectra-consistent recovery under limited sampling budgets without retraining or fine-tuning.
Diffusion-based molecular modeling. Diffusion models generate data via iterative denoising and have become a standard backbone for molecular generation. Early diffusion formulations for molecules include discrete diffusion on 2D graphs, which perturbs and denoises categorical node/edge attributes to enable molecular graph generation.
(Vignac et al., 2022; Huang et al., 2023a; Vignac et al., 2022; Liu et al., 2024). In 3D molecular modeling, SE(3)/E(3)-equivariant diffusion provides a principled way to generate or refine coordinates while respecting Euclidean symmetries (Hoogeboom et al., 2022; Xu et al., 2022; 2023). Building on these advances, joint 2D–3D diffusion models unify topology and geometry in denoising process, enabling coherent generation of both bond structures and feasible 3D conformations with better performance (Huang et al., 2023b; Hua et al., 2024; Peng et al., 2023; Vignac et al., 2023).
Test-time scaling and guided search. Test-time scaling increases computation at inference to improve outputs without changing model parameters. It has gained significant attention in large language models, including best solution selection (Snell et al., 2024; Wu et al., 2024; Brown et al., 2024), random sampling, self-consistency (Wang et al., 2022) and tree-search methods (Yao et al., 2023; Hao et al., 2023; Zhang et al., 2024; Qi et al., 2024). As a classic tree-search algorithm, MCTS has emerged as a powerful technique for structured exploration in the output space (Yao et al., 2024; Wang et al., 2023; Cheng et al., 2025; Coulom, 2006; Silver et al., 2016; Liu et al., 2025). For diffusion models, guided sampling provides an orthogonal way to steer conditional generation, including classifier guidance and classifier-free guidance (Dhariwal & Nichol, 2021; Ho & Salimans, 2022). Inspired by these advances, we combine MCTS and diffusion guidance, significantly improving spectra-consistent generation under limited budgets.
3. Preliminaries
3.1. Task Definition
Let denote a set of observed spectra from modalities, where is a 1D signal sampled on a fixed grid for -th modality (e.g., IR, Raman, UV, NMR). A molecule is represented by a joint 2D–3D structure
where denotes the 3D Cartesian coordinates, denotes atom-level attributes (node features), and denotes bond-level attributes (edge features), which together define the molecular graph and its 3D conformation. We aim to learn a conditional generative model from paired spectra–structure data to capture the inherently one-to-many mapping from spectra to molecular structures.
3.2. Diffusion Models
Diffusion models construct a forward noising process that gradually perturbs data until the marginal distribution approaches a tractable prior, and then learn to reverse this process to generate new samples (Sohl-Dickstein et al., 2015; Ho et al., 2020; Song et al., 2020; Kingma et al., 2021). Let denote a clean data representation, and denote those in the forward process at different noise levels . A common choice is a Gaussian forward marginal:
where are time-dependent differentiable functions. They are typically chosen so that the terminal marginal at satisfies .
The reverse-time generative dynamics can be described by a stochastic differential equation whose drift depends on the gradient (score) (Song et al., 2020):
where is standard Wiener process and are coefficients determined by chosen schedule. The score is usually approximated by a neural network, trained with mean squared error objectives (Ho et al., 2020; Song et al., 2020).
4. Method
In this section, we introduce the framework of MAST, as shown in Figure 2. Section 4.1 introduces spectra-derived conditioning evidence, including a global embedding and an interpretable motif prior. Section 4.2 describes the motif-augmented joint 2D–3D diffusion model, which is then reformulated as a diffusion tree. Section 4.3 presents a Monte Carlo Tree Search (MCTS) based inference strategy on the diffusion tree to efficiently identify spectra-consistent structures under limited sampling budgets.
4.1. Conditioning Evidence from Spectra
Global spectral embedding. We encode multi-modal spectra using a patch-based Transformer encoder and obtain a global conditioning vector . Patchification enables the encoder to model the local spectral patterns (e.g., nearby peak shapes), while self-attention over concatenated multi-modal patches captures long-range dependencies and cross-modal relationships at the molecule level. To avoid overfitting to paired spectra–structure supervision, we initialize self-supervisedly via masked patch reconstruction by optimizing , and then finetune it jointly with the diffusion denoiser.
Interpretable motif prior. Spectra-to-structure inversion is intrinsically underdetermined and a single global spectral embedding is often insufficient to capture the hierarchical mapping from spectra to local chemical environments and then to molecular structure, leaving the model to search in an extremely large molecules space (approximately (Polishchuk et al., 2013)). To get out of this dilemma, we intro-
A
Spectral Evidence → Conditioning
Spectra Encoder

Motif Predictor

B
MCTS-Diffusion over
Denoising Process
cond c

Forward Process
(1) Selection
(2) Expansion
(3) Evaluation
(4) Backpropagation

Figure 2. Overview of MAST. (A) Spectral evidence. Multi-spectra encoding produces global context and a motif prior , yielding . (B) Motif-augmented diffusion as a tree. Conditioned on c, joint 2D–3D diffusion samples the molecular state ; reverse denoising induces a branching sampling tree of plausible trajectories. (C) Reward-guided tree search. Under a limited sampling budget, MCTS prioritizes branches that better match the spectra and the motif evidence.
duce an interpretable motif prior that provides motif-level evidence to complement the global embedding.
We construct a vocabulary with frequent and chemically meaningful motifs. Crucially, this vocabulary covers not only coarse functional group, but a broader set of reusable local motifs, including functional groups and heteroatom-centered local environments, as well as short carbon skeleton fragments, ring systems and common connectivity patterns (see Appendix B for details).
To this end, we train a multi-label predictor to map spectra to motif presence probabilities. Formally, given a molecule M, we define a multi-hot motif label:
The motif presence probability is then computed as:
with the element-wise sigmoid function. is optimized by a weighted binary cross-entropy (BCE) loss:
The resulting is compositional and interpretable: it provides a calibrated, motif-level evidence profile inferred from spectra. During generation, we encode as an additional condition and inject it throughout the denoising process, so that the molecular structure could be steered by motif-level evidence, rather than global representation only.
4.2. Motif-Augmented Diffusion
We model molecules with a joint diffusion state and learn a conditional denoiser that estimates the reverse diffusion dynamics based on spectral evidence.
Spectra-conditioned joint denoiser. We learn an SE(3)-equivariant (w.r.t. 3D rotations and translations) denoiser that jointly refines geometry X and graph attributes along the reverse diffusion trajectory. We condition denoising on the evidence obtained from Section 4.1:
where summarizes global spectral context and provides interpretable motif-level evidence. At each time step , the denoiser predicts the clean state based on condition and the current noise state :
Herein, the condition c is injected at every denoising layer via adaptive normalization: it is mapped to layer-wise modulation parameters for node/edge representations. In this way, both global context and motif evidence shape the intermediate message-passing throughout denoising.
Training objective. We adopt a variance-preserving diffusion process and train in the data-prediction regime (Ho et al., 2020). We sample , obtain by noising , and minimize a weighted reconstruction loss over geometry and topology:
where , , and control the relative contributions of the geometry and node/edge-attribute reconstruction.
Checkpointed reverse sampling tree. The conditional denoiser in Eq. (8), together with a reverse-time sampling algorithm, induces a stochastic reverse-time sampling process for the state under spectral evidence . Under the same evidence , this stochastic reverse process can realize multiple plausible trajectories, depending on the stochasticity of the sampler and other controllable degrees of freedom. To explicitly represent this trajectory-level variability without modifying the underlying diffusion model, we discretize the reverse sampling process into several checkpoints and reformulate it as a tree.
We choose checkpoints , which define the levels of the reverse sampling tree. Each node at depth corresponds to a sampled checkpoint state . We define a segment transition as a block of reverse-time sampling that updates the checkpoint state to . For each segment, branching arises because of the sampling stochasticity and sampler configurations (e.g. noise trajectory and guidance scale), which we package into an action . Given an action , the segment transition from to is deterministic:
where is the segment update induced by denoiser under action . Therefore, a full generation corresponds to a root-to-leaf path ending at . This formulation keeps unchanged, while exposing segment-level branching for inference-time tree search.
4.3. Reward-guided Tree Search
Repeated full-trajectory diffusion sampling is computationally expensive, as each candidate requires executing the entire denoising trajectory. We therefore perform Monte Carlo Tree Search (MCTS) over the checkpointed reverse sampling tree defined above, prioritizing high-reward prefixes and allocating computation to the most promising branches. Spectra-structure reward model. To guide exploration within the tree, we firstly require a spectra-consistency reward for scoring rollouts. Formally, we embed spectra S and molecules M into a shared space:
and define the alignment score by cosine similarity
This score serves two roles in our framework: (i) it provides a scalar reward for ranking candidate trajectories during tree search, and (ii) it provides a differentiable signal for within-segment gradient guidance.
We apply MCTS to the checkpointed reverse sampling tree defined in Section 4.2. MCTS iteratively performs selection-expansion-execution-evaluation-backpropagation to balance exploration and exploitation across candidates.
Selection. The selection step starts from the root checkpoint and repeatedly chooses the most promising child to traverse, balancing exploitation of high-value branches and exploration of under-visited branches. Concretely, we compute the upper confidence bound (UCB) for a node u as
where is the visit count of node , denotes its parent node, is the estimated node value, and controls the exploration-exploitation trade-off. We traverse the tree by repeatedly selecting the child with the highest UCB score until reaching a leaf node.
Expansion. After a leaf node at depth with checkpoint latent is selected, we expand it by generating multiple child nodes that correspond to alternative segment-level sampling decisions for the next time interval . Specifically, we expand the node by proposing candidate segment-sampling actions , where each action corresponds to a child node and is parameterized by
with specifying the segment-wise noise realization (Gaussian noise draws), and controlling the guidance magnitude applied throughout this segment. Executing action advances the reverse-time dynamics from to under condition c and yields the i-th child checkpoint latent . Within the segment, at each internal step from t to , we perform clean state prediction
Table 1. Main structure elucidation results on QM9S (Spectra-to-SMILES baselines are quoted from the original papers; DiffSpectra are reproduced by us under the same evaluation protocol).
| Method | Acc@1↑ | MCES↓ | TaniSimMG↑ | CosSimMG↑ | TaniSimMA↑ | FraggleSim↑ | FGSim↑ | RMSD(Å)↓ | MapAcc↑ |
|---|---|---|---|---|---|---|---|---|---|
| spectra-to-SMILES models | |||||||||
| IR-to-Structure-IR (Alberts et al., 2024) | 0.00% | 11.3187 | 0.0718 | 0.1311 | 0.1585 | 0.1747 | 0.3151 | - | - |
| IR-to-Structure-Raman (Alberts et al., 2024) | 0.00% | 11.3516 | 0.0766 | 0.1395 | 0.1639 | 0.1959 | 0.3525 | - | - |
| IR-to-Structure-UV (Alberts et al., 2024) | 0.00% | 11.4240 | 0.0728 | 0.1326 | 0.1512 | 0.1837 | 0.3151 | - | - |
| Spectra2Structure-IR (Kanakala et al., 2024) | 0.19% | 10.1081 | 0.0965 | 0.1695 | 0.2162 | 0.2308 | 0.4383 | - | - |
| Spectra2Structure-Raman (Kanakala et al., 2024) | 0.00% | 9.4164 | 0.1089 | 0.1901 | 0.2388 | 0.2504 | 0.4419 | - | - |
| Spectra2Structure-UV (Kanakala et al., 2024) | 0.00% | 11.1222 | 0.0716 | 0.1313 | 0.1418 | 0.2092 | 0.3901 | - | - |
| SpectraLLM-IR (Su et al.) | 0.55% | 7.5651 | 0.1921 | 0.3120 | 0.4330 | 0.3194 | 0.6599 | - | - |
| SpectraLLM-Raman (Su et al.) | 3.14% | 6.4076 | 0.2500 | 0.3786 | 0.5071 | 0.2500 | 0.7317 | - | - |
| SpectraLLM-UV (Su et al.) | 0.00% | 10.6374 | 0.0790 | 0.1426 | 0.2026 | 0.2100 | 0.3713 | - | - |
| Diffusion Models | |||||||||
| DiffSpectra (2D&3D) (Wang et al., 2025b) | 60.68% | 1.0514 | 0.7630 | 0.8251 | 0.8609 | 0.8959 | 0.9652 | 0.8091 | 83.84% |
| MAST (w/o MCTS) | 79.12% | 0.6296 | 0.8834 | 0.9141 | 0.9596 | 0.9651 | 0.9806 | 0.8020 | 93.83% |
| MAST (w/ MCTS) | 94.89% | 0.1048 | 0.9774 | 0.9827 | 0.9908 | 0.9754 | 0.9935 | 0.7843 | 95.34% |
Table 2. Molecular stability and distribution metrics on QM9S (CDGS and JODO are quoted from the original papers; DiffSpectra are reproduced by us under the same evaluation protocol).
| Method | AtomStable↑ | MolStable↑ | V&U↑ | V&U&N ↑ | FCD↓ | SNN↑ | Frag↑ | Scaf↑ |
|---|---|---|---|---|---|---|---|---|
| CDGS (Huang et al., 2023a) | 99.7% | 95.1% | 93.6% | 89.8% | 0.798 | 0.493 | 0.973 | 0.784 |
| JODO (Huang et al., 2023b) | 99.9% | 98.8% | 96.0% | 89.5% | 0.138 | 0.522 | 0.986 | 0.934 |
| DiffSpectra (Wang et al., 2025b) | 99.9% | 98.6% | 96.8% | 90.5% | 0.088 | 0.489 | 0.983 | 0.906 |
| MAST (w/o MCTS) | 99.8% | 98.1% | 97.2% | 89.1% | 0.896 | 0.997 | 0.984 | |
| MAST (w/ MCTS) | 99.9% | 98.8% | 98.2% | 97.1% | 0.044 | 0.999 | 0.997 |
and decode it to a molecule hypothesis . We then define an alignment-based guidance loss
to compute , and incorporate the guidance by shifting the reverse transition mean before sampling:
where and are the mean and noise standard deviation of the unguided reverse-time sampler update for the step to , is a predefined time-dependent scaling schedule (shared across branches) and provides a branch-specific strength multiplier for the current segment.
Evaluation. Each expanded node is evaluated by a fast rollout that approximates the final sample quality without running the full reverse trajectory to . Given a checkpoint latent , we perform a fast rollout by running the reverse solver for only a few steps to estimate a clean state for evaluation, decode it to a molecule candidate , and compute a composite reward with two terms:
where BCE denotes the binary cross-entropy and is a hyperparameter that controls the trade-off between the spectra–structure alignment and the motif-consistency. If is invalid, we downweight it by a chosen factor .
Backpropagation. After evaluating newly expanded children, we backpropagate their rollout rewards along the traversal path to update the visit counts and node values, so that future selection increasingly favors high-reward prefixes. We use a softmax backup to update the node values, which upweights high-reward rollouts compared to the mean backup, making value propagation more robust to noisy rollouts and improving search efficiency. Given rollout rewards collected at node , we define
where is used for numerical stability in the softmax exponent, is the temperature parameter and is the visit count of the node .
5. Experiments
5.1. Datasets and Experimental Setup
Datasets. We conduct most experiments on QM9S (Zou et al., 2023), an extension of QM9 (Ramakrishnan et al., 2014) with simulated multi-modal spectra (IR, Raman, and UV/Vis). QM9 contains about 134k small molecules with DFT-optimized 3D geometries. We use all three modalities as input and predict joint 2D–3D molecular structure. QM9S is preprocessed as in MolSpectra (Wang et al., 2025a).
Evaluation metrics. For structure elucidation, we report Acc@1, MCES, Morgan fingerprint similarities (TaniSimMG and CosSimMG), MACCS fingerprint similar-
Table 3. Ablation summary on QM9S. Unless otherwise specified, results are obtained with MAST without MCTS.
| Method | Acc@1↑ | MCES↓ | TaniSimMG↑ | CosSimMG↑ | TaniSimMA↑ | FraggleSim↑ | FGSim↑ | RMSD(Å)↓ | MapAcc↑ |
|---|---|---|---|---|---|---|---|---|---|
| (A) Motif prior | |||||||||
| MAST (w/o Motif) | 69.94% | 0.9783 | 0.8275 | 0.8737 | 0.9394 | 0.9601 | 0.9720 | 0.8136 | 90.34% |
| MAST (w/ Motif) | 79.12% | 0.6296 | 0.8834 | 0.9141 | 0.9596 | 0.9651 | 0.9806 | 0.8020 | 93.83% |
| (B) Guidance and MCTS (MAST w/ Motif) | |||||||||
| Guidance-only (fixed γ) | 79.32% | 0.6161 | 0.8864 | 0.9171 | 0.9618 | 0.9681 | 0.9817 | 0.7949 | 93.92% |
| Guidance-only (scheduled γ(t)) | 79.96% | 0.6287 | 0.8838 | 0.9153 | 0.9602 | 0.9678 | 0.9808 | 0.8011 | 93.70% |
| MCTS-guidance | 94.89% | 0.1048 | 0.9774 | 0.9827 | 0.9908 | 0.9754 | 0.9935 | 0.7843 | 95.34% |
Ground Truth



w/o Motif prior

w/ Motif prior
Motif
Figure 3. Motif prior improves exact recovery. Examples comparing ground-truth molecules with samples generated without or with the motif prior. The last row shows predicted motif cues that cannot be recovered unless they are incorporated as priors.
ity (TaniSimMA), fragment and functional-group similarity (FraggleSim and FGSim), and 3D geometry metrics (RMSD and MapAcc), following DiffSpectra (Wang et al., 2025b). Acc@1 is computed by converting the generated molecule object into canonical SMILES and checking exact match with the ground-truth. For RMSD, we allow mirror inversion because the spectra used are enantiomer-invariant. For generative quality, we report stability and distribution metrics including AtomStable, MolStable, V&U, V&U&N (Valid, Unique and Novel) (Huang et al., 2023b), FCD (Preuer et al., 2018), SNN, Frag, and Scaf (Polykovskiy et al., 2020). More details are provided in Appendix D.
Baseline. For structure elucidation, we compare against spectra-to-SMILES models, including IR-to-Structure (Alberts et al., 2024), Spectra2Structure (Kanakala et al., 2024), and LLM-based SpectraLLM (Su et al.), as well as diffusion-based generators such as DiffSpectra (Wang et al., 2025b). For molecular generation quality, we further report molecular diffusion generators including CDGS (Huang et al., 2023a) and JODO (Huang et al., 2023b).
Implementation details. All experiments are conducted on 8 NVIDIA RTX 3090 GPUs. For MCTS-guided tree search, we first follow MolSpectra (Wang et al., 2025a) to train molecule and spectra encoders for guidance and scoring. the UCB exploration coefficient is set to 1.0. For efficiency, we set the total number of denoising steps per sample to at most 3000. We set the tree expansion width to 4 and the temperature for softmax backup . Additional implementation details are provided in Appendix C.
5.2. Benchmarking Molecular Structure Elucidation
Structure elucidation. We benchmark spectra conditioned structure elucidation on QM9S in Table 1. MAST demonstrates strong improvements over spectra-to-SMILES baselines and diffusion generators. Table 1 suggests two key conclusions. First, MAST contributes significantly more to structural resolution under spectral conditions than previous diffusion baseline methods. Without tree search, it improves Top-1 exact recovery (Acc@1) by 30.4 percentage points over the strongest baseline, and consistently achieves higher fingerprint- and fragment-level similarities. Second, tree search further amplifies performance with a frozen generator, reaching 94.89% Acc@1, 0.1048 MCES and higher similarities, while improving 3D fidelity with lower RMSD and higher MapAcc. These gains arise purely at test time, indicating that tree search can prioritize promising prefixes and avoid computation spent on low-consistency samples.
Generative quality. Table 2 summarizes sample stability and distributional fidelity on QM9S. MAST maintains near-perfect AtomStable and MolStable, indicating that improved conditioning and inference-time search do not compromise chemical validity. Tree-search further increases the fraction

(a) Accuracy vs. denoising steps
(b) Reward vs. search depth

(c) Case Study
Figure 4. MCTS-guided diffusion analysis. (a) Exact recovery (%) under increasing denoising budgets. (b) Average spectra–structure reward versus search depth under different tree widths. (c) Visualization of a reward-guided search tree.
Table 4. Quality of motif evidence on QM9S.
| Setting | Motif-P↑ | Motif-R↑ | F1 (samples)↑ | F1 (macro)↑ |
|---|---|---|---|---|
| (A) Spectra-to-motif predictor | ||||
| (predictor) | 0.9563 | 0.9644 | 0.9529 | 0.9361 |
| (B) Motif inclusion in generated molecules | ||||
| Overall (all test cases) | ||||
| w/o Motif (gen) | 0.9595 | 0.9539 | 0.9503 | 0.9087 |
| w/ Motif (gen) | 0.9783 | 0.9699 | 0.9682 | 0.9430 |
| SMILES-mismatch subset (hard cases) | ||||
| w/o Motif (gen) | 0.8600 | 0.8406 | 0.8280 | 0.7376 |
| w/ Motif (gen) | 0.8894 | 0.8462 | 0.8377 | 0.7667 |
of valid, unique, and novel molecules to 97.1%, compared with 90.5% for DiffSpectra. Across distribution metrics, MAST consistently improves over prior diffusion baselines. For example, it achieves markedly lower FCD while improving nearest-neighbor and fragment/scaffold similarities, suggesting that the method preserves the underlying molecular manifold while selecting spectra-consistent samples.
5.3. Analysis: Motif Prior
We examine the effect of introducing an explicit motif prior as intermediate evidence for spectra-conditioned elucidation. Table 3 shows that removing the motif prior consistently degrades the performance: exact recovery drops and MCES increases, with consistent declines across structural similarity metrics. Qualitatively, Figure 3 indicates that, without the prior, samples may miss key motifs and drift toward incorrect structures; injecting the predicted motif cues steers generation toward spectra-consistent molecules. Some predicted motif cues are highlighted in the last row.
To understand why the motif prior helps, Table 4 evaluates motif evidence from reliability and utilization. First, the spectra-to-motif predictor achieves strong precision/recall and F1, indicating that multi-spectra contain learnable motif-level evidence. Notably, this provides more reliable motif-level signals than samples generated without the motif prior, suggesting that learning such intermediate evidence purely through end-to-end generation is non-trivial. Second, conditioning on the motif prior improves motif in-clusion in generated molecules both on the full test set and the mismatch subset, demonstrating that the generator effectively exploits the motif prior to resolve hard ambiguities (e.g., overall macro-F1 rises from 0.9087 to 0.9430). Finally, a targeted analysis of cases corrected by adding the motif prior shows that of the corrections coincide with motif differences, spanning 100 of the 103 motif types, suggesting that the benefit from motif prior is broad.
5.4. Analysis: MCTS-guided Inference
Table 3 (Panel B) shows that guidance-only variants yield only marginal gains, suggesting that a single fixed or scheduled guidance scales is often insufficient. Figure 4 (a) further compares tree-search diffusion with Best-of-N and Beam Search under increasing denoising budgets. Tree search consistently achieves higher exact recovery at the same step budget and improves faster as the budget increases. Best-of-N wastes computation on redundant trajectories and prefixes that already deviate early, while Beam Search is less competitive under limited budgets since maintaining a beam requires multiple costly continuations per prefix.
We further profile the wall-clock runtime and memory usage of different inference strategies in Appendix G. The results show that MCTS-guided diffusion uses the inference budget more effectively than repeated-sampling baselines, rather than simply relying on substantially larger memory or longer runtime. Under comparable denoising-step and runtime budgets, MCTS-guided diffusion achieves a better accuracy–runtime trade-off than Best-of-N and Beam Search. For example, at around 2000 denoising steps, MCTS-guided diffusion reaches 94.34% Acc@1 with 85.40s per sample, while Best-of-N obtains 86.13% Acc@1 with 79.68s. Peak GPU memory remains similar across methods because they share the same denoising backbone. MCTS uses moderately more CPU memory to maintain the search tree and node statistics, but denoising remains the dominant cost.
Figure 4 (b) characterizes how spectra-structure reward varies with search depth and tree width, averaged over 512 randomly sampled test cases. Increasing the search depth yields consistent reward improvements, but the gains saturate after moderate depth. In contrast, increasing the tree width primarily benefits shallow depths by broadening early exploration and improving the chance of discovering high-reward prefixes, after which different widths converge as the search becomes dominated by a few promising subtrees. Figure 4 (c) visualizes a reward-guided tree on a representative example. The search concentrates visits on two high-reward candidates: one is almost identical to the ground-truth structure, while the other corresponds to a mirror-symmetric configuration that remains highly aligned with the spectra. This example highlights the non-uniqueness of spectra-conditioned elucidation and shows that our method naturally returns multiple high-reward, spectra-consistent solutions.
5.5. Robustness and Sensitivity Analyses
Robustness to spectral perturbations. Realistic spectra often contain measurement noise, baseline shifts, and other acquisition artifacts, which may distort peak intensities and weaken the spectra–structure correspondence. To evaluate whether MAST remains reliable beyond the clean QM9S setting, we perturb the input spectra with additive Gaussian noise and baseline drift. Full results are reported in Appendix E. MAST without MCTS degrades gracefully under both perturbation types. We further compare MAST with DiffSpectra under combined Gaussian noise and baseline drift. Across all tested perturbation settings, MAST consistently outperforms DiffSpectra by a large margin. These results verify motif-level evidence can be reliably extracted by the motif predictor even when the raw spectra are corrupted. These results indicate that motif-augmented conditioning provides robust intermediate chemical evidence under spectral shifts, which is an important source of the overall robustness of MAST.
Sensitivity of reward and motif evidence. We also analyze the sensitivity of MCTS-guided inference and motif conditioning in Appendix F. Softmax backup performs best among the tested backup strategies, suggesting that value propagation should emphasize high-reward rollouts while avoiding relying solely on the maximum reward. A moderate motif-consistency reward weight gives the best exact recovery, while too small or too large weights reduce performance. This indicates that motif consistency is most effective as a complementary constraint to the spectra-structure reward, rather than as the dominant objective. Moreover, MAST remains stable under mild perturbations of the spectra-structure reward scorer, showing that the search procedure does not require a perfectly calibrated reward model. In contrast, corrupting the predicted motif prior leads to clear performance drops, confirming that accurate motif evidence is important for resolving spectra-conditioned ambiguity. These analyses show that MAST benefits from both informative motif conditioning and reward-guided tree search, and that the final improvement is not caused by a single isolated component.
6. Conclusion
In this work, we present MAST, a motif-augmented diffusion framework with search tree for 3D molecular elucidation from spectra. Our experiments demonstrate that MAST substantially improves exact recovery and 3D reconstruction on QM9S. Additional robustness evaluations show that MAST remains effective under noisy spectral perturbations, while runtime–memory profiling confirms that MCTS-guided inference provides a favorable accuracy–efficiency trade-off compared with repeated sampling baselines. Future work can further scale MAST to broader chemical spaces, incorporate more spectral modalities, and evaluate the framework on more diverse datasets, especially real-world experimental spectra.
Acknowledgements
This work is partially supported by the Robotic AI-Scientist Platform program of the Chinese Academy of Sciences.
Impact Statement
This paper presents MAST, a motif-augmented diffusion framework with reward-guided tree search for spectroscopic molecular structure elucidation. By generating spectra-consistent candidate 2D/3D molecular structures, it may support higher-throughput chemical and materials characterization where spectra serve as indirect structural fingerprints. Potential benefits include assisting metabolite annotation, impurity/degradant characterization in drug development, and spectral interpretation in materials analysis. Moreover, The probabilistic motif prior provides interpretable mid-level evidence that may improve transparency and human-in-the-loop review.
Potential negative impacts include misuse and over-reliance: improved spectra-to-structure proposals could be combined with downstream synthesis or acquisition pipelines in sensitive contexts. In addition, spectra-to-structure mapping is inherently one-to-many, so the system may return chemically plausible but incorrect candidates especially under distribution shift. Since our experiments focus on simulated spectra, applying MAST to experimental data may require calibration, domain adaptation, and careful post-generation filtering and validation. We recommend using MAST as decision support by returning a ranked set of candidates, reporting uncertainty, and verifying results with orthogonal evidence. For sensitive deployments, appropriate access control and auditing should be considered.
References
Alberts, M., Laino, T., and Vaucher, A. C. Leveraging infrared spectroscopy for automated structure elucidation. Communications Chemistry, 7(1):268, 2024.
Alberts, M., Zipoli, F., and Laino, T. Setting new benchmarks in ai-driven infrared structure elucidation. Digital Discovery, 2025.
Bohde, M., Manjrekar, M., Wang, R., Ji, S., and Coley, C. W. Diffms: Diffusion generation of molecules conditioned on mass spectra. arXiv preprint arXiv:2502.09571, 2025.
Brown, B., Juravsky, J., Ehrlich, R., Clark, R., Le, Q. V., Ré, C., and Mirhoseini, A. Large language monkeys: Scaling inference compute with repeated sampling. arXiv preprint arXiv:2407.21787, 2024.
Cheng, A. H., Lo, A., Miret, S., Pate, B. H., and Aspuru-Guzik, A. Determining 3d structure from molecular formula and isotopologue rotational spectra in natural abundance with reflection-equivariant diffusion. The Journal of Chemical Physics, 160(12), 2024.
Cheng, X., Li, J., Zhao, W. X., and Wen, J.-R. Think more, hallucinate less: Mitigating hallucinations via dual process of fast and slow thinking. arXiv preprint arXiv:2501.01306, 2025.
Coates, J. et al. Interpretation of infrared spectra, a practical approach. Encyclopedia of analytical chemistry, 12:10815–10837, 2000.
Coulom, R. Efficient selectivity and backup operators in monte-carlo tree search. In International conference on computers and games, pp. 72–83. Springer, 2006.
Dhariwal, P. and Nichol, A. Diffusion models beat gans on image synthesis. Advances in neural information processing systems, 34:8780–8794, 2021.
Dunn, W. B., Erban, A., Weber, R. J., Creek, D. J., Brown, M., Breitling, R., Hankemeier, T., Goodacre, R., Neumann, S., Kopka, J., et al. Mass appeal: metabolite identification in mass spectrometry-focused untargeted metabolomics. Metabolomics, 9(Suppl 1):44–66, 2013.
Ellis, J. D., Iqbal, R., and Yoshimatsu, K. Deep q-learning-based molecular graph generation for chemical structure prediction from infrared spectra. IEEE Transactions on Artificial Intelligence, 5(2):634–646, 2023.
Enders, A. A., North, N. M., Fensore, C. M., Velez-Alvarez, J., and Allen, H. C. Functional group identification for ftir spectra using image-based machine learning models. Analytical Chemistry, 93(28):9711–9718, 2021.
Fine, J. A., Rajasekar, A. A., Jethava, K. P., and Chopra, G. Spectral deep learning for prediction and prospective validation of functional groups. Chemical science, 11(18):4618–4630, 2020.
Görög, S. The importance and the challenges of impurity profiling in modern pharmaceutical analysis. TrAC Trends in Analytical Chemistry, 25(8):755–757, 2006.
Hao, S., Gu, Y., Ma, H., Hong, J., Wang, Z., Wang, D., and Hu, Z. Reasoning with language model is planning with world model. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pp. 8154–8173, 2023.
Ho, J. and Salimans, T. Classifier-free diffusion guidance. arXiv preprint arXiv:2207.12598, 2022.
Ho, J., Jain, A., and Abbeel, P. Denoising diffusion probabilistic models. Advances in neural information processing systems, 33:6840–6851, 2020.
Hoogeboom, E., Satorras, V. G., Vignac, C., and Welling, M. Equivariant diffusion for molecule generation in 3d. In International conference on machine learning, pp. 8867–8887. PMLR, 2022.
Hua, C., Luan, S., Xu, M., Ying, Z., Fu, J., Ermon, S., and Precup, D. Mudiff: Unified diffusion for complete molecule generation. In Learning on Graphs Conference, pp. 33–1. PMLR, 2024.
Huang, H., Sun, L., Du, B., and Lv, W. Conditional diffusion based on discrete graph structures for molecular graph generation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 37, pp. 4302–4311, 2023a.
Huang, H., Sun, L., Du, B., and Lv, W. Learning joint 2d & 3d diffusion models for complete molecule generation. arXiv preprint arXiv:2305.12347, 2023b.
Kanakala, G. C., Sridharan, B., and Priyakumar, U. D. Spectra to structure: contrastive learning framework for library ranking and generating molecular structures for infrared spectra. Digital Discovery, 3(12):2417–2423, 2024.
Kingma, D., Salimans, T., Poole, B., and Ho, J. Variational diffusion models. Advances in neural information processing systems, 34:21696–21707, 2021.
Liu, G., Xu, J., Luo, T., and Jiang, M. Graph diffusion transformers for multi-conditional molecular generation. Advances in Neural Information Processing Systems, 37: 8065–8092, 2024.
Liu, M., Cheng, X., Gao, Z., Chang, H., Tan, C., Shan, S., and Chen, X. Protnvtree: Deliberate protein inverse folding with reward-guided tree search. arXiv preprint arXiv:2506.00925, 2025.
Loshchilov, I. and Hutter, F. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
Peebles, W. and Xie, S. Scalable diffusion models with transformers. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 4195–4205, 2023.
Peng, X., Guan, J., Liu, Q., and Ma, J. Moldiff: Addressing the atom-bond inconsistency problem in 3d molecule diffusion generation. arXiv preprint arXiv:2305.07508, 2023.
Polishchuk, P. G., Madzhidov, T. I., and Varnek, A. Estimation of the size of drug-like chemical space based on gdb-17 data. Journal of computer-aided molecular design, 27(8):675–679, 2013.
Polykovskiy, D., Zhebrak, A., Sanchez-Lengeling, B., Golovanov, S., Tatanov, O., Belyaev, S., Kurbanov, R., Artamonov, A., Aladinskiy, V., Veselov, M., Kadurin, A., Johansson, S., Chen, H., Nikolenko, S., Aspuru-Guzik, A., and Zhavoronkov, A. Molecular sets (MOSES): A benchmarking platform for molecular generation models. Frontiers in Pharmacology, 11:565644, 2020. ISSN 1663-9812. doi: 10.3389/fphar.2020.565644. URL https://www.frontiersin.org/journals/pharmacology/articles/10.3389/fphar.2020.565644.
Preuer, K., Renz, P., Unterthiner, T., Hochreiter, S., and Klambauer, G. Fréchet ChemNet distance: A metric for generative models for molecules in drug discovery. Journal of Chemical Information and Modeling, 58(9):1736–1741, 2018. doi: 10.1021/acs.jcim.8b00234.
Qi, Z., Ma, M., Xu, J., Zhang, L. L., Yang, F., and Yang, M. Mutual reasoning makes smaller llms stronger problem-solvers. arXiv preprint arXiv:2408.06195, 2024.
Ramakrishnan, R., Dral, P. O., Rupp, M., and Von Lilienfeld, O. A. Quantum chemistry structures and properties of 134 kilo molecules. Scientific data, 1(1):1–7, 2014.
Silver, D., Huang, A., Maddison, C. J., Guez, A., Sifre, L., Van Den Driessche, G., Schrittwieser, J., Antonoglou, I., Panneershelvam, V., Lanctot, M., et al. Mastering the game of go with deep neural networks and tree search. nature, 529(7587):484–489, 2016.
Snell, C., Lee, J., Xu, K., and Kumar, A. Scaling llm test-time compute optimally can be more effective than scaling model parameters. arXiv preprint arXiv:2408.03314, 2024.
Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N., and Ganguli, S. Deep unsupervised learning using nonequilibrium thermodynamics. In International conference on machine learning, pp. 2256–2265. pmlr, 2015.
Song, Y., Sohl-Dickstein, J., Kingma, D. P., Kumar, A., Ermon, S., and Poole, B. Score-based generative modeling through stochastic differential equations. arXiv preprint arXiv:2011.13456, 2020.
Stein, S. E. and Scott, D. R. Optimization and testing of mass spectral library search algorithms for compound identification. Journal of the American Society for Mass Spectrometry, 5(9):859–866, 1994.
Su, Y., Chen, J., Jiang, Z., Zhong, Z., Wang, L., Liu, Q., and Zhang, Z. Spectrallm: Uncovering the ability of llms for molecular structure elucidation from multi-spectral data. In The Fourteenth International Conference on Learning Representations.
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. Attention is all you need. In Guyon, I., Von Luxburg, U., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. URL https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf.
Vignac, C., Krawczuk, I., Siraudin, A., Wang, B., Cevher, V., and Frossard, P. Digress: Discrete denoising diffusion for graph generation. arXiv preprint arXiv:2209.14734, 2022.
Vignac, C., Osman, N., Toni, L., and Frossard, P. Midi: Mixed graph and 3d denoising diffusion for molecule generation. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 560–576. Springer, 2023.
Wang, L., Liu, S., Rong, Y., Zhao, D., Liu, Q., and Wu, S. Molspectra: Pre-training 3d molecular representation with multi-modal energy spectra. arXiv preprint arXiv:2502.16284, 2025a.
Wang, L., Rong, Y., Xu, T., Zhong, Z., Liu, Z., Wang, P., Zhao, D., Liu, Q., Wu, S., and Zhang, Y. Diffspectra: Molecular structure elucidation from spectra using diffusion models. arXiv preprint arXiv:2507.06853, 2025b.
Wang, X., Wei, J., Schuurmans, D., Le, Q., Chi, E., Narang, S., Chowdhery, A., and Zhou, D. Self-consistency improves chain of thought reasoning in language models. arXiv preprint arXiv:2203.11171, 2022.
Wang, Y., Tang, H., Huang, L., Pan, L., Yang, L., Yang, H., Mu, F., and Yang, M. Self-play reinforcement learning guides protein engineering. Nature Machine Intelligence, 5(8):845–860, 2023.
Wu, Y., Sun, Z., Li, S., Welleck, S., and Yang, Y. Inference scaling laws: An empirical analysis of compute-optimal inference for problem-solving with language models. arXiv preprint arXiv:2408.00724, 2024.
Xu, M., Yu, L., Song, Y., Shi, C., Ermon, S., and Tang, J. Geodiff: A geometric diffusion model for molecular conformation generation. arXiv preprint arXiv:2203.02923, 2022.
Xu, M., Powers, A. S., Dror, R. O., Ermon, S., and Leskovec, J. Geometric latent diffusion models for 3d molecule generation. In International Conference on Machine Learning, pp. 38592–38610. PMLR, 2023.
Yao, H., Huang, J., Wu, W., Zhang, J., Wang, Y., Liu, S., Wang, Y., Song, Y., Feng, H., Shen, L., et al. Mulberry: Empowering mllm with o1-like reasoning and reflection via collective monte carlo tree search. arXiv preprint arXiv:2412.18319, 2024.
Yao, S., Yu, D., Zhao, J., Shafran, I., Griffiths, T., Cao, Y., and Narasimhan, K. Tree of thoughts: Deliberate problem solving with large language models. Advances in neural information processing systems, 36:11809–11822, 2023.
Zhang, D., Huang, X., Zhou, D., Li, Y., and Ouyang, W. Accessing gpt-4 level mathematical olympiad solutions via monte carlo tree self-refine with llama-3 8b. arXiv preprint arXiv:2406.07394, 2024.
Zhuang, X., Wu, B., Cui, J., Feng, K., Li, X., Xing, H., Ding, K., Zhang, Q., and Chen, H. Boosting llm's molecular structure elucidation with knowledge enhanced tree search reasoning. arXiv preprint arXiv:2506.23056, 2025.
Zou, Z., Zhang, Y., Liang, L., Wei, M., Leng, J., Jiang, J., Luo, Y., and Hu, W. A deep learning model for predicting selected organic molecular spectra. Nature Computational Science, 3(11):957–964, 2023.
Roadmap. This supplementary material complements the main text with the following components:
-
Model details (Appendix A): formal specifications of the multi-spectra encoder, spectra-to-motif prior, conditioning mechanism, and joint 2D–3D denoiser.
-
Motif vocabulary construction (Appendix B): extraction protocol, filtering criteria, and representative motifs in the vocabulary.
-
Implementation details (Appendix C): training and inference configurations, including diffusion settings, encoder architectures, motif predictor training, and MCTS hyperparameters.
-
Evaluation metrics (Appendix D): definitions and formulas for molecular generation quality, spectra-conditioned structure elucidation, and 3D geometry evaluation.
-
Robustness to spectral perturbations (Appendix E): evaluations under additive Gaussian noise and baseline drift, including comparisons with DiffSpectra and analysis of motif-predictor robustness.
-
Additional sensitivity analyses (Appendix F): studies on reward backup strategies, motif-consistency reward weights, reward-scorer perturbations, and motif-prior corruption.
-
Efficiency and resource profiling (Appendix G): wall-clock runtime, GPU memory, and CPU memory comparisons under different denoising-step budgets.
A. Model Details
A molecule is represented as a joint structure , where are 3D coordinates, denotes node attributes (e.g., atom types and charges), and denotes edge/bond attributes (e.g., bond types). We denote the observed multi-modal spectra by , .
A.1. Multi-spectra Encoder
Patching. For each modality , we split into a patch sequence with patch length and stride , where . Each patch is projected to dimensions by a learnable matrix and added with positional embeddings :
Multi-spectrum Transformer. We concatenate patch embeddings from all modalities: , and apply a Transformer (Vaswani et al., 2017) encoder :
We obtain a global spectrum embedding via pooling (e.g., mean-pooling):
A.2. Spectra-to-Motif Prior
Vocabulary and labels. We define a vocabulary of motifs . For a molecule , we extract a multi-hot label with
Predictor. A multi-label predictor maps spectra to logits and probabilities :
We implement as a hierarchical Transformer that first captures local spectral patterns within each modality and then models the global and cross-modal dependencies via self-attention over concatenated patches. The training loss is (weighted) binary cross-entropy:

Figure 5. Denoising network architecture. Detailed architecture of the SE(3)-equivariant denoiser used in MAST. The model conditions on the multi-spectra embedding , the motif prior , and the diffusion timestep , and iteratively updates node features, edge features, and 3D coordinates through stacked equivariant blocks.
A.3. Conditioning Embedding
Diffusion is conditioned on spectral evidence together with diffusion time . The time is embedded as .
Two-stage gate fusion. Conditioning is fused by two successive vector-valued gates (Fig. 5). First, the spectral embedding and time embedding are fused by a gate-weighted sum:
where is a MLP, is the sigmoid, and denotes element-wise multiplication.
Next, the motif probabilities are mapped to a dense embedding
and fused with by another gate-weighted sum:
where is a MLP, is also the sigmoid, and also denotes element-wise multiplication.
Injection into denoiser blocks. The final conditioning vector is used to modulate all denoiser blocks. Concretely, for each equivariant block, is mapped to the adaptive modulation parameters (e.g., AdaLN shift/scale and the multiplicative Scale coefficients) that control the node-, edge-, and coordinate-update pathways.
A.4. Joint 2D–3D Denoiser with Conditional Equivariant Blocks
Let the noisy state at time t be . The denoiser is a conditional mapping
implemented by stacking L blocks that update node stream, edge stream, and coordinate stream jointly.
Adaptive normalization and scaling. We apply AdaLN(Peebles & Xie, 2023) and conditional scaling with conditioning vector C:
(32) where , , are small MLPs and denotes elementwise product.
Relational attention. Let be node features at layer and be edge features. We augment edges with invariant geometry (e.g., squared distances):
where is a fixed or learnable basis expansion (e.g., Gaussian basis). A relational multi-head attention produces an aggregated message :
Node and edge updates. We update nodes via residual + FFN:
Edge features are updated by fusing node messages and applying AdaLN/FFN:
Coordinate update (equivariant field). Coordinates are updated by aggregating relative displacement vectors:
where is a learnable scalar. Finally we mean-center coordinates to remove global translation.
A.5. Diffusion Training Objective
We use data prediction and regress the clean structure from noisy inputs. For a random , we sample noise and obtain via the VP marginal (component-wise). The denoiser predicts , and we minimize a weighted reconstruction loss:
B. Motif Vocabulary Construction
We construct a motif vocabulary as an explicit meso-scale prior between spectra and molecular graphs. Following the knowledge-base extraction protocol in K-MSE (Zhuang et al., 2025), we extract two complementary families of motifs—ring and chain patterns—and represent each motif as a SMILES string. Concretely, for ring motifs, we enumerate rings, merge rings that share at least two atoms, and include one-hop attachments to preserve immediate chemical context; for chain motifs, we collect two-hop neighborhoods centered at non-ring carbon atoms and filter out candidates containing any ring atoms to keep them purely acyclic. All extracted motifs are canonicalized by RDKit and counted on QM9S; we retain motifs that appear in more than 1% of molecules, yielding a compact vocabulary of motifs.
This vocabulary spans diverse intermediate-level chemistry (local topology, ring membership, and functional-group-bearing fragments such as ethers/amines/nitriles/carbonyls), providing a structured prior that is more informative than atom types yet far more compact than full-graph templates; representative motifs are shown in Table 5.
Table 5. Representative motifs in our motif vocabulary, grouped by coarse chemical semantics.
| Category | Representative motifs (SMILES) | Chemical cue |
|---|---|---|
| Alkyl / branching | CCC, CC (C) C, CC (C) (C) C | hydrophobic backbone, steric bulk |
| Unsaturation (alkene/alkyne) | -bond patterns | |
| Alcohols / polyols | CCO, CC (O) O, CC (O) CO | H-bond donors/acceptors, polarity |
| Ethers / acetals | COC, CCOC, COC (C) OC | H-bond acceptors, flexible linkage |
| Amines (primary/tertiary/cyclic) | CCCN, CN (C) C, CN1CCCCC1 | basicity; HBD/HBA sites |
| Carbonyls (aldehyde/ketone) | polar carbonyl center | |
| Carboxylic acids / esters | acidity / ester functionality | |
| Nitriles | strong H-bond acceptor | |
| Aromatic / heteroaromatic | conjugated ring electronics | |
| Small rings / saturated heterocycles | rigidity; ring/heteroatom context |
Table 6. Functional groups used for FGSim.
| Category | Groups included in FGSim |
|---|---|
| C skeleton | alkane_sp3_CH; alkane; alkene; alkyne |
| O-containing | aliphatic_alcohol; ether; epoxide; aldehyde; ketone; ester; carbonyl_any |
| N-containing | amine_any; primary_amine; secondary_amine; tertiary_amine; amide_like; nitrile |
| F-containing | fluoroalkane; fluoro_any |
C. Implementation Details
All experiments are conducted on 8 × NVIDIA RTX 3090 GPUs. For spectral conditioning, we employ a Transformer-style encoder over three modalities (UV, IR, Raman) with depth 4, width 256, 8 heads, and output dimension 128. Spectra are patched with lengths (, , ) = (32, 64, 64) and strides (16, 32, 32). We pretrain the spectral encoder with masked autoencoding (MAE) using a mask ratio of 0.7, and then fine-tune it jointly with the denoiser. We incorporate an explicit spectra-to-motif prior with a vocabulary of motifs. The motif predictor is trained separately using binary cross-entropy with uniform weights , and is kept frozen during diffusion training.
We use a VP-SDE with a cosine schedule(Song et al., 2020), setting and , and sample with denoising steps. Our denoiser include an SE(3)-equivariant Transformer with hidden width , equivariant blocks and 16 attention heads. Training uses AdamW (Loshchilov & Hutter, 2017) with learning rate , , and dropout rate is 0.1. The weights of node, edge, and coordinate losses are , , and .
For MCTS-guided inference, we follow the MolSpectra (Wang et al., 2025a) pipeline and train molecule and spectrum encoders to compute spectrum–structure consistency rewards. We discretize reverse diffusion into 50 linear checkpoints and perform Monte Carlo Tree Search (MCTS) over checkpointed segments. Unless otherwise stated, we run MCTS with UCB exploration coefficient , and expand up to 4 children per node. Each node uses a lightweight rollout of 10 denoising steps per segment to estimate value, and we cap the total number of denoising steps per sample at 3000 for efficiency. We adopt a softmax backup strategy with temperature to aggregate subtree returns. For guidance, we use a small scale set . To ensure chemical validity during search, we set the node reward to zero when the 2D structure is invalid; if the 2D structure is valid but the 3D geometry is invalid, we downweight the reward by a factor of 0.5.
D. Evaluation Metrics
We evaluate our method from two complementary perspectives: (i) molecular generation quality, measuring chemical validity/stability and distributional fidelity of generated molecules; and (ii) spectra-conditioned structure elucidation, measuring exact recovery and graded structural/geometry similarity. Unless otherwise stated, we follow the metric implementations used in DiffSpectra (Wang et al., 2025b).
D.1. Molecular Generation Quality
Validity, uniqueness, and novelty. We generate molecules and decode them into chemically-typed molecular graphs. A molecule is valid if it passes standard chemistry checks. We canonicalize each valid molecule and count duplicates as
Table 7. Robustness of MAST (w/o MCTS) under additive Gaussian noise and baseline drift.
| Perturbation setting | Acc@1↑ | TaniSimMG↑ | CosSimMG↑ | TaniSimMA↑ | FGSim↑ | MapAcc↑ |
|---|---|---|---|---|---|---|
| Clean | 79.12% | 0.8834 | 0.9141 | 0.9596 | 0.9806 | 93.83% |
| Gaussian noise (SNR=50 dB) | 77.73% | 0.8593 | 0.8915 | 0.9441 | 0.9707 | 78.81% |
| Gaussian noise (SNR=40 dB) | 76.76% | 0.8556 | 0.8902 | 0.9481 | 0.9758 | 77.82% |
| Gaussian noise (SNR=30 dB) | 75.98% | 0.8493 | 0.8850 | 0.9456 | 0.9750 | 77.03% |
| Baseline drift=3 | 77.15% | 0.8565 | 0.8896 | 0.9434 | 0.9708 | 78.42% |
| Baseline drift=4 | 76.17% | 0.8492 | 0.8847 | 0.9449 | 0.9761 | 77.23% |
| Baseline drift=5 | 74.61% | 0.8373 | 0.8747 | 0.9358 | 0.9682 | 75.64% |
Table 8. Robustness of the motif predictor under noisy and shifted spectra.
| Setting | micro-F1↑ | macro-F1↑ |
|---|---|---|
| Clean | 0.9726 | 0.9484 |
| SNR=20 dB, drift=5 | 0.9661 | 0.9401 |
| SNR=30 dB, drift=5 | 0.9679 | 0.9417 |
| SNR=40 dB, drift=5 | 0.9683 | 0.9434 |
non-unique. A molecule is novel if its canonical form does not appear in the training set. Let be the number of valid and unique molecules and the number of valid, unique, and novel molecules. We report
These ratios jointly penalize invalid decoding and mode collapse, while V&U&N additionally reflects generalization.
AtomStable and MolStable. We report AtomStable and MolStable to quantify stability at atom- and molecule-level, respectively, using the standard valence/coordination criteria adopted in prior 3D molecular generators and DiffSpectra (Huang et al., 2023b; Wang et al., 2025b).
Distribution-based metrics. We assess distributional fidelity between generated samples and a reference set using standard metrics. FCD (Fréchet ChemNet Distance) measures Fréchet distance between ChemNet feature distributions (Preuer et al., 2018). SNN (Similarity to Nearest Neighbor), Frag (BRICS fragment statistics), and Scaf (Bemis–Murcko scaffold statistics) follow the MOSES benchmark definitions (Polykovskiy et al., 2020). Higher SNN/Frag/Scaf and lower FCD indicate better distributional alignment.
D.2. Spectra-conditioned Structure Elucidation
Acc@K (exact recovery). For each spectrum, we obtain decoded candidates and a ground-truth molecule . We compute Acc@K as the fraction of test cases where at least one candidate matches the ground truth exactly:
In practice, we convert each decoded molecule object to a canonical SMILES using RDKit and check exact match against the ground-truth canonical SMILES.
Connectivity and fingerprint similarities. We report MCES as a graded measure of graph discrepancy, together with Morgan fingerprint similarities (TaniSimMG and CosSimMG), MACCS fingerprint similarity (TaniSimMA), FraggleSim, and FGSim, following DiffSpectra (Wang et al., 2025b). These metrics quantify partial structural overlap when exact match is not achieved. For FGSim, we extract a set of chemically meaningful functional/motif groups using SMARTS-based substructure matching and compute set-level overlap (Table 6).
3D geometry metrics. We evaluate 3D consistency using RMSD and MapAcc (atom-mapping accuracy), following DiffSpectra (Wang et al., 2025b). RMSD is computed after establishing an atom correspondence under atom-type constraints and rigid alignment and we allow mirror inversion because the spectra used are enantiomer-invariant. MapAcc measures the fraction of correctly matched atoms under the established correspondence.
Table 9. Comparison with DiffSpectra under combined Gaussian noise and baseline drift.
| Perturbation setting | Method | Acc@1↑ | TaniSimMG↑ | CosSimMG↑ | TaniSimMA↑ | FGSim↑ |
|---|---|---|---|---|---|---|
| SNR=20 dB, drift=5 | DiffSpectra | 0.20% | 0.0285 | 0.0476 | 0.0665 | 0.0887 |
| SNR=20 dB, drift=5 | MAST (w/o MCTS) | 74.41% | 0.8322 | 0.8698 | 0.9301 | 0.9692 |
| SNR=30 dB, drift=3 | DiffSpectra | 7.68% | 0.2576 | 0.3582 | 0.4413 | 0.5428 |
| SNR=30 dB, drift=3 | MAST (w/o MCTS) | 78.02% | 0.8554 | 0.8890 | 0.9452 | 0.9746 |
| SNR=30 dB, drift=4 | DiffSpectra | 10.43% | 0.2574 | 0.3510 | 0.4460 | 0.5224 |
| SNR=30 dB, drift=4 | MAST (w/o MCTS) | 76.04% | 0.8422 | 0.8798 | 0.9432 | 0.9782 |
| SNR=30 dB, drift=5 | DiffSpectra | 9.38% | 0.2790 | 0.3795 | 0.4643 | 0.5488 |
| SNR=30 dB, drift=5 | MAST (w/o MCTS) | 73.83% | 0.8303 | 0.8687 | 0.9322 | 0.9741 |
| SNR=40 dB, drift=5 | DiffSpectra | 51.95% | 0.8316 | 0.8776 | 0.9376 | 0.9264 |
| SNR=40 dB, drift=5 | MAST (w/o MCTS) | 74.41% | 0.8347 | 0.8732 | 0.9340 | 0.9711 |
Table 10. Effect of different reward backup strategies in MCTS.
| Backup strategy | Acc@1↑ | TaniSimMG↑ | CosSimMG↑ | TaniSimMA↑ | FraggleSim↑ | FGSim↑ | RMSD(Å)↓ |
|---|---|---|---|---|---|---|---|
| Softmax | 95.70% | 0.9895 | 0.9921 | 0.9970 | 0.9787 | 0.9968 | 0.7768 |
| Max | 94.92% | 0.9855 | 0.9894 | 0.9961 | 0.9714 | 0.9959 | 0.7646 |
| Mean | 94.53% | 0.9809 | 0.9836 | 0.9947 | 0.9707 | 0.9947 | 0.7757 |
E. Robustness to Spectral Perturbations
The main experiments in the paper are conducted on clean simulated spectra from QM9S. However, spectra obtained in practical scenarios may contain various acquisition artifacts, such as random measurement noise, imperfect background correction, and baseline shifts. These perturbations can distort peak intensities and global spectral shapes, making the inverse mapping from spectra to molecular structures more ambiguous. Therefore, we further evaluate whether MAST can preserve spectra–structure consistency when the input spectra are corrupted.
We consider two common perturbation types. First, we add Gaussian noise to the input spectra, where the perturbation strength is controlled by the signal-to-noise ratio (SNR). Lower SNR corresponds to stronger noise. Second, we add baseline drift to mimic systematic shifts in the spectral baseline. Compared with random noise, baseline drift changes the global spectral profile and can be particularly harmful for models that rely heavily on global spectral embeddings. All robustness experiments in this section are performed without retraining the model, so they directly test the robustness of the learned spectra-conditioned generator.
Table 7 reports the robustness of MAST without MCTS under individual perturbations. The results show that MAST degrades gracefully as the perturbation strength increases. For Gaussian noise, Acc@1 decreases from on clean spectra to under SNR = 30 dB, while structural similarity metrics such as TaniSimMA and FGSim remain high. For baseline drift, Acc@1 decreases to at drift = 5, but the generated structures still preserve strong fingerprint and functional-group similarity. This indicates that even when exact recovery becomes harder, MAST tends to generate molecules that remain structurally close to the ground truth.
We further compare MAST with DiffSpectra under combined Gaussian noise and baseline drift in Table 9. This setting is more challenging because the spectra are affected by both local random fluctuations and global baseline shifts. MAST consistently outperforms DiffSpectra across all perturbation settings. For example, under SNR = 30 dB and drift = 5, MAST achieves Acc@1, while DiffSpectra obtains only . Even under the severe SNR = 20 dB and drift = 5 setting, MAST maintains Acc@1, whereas DiffSpectra nearly collapses. These results suggest that motif-augmented conditioning provides more robust intermediate evidence than relying only on global spectral representations.
Finally, Table 8 evaluates whether the motif predictor itself remains reliable under noisy and shifted spectra. The micro-F1 and macro-F1 scores drop only slightly compared with the clean setting, indicating that the spectra-to-motif mapping is relatively stable even when the raw spectra are corrupted. This robustness of the motif predictor is an important reason for the robustness of MAST. Since the predicted motif prior provides intermediate local chemical evidence during generation, a stable motif predictor allows the denoising model to rely on chemically meaningful constraints rather than only on perturbed global spectral features. As a result, MAST can still preserve spectra–structure consistency under noisy and shifted inputs.
F. Additional Sensitivity Analyses
We conduct additional sensitivity analyses to better understand which design choices are important for MCTS-guided diffusion. These experiments focus on four aspects: the reward backup strategy, the motif-consistency reward weight,
Table 11. Sensitivity to perturbations in the spectra–structure reward model.
| Reward perturbation setting | Acc@1↑ | TaniSimMG↑ | CosSimMG↑ | TaniSimMA↑ | FraggleSim↑ | FGSim↑ | RMSD(Å)↓ |
|---|---|---|---|---|---|---|---|
| Clean scorer | 95.70% | 0.9895 | 0.9921 | 0.9970 | 0.9787 | 0.9968 | 0.7768 |
| Gaussian noise, std=0.02 | 94.92% | 0.9848 | 0.9894 | 0.9672 | 0.9823 | 0.9952 | 0.7774 |
| Gaussian noise, std=0.05 | 93.36% | 0.9791 | 0.9858 | 0.9651 | 0.9823 | 0.9932 | 0.7893 |
| Gaussian noise, std=0.10 | 88.28% | 0.9434 | 0.9586 | 0.9531 | 0.9761 | 0.9926 | 0.7931 |
Table 12. Effect of the motif-consistency reward weight.
| Motif reward weight | Acc@1↑ | TaniSimMG↑ | CosSimMG↑ | TaniSimMA↑ | FraggleSim↑ | FGSim↑ | RMSD(Å)↓ |
|---|---|---|---|---|---|---|---|
| 0.00 | 94.14% | 0.9810 | 0.9862 | 0.9952 | 0.9822 | 0.9945 | 0.7888 |
| 0.05 | 95.31% | 0.9872 | 0.9903 | 0.9968 | 0.9782 | 0.9952 | 0.7798 |
| 0.10 | 95.70% | 0.9895 | 0.9921 | 0.9970 | 0.9787 | 0.9968 | 0.7768 |
| 0.20 | 94.53% | 0.9855 | 0.9895 | 0.9959 | 0.9787 | 0.9972 | 0.7820 |
the robustness of the spectra–structure reward scorer, and the quality of the motif prior. Unless otherwise specified, the sensitivity experiments are conducted on 1024 samples with the same trained generator.
Reward backup strategy. During MCTS, rollout rewards need to be propagated back to previously visited nodes. The backup rule determines how the value of a node is estimated from its observed rollout rewards. Table 10 compares softmax, max, and mean backup. Softmax backup achieves the best Acc@1. This suggests that the search benefits from emphasizing high-reward rollouts, but using only the maximum reward may be too sensitive to noisy or lucky evaluations. Mean backup is more conservative, but it can dilute strong signals from promising branches. Therefore, softmax backup provides a useful compromise between robustness and exploitation.
Perturbing the reward scorer. Table 11 evaluates the sensitivity of MCTS to perturbations in the spectra–structure reward model. Mild perturbations only slightly reduce performance, indicating that the search procedure does not require a perfectly calibrated scorer. However, stronger perturbations lead to a larger drop in Acc@1. This is expected because the reward scorer determines which denoising prefixes are expanded more often. If the scorer becomes too noisy, MCTS may allocate computation to suboptimal branches.
Motif-consistency reward weight. Table 12 studies the weight of the motif-consistency reward in the MCTS evaluation function. When the weight is 0, the search relies only on the spectra–structure reward. Adding a moderate motif reward improves Acc@1, with the best result obtained at weight 0.10. This confirms that motif consistency provides complementary guidance during tree search. However, increasing the weight to 0.20 reduces exact recovery. One possible explanation is that an overly strong motif constraint may overemphasize local motif agreement and weaken the role of the global spectra–structure reward, which is necessary for exact molecular recovery.
Perturbing the motif prior. Table 13 evaluates the effect of corrupting the predicted motif prior before generation. Small Gaussian perturbations cause moderate performance degradation, while random bit flips and fully random motif priors lead to much larger drops. For example, when the flip rate is increased to , Acc@1 drops to 51.37%, and using a random motif prior further reduces Acc@1 to 29.49%. These results confirm that the motif prior is not merely an auxiliary input, but an important source of interpretable chemical evidence. Wrong motif prior can substantially reduce exact recovery.
G. Efficiency and Resource Profiling
Inference-time scaling improves performance by spending additional computation at test time. However, for diffusion models, such computation can be expensive because each candidate sample requires a sequential denoising trajectory. Therefore, it is important to compare not only accuracy under different denoising-step budgets, but also wall-clock runtime and memory usage. In this section, we profile Best-of-N, Beam Search, and MCTS-guided diffusion under different budgets.
Table 14 reports the accuracy–runtime–memory trade-off. Best-of-N increases accuracy by drawing more independent full-chain samples, but this strategy repeatedly explores redundant trajectories and cannot reuse partially successful denoising prefixes. Beam Search maintains multiple partial candidates, but it still needs to continue several candidates at each stage, which makes it less efficient under limited budgets. In contrast, MCTS-guided diffusion expands the denoising tree adaptively. It allocates more computation to prefixes that receive higher spectra–structure rewards and prunes less promising
Table 13. Effect of perturbing the motif prior before generation.
| Motif prior setting | Acc@1↑ | TaniSimMG↑ | CosSimMG↑ | TaniSimMA↑ | FraggleSim↑ | FGSim↑ | MapAcc↑ |
|---|---|---|---|---|---|---|---|
| MAST (w/o MCTS) | 79.12% | 0.8834 | 0.9141 | 0.9596 | 0.9651 | 0.9806 | 93.83% |
| + Motif prior noise, | 78.52% | 0.8618 | 0.8921 | 0.9434 | 0.8251 | 0.9728 | 79.60% |
| + Motif prior noise, | 78.32% | 0.8607 | 0.8918 | 0.9441 | 0.8277 | 0.9756 | 79.41% |
| + Motif prior noise, | 77.93% | 0.8590 | 0.8905 | 0.9432 | 0.8273 | 0.9716 | 79.01% |
| + Motif prior flip, | 72.27% | 0.8186 | 0.8581 | 0.9188 | 0.8055 | 0.9471 | 73.47% |
| + Motif prior flip, | 51.37% | 0.6580 | 0.7269 | 0.8157 | 0.7535 | 0.8882 | 52.48% |
| + Random motif prior | 29.49% | 0.4585 | 0.5493 | 0.6629 | 0.6557 | 0.7767 | 30.10% |
Table 14. Accuracy–runtime–memory comparison under different denoising-step budgets.
| Method | Denoising steps | Acc@1 (%)↑ | Avg. runtime / sample (s) | Peak GPU memory (MiB) | Peak RAM (MiB) |
|---|---|---|---|---|---|
| Best-of-N | 1000 | 79.12 | 40.43 | 1584.1 | 5364.5 |
| Best-of-N | 2000 | 86.13 | 79.68 | 1584.3 | 5364.8 |
| Best-of-N | 3000 | 89.45 | 118.94 | 1583.8 | 5363.7 |
| Best-of-N | 4000 | 90.62 | 158.27 | 1584.2 | 5365.1 |
| Beam Search | 2000 | 81.45 | 81.74 | 1644.0 | 5423.0 |
| Beam Search | 4000 | 89.06 | 162.03 | 1646.2 | 5424.8 |
| MCTS-guided diffusion | 1000 | 90.82 | 47.44 | 1622.5 | 6025.0 |
| MCTS-guided diffusion | 2000 | 94.34 | 85.40 | 1626.5 | 6027.4 |
| MCTS-guided diffusion | 3000 | 94.81 | 124.63 | 1625.0 | 6030.7 |
| MCTS-guided diffusion | 4000 | 95.11 | 163.03 | 1623.0 | 6038.9 |
branches early. As a result, it achieves better accuracy under comparable runtime.
For example, at around 3000 denoising steps, MCTS-guided diffusion reaches 94.81% Acc@1 with 124.63s per sample, while Best-of-N reaches 89.45% Acc@1 with 118.94s. Similarly, at around 4000 denoising steps, MCTS-guided diffusion reaches 95.11% Acc@1, outperforming both Best-of-N and Beam Search. The runtime of MCTS-guided diffusion is slightly higher at the same nominal step budget because it involves tree operations and reward evaluations, but the accuracy gain is much larger than this overhead.
The peak GPU memory is similar across all methods because the denoising backbone dominates GPU memory consumption and is shared by all inference strategies. The main additional memory cost of MCTS appears in CPU RAM, since the search tree stores checkpoint states, visit counts, values, and other node statistics. This explains why MCTS-guided diffusion uses moderately higher RAM than Best-of-N and Beam Search.
Overall, the profiling results show that MCTS-guided diffusion uses the inference budget more effectively. Rather than relying on substantially larger GPU memory or much longer runtime, MCTS improves performance by adaptively allocating computation to high-reward denoising prefixes. Consequently, under comparable denoising-step and runtime budgets, MCTS achieves consistently higher exact recovery than Best-of-N and Beam Search.