{"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/amortized-rejection-sampling-in-universal","title":"Amortized Rejection Sampling in Universal Probabilistic Programming","arxiv_id":"1910.09056","date":"2019-10-20","proceeding":null,"authors":["Saeid Naderiparizi","Adam Ścibior","Andreas Munk","Mehrdad Ghadiri","Atılım Güneş Baydin","Bradley Gram-Hansen","Christian Schroeder de Witt","Robert Zinkov","Philip H. S. Torr","Tom Rainforth","Yee Whye Teh","Frank Wood"],"abstract":"Naive approaches to amortized inference in probabilistic programs with unbounded loops can produce estimators with infinite variance. This is particularly true of importance sampling inference in programs that explicitly include rejection sampling as part of the user-programmed generative procedure. In this paper we develop a new and efficient amortized importance sampling estimator. We prove finite variance of our estimator and empirically demonstrate our method's correctness and efficiency compared to existing alternatives on generative programs containing rejection sampling loops and discuss how to implement our method in a generic probabilistic programming framework.","url_abs":"https://arxiv.org/abs/1910.09056v3","url_pdf":"https://arxiv.org/pdf/1910.09056v3.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":"amortized-rejection-sampling-in-universal","repo_url":"https://github.com/plai-group/amortized-rejection-sampling","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"probabilistic-programming","task_name":"Probabilistic Programming"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1910.09056","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1910.09056"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/plai-group/amortized-rejection-sampling","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":10},"by_repo_kind":{"official":{"samples":10,"ran":0,"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":"ff7f44ddd1530cb8","entry":"GUMEvidence","repo":"plai-group/amortized-rejection-sampling","repo_kind":"official","path":"exp_marsaglia/model.py","file_url":"https://github.com/plai-group/amortized-rejection-sampling/blob/HEAD/exp_marsaglia/model.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":"ff7f44ddd1530cb8"}},{"code_sha256_prefix":"46fa2815061ee868","entry":"GUMPosteriorParameters","repo":"plai-group/amortized-rejection-sampling","repo_kind":"official","path":"exp_marsaglia/model.py","file_url":"https://github.com/plai-group/amortized-rejection-sampling/blob/HEAD/exp_marsaglia/model.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":"46fa2815061ee868"}},{"code_sha256_prefix":"4295c0ac7b3c6ae4","entry":"M","repo":"plai-group/amortized-rejection-sampling","repo_kind":"official","path":"exp_mini_sherpa/model.py","file_url":"https://github.com/plai-group/amortized-rejection-sampling/blob/HEAD/exp_mini_sherpa/model.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":"4295c0ac7b3c6ae4"}},{"code_sha256_prefix":"d5c7e8c1c3cbedaa","entry":"dispatch_model","repo":"plai-group/amortized-rejection-sampling","repo_kind":"official","path":"utils.py","file_url":"https://github.com/plai-group/amortized-rejection-sampling/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d5c7e8c1c3cbedaa"}},{"code_sha256_prefix":"66193dd6816135ec","entry":"get_evidence_estimate","repo":"plai-group/amortized-rejection-sampling","repo_kind":"official","path":"plotting/utils.py","file_url":"https://github.com/plai-group/amortized-rejection-sampling/blob/HEAD/plotting/utils.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":"66193dd6816135ec"}},{"code_sha256_prefix":"28175f98b50328ec","entry":"get_trace_text","repo":"plai-group/amortized-rejection-sampling","repo_kind":"official","path":"exp_mini_sherpa/utils.py","file_url":"https://github.com/plai-group/amortized-rejection-sampling/blob/HEAD/exp_mini_sherpa/utils.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":"28175f98b50328ec"}},{"code_sha256_prefix":"4e16347fa6329047","entry":"load_log_weights","repo":"plai-group/amortized-rejection-sampling","repo_kind":"official","path":"plotting/utils.py","file_url":"https://github.com/plai-group/amortized-rejection-sampling/blob/HEAD/plotting/utils.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":"4e16347fa6329047"}},{"code_sha256_prefix":"67b641f6d06913d0","entry":"rotations","repo":"plai-group/amortized-rejection-sampling","repo_kind":"official","path":"exp_mini_sherpa/model.py","file_url":"https://github.com/plai-group/amortized-rejection-sampling/blob/HEAD/exp_mini_sherpa/model.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":"67b641f6d06913d0"}},{"code_sha256_prefix":"58957ba935f8204c","entry":"set_size","repo":"plai-group/amortized-rejection-sampling","repo_kind":"official","path":"plotting/utils.py","file_url":"https://github.com/plai-group/amortized-rejection-sampling/blob/HEAD/plotting/utils.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":"58957ba935f8204c"}},{"code_sha256_prefix":"e837e0b3fe75d232","entry":"to_polar","repo":"plai-group/amortized-rejection-sampling","repo_kind":"official","path":"exp_mini_sherpa/model.py","file_url":"https://github.com/plai-group/amortized-rejection-sampling/blob/HEAD/exp_mini_sherpa/model.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":"e837e0b3fe75d232"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}