{"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/nonparametric-hamiltonian-monte-carlo","title":"Nonparametric Hamiltonian Monte Carlo","arxiv_id":"2106.10238","date":"2021-06-18","proceeding":null,"authors":["Carol Mak","Fabian Zaiser","Luke Ong"],"abstract":"Probabilistic programming uses programs to express generative models whose posterior probability is then computed by built-in inference engines. A challenging goal is to develop general purpose inference algorithms that work out-of-the-box for arbitrary programs in a universal probabilistic programming language (PPL). The densities defined by such programs, which may use stochastic branching and recursion, are (in general) nonparametric, in the sense that they correspond to models on an infinite-dimensional parameter space. However standard inference algorithms, such as the Hamiltonian Monte Carlo (HMC) algorithm, target distributions with a fixed number of parameters. This paper introduces the Nonparametric Hamiltonian Monte Carlo (NP-HMC) algorithm which generalises HMC to nonparametric models. Inputs to NP-HMC are a new class of measurable functions called \"tree representable\", which serve as a language-independent representation of the density functions of probabilistic programs in a universal PPL. We provide a correctness proof of NP-HMC, and empirically demonstrate significant performance improvements over existing approaches on several nonparametric examples.","url_abs":"https://arxiv.org/abs/2106.10238v2","url_pdf":"https://arxiv.org/pdf/2106.10238v2.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":"nonparametric-hamiltonian-monte-carlo","repo_url":"https://github.com/fzaiser/nonparametric-hmc","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"probabilistic-programming","task_name":"Probabilistic Programming"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2106.10238","atlas_url":"https://app.syntology.ai/?focus=2106.10238","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2106.10238"}},"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/fzaiser/nonparametric-hmc","reach":null}],"summary":{"ran":2,"ran_draft_wrong":2,"unverified":4},"by_repo_kind":{"official":{"samples":8,"ran":4,"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":"ff94237e7f7393ab","entry":"ProbCtx","repo":"fzaiser/nonparametric-hmc","repo_kind":"official","path":"infer.py","file_url":"https://github.com/fzaiser/nonparametric-hmc/blob/HEAD/infer.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":"ff94237e7f7393ab"}},{"code_sha256_prefix":"39c29a03698ae55c","entry":"ProbRun","repo":"fzaiser/nonparametric-hmc","repo_kind":"official","path":"infer.py","file_url":"https://github.com/fzaiser/nonparametric-hmc/blob/HEAD/infer.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":"39c29a03698ae55c"}},{"code_sha256_prefix":"cde8a094fa42f427","entry":"parse_anglican_timings","repo":"fzaiser/nonparametric-hmc","repo_kind":"official","path":"evaluation.py","file_url":"https://github.com/fzaiser/nonparametric-hmc/blob/HEAD/evaluation.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":"cde8a094fa42f427"}},{"code_sha256_prefix":"f5813ce313755a26","entry":"thin_runs","repo":"fzaiser/nonparametric-hmc","repo_kind":"official","path":"evaluation.py","file_url":"https://github.com/fzaiser/nonparametric-hmc/blob/HEAD/evaluation.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":"f5813ce313755a26"}},{"code_sha256_prefix":"54ae7f011c24d8ff","entry":"coord_integrator","repo":"fzaiser/nonparametric-hmc","repo_kind":"official","path":"infer.py","file_url":"https://github.com/fzaiser/nonparametric-hmc/blob/HEAD/infer.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":"54ae7f011c24d8ff"}},{"code_sha256_prefix":"4817d57b7ebcf4f0","entry":"integrator_step","repo":"fzaiser/nonparametric-hmc","repo_kind":"official","path":"infer.py","file_url":"https://github.com/fzaiser/nonparametric-hmc/blob/HEAD/infer.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":"4817d57b7ebcf4f0"}},{"code_sha256_prefix":"68c352586edf0684","entry":"np_dhmc","repo":"fzaiser/nonparametric-hmc","repo_kind":"official","path":"infer.py","file_url":"https://github.com/fzaiser/nonparametric-hmc/blob/HEAD/infer.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":"68c352586edf0684"}},{"code_sha256_prefix":"8a6993df81cb7c27","entry":"thin_list","repo":"fzaiser/nonparametric-hmc","repo_kind":"official","path":"evaluation.py","file_url":"https://github.com/fzaiser/nonparametric-hmc/blob/HEAD/evaluation.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8a6993df81cb7c27"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}