{"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/greedy-poisson-rejection-sampling","title":"Greedy Poisson Rejection Sampling","arxiv_id":"2305.15313","date":"2023-05-24","proceeding":null,"authors":["Gergely Flamich"],"abstract":"One-shot channel simulation is a fundamental data compression problem concerned with encoding a single sample from a target distribution $Q$ using a coding distribution $P$ using as few bits as possible on average. Algorithms that solve this problem find applications in neural data compression and differential privacy and can serve as a more efficient alternative to quantization-based methods. Sadly, existing solutions are too slow or have limited applicability, preventing widespread adoption. In this paper, we conclusively solve one-shot channel simulation for one-dimensional problems where the target-proposal density ratio is unimodal by describing an algorithm with optimal runtime. We achieve this by constructing a rejection sampling procedure equivalent to greedily searching over the points of a Poisson process. Hence, we call our algorithm greedy Poisson rejection sampling (GPRS) and analyze the correctness and time complexity of several of its variants. Finally, we empirically verify our theorems, demonstrating that GPRS significantly outperforms the current state-of-the-art method, A* coding. Our code is available at https://github.com/gergely-flamich/greedy-poisson-rejection-sampling.","url_abs":"https://arxiv.org/abs/2305.15313v5","url_pdf":"https://arxiv.org/pdf/2305.15313v5.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":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"greedy-poisson-rejection-sampling","repo_url":"https://github.com/gergely-flamich/greedy-poisson-rejection-sampling","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"jax","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2305.15313","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2305.15313"}},"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/gergely-flamich/greedy-poisson-rejection-sampling","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":5},"by_repo_kind":{"official":{"samples":5,"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":"88389e3eedc27471","entry":"laplace_kl","repo":"gergely-flamich/greedy-poisson-rejection-sampling","repo_kind":"official","path":"greedy_poisson_rejection_sampling/laplace.py","file_url":"https://github.com/gergely-flamich/greedy-poisson-rejection-sampling/blob/HEAD/greedy_poisson_rejection_sampling/laplace.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":"88389e3eedc27471"}},{"code_sha256_prefix":"92c8e6cbc338e078","entry":"log1mexp","repo":"gergely-flamich/greedy-poisson-rejection-sampling","repo_kind":"official","path":"greedy_poisson_rejection_sampling/util.py","file_url":"https://github.com/gergely-flamich/greedy-poisson-rejection-sampling/blob/HEAD/greedy_poisson_rejection_sampling/util.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":"92c8e6cbc338e078"}},{"code_sha256_prefix":"336fb214f5f58c3f","entry":"log_inv_stretch","repo":"gergely-flamich/greedy-poisson-rejection-sampling","repo_kind":"official","path":"greedy_poisson_rejection_sampling/triangular.py","file_url":"https://github.com/gergely-flamich/greedy-poisson-rejection-sampling/blob/HEAD/greedy_poisson_rejection_sampling/triangular.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":"336fb214f5f58c3f"}},{"code_sha256_prefix":"475d3b85452c3152","entry":"logsubexp","repo":"gergely-flamich/greedy-poisson-rejection-sampling","repo_kind":"official","path":"greedy_poisson_rejection_sampling/util.py","file_url":"https://github.com/gergely-flamich/greedy-poisson-rejection-sampling/blob/HEAD/greedy_poisson_rejection_sampling/util.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":"475d3b85452c3152"}},{"code_sha256_prefix":"ab16326fd1aa238a","entry":"trunc_gumbel","repo":"gergely-flamich/greedy-poisson-rejection-sampling","repo_kind":"official","path":"greedy_poisson_rejection_sampling/util.py","file_url":"https://github.com/gergely-flamich/greedy-poisson-rejection-sampling/blob/HEAD/greedy_poisson_rejection_sampling/util.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":"ab16326fd1aa238a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}