{"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/qa-lora-quantization-aware-low-rank","title":"QA-LoRA: Quantization-Aware Low-Rank Adaptation of Large Language Models","arxiv_id":"2309.14717","date":"2023-09-26","proceeding":null,"authors":["Yuhui Xu","Lingxi Xie","Xiaotao Gu","Xin Chen","Heng Chang","Hengheng Zhang","Zhengsu Chen","Xiaopeng Zhang","Qi Tian"],"abstract":"Recently years have witnessed a rapid development of large language models (LLMs). Despite the strong ability in many language-understanding tasks, the heavy computational burden largely restricts the application of LLMs especially when one needs to deploy them onto edge devices. In this paper, we propose a quantization-aware low-rank adaptation (QA-LoRA) algorithm. The motivation lies in the imbalanced degrees of freedom of quantization and adaptation, and the solution is to use group-wise operators which increase the degree of freedom of quantization meanwhile decreasing that of adaptation. QA-LoRA is easily implemented with a few lines of code, and it equips the original LoRA with two-fold abilities: (i) during fine-tuning, the LLM's weights are quantized (e.g., into INT4) to reduce time and memory usage; (ii) after fine-tuning, the LLM and auxiliary weights are naturally integrated into a quantized model without loss of accuracy. We apply QA-LoRA to the LLaMA and LLaMA2 model families and validate its effectiveness in different fine-tuning datasets and downstream scenarios. Code will be made available at https://github.com/yuhuixu1993/qa-lora.","url_abs":"https://arxiv.org/abs/2309.14717v2","url_pdf":"https://arxiv.org/pdf/2309.14717v2.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":"qa-lora-quantization-aware-low-rank","repo_url":"https://github.com/intel-analytics/BigDL","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"torch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"qa-lora-quantization-aware-low-rank","repo_url":"https://github.com/intel/ipex-llm","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"quantization","task_name":"Quantization"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2309.14717","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2309.14717"}},"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/intel-analytics/BigDL","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/intel/ipex-llm","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":1,"ran_fixture":2,"unverified":9},"by_repo_kind":{"listed":{"samples":12,"ran":3,"repositories":2}},"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":"2564045c0e65006b","entry":"slice1d","repo":"intel-analytics/BigDL","repo_kind":"listed","path":"python/llm/portable-zip/kv_cache.py","file_url":"https://github.com/intel-analytics/BigDL/blob/HEAD/python/llm/portable-zip/kv_cache.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2564045c0e65006b"}},{"code_sha256_prefix":"19c86edfcb34276c","entry":"slice2d","repo":"intel-analytics/BigDL","repo_kind":"listed","path":"python/llm/portable-zip/kv_cache.py","file_url":"https://github.com/intel-analytics/BigDL/blob/HEAD/python/llm/portable-zip/kv_cache.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"19c86edfcb34276c"}},{"code_sha256_prefix":"8884022644d5af82","entry":"slice3d","repo":"intel-analytics/BigDL","repo_kind":"listed","path":"python/llm/portable-zip/kv_cache.py","file_url":"https://github.com/intel-analytics/BigDL/blob/HEAD/python/llm/portable-zip/kv_cache.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8884022644d5af82"}},{"code_sha256_prefix":"559f1c3fe0502b84","entry":"format_prompt_with_history","repo":"intel-analytics/BigDL","repo_kind":"listed","path":"python/llm/portable-zip/chat.py","file_url":"https://github.com/intel-analytics/BigDL/blob/HEAD/python/llm/portable-zip/chat.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"559f1c3fe0502b84"}},{"code_sha256_prefix":"482c7e5ca6778460","entry":"get_package_version","repo":"intel/ipex-llm","repo_kind":"listed","path":"python/llm/src/ipex_llm/transformers/convert.py","file_url":"https://github.com/intel/ipex-llm/blob/HEAD/python/llm/src/ipex_llm/transformers/convert.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"482c7e5ca6778460"}},{"code_sha256_prefix":"6bc05af3167f1f75","entry":"get_stop_words_ids","repo":"intel-analytics/BigDL","repo_kind":"listed","path":"python/llm/portable-zip/chat.py","file_url":"https://github.com/intel-analytics/BigDL/blob/HEAD/python/llm/portable-zip/chat.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6bc05af3167f1f75"}},{"code_sha256_prefix":"20c7e7fb2d9f76a2","entry":"greedy_generate","repo":"intel-analytics/BigDL","repo_kind":"listed","path":"python/llm/portable-zip/chat.py","file_url":"https://github.com/intel-analytics/BigDL/blob/HEAD/python/llm/portable-zip/chat.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"20c7e7fb2d9f76a2"}},{"code_sha256_prefix":"9c5cfec3eb2fe2b1","entry":"is_lm_head","repo":"intel/ipex-llm","repo_kind":"listed","path":"python/llm/src/ipex_llm/transformers/convert.py","file_url":"https://github.com/intel/ipex-llm/blob/HEAD/python/llm/src/ipex_llm/transformers/convert.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9c5cfec3eb2fe2b1"}},{"code_sha256_prefix":"4558cb77c58b03d2","entry":"is_module_in_classes","repo":"intel/ipex-llm","repo_kind":"listed","path":"python/llm/src/ipex_llm/transformers/convert.py","file_url":"https://github.com/intel/ipex-llm/blob/HEAD/python/llm/src/ipex_llm/transformers/convert.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4558cb77c58b03d2"}},{"code_sha256_prefix":"af66d016e3041df1","entry":"load_model_base","repo":"intel-analytics/BigDL","repo_kind":"listed","path":"python/llm/src/ipex_llm/serving/fastchat/bigdl_llm_model.py","file_url":"https://github.com/intel-analytics/BigDL/blob/HEAD/python/llm/src/ipex_llm/serving/fastchat/bigdl_llm_model.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"af66d016e3041df1"}},{"code_sha256_prefix":"a87af6ee0d3f977b","entry":"load_model_chatglm","repo":"intel-analytics/BigDL","repo_kind":"listed","path":"python/llm/src/ipex_llm/serving/fastchat/bigdl_llm_model.py","file_url":"https://github.com/intel-analytics/BigDL/blob/HEAD/python/llm/src/ipex_llm/serving/fastchat/bigdl_llm_model.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a87af6ee0d3f977b"}},{"code_sha256_prefix":"d9150efc59718cbf","entry":"repeat_kv","repo":"intel/ipex-llm","repo_kind":"listed","path":"python/llm/src/ipex_llm/transformers/kv.py","file_url":"https://github.com/intel/ipex-llm/blob/HEAD/python/llm/src/ipex_llm/transformers/kv.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d9150efc59718cbf"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}