Estimate LoRA Parameters and Memory for a 70B Fine-Tune
Last updated: November 29, 2026
Quick Overview
For a 70B-parameter Llama-style model with grouped-query attention, estimate how many trainable parameters rank-16 LoRA adds across attention and MLP projections, and compare the training memory of LoRA, QLoRA and full fine-tuning.
Together AI
November 29, 20260
0
0 solved
For a 70B-parameter Llama-style model with grouped-query attention, estimate how many trainable parameters rank-16 LoRA adds across attention and MLP projections, and compare the training memory of LoRA, QLoRA and full fine-tuning.
Together AI's fine-tuning service offers both LoRA and full fine-tuning on large open models and shows customers cost and time estimates, which depend on exactly this arithmetic. The screen checks that a candidate knows where LoRA attaches, how GQA shrinks the K and V projections, and what actually dominates GPU memory in training.
What the Interviewer Expects
- Uses r times (in + out) per adapted matrix
- Accounts for smaller K and V projections under grouped-query attention
- Includes MLP gate, up and down projections when targeted
- Separates frozen weights, trainable parameters, gradients, optimizer state and activations
- Gives order-of-magnitude memory for each method and the GPU count it implies
Key Topics to Cover
How to Approach This
- Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
- Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
- Feature engineering is often more impactful than model selection.
- Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
- Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
- How does the choice of rank and target modules affect quality on reasoning tasks?
- Why can many LoRA adapters share one base model at serving time, and what limits that?
- How does activation checkpointing change the memory picture for long-context fine-tuning?
- When would you recommend full fine-tuning over LoRA to a customer?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Explore ML Interview PrepSample Answer
Clarify
Assume 80 layers, hidden size 8192, MLP intermediate 28672, 64 query heads and 8 KV heads of dim 128, so K and V project 8192 to 1024. LoRA rank on q, k, v, o, gate, up and down. A LoRA pair fo...
Approach
Count per layer, multiply by layers, then build memory per method: frozen weights, plus trainable parameters with their gradients and Adam states (about 16 bytes per trainable parameter in mixed preci...