{"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/arxiv-2508-10684","title":"MDNS: Masked Diffusion Neural Sampler via Stochastic Optimal Control","arxiv_id":"2508.10684","date":"2025-08-14","proceeding":"NeurIPS","authors":["Yuchen Zhu","Wei Guo","Jaemoo Choi","Guan-Horng Liu","Yongxin Chen","Molei Tao"],"abstract":"We study the problem of learning a neural sampler to generate samples from discrete state spaces where the target probability mass function $π\\propto\\mathrm{e}^{-U}$ is known up to a normalizing constant, which is an important task in fields such as statistical physics, machine learning, combinatorial optimization, etc. To better address this challenging task when the state space has a large cardinality and the distribution is multi-modal, we propose $\\textbf{M}$asked $\\textbf{D}$iffusion $\\textbf{N}$eural $\\textbf{S}$ampler ($\\textbf{MDNS}$), a novel framework for training discrete neural samplers by aligning two path measures through a family of learning objectives, theoretically grounded in the stochastic optimal control of the continuous-time Markov chains. We validate the efficiency and scalability of MDNS through extensive experiments on various distributions with distinct statistical properties, where MDNS learns to accurately sample from the target distributions despite the extremely high problem dimensions and outperforms other learning-based baselines by a large margin. A comprehensive study of ablations and extensions is also provided to demonstrate the efficacy and potential of the proposed framework. Our code is available at https://github.com/yuchen-zhu-zyc/MDNS.","url_abs":"https://arxiv.org/abs/2508.10684","url_pdf":"https://arxiv.org/pdf/2508.10684","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2508.10684","atlas_url":"https://app.syntology.ai/?focus=2508.10684","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2508.10684"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/yuchen-zhu-zyc/MDNS","reach":{"status":"ok"}}],"summary":{"ran_violates":1,"ran_honours":1,"unverified":11},"by_repo_kind":{"found_in_text":{"samples":13,"ran":2,"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":13,"samples":[{"code_sha256_prefix":"ca0035b41d2fa8b4","entry":"compute_axial_cis","repo":"yuchen-zhu-zyc/MDNS","repo_kind":"found_in_text","path":"model/vit_rope.py","file_url":"https://github.com/yuchen-zhu-zyc/MDNS/blob/HEAD/model/vit_rope.py","link_basis":"plan_row","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ca0035b41d2fa8b4"}},{"code_sha256_prefix":"241579c505724f68","entry":"init_random_2d_freqs","repo":"yuchen-zhu-zyc/MDNS","repo_kind":"found_in_text","path":"model/vit_rope.py","file_url":"https://github.com/yuchen-zhu-zyc/MDNS/blob/HEAD/model/vit_rope.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"241579c505724f68"}},{"code_sha256_prefix":"e231579fccd77a61","entry":"compute_mixed_cis","repo":"yuchen-zhu-zyc/MDNS","repo_kind":"found_in_text","path":"model/vit_rope.py","file_url":"https://github.com/yuchen-zhu-zyc/MDNS/blob/HEAD/model/vit_rope.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":"e231579fccd77a61"}},{"code_sha256_prefix":"ac7a3634765bc430","entry":"ess","repo":"yuchen-zhu-zyc/MDNS","repo_kind":"found_in_text","path":"utils.py","file_url":"https://github.com/yuchen-zhu-zyc/MDNS/blob/HEAD/utils.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":"ac7a3634765bc430"}},{"code_sha256_prefix":"7e0bdb0797632655","entry":"ising2d_get_all_configs","repo":"yuchen-zhu-zyc/MDNS","repo_kind":"found_in_text","path":"utils_ising.py","file_url":"https://github.com/yuchen-zhu-zyc/MDNS/blob/HEAD/utils_ising.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":"7e0bdb0797632655"}},{"code_sha256_prefix":"856bb78ae55c23b6","entry":"ising2d_ham","repo":"yuchen-zhu-zyc/MDNS","repo_kind":"found_in_text","path":"utils_ising.py","file_url":"https://github.com/yuchen-zhu-zyc/MDNS/blob/HEAD/utils_ising.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":"856bb78ae55c23b6"}},{"code_sha256_prefix":"b22169bdab2d9b6c","entry":"ising2d_part_func","repo":"yuchen-zhu-zyc/MDNS","repo_kind":"found_in_text","path":"utils_ising.py","file_url":"https://github.com/yuchen-zhu-zyc/MDNS/blob/HEAD/utils_ising.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":"b22169bdab2d9b6c"}},{"code_sha256_prefix":"694badfc2ffb7577","entry":"loss_ce","repo":"yuchen-zhu-zyc/MDNS","repo_kind":"found_in_text","path":"utils_train.py","file_url":"https://github.com/yuchen-zhu-zyc/MDNS/blob/HEAD/utils_train.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":"694badfc2ffb7577"}},{"code_sha256_prefix":"4a4de16bb6ca9333","entry":"potts2d_ham","repo":"yuchen-zhu-zyc/MDNS","repo_kind":"found_in_text","path":"utils_potts.py","file_url":"https://github.com/yuchen-zhu-zyc/MDNS/blob/HEAD/utils_potts.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":"4a4de16bb6ca9333"}},{"code_sha256_prefix":"8242f05d8627a1e7","entry":"potts2d_magnetization","repo":"yuchen-zhu-zyc/MDNS","repo_kind":"found_in_text","path":"utils_potts.py","file_url":"https://github.com/yuchen-zhu-zyc/MDNS/blob/HEAD/utils_potts.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":"8242f05d8627a1e7"}},{"code_sha256_prefix":"f2c91dce7683fd12","entry":"potts2d_magnetization_all","repo":"yuchen-zhu-zyc/MDNS","repo_kind":"found_in_text","path":"utils_potts.py","file_url":"https://github.com/yuchen-zhu-zyc/MDNS/blob/HEAD/utils_potts.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":"f2c91dce7683fd12"}},{"code_sha256_prefix":"399f607de3e3cec3","entry":"sample_categorical","repo":"yuchen-zhu-zyc/MDNS","repo_kind":"found_in_text","path":"utils.py","file_url":"https://github.com/yuchen-zhu-zyc/MDNS/blob/HEAD/utils.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":"399f607de3e3cec3"}},{"code_sha256_prefix":"423a4108584be544","entry":"sample_categorical_logits","repo":"yuchen-zhu-zyc/MDNS","repo_kind":"found_in_text","path":"utils.py","file_url":"https://github.com/yuchen-zhu-zyc/MDNS/blob/HEAD/utils.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":"423a4108584be544"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.LG","source":"arxiv_api"},"syntology_extracted_results":{"kind":"leaderboard_placements","source":"Syntology's leaderboard-shaped extractor over the paper's own arXiv-HTML tables: a model pointed at a cell, the number was read from that cell and checked against the board's metric, dataset, split and scale, and an independent check accepted the entry; not reviewed by the paper's authors or the archive's editors","extractor_model":"global.anthropic.claude-sonnet-4-5-20250929-v1:0","verifier_model":null,"prompt_sha":"fa63d4bb9d755694","coverage":{"sentence":"Syntology has checked 6,885 of the 9,623 papers on this site that are newer than the archive; results from the others appear after they are checked.","papers_newer_than_archive":9623,"papers_checked":6885},"entries":[],"not_placed":{"boards":0,"rejected_by_independent_check":0,"refused_by_a_rule":0,"check_did_not_answer":0,"proposed_without_a_cell":0,"declined_by_site":0}}}