The three innovations
QLoRA (Dettmers et al. 2023) combines LoRA with 4-bit quantization. Three key ideas:
1. NF4 (NormalFloat4) quantization
A 4-bit data type optimized for normally distributed weights. Neural network weights are typically Gaussian, so NF4 allocates quantization levels proportional to the Gaussian distribution — more precision near zero where most weights cluster.
2. Double quantization
The quantization scaling constants are themselves quantized (FP32 → FP8), saving an additional ~0.37 bits per parameter.
3. Paged optimizers
Uses CUDA unified memory to handle GPU memory spikes during gradient computation. When GPU memory fills up, optimizer states are temporarily paged to CPU RAM.
Memory savings
| Model | Full FT (fp16) | LoRA (fp16) | QLoRA (4-bit) |
|---|---|---|---|
| 7B | ~60 GB | ~18 GB | ~6 GB |
| 13B | ~120 GB | ~32 GB | ~10 GB |
| 70B | ~600 GB | ~160 GB | ~36 GB |
QLoRA put 7B fine-tuning on a single RTX 3090/4090 (24 GB) and 70B on a single A100 (80 GB). It democratized fine-tuning more than any other technique.