arXiv(opens in a new tab)physics.chem-phNov 2026

Manuscript Offprint

arXiv:2611.07133

Context-Aware Automated NMR Structure Elucidation

Frank Hu, Jonathan M. Tubb, Grant M. Rotskoff, Matthew W. Kanan, Thomas E. Markland

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Frank Hu,¹ Jonathan M. Tubb,¹ Grant M. Rotskoff,¹, a) Matthew W. Kanan,¹, b) and Thomas E. Markland¹, c)

Department of Chemistry, Stanford University, Stanford, California, 94305, USA

(Dated: 6 November 2026)

Machine learning approaches are rapidly revolutionizing the ability to analyze and extract structural insights from chemical data, enabling high-throughput chemical discovery. While existing data-driven approaches have shown remarkable promise for predicting chemical structures in the de novo setting, incorporating additional chemically informed context offers the opportunity to further improve these models' performance and extend their real-world utility. Here we provide a straightforward protocol to combine artificial-intelligence-based spectroscopic elucidation pipelines with contextual chemical data, e.g., known reactants or a desired product, by using automated retrosynthetic analysis to generate large training sets of molecules and contextual data in the form of synthetic precursors. We demonstrate our approach by showing that our recently introduced NMR structure elucidation framework can be trained to effectively leverage molecular precursor context. We show that when the chemical context provides useful information on the target molecule we obtain dramatically improved accuracy over using NMR spectra alone, obtaining Top-15 accuracies of up to 95.4% for molecules up to 40 heavy atoms spanning the full elemental range of organic chemistry. Furthermore, we demonstrate that our approach is highly robust, such that even when the context provided is uncorrelated with the target, one still obtains accuracies commensurate with those of the original NMR structure elucidation framework. This approach provides an efficient route to improve a wide range of spectroscopic structure elucidation platforms using contextual data.

I. INTRODUCTION

Recent advances in artificial intelligence have spurred massive growth in research on the use of machine learning techniques to extract rich information on chemical structure, including complete structure elucidation, from spectroscopic data ranging from 1D and 2D NMR¹⁻¹¹ to Mass Spectrometry,¹²⁻¹⁴ Infrared,¹⁵ and UV-vis,¹⁶ as well as multimodal models that incorporate combinations of these.¹⁷⁻²¹ Many of these models have shown excellent performance in making de novo predictions using spectral data alone. However, the combinatorial explosion in chemical space²²,²³ for larger molecules, the complexity associated with mixtures of species and impurities, and the noise and finite resolution in real-world experimental conditions remain considerable challenges. At the same time, in experimental settings, structure elucidation is rarely a daunting de novo prediction, since contextual information is generally available, ranging from known solvents or reactants to the planned product. Incorporating this contextual information thus offers the opportunity to significantly boost the performance of spectroscopic structure elucidation platforms in the most challenging real-world applications.

A protocol for incorporating additional contextual information in a de novo structure elucidation framework should ideally satisfy the following conditions: First, the protocol should be easily applicable to vision-language model style architectures given their proven effectiveness for spectroscopic structure elucidation²⁴,²⁵ and since con-

textual information is best expressed as additional chemical language input. Second, since data scaling is essential for generalizable model performance,²⁶⁻²⁹ the protocol should allow for efficient training data acquisition. Third, the protocol should not degrade performance in the de novo setting and should instead improve accuracy, with worst-case performance reverting to approximately that of the model without any context.

Here, we introduce a protocol for training structure elucidation models to use molecular precursors as context. We demonstrate this approach by applying it to our existing NMRElucidator platform,⁶ a spectrum-to-structure model exploiting a deep learning architecture inspired by vision-language models. When using only one-dimensional ¹H and/or ¹³C NMR spectra as the input, we have previously shown that the NMRElucidator can make accurate predictions for molecules with up to 40 non-hydrogen atoms across the full elemental coverage typically encountered in organic chemistry (C, N, O, H, P, S, Si, B, and the halogens), although the accuracy is moderate for molecules at the larger end (Top-15 accuracy of 15% for 40 heavy atoms) of this size range because of the enormity of the structure space, O(1037)\mathcal{O}(10^{37}) possible molecules. Here, to train NMRElucidator to recognize molecular precursor context, we use AiZynthFinder³⁰,³¹ to perform retrosynthetic analysis of molecules and sample from the retrosynthetic paths to generate precursors that serve as the prompt for the structure elucidation model. The resulting context-aware NMRElucidator shows an improvement in Top-1 accuracy by up to 46.5 percentage points when provided with high-quality precursor context and minimal (<4 percentage points) degradation in accuracy when provided with low-quality context. Our approach is model-agnostic in both directions: we impose no constraints on the structure eluci-

a) Electronic mail: rotskoff@stanford.edu b) Electronic mail: mkanan@stanford.edu c) Electronic mail: tmarkland@stanford.edu dation model or the retrosynthetic model for generating training precursors, except that the structure elucidation model must be a spectrum-to-structure model. Our protocol therefore provides a route to advance the accuracy of de novo spectroscopic structure elucidation models across a wide range of applications.

References (8)