{"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/compressing-multisets-with-large-alphabets","title":"Compressing Multisets with Large Alphabets using Bits-Back Coding","arxiv_id":"2107.09202","date":"2021-07-15","proceeding":null,"authors":["Daniel Severo","James Townsend","Ashish Khisti","Alireza Makhzani","Karen Ullrich"],"abstract":"Current methods which compress multisets at an optimal rate have computational complexity that scales linearly with alphabet size, making them too slow to be practical in many real-world settings. We show how to convert a compression algorithm for sequences into one for multisets, in exchange for an additional complexity term that is quasi-linear in sequence length. This allows us to compress multisets of exchangeable symbols at an optimal rate, with computational complexity decoupled from the alphabet size. The key insight is to avoid encoding the multiset directly, and instead compress a proxy sequence, using a technique called `bits-back coding'. We demonstrate the method experimentally on tasks which are intractable with previous optimal-rate methods: compression of multisets of images and JavaScript Object Notation (JSON) files. Code for our experiments is available at https://github.com/facebookresearch/multiset-compression.","url_abs":"https://arxiv.org/abs/2107.09202v2","url_pdf":"https://arxiv.org/pdf/2107.09202v2.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":"compressing-multisets-with-large-alphabets","repo_url":"https://github.com/facebookresearch/multiset-compression","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2107.09202","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2107.09202"}},"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/facebookresearch/multiset-compression","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":1,"unverified":7},"by_repo_kind":{"official":{"samples":8,"ran":1,"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":7,"samples":[{"code_sha256_prefix":"be6081790a78bd00","entry":"stack_extend","repo":"facebookresearch/multiset-compression","repo_kind":"official","path":"multiset_codec/rans.py","file_url":"https://github.com/facebookresearch/multiset-compression/blob/HEAD/multiset_codec/rans.py","link_basis":"plan_row","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":"be6081790a78bd00"}},{"code_sha256_prefix":"a22b8c105174112c","entry":"base_message","repo":"facebookresearch/multiset-compression","repo_kind":"official","path":"multiset_codec/rans.py","file_url":"https://github.com/facebookresearch/multiset-compression/blob/HEAD/multiset_codec/rans.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":false,"mcp_get_code":{"code_sha256":"a22b8c105174112c"}},{"code_sha256_prefix":"fe7cac16dfb7d0bf","entry":"forward_lookup","repo":"facebookresearch/multiset-compression","repo_kind":"official","path":"multiset_codec/msbst.py","file_url":"https://github.com/facebookresearch/multiset-compression/blob/HEAD/multiset_codec/msbst.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":false,"mcp_get_code":{"code_sha256":"fe7cac16dfb7d0bf"}},{"code_sha256_prefix":"9808281cdfa48d80","entry":"insert","repo":"facebookresearch/multiset-compression","repo_kind":"official","path":"multiset_codec/msbst.py","file_url":"https://github.com/facebookresearch/multiset-compression/blob/HEAD/multiset_codec/msbst.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":false,"mcp_get_code":{"code_sha256":"9808281cdfa48d80"}},{"code_sha256_prefix":"49cb7524aead5cc1","entry":"load_corpus","repo":"facebookresearch/multiset-compression","repo_kind":"official","path":"utils.py","file_url":"https://github.com/facebookresearch/multiset-compression/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":false,"mcp_get_code":{"code_sha256":"49cb7524aead5cc1"}},{"code_sha256_prefix":"f1d52f9ab7185901","entry":"log2_multinomial_coeff","repo":"facebookresearch/multiset-compression","repo_kind":"official","path":"utils.py","file_url":"https://github.com/facebookresearch/multiset-compression/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":false,"mcp_get_code":{"code_sha256":"f1d52f9ab7185901"}},{"code_sha256_prefix":"68949dba1b92959c","entry":"remove","repo":"facebookresearch/multiset-compression","repo_kind":"official","path":"multiset_codec/msbst.py","file_url":"https://github.com/facebookresearch/multiset-compression/blob/HEAD/multiset_codec/msbst.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":false,"mcp_get_code":{"code_sha256":"68949dba1b92959c"}},{"code_sha256_prefix":"f64d7790cb949a2c","entry":"stack_slice","repo":"facebookresearch/multiset-compression","repo_kind":"official","path":"multiset_codec/rans.py","file_url":"https://github.com/facebookresearch/multiset-compression/blob/HEAD/multiset_codec/rans.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":false,"mcp_get_code":{"code_sha256":"f64d7790cb949a2c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}