Dev tools

LoRA vs QLoRA: Fine-Tuning a Model on One GPU

LoRA vs QLoRA: both fine-tune by training small add-on weights; QLoRA also shrinks the base model to 4-bit. Memory, quality, speed and which to use.

By OmniAI Editorial · Nov 20, 2026 · 11 min read

The difference in LoRA vs QLoRA is how the base model is stored while you fine-tune it. LoRA (Low-Rank Adaptation) freezes the original model and trains a small set of extra weights, cutting the memory and compute needed for fine-tuning dramatically. QLoRA does the same, but also loads the frozen base model in 4-bit precision, shrinking its memory by about four times compared with 16-bit, so you can fine-tune much larger models on a single GPU. QLoRA uses less memory; LoRA is usually a bit faster and slightly simpler, with quality that's typically very close between the two.

This guide explains how LoRA fine-tuning works, what QLoRA adds, LoRA vs full fine-tuning, memory needs with a worked example, LoRA vs QLoRA vs DoRA, the tools to use, and how to choose.

LoRA vs QLoRA at a Glance

Full fine-tuningLoRAQLoRA
What's trainedAll model weightsSmall adapter matricesSmall adapter matrices
Base model during training16-bit, updated16-bit, frozen4-bit, frozen
Memory neededVery highModerateLowest
Speed per stepSlowest overall (most memory traffic)FastSomewhat slower than LoRA (de-quantising weights)
QualityHighest ceilingClose to full fine-tuning for most tasksClose to LoRA
OutputA whole new modelA small adapter fileA small adapter file
Typical hardware for a 7–8B modelSeveral data-centre GPUsOne 24–48 GB GPUOne 12–24 GB GPU

How Does LoRA Fine-Tuning Work?

How does LoRA fine-tuning work? Microsoft researchers introduced LoRA in 2021. Their insight: when you fine-tune a large model, the change to each weight matrix can be approximated by a much smaller, "low-rank" update.

Instead of changing a huge weight matrix W directly, LoRA:

  1. Freezes W, the original pre-trained weights.
  2. Adds two small matrices, A and B, whose product has the same shape as W but is built from far fewer numbers. The "rank" (often 8, 16 or 32) controls how small they are.
  3. Trains only A and B. During use, the model's output is the original W plus the product of B and A.
  4. Saves A and B as an adapter, usually a few megabytes to a few hundred megabytes.

The LoRA paper reported that, for GPT-3 175B, LoRA could cut the number of trainable parameters by 10,000 times and GPU memory needs by three times compared with full fine-tuning, with comparable quality. Because only the adapter is trained, you can also keep many adapters for different tasks and swap them on one base model.

A large grey grid matrix, an ink plus sign, then a tall narrow light bar and a wide flat orange bar.
LoRA leaves the big weight matrix frozen and trains two thin matrices whose product adds the update.

What Is QLoRA?

QLoRA, introduced by researchers at the University of Washington in 2023, combines LoRA with aggressive quantisation of the frozen base model. Its main ideas:

  • 4-bit NormalFloat (NF4): a 4-bit data type designed for the bell-shaped way neural network weights are distributed, so 4-bit storage loses little information.
  • Double quantisation: the scaling constants used for quantisation are themselves quantised, saving more memory.
  • Paged optimisers: optimiser memory can spill to CPU RAM during spikes, avoiding out-of-memory crashes.
  • LoRA adapters trained in higher precision on top of the 4-bit base, with gradients flowing through the frozen quantised weights.

The QLoRA paper showed fine-tuning a 65-billion-parameter model on a single 48 GB GPU, something that would otherwise need many GPUs, while matching 16-bit fine-tuning quality on its benchmarks. Our guide to LLM quantization explains how 4-bit formats work.

LoRA vs Full Fine-Tuning

LoRA vs full fine-tuning is the first decision:

  • Full fine-tuning updates every weight. It has the highest quality ceiling and can teach the model the most new behaviour, but needs memory for the weights, gradients and optimiser state of the whole model, which means several data-centre GPUs even for mid-sized models. Our guide to AI inference vs training shows the memory maths.
  • LoRA trains a tiny fraction of the parameters, needs far less memory and storage, trains faster and is less likely to make the model forget its general abilities.

