Papers › QLoRA: Efficient Finetuning of Quantized LLMs

QLoRA: Efficient Finetuning of Quantized LLMs

23 May 2023NeurIPS 2023 11arXiv:2305.14314archive 2025-07-28

Tim Dettmers, Artidoro Pagnoni, Ari Holtzman, Luke Zettlemoyer

We present QLoRA, an efficient finetuning approach that reduces memory usage enough to finetune a 65B parameter model on a single 48GB GPU while preserving full 16-bit finetuning task performance. QLoRA backpropagates gradients through a frozen, 4-bit quantized pretrained language model into Low Rank Adapters~(LoRA). Our best model family, which we name Guanaco, outperforms all previous openly released models on the Vicuna benchmark, reaching 99.3% of the performance level of ChatGPT while only requiring 24 hours of finetuning on a single GPU. QLoRA introduces a number of innovations to save memory without sacrificing performance: (a) 4-bit NormalFloat (NF4), a new data type that is information theoretically optimal for normally distributed weights (b) double quantization to reduce the average memory footprint by quantizing the quantization constants, and (c) paged optimziers to manage memory spikes. We use QLoRA to finetune more than 1,000 models, providing a detailed analysis of instruction following and chatbot performance across 8 instruction datasets, multiple model types (LLaMA, T5), and model scales that would be infeasible to run with regular finetuning (e.g. 33B and 65B parameter models). Our results show that QLoRA finetuning on a small high-quality dataset leads to state-of-the-art results, even when using smaller models than the previous SoTA. We provide a detailed analysis of chatbot performance based on both human and GPT-4 evaluations showing that GPT-4 evaluations are a cheap and reasonable alternative to human evaluation. Furthermore, we find that current chatbot benchmarks are not trustworthy to accurately evaluate the performance levels of chatbots. A lemon-picked analysis demonstrates where Guanaco fails compared to ChatGPT. We release all of our models and code, including CUDA kernels for 4-bit training.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2305.14314")

Code

Syntology Ran 17 of 26 code samples harvested from 8 repositories linked to this paper; 9 have no recorded run. Of those that ran: 2 ran · honoured contract; 2 ran · violated contract; 10 ran · our draft was wrong; 1 ran · fixture could not drive it; 2 ran with no contract checked.

By repository: official repository: 3 samples from 1 repository, 3 ran; community (archive-listed): 13 samples from 4 repositories, 6 ran; community: 6 samples from 3 repositories, 5 ran; 4 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

20 repositories listed; official and paper-mentioned ones first.

artidoro/qlora officialmentioned in paperpytorch report
timdettmers/bitsandbytes officialmentioned in paperpytorch report
12kimih/hicupid mentioned on GitHubpytorchApache-2.0 report
BatsResearch/LexC-Gen mentioned on GitHub report
Luohh5/Chain-of-Exemplar mentioned on GitHubpytorchNOASSERTION report
QwenLM/Qwen-7B mentioned on GitHubpytorch report
Rain9876/ShareLoRA mentioned on GitHubpytorch report
brandon3964/multimodal-task-vector mentioned on GitHubpytorchNOASSERTION report
cornell-zhang/llm-datatypes mentioned on GitHubtf report
daniel-furman/sft-demos mentioned on GitHubpytorchApache-2.0 report
flagai-open/aquila2 mentioned on GitHubpytorch report
huggingface/text-generation-inference mentioned on GitHubpytorch report
internlm/xtuner mentioned on GitHubpytorch report
ist-daslab/rosa mentioned on GitHubpytorchApache-2.0 report
jerrywu-code/susgen mentioned on GitHubpytorchMIT report
openmedlab/pulse mentioned on GitHubpytorchApache-2.0 report
pilancilab/caldera mentioned on GitHubpytorch report
qwenlm/qwen mentioned on GitHubpytorchApache-2.0 report
qwenlm/qwen-vl mentioned on GitHubpytorchNOASSERTION report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

26 samples harvested; 17 ran; 2 honoured the contract we drafted; 9 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · honoured contract
2ran · violated contract
10ran · our draft was wrong
1ran · fixture could not drive it
2ran
9unverified

Licence: 17 of the 26 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 8 repositories linked to this paper, official or community; each sample names its own and says which. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: 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. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

