Fine-tuning, RLHF & Alignment
This topic shows up in nearly every AI Engineer loop because it separates people who call APIs from people who can change model behaviour. Expect it if you're interviewing for GenAI/LLM engineer roles at frontier labs, applied ML teams at big tech, or any startup that ships custom models - interviewers use it to probe whether you know when to fine-tune, what it costs, and how post-training actually works under the hood.
Card 1 of 11
The decision framework: prompt → RAG → fine-tune
Fine-tuning changes form; RAG changes knowledge. The default escalation path is: prompt engineering (hours, free) → RAG (days, adds fresh/private knowledge) → fine-tuning (weeks, changes behaviour). Fine-tune when you need consistent style/format/tone, reliable structured output, latency/cost wins (a tuned 8B replacing a frontier model, or cutting a 2,000-token system prompt), or narrow-task skill (classification, extraction, a house SQL dialect). Don't fine-tune to inject facts - knowledge injection via SFT is unreliable and goes stale; that's RAG's job (or continued pretraining if the domain language itself is foreign, e.g. legal or genomics corpora). The nuance: real systems combine them - RAG for facts, a fine-tuned model that's better at using retrieved context.
All 61 Fine-tuning, RLHF & Alignment questions
Basic
- When would you fine-tune a model instead of using prompting or RAG?
- What actually happens during supervised fine-tuning? What role do chat templates and special tokens play?
- What is loss masking in SFT, and why do you mask the prompt tokens?
- How much data do you need to fine-tune a model? Quality vs. quantity?
- Full fine-tuning vs. parameter-efficient fine-tuning - how do you choose?
- Explain how LoRA works - the math, and what
randalphamean. - What is catastrophic forgetting in fine-tuning, and how do you mitigate it?
- What are the key hyperparameters for fine-tuning, and what are sensible starting values?
- How do you tell that a fine-tune is overfitting? What are the signals?
- Walk me through the classic RLHF pipeline end to end.
- Would you fine-tune a base model or an instruct model? How does that choice change your data and your recipe?
- Why do you deduplicate fine-tuning data, and how would you actually do it?
- What is the difference between an outcome reward model and a process reward model, and when do you need each?
Intermediate
- Which modules do you target with LoRA, how do you pick the rank, and what are the actual memory savings?
- How does adapter merging work, and how do multi-LoRA serving and hot-swapping work in production?
- Explain QLoRA - NF4, double quantization, paged optimizers. What do you give up?
- How do you train a reward model? Explain the preference data and the Bradley - Terry loss.
- Explain PPO in the RLHF context. Why is there a KL penalty against a reference model?
- What is reward hacking? Give concrete examples and mitigations.
- Explain DPO. What's the key insight that lets it skip the reward model and the RL loop?
- DPO vs PPO-style RLHF - when would you choose each?
- Give one-liners on IPO, KTO, and ORPO - what problem does each solve, and when would you pick it?
- How do you evaluate a model before and after fine-tuning?
- What's the difference between continued pretraining and SFT? When do you need domain knowledge injection?
- How do you generate synthetic training data with an LLM, and what are the pitfalls?
- Explain distillation for LLMs - black-box vs logit distillation - and the licensing caveats.
- Do the GPU memory math: why can't you full-fine-tune a 7B model on a single 24 GB GPU with Adam?
- You are fine-tuning on a domain full of jargon and someone suggests adding new tokens to the tokenizer. What can go wrong, and how do you handle vocabulary changes correctly?
- DoRA, rsLoRA and LoRA+ all claim to improve on vanilla LoRA. What does each actually change, and when would you reach for them?
- Explain model merging: task arithmetic, TIES, DARE and SLERP. When does merging actually work?
- You have 500k instruction examples of mixed quality and compute budget to train on 20k. How do you choose the 20k?
- Walk me through actually collecting preference data. What are the logistics, and where does it go wrong?
- How do you evaluate a reward model? Why is held-out pairwise accuracy not enough?
- You are fine-tuning a reasoning model that writes a thinking block before its final answer. How do you build the SFT data, and what breaks if you train on final answers only?
- Why does LoRA hold up so well for RL fine-tuning, even at very low rank, when the same rank can underfit a large SFT run?
- You want to build your product on a Chinese open-weight base model such as Kimi, GLM or DeepSeek. What licence, provenance, security and deployment-region checks do you run before post-training on it or serving it to customers?
- A customer wants their open-weight model post-trained for one workflow. Pick the base model, choose between SFT, DPO and RL with a verifier, design the data plan, and estimate compute and calendar time, with rollout generation counted separately from training. What result in week one would make you tell them RL is not worth it?
Advanced
- Explain gradient accumulation, gradient checkpointing, and ZeRO/FSDP - and how you'd combine them for a real training run.
- Explain GRPO. Why has it displaced PPO for reasoning RL?
- Why are math and code so RL-friendly? Explain verifiable rewards and the R1-style training recipe.
- What are RLAIF and Constitutional AI? How does AI feedback replace human feedback?
- What is the "alignment tax"? How does preference tuning cause over-refusal, and how do you manage it?
- When is fine-tuning the wrong call? Describe failure modes you'd warn a team about.
- Hosted fine-tuning APIs vs training it yourself - how do you decide?
- Your fine-tuned model's training loss looked great, but outputs in production are worse than the base model. Walk me through your debugging process.
- Design an end-to-end fine-tuning pipeline for a customer-support model at a mid-size company. Walk me through data → training → eval → deployment → iteration.
- How do you construct the data mixture for a fine-tune to prevent capability regressions - and how do you validate the mixture?
- Explain sequence packing in SFT. What's the attention contamination problem and how is it solved?
- How do you serve fine-tuned models at scale - merged checkpoints vs adapters, versioning, rollback?
- Your DPO run improves win rate against the SFT model, but outputs are longer, waffly and hedge constantly. Debug it.
- Your fine-tune gained 8 points on your benchmark. How do you know the gain is real and not contamination?
- You are running GRPO with a verifier reward on a code task. Reward climbs steadily, but outputs get shorter and more repetitive and held-out pass rate drops. What is happening?
- Design a pipeline to distil a frontier model's performance on your task into an 8B model you can serve yourself. Walk me through the whole thing.
- You want to RL-train an agent for a multi-turn tool-use task, and the only reward you have is whether the final task succeeded. How do you make that work?
- You RL-trained an agent against a mocked environment, held-out reward improved, and the gains did not show up in production. Diagnose it.
- Your RL loop samples rollouts with a fast inference engine and trains with FSDP. Why do the two disagree on token log-probs, and what do you do about it?
- A team fine-tuned an aligned model on a few thousand benign support transcripts, and its refusal behaviour got noticeably weaker. Why does that happen, and how do you guard against it?
- What changes when you fine-tune a mixture-of-experts model instead of a dense one?
- You are turning someone else's open-weight MoE base model into an agentic coding model. Why add a mid-training stage before RL, what goes into a few trillion tokens of mid-training data, and what ablation would show the stage was worth its compute?
- Your RL environments reward the agent for reaching the answer by any route. After deployment it reads access tokens out of a config file and exploits a site's injection flaw to finish tasks. How did training cause that, and how do you design and audit environments so it does not happen?
- Walk me through pipeline-parallel training schedules: GPipe, 1F1B, interleaved stages and zero-bubble schedules. Where does the bubble come from, and what does each schedule give up to shrink it?