{"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/molspectra-pre-training-3d-molecular","title":"MolSpectra: Pre-training 3D Molecular Representation with Multi-modal Energy Spectra","arxiv_id":"2502.16284","date":"2025-02-22","proceeding":null,"authors":["Shaozhen Liu","Yu Rong","Deli Zhao","Qiang Liu","Shu Wu","Liang Wang"],"abstract":"Establishing the relationship between 3D structures and the energy states of molecular systems has proven to be a promising approach for learning 3D molecular representations. However, existing methods are limited to modeling the molecular energy states from classical mechanics. This limitation results in a significant oversight of quantum mechanical effects, such as quantized (discrete) energy level structures, which offer a more accurate estimation of molecular energy and can be experimentally measured through energy spectra. In this paper, we propose to utilize the energy spectra to enhance the pre-training of 3D molecular representations (MolSpectra), thereby infusing the knowledge of quantum mechanics into the molecular representations. Specifically, we propose SpecFormer, a multi-spectrum encoder for encoding molecular spectra via masked patch reconstruction. By further aligning outputs from the 3D encoder and spectrum encoder using a contrastive objective, we enhance the 3D encoder's understanding of molecules. Evaluations on public benchmarks reveal that our pre-trained representations surpass existing methods in predicting molecular properties and modeling dynamics.","url_abs":"https://arxiv.org/abs/2502.16284v1","url_pdf":"https://arxiv.org/pdf/2502.16284v1.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":"molspectra-pre-training-3d-molecular","repo_url":"https://github.com/azureleon1/molspectra","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"molecular-representation","task_name":"molecular representation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2502.16284","atlas_url":"https://app.syntology.ai/?focus=2502.16284","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2502.16284"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/azureleon1/molspectra","reach":null}],"summary":{"ran":3,"ran_honours":1,"ran_draft_wrong":1,"ran_fixture":1,"unverified":6},"by_repo_kind":{"official":{"samples":12,"ran":6,"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":12,"samples":[{"code_sha256_prefix":"246f52c6484b0599","entry":"Flatten_Head","repo":"azureleon1/molspectra","repo_kind":"official","path":"torchmdnet/models/Sp.py","file_url":"https://github.com/azureleon1/molspectra/blob/HEAD/torchmdnet/models/Sp.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"246f52c6484b0599"}},{"code_sha256_prefix":"441db23d80d94d29","entry":"_MultiheadAttention","repo":"azureleon1/molspectra","repo_kind":"official","path":"torchmdnet/models/Sp.py","file_url":"https://github.com/azureleon1/molspectra/blob/HEAD/torchmdnet/models/Sp.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"441db23d80d94d29"}},{"code_sha256_prefix":"3b5743df00e17831","entry":"_ScaledDotProductAttention","repo":"azureleon1/molspectra","repo_kind":"official","path":"torchmdnet/models/Sp.py","file_url":"https://github.com/azureleon1/molspectra/blob/HEAD/torchmdnet/models/Sp.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3b5743df00e17831"}},{"code_sha256_prefix":"46bcc4c6885ef0d1","entry":"compute_reconstruct_loss","repo":"azureleon1/molspectra","repo_kind":"official","path":"torchmdnet/models/Sp.py","file_url":"https://github.com/azureleon1/molspectra/blob/HEAD/torchmdnet/models/Sp.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"46bcc4c6885ef0d1"}},{"code_sha256_prefix":"2d15324019001de4","entry":"get_activation_fn","repo":"azureleon1/molspectra","repo_kind":"official","path":"torchmdnet/models/SpecFormer_layers.py","file_url":"https://github.com/azureleon1/molspectra/blob/HEAD/torchmdnet/models/SpecFormer_layers.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2d15324019001de4"}},{"code_sha256_prefix":"537d3f04688b32dd","entry":"random_masking","repo":"azureleon1/molspectra","repo_kind":"official","path":"torchmdnet/models/Sp.py","file_url":"https://github.com/azureleon1/molspectra/blob/HEAD/torchmdnet/models/Sp.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"537d3f04688b32dd"}},{"code_sha256_prefix":"a82b47c227d5b5bc","entry":"Coord2dPosEncoding","repo":"azureleon1/molspectra","repo_kind":"official","path":"torchmdnet/models/SpecFormer_layers.py","file_url":"https://github.com/azureleon1/molspectra/blob/HEAD/torchmdnet/models/SpecFormer_layers.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a82b47c227d5b5bc"}},{"code_sha256_prefix":"9ec0fb6fafc3df1e","entry":"PositionalEncoding","repo":"azureleon1/molspectra","repo_kind":"official","path":"torchmdnet/models/SpecFormer_layers.py","file_url":"https://github.com/azureleon1/molspectra/blob/HEAD/torchmdnet/models/SpecFormer_layers.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9ec0fb6fafc3df1e"}},{"code_sha256_prefix":"470bf121dcb9ca04","entry":"SpecFormer","repo":"azureleon1/molspectra","repo_kind":"official","path":"torchmdnet/models/Sp.py","file_url":"https://github.com/azureleon1/molspectra/blob/HEAD/torchmdnet/models/Sp.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"470bf121dcb9ca04"}},{"code_sha256_prefix":"ed3a26c1277d6c6c","entry":"TSTEncoder","repo":"azureleon1/molspectra","repo_kind":"official","path":"torchmdnet/models/Sp.py","file_url":"https://github.com/azureleon1/molspectra/blob/HEAD/torchmdnet/models/Sp.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ed3a26c1277d6c6c"}},{"code_sha256_prefix":"78bc84c5375b0dae","entry":"TSTEncoderLayer","repo":"azureleon1/molspectra","repo_kind":"official","path":"torchmdnet/models/Sp.py","file_url":"https://github.com/azureleon1/molspectra/blob/HEAD/torchmdnet/models/Sp.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"78bc84c5375b0dae"}},{"code_sha256_prefix":"debd2763d8945222","entry":"TSTiEncoder","repo":"azureleon1/molspectra","repo_kind":"official","path":"torchmdnet/models/Sp.py","file_url":"https://github.com/azureleon1/molspectra/blob/HEAD/torchmdnet/models/Sp.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"debd2763d8945222"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}