Research has looked at where they differ. A 2024 study titled "LoRA vs Full Fine-tuning: An Illusion of Equivalence" found that models fine-tuned with LoRA and full fine-tuning can perform similarly on the target task while differing in their internal structure and in how they generalise or forget. Other work has found that LoRA learns less from very large amounts of new data, such as teaching a whole new domain, but also forgets less.

Practical rule: start with LoRA or QLoRA. Consider full fine-tuning only if adapters clearly fall short on a large, high-value task and you have the hardware.

How Much Memory Each Needs

Illustrative memory estimates for fine-tuning an 8-billion-parameter model, before activations (which depend on batch size and sequence length):

ItemFull fine-tuning (16-bit, Adam)LoRA (16-bit base)QLoRA (4-bit base)
Base weights16 GB16 GBAbout 5 GB
Gradients16 GBTiny (adapters only)Tiny
Optimiser stateAbout 96 GB (32-bit copy plus Adam moments)SmallSmall
AdaptersNoneTens to hundreds of MBTens to hundreds of MB
Rough total before activationsAbout 128 GBAbout 17–18 GBAbout 6–7 GB

With activations added, LoRA on an 8B model usually fits a 24 GB GPU with modest settings, while QLoRA fits a 12–16 GB GPU. For a 70B model, QLoRA needs roughly 40–48 GB, within reach of one large GPU; LoRA in 16-bit needs about 140 GB for the base weights alone. That's why QLoRA made fine-tuning big models practical for individuals.

Three stacked bar columns on an ink baseline getting shorter from left to right, the first tallest in grey and light sections, the second shorter, and the shortest on the right topped with an orange section.
Full fine-tuning needs the most memory, LoRA much less, and QLoRA the least.

LoRA vs QLoRA: Speed and Quality

  • Quality: in most published comparisons and community experience, QLoRA's results are very close to LoRA's on the same data. The 4-bit base adds a small amount of noise; for most tasks it's not noticeable.
  • Speed: QLoRA is usually somewhat slower per training step, because the 4-bit weights must be de-quantised on the fly. LoRA in 16-bit is faster if you have the memory.
  • Deployment: after QLoRA training, many people merge the adapter into a 16-bit copy of the base model, or keep it as an adapter and load it with a quantised base for inference. Test the final setup, because merging with different precision can change results slightly.

LoRA vs QLoRA vs DoRA and Other Variants

LoRA vs QLoRA vs DoRA covers the most common variants:

MethodWhat it changesWhen to consider it
LoRATrains low-rank adapters on a 16-bit frozen baseDefault when memory allows
QLoRALoRA on a 4-bit quantised baseLarge models or small GPUs
DoRASplits each weight into magnitude and direction and adapts the direction with LoRASmall quality gains over LoRA in some tasks, at some extra cost
LoRA+ and rsLoRATweaks to learning rates or scaling for adaptersStability and better results at higher ranks
Full fine-tuningUpdates everythingLarge datasets and maximum quality with plenty of hardware

Most training libraries let you switch between these with a configuration flag, so it's easy to compare them on your own data.

Tools for LoRA and QLoRA

  • Hugging Face PEFT: the standard library for LoRA, QLoRA, DoRA and other adapter methods, used with Transformers.
  • bitsandbytes: provides the 4-bit quantisation used by QLoRA.
  • TRL: Hugging Face's library for supervised fine-tuning and preference training on top of PEFT.
  • Unsloth: an optimised library that speeds up LoRA and QLoRA training and reduces memory, popular for single-GPU fine-tuning.
  • Axolotl and LLaMA-Factory: configuration-driven fine-tuning frameworks that support many models and methods.
  • Managed services: several model providers and cloud platforms offer LoRA fine-tuning as a service.

