QLoRA
QLoRA combines LoRA fine-tuning with 4-bit quantization of the base model. Introduced by Tim Dettmers in 2023, it dropped the VRAM cost of fine-tuning by ~4× and made consumer-GPU fine-tuning of 70B models possible for the first time.
The technique: the base model is loaded in 4-bit NF4 (a normalized float-4 format), only the LoRA adapter weights are kept in FP16, and gradients flow only through the adapter. Forward passes dequantize on-the-fly.
Practical impact: a Llama 3.1 70B QLoRA fine-tune fits on a single RTX 4090 (24 GB) where full fine-tuning would need 8× A100s. Tools like Unsloth optimize QLoRA further, achieving 2× speed over the reference HuggingFace implementation.
Practical example
A team wants to fine-tune Llama 3.1 70B on a proprietary support-ticket dataset but only has access to a single RTX 4090. Full fine-tuning is a non-starter — optimizer states and gradients for 70B parameters alone would need multiple A100-class GPUs. With QLoRA, they load the base model in 4-bit NF4 (roughly 40GB, still needing to be offloaded or split, but far more tractable than FP16), attach small LoRA adapters in FP16, and train only those adapters while the frozen base stays quantized. Using Unsloth's optimized kernels cuts training time further versus a reference HuggingFace TRL run. The resulting adapter file is typically tens to a couple hundred MB — small enough to version-control and swap at inference time — while the quality gap versus a full fine-tune is often small enough to be worth the massive compute savings.
Related terms
See also
Reviewed by Eruo Fredoline. See our editorial policy.