Skip to content

quantized low-rank adaptation (QLoRA)

Quantized low-rank adaptation (QLoRA) is a memory-efficient fine-tuning method that adapts a large language model by freezing its weights at 4-bit precision and training a small set of low-rank adapter weights on top. The frozen base and the trainable adapters combine on each layer:

A frozen 4-bit base and trainable low-rank adapters both feed the output, and backprop updates only the adapters
Only the Adapters Train While the Base Stays Frozen

QLoRA builds on low-rank adaptation (LoRA), which freezes the base model and learns only a pair of small matrices per layer. The rank is what keeps them small: instead of updating a full weight matrix, LoRA learns two skinny matrices whose product has the same shape as that matrix, so the count of trainable parameters stays tiny.

QLoRA cuts memory further by quantizing the frozen weights to 4 bits, then backpropagating gradients through them into the higher-precision adapters.

Introduced in 2023 by Dettmers and colleagues, QLoRA can fine-tune a 65-billion-parameter model on a single 48 GB GPU while matching the accuracy of full 16-bit fine-tuning. Three techniques make this possible:

  • 4-bit NormalFloat (NF4): A data type matched to the roughly normal distribution of pretrained weights, more accurate than plain 4-bit integers.
  • Double quantization: Compressing the quantization constants themselves, saving about a third of a bit per parameter.
  • Paged optimizers: Using unified CPU-GPU memory to absorb the spikes that would otherwise cause out-of-memory errors.

QLoRA is implemented in libraries such as Hugging Face PEFT and bitsandbytes, and has become a common way to adapt open-weight models on consumer hardware.

Hugging Face Transformers: Leverage Open-Source AI in Python

Tutorial

Hugging Face Transformers: Leverage Open-Source AI in Python

As the AI boom continues, the Hugging Face platform stands out as the leading open-source model hub. In this tutorial, you'll get hands-on experience with Hugging Face and the Transformers library in Python.

intermediate ai

For additional information on related topics, take a look at the following resources:


By Martin Breuss • Updated Aug. 20, 2026