{"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/billm-pushing-the-limit-of-post-training","title":"BiLLM: Pushing the Limit of Post-Training Quantization for LLMs","arxiv_id":"2402.04291","date":"2024-02-06","proceeding":null,"authors":["Wei Huang","Yangdong Liu","Haotong Qin","Ying Li","Shiming Zhang","Xianglong Liu","Michele Magno","Xiaojuan Qi"],"abstract":"Pretrained large language models (LLMs) exhibit exceptional general language processing capabilities but come with significant demands on memory and computational resources. As a powerful compression technology, binarization can extremely reduce model weights to a mere 1 bit, lowering the expensive computation and memory requirements. However, existing quantization techniques fall short of maintaining LLM performance under ultra-low bit-widths. In response to this challenge, we present BiLLM, a groundbreaking 1-bit post-training quantization scheme tailored for pretrained LLMs. Based on the weight distribution of LLMs, BiLLM first identifies and structurally selects salient weights, and minimizes the compression loss through an effective binary residual approximation strategy. Moreover, considering the bell-shaped distribution of the non-salient weights, we propose an optimal splitting search to group and binarize them accurately. BiLLM achieving for the first time high-accuracy inference (e.g. 8.41 perplexity on LLaMA2-70B) with only 1.08-bit weights across various LLMs families and evaluation metrics, outperforms SOTA quantization methods of LLM by significant margins. Moreover, BiLLM enables the binarization process of the LLM with 7 billion weights within 0.5 hours on a single GPU, demonstrating satisfactory time efficiency. Our code is available at https://github.com/Aaronhuang-778/BiLLM.","url_abs":"https://arxiv.org/abs/2402.04291v2","url_pdf":"https://arxiv.org/pdf/2402.04291v2.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":"billm-pushing-the-limit-of-post-training","repo_url":"https://github.com/aaronhuang-778/billm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"binarization","task_name":"Binarization"},{"task_slug":null,"task_name":"GPU"},{"task_slug":"quantization","task_name":"Quantization"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2402.04291","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.04291"}},"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/aaronhuang-778/billm","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":7,"ran_draft_wrong":1,"unverified":3},"by_repo_kind":{"official":{"samples":11,"ran":8,"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":"979aa3c27b3192b2","entry":"calculate_percentage_and_variance_original","repo":"aaronhuang-778/billm","repo_kind":"official","path":"utils/autosearch.py","file_url":"https://github.com/aaronhuang-778/billm/blob/HEAD/utils/autosearch.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":"979aa3c27b3192b2"}},{"code_sha256_prefix":"6bace2f25ec5ba40","entry":"error_computing","repo":"aaronhuang-778/billm","repo_kind":"official","path":"utils/autosearch.py","file_url":"https://github.com/aaronhuang-778/billm/blob/HEAD/utils/autosearch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6bace2f25ec5ba40"}},{"code_sha256_prefix":"a9e7f2cdf016b88b","entry":"find_layers","repo":"aaronhuang-778/billm","repo_kind":"official","path":"modelutils.py","file_url":"https://github.com/aaronhuang-778/billm/blob/HEAD/modelutils.py","link_basis":"harvester_set","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":"a9e7f2cdf016b88b"}},{"code_sha256_prefix":"fc283fd7e228ed38","entry":"generate_mask","repo":"aaronhuang-778/billm","repo_kind":"official","path":"utils/mask.py","file_url":"https://github.com/aaronhuang-778/billm/blob/HEAD/utils/mask.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":"fc283fd7e228ed38"}},{"code_sha256_prefix":"10bfd6f601862d1a","entry":"generate_structural_mask","repo":"aaronhuang-778/billm","repo_kind":"official","path":"utils/mask.py","file_url":"https://github.com/aaronhuang-778/billm/blob/HEAD/utils/mask.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":"10bfd6f601862d1a"}},{"code_sha256_prefix":"7ae3b57ecdeec075","entry":"high_order_residual","repo":"aaronhuang-778/billm","repo_kind":"official","path":"binary.py","file_url":"https://github.com/aaronhuang-778/billm/blob/HEAD/binary.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":"7ae3b57ecdeec075"}},{"code_sha256_prefix":"dd1edfd05dda7353","entry":"normal_quantize","repo":"aaronhuang-778/billm","repo_kind":"official","path":"binary.py","file_url":"https://github.com/aaronhuang-778/billm/blob/HEAD/binary.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":"dd1edfd05dda7353"}},{"code_sha256_prefix":"25eb3a441763f260","entry":"part_mean","repo":"aaronhuang-778/billm","repo_kind":"official","path":"binary.py","file_url":"https://github.com/aaronhuang-778/billm/blob/HEAD/binary.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"25eb3a441763f260"}},{"code_sha256_prefix":"a7cbf4fc49c71e03","entry":"get_ptb","repo":"aaronhuang-778/billm","repo_kind":"official","path":"datautils.py","file_url":"https://github.com/aaronhuang-778/billm/blob/HEAD/datautils.py","link_basis":"harvester_set","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":"a7cbf4fc49c71e03"}},{"code_sha256_prefix":"729f957048af4a3f","entry":"get_tokenizer","repo":"aaronhuang-778/billm","repo_kind":"official","path":"datautils.py","file_url":"https://github.com/aaronhuang-778/billm/blob/HEAD/datautils.py","link_basis":"harvester_set","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":"729f957048af4a3f"}},{"code_sha256_prefix":"011909315dfdbc2e","entry":"get_wikitext2","repo":"aaronhuang-778/billm","repo_kind":"official","path":"datautils.py","file_url":"https://github.com/aaronhuang-778/billm/blob/HEAD/datautils.py","link_basis":"harvester_set","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":"011909315dfdbc2e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}