get_last_checkpoint artidoro/qlora/examples/guanaco_generate.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · 89ce33341af66037 · report
parse_score artidoro/qlora/eval/eval_gpt_review.py official repository ran · violated contract fingerprinted MIT (permissive) · 8049b382893c73dd · report
parse_three_class_score artidoro/qlora/eval/eval_gpt_review.py official repository ran · honoured contract fingerprinted MIT (permissive) · 2155c3b1b19d8ab9 · report
LowMemoryQuantizer pilancilab/caldera/src/caldera/utils/quantization.py community (archive-listed) ran no licence file found · pointer only · cec1d4e0b363b8b0 · report
dequantize_module_weight Rain9876/ShareLoRA/sharelora/peft/tuners/lora/layer.py community (archive-listed) ran · honoured contract no licence file found · pointer only · 21811f6ec0830792 · report
gather_params_ctx Rain9876/ShareLoRA/sharelora/peft/tuners/lora/layer.py community (archive-listed) ran no licence file found · pointer only · 1c29706f4a8bd965 · report
get_bnb_param_type Rain9876/ShareLoRA/sharelora/peft/tuners/lora/layer.py community (archive-listed) ran · violated contract fingerprinted no licence file found · pointer only · 1386e6b11e2ef9e0 · report
parse_text openmedlab/pulse/web_demo_gradio.py community (archive-listed) ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 826ceb601fb31250 · report
transpose Rain9876/ShareLoRA/sharelora/peft/tuners/lora/layer.py community (archive-listed) ran · fixture could not drive it fingerprinted no licence file found · pointer only · 5aaa7db51b41253b · report
AbstractQuantizer pilancilab/caldera/src/caldera/utils/quantization.py community (archive-listed) unverified no licence file found · pointer only · a4ade271d27a6b35 · report
BaseTunerLayer Rain9876/ShareLoRA/sharelora/peft/tuners/lora/layer.py community (archive-listed) unverified no licence file found · pointer only · c75ab97e2e86199a · report
BufferDict Rain9876/ShareLoRA/sharelora/peft/tuners/lora/layer.py community (archive-listed) unverified no licence file found · pointer only · d628ec92a2bbbdd3 · report
DoraLinearLayer Rain9876/ShareLoRA/sharelora/peft/tuners/lora/layer.py community (archive-listed) unverified no licence file found · pointer only · 9eb99d2625ca1e2f · report
LoraLayer Rain9876/ShareLoRA/sharelora/peft/tuners/lora/layer.py community (archive-listed) unverified no licence file found · pointer only · d2729dc566040484 · report
dequantize_bnb_weight Rain9876/ShareLoRA/sharelora/peft/tuners/lora/layer.py community (archive-listed) unverified no licence file found · pointer only · 221e70695f549713 · report
formatting_prompts_func daniel-furman/sft-demos/_peft/falcon/peft_falcon_180b_instruct.py community (archive-listed) unverified Apache-2.0 (permissive) · ba51656a6aaea3b7 · report
read_yaml_file georgesung/llm_qlora/inference.py community ran · our draft was wrong MIT (permissive) · 38a41485b6f05e08 · report
generate_prompt KohakuBlueleaf/guanaco-lora/finetune.py community ran · our draft was wrong Apache-2.0 (permissive) · a87961e99cab3b49 · report
get_prompt georgesung/llm_qlora/inference.py community ran · our draft was wrong fingerprinted MIT (permissive) · 8bdd290bac0f9c85 · report
quantize shuxueslpi/chatGLM-6B-QLoRA/merge_lora_and_quantize.py community ran · our draft was wrong no licence file found · pointer only · 9b9c46fa571c5690 · report
tokenize_func shuxueslpi/chatGLM-6B-QLoRA/train_qlora.py community ran · our draft was wrong no licence file found · pointer only · f63e332bb59704df · report
get_llm_response georgesung/llm_qlora/inference.py community unverified MIT (permissive) · 0798e321dcc227ed · report
extract_alpaca_dataset identical code first harvested elsewhere ran · our draft was wrong licence of this copy not recorded · b5445674ab17410f · report
extract_unnatural_instructions_data identical code first harvested elsewhere ran · our draft was wrong licence of this copy not recorded · f82430123a91cf21 · report
generate_prompt identical code first harvested elsewhere ran · our draft was wrong fingerprinted licence of this copy not recorded · b9c4c8084f5cc40a · report
local_dataset identical code first harvested elsewhere unverified licence of this copy not recorded · ec8bb649218d4f43 · report

Tasks

ChatbotInstruction FollowingLanguage ModellingQuantizationparameter-efficient fine-tuning

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
parameter-efficient fine-tuning BoolQ LLaMA2-7b Accuracy (% ) 82.63 #1 of 4 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutGPT-4Label SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections