{"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/hamiltonian-dynamics-with-non-newtonian","title":"Hamiltonian Dynamics with Non-Newtonian Momentum for Rapid Sampling","arxiv_id":"2111.02434","date":"2021-11-03","proceeding":"NeurIPS 2021 12","authors":["Greg Ver Steeg","Aram Galstyan"],"abstract":"Sampling from an unnormalized probability distribution is a fundamental problem in machine learning with applications including Bayesian modeling, latent factor inference, and energy-based model training. After decades of research, variations of MCMC remain the default approach to sampling despite slow convergence. Auxiliary neural models can learn to speed up MCMC, but the overhead for training the extra model can be prohibitive. We propose a fundamentally different approach to this problem via a new Hamiltonian dynamics with a non-Newtonian momentum. In contrast to MCMC approaches like Hamiltonian Monte Carlo, no stochastic step is required. Instead, the proposed deterministic dynamics in an extended state space exactly sample the target distribution, specified by an energy function, under an assumption of ergodicity. Alternatively, the dynamics can be interpreted as a normalizing flow that samples a specified energy model without training. The proposed Energy Sampling Hamiltonian (ESH) dynamics have a simple form that can be solved with existing ODE solvers, but we derive a specialized solver that exhibits much better performance. ESH dynamics converge faster than their MCMC competitors enabling faster, more stable training of neural network energy models.","url_abs":"https://arxiv.org/abs/2111.02434v3","url_pdf":"https://arxiv.org/pdf/2111.02434v3.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":"hamiltonian-dynamics-with-non-newtonian","repo_url":"https://github.com/gregversteeg/esh_dynamics","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[],"methods":[{"method_slug":"speed","method_name":"SPEED"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2111.02434","atlas_url":"https://app.syntology.ai/?focus=2111.02434","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2111.02434"}},"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":"deterministic:regex_extraction","url":"https://github.com/wgrathwohl/JEM","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/gregversteeg/esh_dynamics","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/point0bar1/ebm-anatomy","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/rtqichen/torchdiffeq","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/eigenfoo/littlemcmc","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_honours":2,"ran_draft_wrong":5,"ran":5,"unverified":2},"by_repo_kind":{"official":{"samples":5,"ran":5,"repositories":1},"found_in_text":{"samples":8,"ran":6,"repositories":2}},"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":1,"samples":[{"code_sha256_prefix":"246b3036cf5c3d38","entry":"billiards","repo":"gregversteeg/esh_dynamics","repo_kind":"official","path":"esh/core.py","file_url":"https://github.com/gregversteeg/esh_dynamics/blob/HEAD/esh/core.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"246b3036cf5c3d38"}},{"code_sha256_prefix":"ad0a2d24d12e2af3","entry":"esh_leap_step","repo":"gregversteeg/esh_dynamics","repo_kind":"official","path":"esh/core.py","file_url":"https://github.com/gregversteeg/esh_dynamics/blob/HEAD/esh/core.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ad0a2d24d12e2af3"}},{"code_sha256_prefix":"90eed7b2ef9c7cc9","entry":"esh_leap_step","repo":"gregversteeg/esh_dynamics","repo_kind":"official","path":"esh/core.py","file_url":"https://github.com/gregversteeg/esh_dynamics/blob/HEAD/esh/core.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"90eed7b2ef9c7cc9"}},{"code_sha256_prefix":"29ae6da71890a0da","entry":"get_sample_q","repo":"wgrathwohl/JEM","repo_kind":"found_in_text","path":"train_wrn_ebm.py","file_url":"https://github.com/wgrathwohl/JEM/blob/HEAD/train_wrn_ebm.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"29ae6da71890a0da"}},{"code_sha256_prefix":"77d3d7b7c1ab83ce","entry":"init_random","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"77d3d7b7c1ab83ce"}},{"code_sha256_prefix":"916d7e0ce470f1bb","entry":"isquadpotential","repo":"eigenfoo/littlemcmc","repo_kind":"found_in_text","path":"littlemcmc/quadpotential.py","file_url":"https://github.com/eigenfoo/littlemcmc/blob/HEAD/littlemcmc/quadpotential.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"916d7e0ce470f1bb"}},{"code_sha256_prefix":"5420df8af89cc7cd","entry":"jarzynski_sample","repo":"gregversteeg/esh_dynamics","repo_kind":"official","path":"esh/core.py","file_url":"https://github.com/gregversteeg/esh_dynamics/blob/HEAD/esh/core.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5420df8af89cc7cd"}},{"code_sha256_prefix":"b0fc8c54e4f85a50","entry":"log1mexp_numpy","repo":"eigenfoo/littlemcmc","repo_kind":"found_in_text","path":"littlemcmc/math.py","file_url":"https://github.com/eigenfoo/littlemcmc/blob/HEAD/littlemcmc/math.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b0fc8c54e4f85a50"}},{"code_sha256_prefix":"ce692f1e057145d0","entry":"logbern","repo":"eigenfoo/littlemcmc","repo_kind":"found_in_text","path":"littlemcmc/math.py","file_url":"https://github.com/eigenfoo/littlemcmc/blob/HEAD/littlemcmc/math.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ce692f1e057145d0"}},{"code_sha256_prefix":"5b291226145b9ec1","entry":"logdiffexp_numpy","repo":"eigenfoo/littlemcmc","repo_kind":"found_in_text","path":"littlemcmc/math.py","file_url":"https://github.com/eigenfoo/littlemcmc/blob/HEAD/littlemcmc/math.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5b291226145b9ec1"}},{"code_sha256_prefix":"5b85f7845f5fe619","entry":"rebuild_exc","repo":"eigenfoo/littlemcmc","repo_kind":"found_in_text","path":"littlemcmc/parallel_sampling.py","file_url":"https://github.com/eigenfoo/littlemcmc/blob/HEAD/littlemcmc/parallel_sampling.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5b85f7845f5fe619"}},{"code_sha256_prefix":"ce2f28911e5c38cf","entry":"u_r_step","repo":"gregversteeg/esh_dynamics","repo_kind":"official","path":"esh/core.py","file_url":"https://github.com/gregversteeg/esh_dynamics/blob/HEAD/esh/core.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ce2f28911e5c38cf"}},{"code_sha256_prefix":"bf4617984094c1f5","entry":"init_nuts","repo":"eigenfoo/littlemcmc","repo_kind":"found_in_text","path":"littlemcmc/sampling.py","file_url":"https://github.com/eigenfoo/littlemcmc/blob/HEAD/littlemcmc/sampling.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bf4617984094c1f5"}},{"code_sha256_prefix":"91493b1dc16affd9","entry":"quad_potential","repo":"eigenfoo/littlemcmc","repo_kind":"found_in_text","path":"littlemcmc/quadpotential.py","file_url":"https://github.com/eigenfoo/littlemcmc/blob/HEAD/littlemcmc/quadpotential.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"91493b1dc16affd9"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}