QLoRA › Comparing QLoRA with Other Quantization Approaches
Language AI HandbookAll chapters QLoRA › Comparing QLoRA with Other Quantization ApproachesOne section · Sections in this chapter12 / 15 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
QLoRA is not the only approach to running quantized LLMs, and understanding where it fits in the range helps you choose the right tool for your task. The key distinction is between quantization for inference efficiency (deploying a smaller model for fast generation) and quantization for training efficiency (fitting a larger model into memory during fine-tuning). QLoRA is primarily a training-time technique, though the resulting quantized model can also be used for inference.
Post-training quantization (PTQ) approaches like GPTQ and AWQ quantize a pre-trained model after the fact, without any further training. GPTQ uses second-order information (the Hessian of the loss with respect to weights) to find the optimal quantization for each layer, compensating for errors in one weight by adjusting adjacent weights. AWQ takes a complementary approach, identifying which weights are most important for model quality (those corresponding to large activation values) and protecting those weights from aggressive quantization. Both methods produce models optimized for inference speed, but they cannot be used for further training because the quantization is not designed to preserve gradients.
QLoRA is specifically designed for training, not inference. The NF4 format is optimized to minimize quantization error for weight values, which preserves model quality during the forward pass. But NF4 does not have hardware-optimized kernels as mature as those for GPTQ or AWQ, so inference with a QLoRA-quantized model is somewhat slower than inference with an equivalently quantized GPTQ model. After QLoRA fine-tuning, practitioners often either keep the adapter and quantized base model for deployment, or dequantize the base model to FP16, merge the adapters, and then re-quantize to a deployment-optimized format like GPTQ or AWQ.
8-bit quantization with LLM.int8() (available via bitsandbytes) provides an alternative for users who want less aggressive compression with even less quality degradation. LLM.int8() uses a mixed-precision approach: it keeps the small fraction of weights that exceed a magnitude threshold (outlier weights) in 16-bit precision, while quantizing all other weights to 8-bit integers. This handles the outlier problem that naive 8-bit quantization suffers from and produces models very close in quality to the FP16 original. The memory savings are more modest (roughly 2x instead of 4x), but the quality preservation is better for tasks sensitive to subtle model quality differences.
The choice between these approaches depends on your specific situation. If your primary concern is fitting the model in memory during fine-tuning and you have flexibility on inference infrastructure, QLoRA is the right tool. If your primary concern is fast and efficient inference on a pre-trained model, GPTQ or AWQ are better choices. If you want a balance of memory efficiency and quality preservation for both training and inference, 8-bit quantization offers a middle ground worth considering.