QLoRA on 12GB: what actually fits in 2026
Every few weeks someone asks if their 12GB card can fine-tune a "real" model. I've spent the month systematically answering that with a 3060 and a stopwatch. Short version: yes, up to 14B, with caveats.
The config that works
# adapter
r: 16
lora_alpha: 32
lora_dropout: 0.05
target_modules: [q_proj, k_proj, v_proj, o_proj]
# base model
load_in_4bit: true
bnb_4bit_quant_type: nf4
bnb_4bit_compute_dtype: bfloat16
# memory
gradient_checkpointing: true
per_device_train_batch_size: 2
gradient_accumulation_steps: 8
optim: paged_adamw_8bit
Measured peak VRAM (seq len 1024)
model base (4-bit) peak VRAM (r=16) fits 12GB?
Llama 3.1 8B 4.9 GB 9.8 GB yes, comfortably
Qwen2.5 14B 8.1 GB 11.6 GB yes, barely
Mistral Small 22B 12.9 GB — no
Qwen2.5 32B 18.6 GB — no
What actually moves the needle
- Gradient checkpointing is non-negotiable — it's the difference between 11.6GB and 17GB on the 14B, at the cost of ~25% step time.
- Sequence length is the hidden variable: at 2,048 tokens the 14B needs 12.9GB and OOMs. Train at 1,024, then do a short context-extension pass if you need it.
- paged_adamw_8bit saved me twice when a long batch spiked; without it the 14B run died at step 340 of 500.
- Dropping rank from 16 to 8 buys about 0.7GB and, on my evals, cost almost nothing in quality for style-transfer tasks.
Everything above is bitsandbytes 0.45, transformers 4.48, CUDA 12.4. Your mileage may vary by one driver update.
This table should be pinned somewhere — it's the answer to roughly a third of the questions in this category.
One addition from my runs: on the 14B, r=8 with alpha=16 plus target_modules extended to the MLP layers (gate_proj, up_proj, down_proj) beat plain r=16 attention-only on my eval set, at the same VRAM. Rank gets too much credit; coverage of modules matters more.
Also worth stating explicitly: 4-bit base + LoRA is fine for style and domain adaptation, but if you're chasing benchmark gains on reasoning, you'll want the base in bf16 — which means you'll want a bigger card. Know which game you're playing.
Confirming the batch-size findings on my end — I had to drop to per_device_train_batch_size: 1 with accumulation 16 on the 14B once I added the MLP targets Kasimir mentions. Same effective batch, about 0.9GB of headroom back.
Also: close your browser before training. Chrome's GPU process quietly holds 400MB and the OOM message will happily blame the model instead.