How does adapter merging work, and how do multi-LoRA serving and hot-swapping work in production?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
Merging: because LoRA's update is additive, you can fold it into the base weights offline: $W' = W + \frac{\alpha}{r}BA$. The merged model is a standard checkpoint - zero inference overhead, no PEFT dependency at serving time, deployable anywhere. In PEFT it's model.merge_and_unload(). Costs: you now store/ship a full-size artefact per variant, you lose the ability to detach the adapter, and merging into a quantized base is lossy - the standard practice is to merge into the full-precision base weights and then (re)quantize, not to merge into the 4-bit tensors a QLoRA run trained against.
Full worked answer with diagram
Merging: because LoRA's update is additive, you can fold it into the base weights offline: $W' = W + \frac{\alpha}{r}BA$. The merged model is a standard checkpoint - zero inference overhead, no PEFT dependency at serving time, deployable anywhere. In PEFT it's model.merge_and_unload(). Costs: you now store/ship a full-size artefact per variant, you lose the ability to detach the adapter, and merging into a quantized base is lossy - the standard practice is to merge into the full-precision base weights and then (re)quantize, not to merge into the 4-bit tensors a QLoRA run trained against.
Unmerged serving: keep the base frozen and compute $Wx + \frac{\alpha}{r}BAx$ at runtime - a small extra matmul whose latency cost depends on the kernels and on how many distinct adapters share a batch, so benchmark it on your own traffic mix. Why accept that cost? Because it unlocks multi-LoRA serving: one copy of the base model in GPU memory with many adapters (each tens of MB) attached per-request. Systems like S-LoRA and vLLM's LoRA support batch requests for different adapters through the same base-model forward pass using batched/gathered adapter kernels, and page adapters between GPU/CPU memory on demand. This changes the economics of customization: serving 100 per-customer fine-tunes as merged models means 100 model replicas; as adapters it's one base replica plus ~GBs of adapters.
Hot-swapping means loading/unloading adapters at runtime without restarting the server or reloading the base - new fine-tune versions deploy in seconds, and rollback is "point requests at the previous adapter ID."
Going further: follow-up territory
Operational notes worth volunteering: pin the exact base-model version an adapter was trained against (adapters are meaningless deltas without it); version adapters like code with eval gates; and if one adapter gets 95% of traffic, merging that one into a dedicated replica may be worth the zero overhead.
Worth sketching. it shows where the economics come from: one resident base, many small deltas.
flowchart LR
R1["Request for tenant A"] --> P["One batched forward<br/>through one base copy"]
R2["Request for tenant B"] --> P
LA["Adapter A, tens of MB"] --> P
LB["Adapter B, tens of MB"] --> P
P --> OUT["Per-request outputs"]
COLD["Cold adapters paged<br/>from CPU memory"] --> LB
NEW["New version:<br/>hot-swap the adapter id"] --> LA
What a good answer covers
- Merging: because LoRA's update is additive, you can fold it into the base weights offline: $W' = W +…
- The merged model is a standard checkpoint - zero inference overhead, no PEFT dependency at serving time,…
- In PEFT it's model.merge_and_unload()
- Costs: you now store/ship a full-size artefact per variant, you lose the ability to detach the adapter,…
- Unmerged serving: keep the base frozen and compute $Wx + \frac{\alpha}{r}BAx$ at runtime - a small extra…
Key terms: Merging · Unmerged serving · multi-LoRA serving · Hot-swapping
Interviewer follow-ups to expect
Why is merging into a 4-bit quantized base problematic?
How would you design serving for 500 tenant-specific fine-tunes with skewed traffic?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep