{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/diffms-diffusion-generation-of-molecules","title":"DiffMS: Diffusion Generation of Molecules Conditioned on Mass Spectra","arxiv_id":"2502.09571","date":"2025-02-13","proceeding":null,"authors":["Montgomery Bohde","Mrunali Manjrekar","Runzhong Wang","Shuiwang Ji","Connor W. Coley"],"abstract":"Mass spectrometry plays a fundamental role in elucidating the structures of unknown molecules and subsequent scientific discoveries. One formulation of the structure elucidation task is the conditional de novo generation of molecular structure given a mass spectrum. Toward a more accurate and efficient scientific discovery pipeline for small molecules, we present DiffMS, a formula-restricted encoder-decoder generative network that achieves state-of-the-art performance on this task. The encoder utilizes a transformer architecture and models mass spectra domain knowledge such as peak formulae and neutral losses, and the decoder is a discrete graph diffusion model restricted by the heavy-atom composition of a known chemical formula. To develop a robust decoder that bridges latent embeddings and molecular structures, we pretrain the diffusion decoder with fingerprint-structure pairs, which are available in virtually infinite quantities, compared to structure-spectrum pairs that number in the tens of thousands. Extensive experiments on established benchmarks show that DiffMS outperforms existing models on de novo molecule generation. We provide several ablations to demonstrate the effectiveness of our diffusion and pretraining approaches and show consistent performance scaling with increasing pretraining dataset size. DiffMS code is publicly available at https://github.com/coleygroup/DiffMS.","url_abs":"https://arxiv.org/abs/2502.09571v2","url_pdf":"https://arxiv.org/pdf/2502.09571v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"diffms-diffusion-generation-of-molecules","repo_url":"https://github.com/coleygroup/diffms","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"de-novo-molecule-generation-from-ms-ms-1","task_name":"De novo molecule generation from MS/MS spectrum (bonus chemical formulae)"},{"task_slug":"decoder","task_name":"Decoder"},{"task_slug":"scientific-discovery","task_name":"scientific discovery"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/de-novo-molecule-generation-from-ms-ms-1","task":"De novo molecule generation from MS/MS spectrum (bonus chemical formulae)","dataset":"MassSpecGym","model":"DiffMS","rank_in_archive_order":1,"of":9,"metrics":{"Top-1 Accuracy":"2.3","Top-1 MCES":"18.45","Top-1 Tanimoto":"0.28","Top-10 Accuracy":"4.25","Top-10 MCES":"14.73","Top-10 Tanimoto":"0.39"},"uses_additional_data":true},{"leaderboard":"/sota/de-novo-molecule-generation-from-ms-ms-1","task":"De novo molecule generation from MS/MS spectrum (bonus chemical formulae)","dataset":"MassSpecGym","model":"Spec2Mol","rank_in_archive_order":5,"of":9,"metrics":{"Top-1 Accuracy":"0.00","Top-1 MCES":"37.76","Top-1 Tanimoto":"0.12","Top-10 Accuracy":"0.00","Top-10 MCES":"29.40","Top-10 Tanimoto":"0.16"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2502.09571","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2502.09571"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/coleygroup/DiffMS","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/coleygroup/diffms","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1},"by_repo_kind":{"official":{"samples":1,"ran":1,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"da1d4f7563efdef8","entry":"load_weights","repo":"coleygroup/DiffMS","repo_kind":"official","path":"src/spec2mol_main.py","file_url":"https://github.com/coleygroup/DiffMS/blob/HEAD/src/spec2mol_main.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"da1d4f7563efdef8"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}