LoRA in an AI Engineer Interview: What the Low-Rank Update Actually Saves
When an interviewer asks you to explain LoRA and when you would use it, the hard part is saying exactly what gets smaller during training and what you still need at inference. For more practice with that kind of distinct
When an interviewer asks you to explain LoRA and when you would use it, the hard part is saying exactly what gets smaller during training and what you still need at inference. For more practice with that kind of distinction, get the free Top 30 AI Engineer Interview Questions PDF (13 pages, each with what the interviewer tests and the follow-up to expect) by entering $0.
What the interviewer is checking
Can you explain the update at one layer, then connect it to an engineering decision? Start with a weight matrix W in a layer you want to adapt. LoRA freezes W and learns two smaller matrices, A and B. Their product BA has the same shape as W and is added to W as a scaled update. The rank you choose sets an upper bound on the rank of that update.
For a 4096 by 4096 weight matrix, full fine-tuning makes all 16,777,216 entries trainable. At rank 8, the two factors have shapes 8 by 4096 and 4096 by 8. Together they contain 65,536 trainable parameters, a factor of 256 fewer for that matrix. You still store the original weight. The savings come from computing and storing gradients and optimizer state for the factors, and from saving only the factors in an adapter checkpoint. Training also still uses memory for activations.
A strong answer
I would use LoRA when I already have a capable base model and want to adapt it to a specific task with a limited training budget. I freeze the base weights and add a trainable low-rank update to selected layers. For each weight matrix I target, I learn two thin matrices whose product gives me an update of the right shape. A smaller rank means fewer trainable parameters and less optimizer state. It also gives the update less capacity, so I would pick the rank using validation results.
If I need several task variants, I can keep one base model and load a different adapter for each task. Serving still requires the full base model. I can merge the update into the base weights for a fixed task, which folds the adapter computation into the original layer, or keep the adapter separate so I can swap it. If storing the frozen base is the training memory bottleneck, I would consider QLoRA. It trains LoRA adapters while keeping the frozen base weights quantized.
Follow-ups to expect
- Which layers would you target? Start with the attention projections as a baseline. If that run falls short, test adding adapters to the feed-forward projections. Hold the data and evaluation fixed so you can see whether broader coverage earns its extra cost.
- How would you choose rank? Compare a small set of ranks while keeping the target layers fixed. Look at held-out task performance and memory use. If a larger rank provides little gain, use the smaller one. If every rank struggles, check the data and layer choice before paying for more capacity.
- Does LoRA prevent catastrophic forgetting? The original weights remain intact, so disabling an unmerged adapter recovers the base model's behavior under the same serving settings. With the adapter enabled, performance on general tasks can still drop. Evaluate both the target task and any base capabilities your application depends on.
The weak answer
LoRA makes the model smaller, so training and inference are both cheaper. That answer conflates trainable parameters with the weights needed to serve the model. An adapter checkpoint can be small because it depends on a compatible base checkpoint. At inference, a separate adapter adds computation to its target layers. Merging removes that separate computation, and the resulting weight matrices still have their original dimensions.
A drill
- Give the strong answer aloud in 90 seconds. Draw W, A, and B, and calculate the trainable parameter count for rank 8 without notes.
- Assume you need to serve three task variants on one base. Explain how keeping adapters separate lets you switch tasks and what serving with three merged variants would require you to store.
- Name one metric for the target task and one regression check for a general capability. Explain how those results would guide your choice of rank.
Keep practicing
For more questions that ask you to defend a design choice under follow-up, see The 0 to 1 AI Engineer Interview Playbook (twenty chapters on RAG, agents, evals, fine-tuning and LLM system design), 30 percent off with code BF30 through Mon Nov 30.
Valenx Press. Practice material, no company affiliation, no interview promise.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.