Key Settings to Get Right

  • Rank (r): 8–16 is common; higher ranks capture more change but use more memory. Start low.
  • Alpha: a scaling factor, often set to the rank or twice the rank.
  • Target modules: adapting all the attention and MLP projection layers usually works better than only a few.
  • Learning rate: adapters typically use higher learning rates than full fine-tuning (for example around 1e-4 to 2e-4), but check your library's defaults.
  • Data quality: a few thousand clean, consistent examples beat a large messy dataset.
  • Evaluation: hold out examples and compare against the base model with good prompts, so you know the fine-tune actually helped.

When Fine-Tuning Is the Right Choice

Fine-tuning with LoRA or QLoRA is worth it for consistent style, tone or format, specialised output structures, domain-specific language, or making a smaller model perform a narrow task as well as a larger one. It's not the best way to add facts that change often; retrieval is better for that. Our guide to fine-tuning vs RAG covers the choice.

LoRA Beyond Language Models

LoRA isn't just for chatbots. It's the standard way to customise image models too: a Stable Diffusion or Flux LoRA teaches a model a style, a character or a product from a few dozen images, and the resulting adapter file is small enough to share and stack with others. Speech and vision models use the same idea. The trade-offs are similar: adapters are cheap to train and swap, but they inherit the base model's limits.

Common LoRA and QLoRA Mistakes

  • Training on messy or inconsistent data. The adapter learns your data's flaws faithfully.
  • Too many epochs on a small dataset, which overfits: great on training examples, worse on everything else.
  • Mismatched chat templates between training and use, which produces odd formatting or ignored instructions.
  • Using the adapter with a different base model than the one it was trained on. Adapters only fit their exact base.
  • Skipping a baseline: compare against the base model with a good prompt; sometimes prompting is enough.
  • Merging in a different precision than you tested, which can shift results slightly.

Which Should You Use?

SituationPick
7–8B model, GPU with 24 GB or moreLoRA (faster)
7–8B model, GPU with 12–16 GBQLoRA
30–70B model on one large GPUQLoRA
Maximum quality, large dataset, plenty of GPUsFull fine-tuning (or LoRA with high rank as a test)
Many task-specific variants of one modelLoRA adapters you can swap
UnsureStart with QLoRA to test the idea cheaply, then try LoRA if it fits your hardware

FAQ

What is the difference between LoRA and QLoRA?

Both fine-tune a model by training small adapter weights while the original model stays frozen. QLoRA also stores the frozen base model in 4-bit precision, cutting its memory use by about four times compared with 16-bit, at the cost of somewhat slower training.

Is QLoRA worse than LoRA?

Usually only slightly, if at all. Studies and practical experience find QLoRA results very close to LoRA's on the same data. LoRA is typically faster to train if you have enough GPU memory.

How much VRAM do I need for QLoRA?

For an 8B model, roughly 10–16 GB of GPU memory is enough with modest batch sizes and sequence lengths. A 70B model needs around 40–48 GB with QLoRA.

Is LoRA as good as full fine-tuning?

For most tasks, LoRA gets close to full fine-tuning quality with far less memory. For very large datasets or teaching a model substantial new knowledge, full fine-tuning can learn more, though it also tends to make the model forget more of its general abilities.

Can I use LoRA adapters with Ollama or llama.cpp?

Yes. Adapters can be merged into the base model and converted to GGUF, or loaded as separate adapters in tools that support them, such as llama.cpp. Check that the adapter matches the exact base model it was trained on.

All articles

Read next

Language

EnglishEnglish · en TürkçeTurkish · tr DeutschGerman · de العربيةArabic · ar

Account

Enter your email. We’ll send you a sign-in link and a 6-digit code. No password needed.

Sign in

Theme

Language

Show our email address

To keep spam out of our inbox, please confirm your own email first. We will send you a 6-digit code.

We send codes only to these providers: gmail.com, googlemail.com, outlook.com, hotmail.com, live.com, msn.com, proton.me, protonmail.com, pm.me, icloud.com, me.com, mac.com, yahoo.com, aol.com, gmx.de, gmx.net, web.de, t-online.de, yandex.com, omniai.blog