{"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/bitdistiller-unleashing-the-potential-of-sub","title":"BitDistiller: Unleashing the Potential of Sub-4-Bit LLMs via Self-Distillation","arxiv_id":"2402.10631","date":"2024-02-16","proceeding":null,"authors":["Dayou Du","Yijia Zhang","Shijie Cao","Jiaqi Guo","Ting Cao","Xiaowen Chu","Ningyi Xu"],"abstract":"The upscaling of Large Language Models (LLMs) has yielded impressive advances in natural language processing, yet it also poses significant deployment challenges. Weight quantization has emerged as a widely embraced solution to reduce memory and computational demands. This paper introduces BitDistiller, a framework that synergizes Quantization-Aware Training (QAT) with Knowledge Distillation (KD) to boost the performance of LLMs at ultra-low precisions (sub-4-bit). Specifically, BitDistiller first incorporates a tailored asymmetric quantization and clipping technique to maximally preserve the fidelity of quantized weights, and then proposes a novel Confidence-Aware Kullback-Leibler Divergence (CAKLD) objective, which is employed in a self-distillation manner to enable faster convergence and superior model performance. Empirical evaluations demonstrate that BitDistiller significantly surpasses existing methods in both 3-bit and 2-bit configurations on general language understanding and complex reasoning benchmarks. Notably, BitDistiller is shown to be more cost-effective, demanding fewer data and training resources. The code is available at https://github.com/DD-DuDa/BitDistiller.","url_abs":"https://arxiv.org/abs/2402.10631v1","url_pdf":"https://arxiv.org/pdf/2402.10631v1.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":"bitdistiller-unleashing-the-potential-of-sub","repo_url":"https://github.com/dd-duda/bitdistiller","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"bitdistiller-unleashing-the-potential-of-sub","repo_url":"https://github.com/microsoft/bitblas","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"knowledge-distillation","task_name":"Knowledge Distillation"},{"task_slug":"quantization","task_name":"Quantization"}],"methods":[{"method_slug":"knowledge-distillation","method_name":"Knowledge Distillation"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2402.10631","atlas_url":"https://app.syntology.ai/?focus=2402.10631","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.10631"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/dd-duda/bitdistiller","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/microsoft/bitblas","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":5,"ran_violates":1,"ran_fixture":1,"unverified":8},"by_repo_kind":{"official":{"samples":15,"ran":7,"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":"f9ef8eeb630a0972","entry":"build_alibi_bias","repo":"dd-duda/bitdistiller","repo_kind":"official","path":"inference/models/mpt.py","file_url":"https://github.com/dd-duda/bitdistiller/blob/HEAD/inference/models/mpt.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":"f9ef8eeb630a0972"}},{"code_sha256_prefix":"fd8719af3db2c5ae","entry":"calculate_zeros_width","repo":"dd-duda/bitdistiller","repo_kind":"official","path":"quantization/qmodule.py","file_url":"https://github.com/dd-duda/bitdistiller/blob/HEAD/quantization/qmodule.py","link_basis":"harvester_set","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":"fd8719af3db2c5ae"}},{"code_sha256_prefix":"5dfd0c2387dff573","entry":"gen_slopes","repo":"dd-duda/bitdistiller","repo_kind":"official","path":"inference/models/mpt.py","file_url":"https://github.com/dd-duda/bitdistiller/blob/HEAD/inference/models/mpt.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":"5dfd0c2387dff573"}},{"code_sha256_prefix":"0310065bdf9208bb","entry":"get_named_linears","repo":"dd-duda/bitdistiller","repo_kind":"official","path":"quantization/pre_quant.py","file_url":"https://github.com/dd-duda/bitdistiller/blob/HEAD/quantization/pre_quant.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":"0310065bdf9208bb"}},{"code_sha256_prefix":"ad85b288e9acb9c2","entry":"make_divisible","repo":"dd-duda/bitdistiller","repo_kind":"official","path":"quantization/qmodule.py","file_url":"https://github.com/dd-duda/bitdistiller/blob/HEAD/quantization/qmodule.py","link_basis":"harvester_set","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":"ad85b288e9acb9c2"}},{"code_sha256_prefix":"14a84c2cbfebc413","entry":"precompute_freqs_cis","repo":"dd-duda/bitdistiller","repo_kind":"official","path":"inference/models/llama.py","file_url":"https://github.com/dd-duda/bitdistiller/blob/HEAD/inference/models/llama.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"14a84c2cbfebc413"}},{"code_sha256_prefix":"70bf6ebaafd266c4","entry":"reshape_for_broadcast","repo":"dd-duda/bitdistiller","repo_kind":"official","path":"inference/models/llama.py","file_url":"https://github.com/dd-duda/bitdistiller/blob/HEAD/inference/models/llama.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"70bf6ebaafd266c4"}},{"code_sha256_prefix":"797af70a155dd94f","entry":"apply_rotary_emb","repo":"dd-duda/bitdistiller","repo_kind":"official","path":"inference/models/llama.py","file_url":"https://github.com/dd-duda/bitdistiller/blob/HEAD/inference/models/llama.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":"797af70a155dd94f"}},{"code_sha256_prefix":"daff7fa3b7b944d2","entry":"convertModelToQuant","repo":"dd-duda/bitdistiller","repo_kind":"official","path":"quantization/qlinear.py","file_url":"https://github.com/dd-duda/bitdistiller/blob/HEAD/quantization/qlinear.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":"daff7fa3b7b944d2"}},{"code_sha256_prefix":"fa80a6587641fb46","entry":"get_blocks","repo":"dd-duda/bitdistiller","repo_kind":"official","path":"quantization/pre_quant.py","file_url":"https://github.com/dd-duda/bitdistiller/blob/HEAD/quantization/pre_quant.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":"fa80a6587641fb46"}},{"code_sha256_prefix":"a1ca17436132cd8f","entry":"get_calib_dataset","repo":"dd-duda/bitdistiller","repo_kind":"official","path":"quantization/clip_utils.py","file_url":"https://github.com/dd-duda/bitdistiller/blob/HEAD/quantization/clip_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":"a1ca17436132cd8f"}},{"code_sha256_prefix":"eca59c8a0da72a0c","entry":"get_calib_dataset_code","repo":"dd-duda/bitdistiller","repo_kind":"official","path":"quantization/clip_utils.py","file_url":"https://github.com/dd-duda/bitdistiller/blob/HEAD/quantization/clip_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":"eca59c8a0da72a0c"}},{"code_sha256_prefix":"05aeb596afd8012e","entry":"get_pile_dataset","repo":"dd-duda/bitdistiller","repo_kind":"official","path":"quantization/clip_utils.py","file_url":"https://github.com/dd-duda/bitdistiller/blob/HEAD/quantization/clip_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":"05aeb596afd8012e"}},{"code_sha256_prefix":"766ad0e51b7a8f09","entry":"rotate_half","repo":"dd-duda/bitdistiller","repo_kind":"official","path":"inference/models/falcon.py","file_url":"https://github.com/dd-duda/bitdistiller/blob/HEAD/inference/models/falcon.py","link_basis":"plan_row","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":"766ad0e51b7a8f09"}},{"code_sha256_prefix":"fa755c29499d4073","entry":"run_awq","repo":"dd-duda/bitdistiller","repo_kind":"official","path":"quantization/pre_quant.py","file_url":"https://github.com/dd-duda/bitdistiller/blob/HEAD/quantization/pre_quant.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":"fa755c29499d4073"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}