{"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/practical-lossless-compression-with-latent","title":"Practical Lossless Compression with Latent Variables using Bits Back Coding","arxiv_id":"1901.04866","date":"2019-01-15","proceeding":"ICLR 2019 5","authors":["James Townsend","Tom Bird","David Barber"],"abstract":"Deep latent variable models have seen recent success in many data domains.\nLossless compression is an application of these models which, despite having\nthe potential to be highly useful, has yet to be implemented in a practical\nmanner. We present `Bits Back with ANS' (BB-ANS), a scheme to perform lossless\ncompression with latent variable models at a near optimal rate. We demonstrate\nthis scheme by using it to compress the MNIST dataset with a variational\nauto-encoder model (VAE), achieving compression rates superior to standard\nmethods with only a simple VAE. Given that the scheme is highly amenable to\nparallelization, we conclude that with a sufficiently high quality generative\nmodel this scheme could be used to achieve substantial improvements in\ncompression rate with acceptable running time. We make our implementation\navailable open source at https://github.com/bits-back/bits-back .","url_abs":"http://arxiv.org/abs/1901.04866v1","url_pdf":"http://arxiv.org/pdf/1901.04866v1.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":"practical-lossless-compression-with-latent","repo_url":"https://github.com/bits-back/bits-back","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"practical-lossless-compression-with-latent","repo_url":"https://github.com/fhkingma/bitswap","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"image-compression","task_name":"Image Compression"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1901.04866","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1901.04866"}},"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/bits-back/bits-back","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/fhkingma/bitswap","reach":null}],"summary":{"ran_draft_wrong":4,"ran_fixture":1,"ran_honours":1,"unverified":1},"by_repo_kind":{"official":{"samples":4,"ran":4,"repositories":1},"listed":{"samples":3,"ran":2,"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":"1559f9ae98c97b05","entry":"append","repo":"bits-back/bits-back","repo_kind":"official","path":"rans.py","file_url":"https://github.com/bits-back/bits-back/blob/HEAD/rans.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1559f9ae98c97b05"}},{"code_sha256_prefix":"386207a4dfdd07a4","entry":"append_symbol","repo":"bits-back/bits-back","repo_kind":"official","path":"rans.py","file_url":"https://github.com/bits-back/bits-back/blob/HEAD/rans.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"386207a4dfdd07a4"}},{"code_sha256_prefix":"a2d19c9311f571c7","entry":"extract_blocks","repo":"fhkingma/bitswap","repo_kind":"listed","path":"benchmark_compress.py","file_url":"https://github.com/fhkingma/bitswap/blob/HEAD/benchmark_compress.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a2d19c9311f571c7"}},{"code_sha256_prefix":"d296406eaa401181","entry":"lr_step","repo":"fhkingma/bitswap","repo_kind":"listed","path":"model/mnist_train.py","file_url":"https://github.com/fhkingma/bitswap/blob/HEAD/model/mnist_train.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d296406eaa401181"}},{"code_sha256_prefix":"29df9c4fcc8a2d59","entry":"non_uniform_enc_statfun","repo":"bits-back/bits-back","repo_kind":"official","path":"util.py","file_url":"https://github.com/bits-back/bits-back/blob/HEAD/util.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"29df9c4fcc8a2d59"}},{"code_sha256_prefix":"1a015e0c4fcc06cd","entry":"pop","repo":"bits-back/bits-back","repo_kind":"official","path":"rans.py","file_url":"https://github.com/bits-back/bits-back/blob/HEAD/rans.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1a015e0c4fcc06cd"}},{"code_sha256_prefix":"445dfb9af994229b","entry":"unextract_blocks","repo":"fhkingma/bitswap","repo_kind":"listed","path":"benchmark_compress.py","file_url":"https://github.com/fhkingma/bitswap/blob/HEAD/benchmark_compress.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"445dfb9af994229b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}