QLoRA
Definition
LoRA fine-tuning applied to a base model loaded in 4-bit quantised form, cutting memory needs further so large models fit on one GPU.
In more detail
QLoRA made it practical to fine-tune fairly large models on a single GPU, with quality close to standard LoRA in many tasks.
QLoRA, from a 2023 paper by Dettmers and colleagues, loads the frozen base model in 4-bit precision and trains LoRA adapters on top, using tricks such as a 4-bit NormalFloat data type and paged optimisers to save memory. The adapters can later be applied to the full-precision model. Unsloth, Axolotl and TRL all support it.
Related terms
LoRA
Low-Rank Adaptation: a fine-tuning method that freezes the model's weights and trains small added matrices instead, cutting memory needs.
Quantization
Storing model weights at lower numerical precision, such as 8 or 4 bits, to reduce memory use and speed up inference at a small quality cost.
Fine-tuning
Further training a pretrained model on task-specific examples to change its behaviour, format or style, rather than its general knowledge.
Read more about QLoRA
- Unsloth
Faster, lower-memory LoRA and QLoRA fine-tuning for open models.
- LoRA
Low-Rank Adaptation: a fine-tuning method that freezes the model's weights and trains small added matrices instead, cutting memory needs.
- Quantization
Storing model weights at lower numerical precision, such as 8 or 4 bits, to reduce memory use and speed up inference at a small quality cost.