Adam stores two fp32 buffers per trainable parameter: what does that imply for LoRA vs full FT on a 7B?
Adam holds two fp32 buffers (first moment m, second moment v) per trainable parameter. Use that single fact to compute the optimizer-state memory for a full fine-tune of a 7B model versus a LoRA fine-tune at r=16 over a few hundred million trainable parameters. State the headline number for each case and explain why most of LoRA's memory win lives here.
Adam costs 8 bytes per trainable parameter; full FT of a 7B model needs about 56 GB of optimizer state, LoRA r=16 needs about 0.8 GB, and that gap is the bulk of the LoRA win.
Imagine every worker on a construction site needs two clipboards to track their work. If a thousand workers are on the job, that is two thousand clipboards. If you instead let a small specialist crew of ten people make the actual changes while the rest of the site just observes, you only need twenty clipboards. The clipboards are the bookkeeping the optimiser keeps for each parameter it is changing. Full fine-tuning changes every parameter and pays the cost for all of them. LoRA changes only a small specialist crew of tiny adapter matrices on top of a frozen base model. The base parameters do not move, so they need no clipboards. The big memory saving is the bookkeeping you skipped, not the weights you stored.
Detailed answer & concept explanation~8 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
5 min: compute 8 bytes per trainable parameter, derive 56 GB for full FT vs 0.8 GB for LoRA r=16, and explain that the saving scales with trainable count not total count.
Real products, models, and research that use this idea.
- Hugging Face PEFT's LoRA implementation reports trainable-parameter counts and corresponding VRAM savings of 60-70x on the optimizer line at r=16.
- QLoRA paper (Dettmers et al. 2023) showed a 65B fine-tune fitting on a single 48 GB GPU by combining LoRA's optimizer savings with NF4-quantized base weights.
- bitsandbytes' Adam8bit drops m and v from fp32 to 8-bit blockwise, cutting optimizer state by a further 4x and used in most consumer-GPU fine-tuning recipes.
- Modern fine-tuning stacks like Unsloth and Axolotl default to LoRA with PEFT for 7B to 70B models precisely because the Adam-state win unlocks single-GPU training.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow does an 8-bit optimizer like bitsandbytes Adam8bit change the memory math?
QWhat happens to the memory math when you combine LoRA with ZeRO-3 sharding?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Claiming LoRA saves memory because the adapters are small. The dominant saving is the optimizer state you no longer maintain for the frozen base, not the size of the adapter weights themselves.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.