{"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/molhf-a-hierarchical-normalizing-flow-for","title":"MolHF: A Hierarchical Normalizing Flow for Molecular Graph Generation","arxiv_id":"2305.08457","date":"2023-05-15","proceeding":null,"authors":["Yiheng Zhu","Zhenqiu Ouyang","Ben Liao","Jialu Wu","Yixuan Wu","Chang-Yu Hsieh","Tingjun Hou","Jian Wu"],"abstract":"Molecular de novo design is a critical yet challenging task in scientific fields, aiming to design novel molecular structures with desired property profiles. Significant progress has been made by resorting to generative models for graphs. However, limited attention is paid to hierarchical generative models, which can exploit the inherent hierarchical structure (with rich semantic information) of the molecular graphs and generate complex molecules of larger size that we shall demonstrate to be difficult for most existing models. The primary challenge to hierarchical generation is the non-differentiable issue caused by the generation of intermediate discrete coarsened graph structures. To sidestep this issue, we cast the tricky hierarchical generation problem over discrete spaces as the reverse process of hierarchical representation learning and propose MolHF, a new hierarchical flow-based model that generates molecular graphs in a coarse-to-fine manner. Specifically, MolHF first generates bonds through a multi-scale architecture, then generates atoms based on the coarsened graph structure at each scale. We demonstrate that MolHF achieves state-of-the-art performance in random generation and property optimization, implying its high capacity to model data distribution. Furthermore, MolHF is the first flow-based model that can be applied to model larger molecules (polymer) with more than 100 heavy atoms. The code and models are available at https://github.com/violet-sto/MolHF.","url_abs":"https://arxiv.org/abs/2305.08457v1","url_pdf":"https://arxiv.org/pdf/2305.08457v1.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":"molhf-a-hierarchical-normalizing-flow-for","repo_url":"https://github.com/violet-sto/molhf","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"graph-generation","task_name":"Graph Generation"},{"task_slug":"molecular-graph-generation","task_name":"Molecular Graph Generation"},{"task_slug":"representation-learning","task_name":"Representation Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2305.08457","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2305.08457"}},"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/violet-sto/MolHF","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/violet-sto/molhf","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":10,"ran_violates":1,"ran_honours":1,"ran_fixture":1,"ran_draft_wrong":1,"unverified":9},"by_repo_kind":{"official":{"samples":23,"ran":14,"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":"62239b0f787c9409","entry":"ActNorm","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"62239b0f787c9409"}},{"code_sha256_prefix":"1e9fb6d1a5de1997","entry":"ActNorm2D","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1e9fb6d1a5de1997"}},{"code_sha256_prefix":"e0ea9e5584744a7e","entry":"AffineCoupling","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e0ea9e5584744a7e"}},{"code_sha256_prefix":"673215531f5c9351","entry":"CrissCrossAttention","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"673215531f5c9351"}},{"code_sha256_prefix":"2c475547db518beb","entry":"GraphConv","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2c475547db518beb"}},{"code_sha256_prefix":"399928d133771096","entry":"INF","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"399928d133771096"}},{"code_sha256_prefix":"0a804d8c8c4a8d7b","entry":"InvConv2d","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0a804d8c8c4a8d7b"}},{"code_sha256_prefix":"76fecc6493ba2e83","entry":"InvConv2dLU","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"76fecc6493ba2e83"}},{"code_sha256_prefix":"37df6656e9f537ed","entry":"InvRotationLU","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"37df6656e9f537ed"}},{"code_sha256_prefix":"255d29628ddbc5c1","entry":"RGCN","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"255d29628ddbc5c1"}},{"code_sha256_prefix":"b33a81dea55c1513","entry":"Rescale","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b33a81dea55c1513"}},{"code_sha256_prefix":"cd1a4050db5f5c36","entry":"logabs","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cd1a4050db5f5c36"}},{"code_sha256_prefix":"19c4edfbb17dc994","entry":"rescale_adj","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"19c4edfbb17dc994"}},{"code_sha256_prefix":"9b3bfa20027b4271","entry":"squeeze_adj","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9b3bfa20027b4271"}},{"code_sha256_prefix":"46b1f7a69cd6719a","entry":"Block","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"46b1f7a69cd6719a"}},{"code_sha256_prefix":"1874778db54a827e","entry":"BlockOnGraph","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1874778db54a827e"}},{"code_sha256_prefix":"ddab52777bb4f278","entry":"CC_Glow","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ddab52777bb4f278"}},{"code_sha256_prefix":"9ac0aa08d59068b7","entry":"Flow","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9ac0aa08d59068b7"}},{"code_sha256_prefix":"9810c9a6a91778ff","entry":"FlowOnGraph","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9810c9a6a91778ff"}},{"code_sha256_prefix":"117498aa88c3d909","entry":"Gaussianize","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"117498aa88c3d909"}},{"code_sha256_prefix":"0e21277976b52619","entry":"GraphAffineCoupling","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0e21277976b52619"}},{"code_sha256_prefix":"8b68ca797d26b070","entry":"GraphFlow","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8b68ca797d26b070"}},{"code_sha256_prefix":"a0f64373d768ebb1","entry":"MolHF","repo":"violet-sto/molhf","repo_kind":"official","path":"models/MolHF.py","file_url":"https://github.com/violet-sto/molhf/blob/HEAD/models/MolHF.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a0f64373d768ebb1"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}