Practise Fine-Tuning & Model Customization one question at a time. Answer out loud or in writing, get graded, and see exactly what you missed.
What is fine-tuning, and how is it different from pretraining a model from scratch?
Fine-tuning takes a model that is already trained and keeps training it on a smaller, focused dataset. Pretraining from scratch starts from random weights and teaches the model language itself, from raw text at huge scale.
| Pretraining from scratch | Fine-tuning | |
|---|---|---|
| Starting weights | Random | An existing trained model |
| Data | Trillions of tokens of raw text | Thousands of curated examples |
| Compute | Weeks or months on large GPU clusters | Hours or days on a few GPUs |
| Goal | Build general ability and knowledge | Shape behavior, style, or format |
The mechanism is the same in both: gradient descent on a next-token prediction loss. The difference is the starting point and the scale.
That starting point drives the practical rules. The base model already holds the ability you want, so fine-tuning uses a small learning rate and few passes. A high learning rate or too many passes erode the general ability pretraining built.
Missed:
“I'd go in order of effort. First I'd just try prompting - a clear system prompt, a few examples, maybe structured output - because I can iterate on that in minutes. If the problem is that the model doesn't have the information, like our internal policies or today's order status, I'd add retrieval and put the right documents into the context. Fine-tuning is for when the knowledge is fine but the behavior isn't. Say we need the same JSON shape and tone every time, and the prompt to get there has grown to two pages and still slips. Training on a few hundred good examples bakes that in, and it might let us move to a smaller, cheaper model. So retrieval is my fix for knowledge, and fine-tuning is my fix for behavior. Pretraining I basically wouldn't touch. That's for labs with huge budgets.”
Knew itSolid grasp: prompting first, RAG for knowledge, fine-tuning for locked-in behavior, pretraining basically never. Missing the framing that these stack together rather than being an either-or choice.
Missed: Doesn't mention these approaches combine in practice rather than being picked one at a time
Missed: No mention of continued pretraining's actual use case, when the model doesn't understand the domain's language at all
Get your own answers graded
Sign up free. Your account comes with 50 credits for grading, and it remembers what you missed.
What it covers
- What fine-tuning is
- When to fine-tune
- Building the training dataset
- Training setup and debugging
- LoRA and parameter-efficient methods
- GPU memory and scaling
- Overfitting and forgetting
- Evaluating fine-tuned models
- Synthetic data and distillation
- Preference optimization and RL
- Fine-tuning for RAG and agents
- Tooling, serving and operations
All 56 questions
What fine-tuning is
How fine-tuning differs from pretraining, what supervised fine-tuning does mechanically, instruction tuning and continued pretraining.
- What is fine-tuning, and how is it different from pretraining a model from scratch?
- What actually happens during supervised fine-tuning, mechanically?
- What is instruction tuning, and how does it differ from task-specific fine-tuning? Pro
- When do you need continued pretraining instead of SFT, and how do you run it? Pro
When to fine-tune
Choosing between prompting, RAG and fine-tuning, what fine-tuning is good and bad at, picking a base model and replacing a frontier model.
- Walk me through the customization spectrum. When would you reach for prompting, RAG, fine-tuning, or pretraining?
- What kinds of problems is fine-tuning actually good at solving?
- Why is fine-tuning usually the wrong tool for teaching a model new facts?
- How do you choose a base model for fine-tuning? Pro
- When can a fine-tuned small model replace a frontier model, and how do you de-risk the swap? Pro
Building the training dataset
Dataset format, how much data you need, deduplication and choosing the data mixture for a domain fine-tune.
Training setup and debugging
Hyperparameters, loss masking, chat templates and debugging a fine-tune that rambles or ignores instructions.
- What are the key hyperparameters in an SFT run, and what are sensible starting points? Pro
- What is loss masking in SFT, and why does it matter? Pro
- Why do chat templates and formatting consistency matter so much in fine-tuning? Pro
- Your fine-tuned model is worse than the base model: it rambles, never stops, or ignores instructions. How do you debug it? Pro
LoRA and parameter-efficient methods
How LoRA works, rank and alpha, target modules, other PEFT methods and when full fine-tuning is worth it.
- In simple terms, what is LoRA and why did it become the default fine-tuning method?
- How does LoRA actually work under the hood? Pro
- What do rank and alpha control in LoRA, and how do you pick them? Pro
- Compare full fine-tuning with parameter-efficient fine-tuning. When is full fine-tuning worth it? Pro
- Besides LoRA, what other parameter-efficient fine-tuning methods are there? Pro
- Which modules should LoRA target, and does it matter? Pro
GPU memory and scaling
QLoRA and 4-bit quantization, estimating memory, gradient checkpointing, and sharding with FSDP and DeepSpeed ZeRO.
- What is QLoRA, and when do you choose it over standard LoRA? Pro
- What is gradient checkpointing, and what does it cost you during fine-tuning? Pro
- Walk me through QLoRA's key technical innovations. Pro
- Estimate the GPU memory needed to fine-tune an 8B-parameter model: full fine-tuning versus LoRA versus QLoRA. Pro
- How do you fine-tune a model that does not fit on one GPU? Explain FSDP, DeepSpeed ZeRO stages, and when you need each. Pro
Overfitting and forgetting
Validation splits, overfitting signals, catastrophic forgetting and its fixes, and how fine-tuning can erode safety alignment.
- Why do you need a validation split when fine-tuning, and how do you use it? Pro
- What is catastrophic forgetting in the context of fine-tuning? Pro
- How do you mitigate catastrophic forgetting in practice? Pro
- What signals tell you a fine-tune is overfitting, and how do you respond? Pro
- How can fine-tuning degrade a model's safety alignment, and what do you do about it? Pro
Evaluating fine-tuned models
Proving a fine-tune beats its baseline, measuring style and format adherence, and keeping eval data out of training.
Synthetic data and distillation
Teacher-student distillation, hard versus soft labels, generating synthetic training data and what goes wrong with it at scale.
- What is model distillation, and why has it become so central to model customization? Pro
- How would you generate synthetic training data, and what are the risks? Pro
- Explain the mechanics of distillation: hard versus soft labels, and off-policy versus on-policy. Pro
- At scale, what goes wrong with synthetic training data, and how do you counter it? Pro
Preference optimization and RL
RLHF, DPO and its successors, preference datasets, GRPO with verifiable rewards and production preference pipelines.
- Explain RLHF at a concept level. Why was it so important, and what are its costs? Pro
- What is DPO, and how does it simplify the RLHF pipeline? Pro
- How do you build a good preference dataset for DPO or similar methods? Pro
- What are DPO's known failure modes, and what do successors like IPO, KTO, ORPO, and SimPO change? Pro
- Where do GRPO and RL with verifiable rewards fit relative to SFT and DPO? Pro
- Design a preference-optimization pipeline for a production assistant. What breaks, and how do you defend against it? Pro
Fine-tuning for RAG and agents
Fine-tuning a generator for RAG, training embedding and reranker models, and fine-tuning for tool calling and agent trajectories.
- How would you fine-tune an embedding or reranker model for retrieval, and how does it differ from fine-tuning an LLM? Pro
- How do fine-tuning and RAG work together, and what does "fine-tuning for RAG" actually involve? Pro
- How do you fine-tune a model for tool calling and agentic use, and how do you evaluate it? Pro
Tooling, serving and operations
Hosted APIs and open-source stacks, cost estimates, serving adapters, versioning and rollback, and continuous fine-tuning programs.
- What do hosted fine-tuning APIs actually provide, and what are the main options in 2026? Pro
- Your LoRA fine-tune is ready for production. Do you merge the adapter or serve it separately? Pro
- Compare the main open-source fine-tuning stacks: Hugging Face TRL, Axolotl, and Unsloth. Pro
- How do you estimate the cost of a fine-tuning project? Pro
- How does serving hundreds of fine-tuned variants on shared infrastructure actually work? Pro
- How do you handle versioning and rollback for fine-tuned models? Pro
- Design a continuous fine-tuning program that learns from production feedback, with eval gates and rollback. Pro
All questions
Showing of 56What is fine-tuning, and how is it different from pretraining a model from scratch?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Fine-tuning takes a model that is already trained and keeps training it on a smaller, focused dataset. Pretraining from scratch starts from random weights and teaches the model language itself, from raw text at huge scale.
| Pretraining from scratch | Fine-tuning | |
|---|---|---|
| Starting weights | Random | An existing trained model |
| Data | Trillions of tokens of raw text | Thousands of curated examples |
| Compute | Weeks or months on large GPU clusters | Hours or days on a few GPUs |
| Goal | Build general ability and knowledge | Shape behavior, style, or format |
The mechanism is the same in both: gradient descent on a next-token prediction loss. The difference is the starting point and the scale.
That starting point drives the practical rules. The base model already holds the ability you want, so fine-tuning uses a small learning rate and few passes. A high learning rate or too many passes erode the general ability pretraining built.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
Walk me through the customization spectrum. When would you reach for prompting, RAG, fine-tuning, or pretraining?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Treat it as a ladder of cost and commitment. Start on the cheapest rung, and climb only when the one below clearly fails.
- Prompting changes nothing lasting, only each call's instructions. Always start here, and stay when the behavior can be put into words.
- RAG changes the facts in the context window, for private, fresh or changing knowledge.
- Fine-tuning changes the weights, so behavior sticks. Use it when prompts work but are long, slow or unreliable.
- Continued pretraining changes base knowledge and language, for a model that barely understands your domain's text or notation.
As a rough rule, RAG changes what the model answers with, and fine-tuning changes how it answers.
These stack rather than compete. Most production systems are prompting plus RAG, with a fine-tune added later for cost or consistency. Pretraining is rare, because it needs billions of tokens.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What actually happens during supervised fine-tuning, mechanically?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Supervised fine-tuning is the same next-token prediction as pretraining, run on your examples. The weights already exist, so each step only nudges them.
Each row is rendered with the chat template, then tokenized. The model does one forward pass and predicts a distribution over the next token at every position. Cross-entropy loss measures how surprised it was by your actual tokens. Backpropagation then works out how much each weight contributed to the loss. That gives a gradient, and the optimizer subtracts a small step.
for batch in loader: # one optimizer step per batch
out = model(input_ids=batch["input_ids"], labels=batch["labels"])
out.loss.backward() # gradient for every trained weight
optimizer.step() # weights move a little
optimizer.zero_grad()
Nothing is inserted or looked up. The model becomes more likely to produce sequences that look like your answers. Fine-tuning learning rates are much smaller than pretraining ones, so each pass shifts behavior gently.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What does a fine-tuning dataset look like in practice?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
In practice it is a plain text file, usually JSONL, which holds one JSON object per line. Each line is one complete example: the input your model sees in production, plus the exact output you want back.
{"messages": [
{"role": "system", "content": "Triage support tickets. Reply with JSON only."},
{"role": "user", "content": "I was charged twice for order 4417."},
{"role": "assistant", "content": "{\"category\": \"billing\", \"priority\": \"high\", \"order\": \"4417\"}"}
]}
In the real file that whole object sits on a single line.
Two things matter more than volume. Keep the structure identical on every line, with the same system prompt and the same output shape. The model copies whatever you repeat, including sloppiness. And examples should come from real traffic, so training inputs match production inputs.
You normally ship two files: a training set and a validation set.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What kinds of problems is fine-tuning actually good at solving?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Fine-tuning is good at teaching a model how to behave, not what to know. It shifts form, style and task habits, which you can show in examples but struggle to describe in a prompt.
The usual sweet spots:
- Consistent format, tone or house style. Examples beat a long, brittle style prompt.
- One narrow, repeated task, such as classifying, extracting or routing. The model only needs that job done well.
- Cost and latency. A small tuned model can match a large prompted one.
- Unusual output shapes or tool-call patterns. They are easier to demonstrate than to explain.
It also shortens prompts. Behavior baked into the weights does not need repeating on every call.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
Why is fine-tuning usually the wrong tool for teaching a model new facts?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Fine-tuning is the wrong tool because it changes behavior, not storage. It shapes style, format and task shape. Facts land in the weights only as fuzzy statistics, so the model learns the shape of a confident answer and invents the details.
Three concrete problems:
- Recall is unreliable. A fact needs many repeated paraphrases before it sticks. A small SFT run rarely gets there.
- Facts change. Every correction means another training run and another eval pass. Retrieval needs one document edit.
- It can increase hallucination. Training on facts the base model never saw rewards confident guessing, and that habit spreads to other questions.
You also lose citations, per-user access control and instant removal.
As a rule of thumb, use RAG for what the model should know and fine-tuning for how it should answer.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
In simple terms, what is LoRA and why did it become the default fine-tuning method?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Low-Rank Adaptation (LoRA) freezes the original model weights and trains a small set of extra weights beside them, called an adapter. The base model never changes, and the adapter carries your new behavior.
It became the default because it removes most of the cost without much loss in quality.
- You train a tiny fraction of the parameters, so one mid-range GPU is often enough.
- The result is an adapter file of megabytes, not a full model copy of gigabytes.
- One base model can serve many adapters, and you can swap or delete one instantly.
- On style, format and narrow task work, it usually matches full fine-tuning.
Hosted services run it too. Together AI trains LoRA by default, and Azure OpenAI in Microsoft Foundry fine-tunes with LoRA.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
Why do you need a validation split when fine-tuning, and how do you use it?
What is catastrophic forgetting in the context of fine-tuning?
What do hosted fine-tuning APIs actually provide, and what are the main options in 2026?
What is model distillation, and why has it become so central to model customization?
How much data do you need to fine-tune a model?
What is instruction tuning, and how does it differ from task-specific fine-tuning?
How does LoRA actually work under the hood?
What do rank and alpha control in LoRA, and how do you pick them?
What is QLoRA, and when do you choose it over standard LoRA?
Compare full fine-tuning with parameter-efficient fine-tuning. When is full fine-tuning worth it?
Besides LoRA, what other parameter-efficient fine-tuning methods are there?
Which modules should LoRA target, and does it matter?
What are the key hyperparameters in an SFT run, and what are sensible starting points?
What is loss masking in SFT, and why does it matter?
Why do chat templates and formatting consistency matter so much in fine-tuning?
How do you deduplicate a fine-tuning dataset, and why does it matter so much?
How would you generate synthetic training data, and what are the risks?
Explain RLHF at a concept level. Why was it so important, and what are its costs?
What is DPO, and how does it simplify the RLHF pipeline?
How do you build a good preference dataset for DPO or similar methods?
How do you evaluate whether a fine-tuned model is actually better?
Your LoRA fine-tune is ready for production. Do you merge the adapter or serve it separately?
Compare the main open-source fine-tuning stacks: Hugging Face TRL, Axolotl, and Unsloth.
How do you estimate the cost of a fine-tuning project?
Your fine-tuned model is worse than the base model: it rambles, never stops, or ignores instructions. How do you debug it?
How would you fine-tune an embedding or reranker model for retrieval, and how does it differ from fine-tuning an LLM?
What is gradient checkpointing, and what does it cost you during fine-tuning?
How do you mitigate catastrophic forgetting in practice?
What signals tell you a fine-tune is overfitting, and how do you respond?
How do you choose a base model for fine-tuning?
Explain the mechanics of distillation: hard versus soft labels, and off-policy versus on-policy.
What are DPO's known failure modes, and what do successors like IPO, KTO, ORPO, and SimPO change?
Where do GRPO and RL with verifiable rewards fit relative to SFT and DPO?
Walk me through QLoRA's key technical innovations.
How does serving hundreds of fine-tuned variants on shared infrastructure actually work?
How do you handle versioning and rollback for fine-tuned models?
How do you detect and prevent contamination between training data and evaluations?
How do you choose the data mixture for a domain fine-tune?
When can a fine-tuned small model replace a frontier model, and how do you de-risk the swap?
How do you rigorously evaluate style and format adherence in a fine-tuned model?
Estimate the GPU memory needed to fine-tune an 8B-parameter model: full fine-tuning versus LoRA versus QLoRA.
How do fine-tuning and RAG work together, and what does "fine-tuning for RAG" actually involve?
At scale, what goes wrong with synthetic training data, and how do you counter it?
Design a preference-optimization pipeline for a production assistant. What breaks, and how do you defend against it?
How can fine-tuning degrade a model's safety alignment, and what do you do about it?
Design a continuous fine-tuning program that learns from production feedback, with eval gates and rollback.
How do you fine-tune a model for tool calling and agentic use, and how do you evaluate it?
When do you need continued pretraining instead of SFT, and how do you run it?
How do you fine-tune a model that does not fit on one GPU? Explain FSDP, DeepSpeed ZeRO stages, and when you need each.
This answer is part of Pro.
The full written answer, with the trade-offs and follow-ups an interviewer will probe.
No matches
Try a different filter or search term.
Fine-Tuning & Model Customization in pictures.
A quick recap of Fine-Tuning & Model Customization in 39 short animated pictures, one idea at a time. About 10 min to get the whole topic back in your head before you walk in. Pause any picture, slow it down, or step through it.
Pro The first chapter is free to play. The other 35 pictures come with Pro.
Fine-Tuning & Model Customization cheatsheet
- When to fine-tune01
- Supervised fine-tuning02
- LoRA & QLoRA03
- Training data04
- Distillation05
- Evaluate & debug06
- Preference tuning & RL07
- GPUs, tools & cost08
- Tool calling & RAG09
- Serve & roll back10
- The model11
- + 5 more inside
This picture is part of Pro. The first chapter is free to play; the other 35 pictures come with Pro.
Get Pro · $10/mo Already Pro? Sign in49 of 56 Fine-Tuning & Model Customization answers are in Pro.
Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.
- Full answers + code
- AI explanations, simpler or deeper
- 1,000 AI credits / month
- Cancel anytime
Change topic
Pick a different technology or stack. Your current topic stays put until you choose a new one.
MEAN
MongoDB, Express, Angular, Node.jsMERN
MongoDB, Express, React, Node.jsDjango
Python Full-Stack DevelopmentRuby on Rails
Convention over ConfigurationServerless on AWS
Serverless Architecture on AWSInterviewers also test these - they're common to every stack, whichever one you picked above.
Flutter Mobile
Flutter Cross-Platform Mobile DevelopmentInterviewers also test these - they're common to every stack, whichever one you picked above.
Spring Boot
Enterprise Java Development.NET
Microsoft EcosystemVue
Vue.js, Vite, TypeScript, Tailwind, Node.jsGo Backend
Golang, gRPC, PostgreSQL, Redis, RabbitMQInterviewers also test these - they're common to every stack, whichever one you picked above.
FastAPI
Python, FastAPI, SQLAlchemy, PostgreSQLReact Native
React, TypeScript, Redux, FirebaseiOS Native
Swift, SwiftUI, UIKit, FirebaseAndroid Native
Java, Jetpack Compose, FirebaseDevOps / Platform
Docker, Kubernetes, Terraform, CI/CDInterviewers also test these - they're common to every stack, whichever one you picked above.
AI Engineer
LLMs, RAG, Agents, EvalsAI-Powered Developer
Claude Code, Copilot, Agentic WorkflowsCore SWE Interview Prep
Data structures, algorithms, OS, concurrency, networking, gitInterviewers also test these - they're common to every stack, whichever one you picked above.
Interviewers also test these - they're common to every stack, whichever one you picked above.