---
title: "LoRA, QLoRA or full fine-tuning: pick by memory and goal · CloudSat"
description: "LoRA, QLoRA or full fine-tuning? Weigh GPU memory, output quality and forgetting, with the VRAM math, recent research results and a QLoRA script that runs."
url: https://cloudsat.io/learn/lora-qlora-or-full-fine-tuning
updated: 2026-11-18T12:00:00Z
source: CloudSat (https://cloudsat.io/). Prices in USD.
---

[AI and machine learning](https://cloudsat.io/learn/topic/ai)

# LoRA, QLoRA or full fine-tuning: pick by memory and goal

LoRA, QLoRA or full fine-tuning? Weigh GPU memory, output quality and forgetting, with the VRAM math, recent research results and a QLoRA script that runs.

CloudSat team November 18, 2026 6 min read

The three common ways to fine-tune a language model differ in one thing: how much of the model you allow to change. Full fine-tuning updates every weight. LoRA freezes the model and trains small add-on matrices. QLoRA does the same on top of a 4-bit copy of the model. That single difference decides how much GPU memory you need, how much the model can learn, and how much it forgets. Here is how to choose.

## First, make sure fine-tuning is the right tool

Fine-tuning changes behavior. It is good at teaching a format, a tone, a classification scheme, a tool-calling convention or a domain's style of reasoning, and at shrinking long prompts into learned habits. It is a poor way to add facts that change often. For a product catalog or internal documents, retrieval (putting the relevant text into the prompt at query time) is cheaper to update and easier to audit. Many teams fine-tune for behavior and retrieve for knowledge.

## What each method trains

### Full fine-tuning

Every parameter receives gradients, and the optimizer keeps its own state for each one. Nothing limits what the model can learn, and nothing protects what it already knew.

### LoRA

LoRA, introduced by Hu and colleagues in 2021, freezes the base weights and learns two thin matrices for each targeted weight matrix. Their product, of low rank `r`, is added to the frozen weights. The paper reported 10,000 times fewer trainable parameters and a threefold drop in GPU memory compared with fine-tuning GPT-3 175B using Adam. The result is an adapter file you can keep separate, swap at serving time, or merge into the base model.

### QLoRA

QLoRA, from Dettmers and colleagues in 2023, stores the frozen base model in 4-bit NormalFloat (NF4), compresses the quantization constants a second time (double quantization), and uses paged optimizers to absorb memory spikes. Gradients flow through the 4-bit weights into 16-bit LoRA adapters. Its best-known result: one 48 GB GPU was enough to fine-tune a 65B model, and task performance matched full 16-bit fine-tuning.

## The memory math

Model states come first; activations come on top and depend on sequence length, batch size and whether gradient checkpointing is on.

| Method | Bytes per parameter for model states | 7B model | 70B model |
| --- | --- | --- | --- |
| Full fine-tuning (BF16, AdamW, mixed precision) | About 16 | About 112 GB | About 1,120 GB |
| LoRA on a BF16 base | About 2, plus small adapter states | About 14 GB | About 140 GB |
| QLoRA on an NF4 base | About 0.5, plus small adapter states | About 4 GB | About 35 to 40 GB |

The 16 bytes for full fine-tuning break down as 2 for the BF16 weights, 2 for gradients and 12 for the FP32 master copy and Adam's two moment estimates. That is why full fine-tuning of even a 7B model is a multi-GPU job, while QLoRA of the same model fits on one consumer card.

How that maps to hardware:

- **QLoRA, 7B to 14B**: one 24 GB or 32 GB card (RTX 4090, RTX 5090).
- **LoRA, 7B to 8B in BF16**: 24 GB with gradient checkpointing and modest sequence lengths; 32 GB or more gives room.
- **QLoRA, 70B**: 48 GB or more; one A100 80 GB or one RTX PRO 6000 with 96 GB.
- **Full fine-tuning, 7B**: several 80 GB cards with sharding (PyTorch FSDP or DeepSpeed ZeRO).

The [VRAM guide](https://cloudsat.io/learn/how-much-vram-does-an-llm-need) explains how quantization formats translate into bytes, and the [GPU guide](https://cloudsat.io/learn/choose-a-gpu-for-ai-workloads) compares the cards.

## What the research says about quality

Three results are worth knowing before you pick.

- **QLoRA (2023)** matched 16-bit full fine-tuning on the benchmarks in the paper, which is why 4-bit bases became the default for single-GPU work.
- **"LoRA Learns Less and Forgets Less"** (Biderman and colleagues, TMLR 2024) compared the methods on programming and math, with about 100K instruction pairs and with continued pretraining on 20B tokens. In standard low-rank settings, LoRA substantially underperformed full fine-tuning, but it better preserved the base model's skills outside the target domain.
- **"LoRA Without Regret"** (Thinking Machines Lab, September 2025) found that LoRA matched full fine-tuning on small and medium post-training datasets when two conditions held: adapters on all layers, especially the MLP layers, and a dataset within the adapter's capacity. The best LoRA learning rate was consistently about 10 times the full fine-tuning rate, LoRA tolerated large batch sizes less well, and in reinforcement learning even rank 1 matched full fine-tuning.

Put together: for instruction tuning, style and task adaptation on typical datasets, LoRA or QLoRA on all linear layers is enough. For a large domain shift trained on billions of tokens, full fine-tuning learns more and also forgets more.

## Pick by situation

| Your situation | Method |
| --- | --- |
| One consumer GPU, 7B to 14B model, format or task tuning | QLoRA |
| Enough memory for a BF16 base, faster steps wanted | LoRA |
| Several variants of one base (per customer or per task) | LoRA or QLoRA, one adapter each |
| Reinforcement learning on top of a tuned model | LoRA, even at low rank |
| Large new domain, billions of tokens, multi-GPU budget | Full fine-tuning with sharding |

## A minimal QLoRA run

This uses Hugging Face Transformers, PEFT, bitsandbytes and TRL. The training file holds one JSON object per line with a `messages` list of chat turns.

```python
import torch
from datasets import load_dataset
from peft import LoraConfig
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from trl import SFTConfig, SFTTrainer

model_id = "Qwen/Qwen3-8B"  # any causal LM whose license allows fine-tuning

bnb = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_use_double_quant=True,
    bnb_4bit_compute_dtype=torch.bfloat16,
)
model = AutoModelForCausalLM.from_pretrained(model_id, quantization_config=bnb, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_id)

lora = LoraConfig(r=16, lora_alpha=32, lora_dropout=0.05,
                  target_modules="all-linear", task_type="CAUSAL_LM")

trainer = SFTTrainer(
    model=model,
    train_dataset=load_dataset("json", data_files="train.jsonl", split="train"),
    peft_config=lora,
    processing_class=tokenizer,
    args=SFTConfig(
        output_dir="qlora-out",
        per_device_train_batch_size=2,
        gradient_accumulation_steps=8,
        gradient_checkpointing=True,
        learning_rate=2e-4,
        num_train_epochs=1,
        bf16=True,
        logging_steps=10,
    ),
)
trainer.train()
trainer.save_model("qlora-out/adapter")
```

`target_modules="all-linear"` puts adapters on the MLP layers as well as attention, which matches the research above. Unsloth and Axolotl package the same recipe with extra memory savings and configuration files, if you prefer not to write the loop yourself.

On CloudSat, an RTX 4090 or RTX 5090 [deep learning server](https://cloudsat.io/deep-learning-servers) covers QLoRA on 7B to 14B models, and the two-card and four-card A100 configurations cover full fine-tuning of small models with sharding.

## Mistakes that cost the most

- **Attention-only adapters.** Older tutorials target only the query and value projections. Adapters on all linear layers learn faster for the same budget.
- **Reusing a full fine-tuning learning rate.** LoRA usually wants a rate roughly ten times higher.
- **Merging into the 4-bit base.** To ship a merged model, load the base in BF16, merge the adapter there, then quantize the result for inference.
- **Measuring only the target task.** Keep a small set of general prompts and compare before and after, so you notice forgetting.
- **Skipping the license.** Model licenses differ on fine-tuning and redistribution. Read the model card first.

## FAQ

### What LoRA rank should I use?

Start at 16 or 32 for instruction and style tuning. Rank matters less than putting adapters on every linear layer. Raise it only when the training loss stalls on a large dataset.

### How much training data do I need?

Less than most people expect, if it is clean. Meta's LIMA study tuned a 65B model on 1,000 carefully curated examples and reported strong results. A few hundred high-quality examples of your exact format beat thousands of noisy ones.

### Can one server run several adapters on one base model?

Yes. vLLM can serve multiple LoRA adapters on a single base with `--enable-lora` and `--lora-modules`, so each customer or task gets its own behavior without its own copy of the model.

### Is QLoRA slower than LoRA?

Each step does extra work to dequantize the 4-bit weights, so a QLoRA step takes longer than a LoRA step on the same card. You trade speed for memory, which is usually the right trade on a single GPU.

**Run it on CloudSat.** Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. [See plans](https://cloudsat.io/plans) or [deploy a server](https://dash.cloudsat.io/console/deploy).

## Keep reading

[All guides in AI and machine learning](https://cloudsat.io/learn/topic/ai)

- [How to choose a GPU for AI: VRAM first, then bandwidth](https://cloudsat.io/learn/choose-a-gpu-for-ai-workloads): AI and machine learning How to choose a GPU for AI: VRAM first, then bandwidth 7 min read
- [How much VRAM does an LLM need? Weights, KV cache, quants](https://cloudsat.io/learn/how-much-vram-does-an-llm-need): AI and machine learning How much VRAM does an LLM need? Weights, KV cache, quants 7 min read
- [Ollama, LM Studio and AI workspaces: how the layers fit](https://cloudsat.io/learn/ollama-lm-studio-and-ai-workspaces): AI and machine learning Ollama, LM Studio and AI workspaces: how the layers fit 6 min read
- [Self-hosted LLM or API: work out the real break-even](https://cloudsat.io/learn/self-hosted-llm-or-api-break-even): AI and machine learning Self-hosted LLM or API: work out the real break-even 7 min read
