All questions
Showing of 55What 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 has already been pretrained on massive general-purpose data. Training then continues on a much smaller, curated dataset to specialize the model's behavior.
Fine-tuning starts from learned weights and updates them with a much smaller, task-focused dataset. It needs far less data and compute than pretraining.
The practical differences are:
- Scale: trillions of tokens versus thousands of curated examples.
- Objective: usually the same next-token prediction loss, but applied to task-specific input-output pairs.
- Learning rate: much lower than pretraining, so behavior changes without overwriting broad capabilities.
- Goal: pretraining builds raw capability; fine-tuning shapes behavior such as style, output format, domain vocabulary, and task reliability.
Almost no application team pretrains from scratch. In practice, customization means prompting, retrieval-augmented generation (RAG), or fine-tuning, and fine-tuning itself is usually parameter-efficient (LoRA-style) rather than updating every weight.
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 -
Think of it as an escalation ladder ordered by cost and iteration speed:
- Prompting (system prompts, few-shot examples, structured output settings): always the first resort.
- RAG: reach for it when the problem is knowledge. Fresh, proprietary, or per-user data; the need for citations; content that changes daily.
- Fine-tuning: reach for it when the problem is behavior. Consistent style or format, domain vocabulary, or reliable tool calling. Also making a small cheap model do what a big model needs a huge prompt to do.
- Continued pretraining or training from scratch: only for deep domain or language adaptation with billions of tokens (say, a genomics or low-resource-language model).
In short: RAG fixes what the model knows; fine-tuning fixes how it behaves.
A reliable approach is insisting on an evaluation set first and exhausting the cheaper rung against that eval. Only move down the ladder when the current rung demonstrably fails. This is because each step down adds cost, latency of iteration, and operational burden.
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 (SFT) is ordinary gradient-descent training applied to a pretrained model on labeled input-output pairs. Mechanically:
- Each example (typically a chat conversation) is rendered into a token sequence using the model's chat template, with special tokens marking roles and turn boundaries.
- A forward pass computes the model's predicted probability for each next token, and cross-entropy loss compares predictions to the actual tokens.
- Backpropagation computes gradients, and an optimizer (almost always AdamW) updates the weights: all of them in full fine-tuning, or a small adapter in parameter-efficient methods.
- Repeat for a few passes over the dataset, using a small learning rate, a short warmup, and a decay schedule.
- A held-out validation split is scored periodically to catch overfitting.
The objective is identical to pretraining; what changes is the data, the scale, and the learning rate.
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 -
Most trainers accept JSON Lines (JSONL): one JSON object per line, with each object holding a complete chat conversation. The exact field names may vary, but the structure is similar:
{"messages": [
{"role": "system", "content": "You are Acme's billing support assistant. Reply in under 120 words."},
{"role": "user", "content": "I was charged twice this month."},
{"role": "assistant", "content": "I'm sorry about that. I can see duplicate charges are usually authorization holds..."}
]}
Practical rules that matter more than the syntax:
- Include the system prompt you will actually use in production, verbatim. The model learns the pairing of that prompt with the desired behavior.
- Assistant messages are the target answers. They must match the style, format, and quality you want. The model can learn their flaws as easily as their strengths.
- Multi-turn conversations are fine and often valuable; trainers mask the loss so only assistant turns are learned.
- For tool-use fine-tuning, include the tool schemas and assistant tool-call messages in the same structure the runtime will produce.
The deeper point: dataset design is the product spec. Every quirk in your examples, from greeting phrasing to how errors are handled, becomes model behavior.
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 works best when you need consistent behavior, not a store of changing facts:
- Style and tone: a support voice, legal register, brand personality, or strict reading level, applied every time without prompt gymnastics.
- Format adherence: always-valid JSON against a schema, specific markdown structures, diff formats, or domain-specific notations that prompting produces.
- Domain vocabulary and conventions: using clinical, legal, or internal jargon correctly and preferring your organization's terminology.
- Task specialization: classification, extraction, routing, summarization in a fixed shape, where a tuned small model often beats a prompted large one.
- Prompt compression: baking a 3,000-token instruction block into the weights, cutting cost and latency on every request.
- Latency and cost: distilling a narrow capability from a frontier model into a 4-9B parameter model.
- Implicit rules: behaviors that are easy to demonstrate with examples but hard to articulate as instructions, like judgment calls in moderation.
- Reliability of tool calling in agentic workflows.
The common thread: you have examples of what good looks like, the task distribution is reasonably stable, and you can measure.
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 -
Knowledge in an LLM is stored diffusely across billions of weights, learned from seeing facts many times in varied contexts during pretraining. A fine-tune that mentions a fact a handful of times rarely creates reliably retrievable knowledge. The model may memorize the exact phrasing without generalizing to paraphrased questions.
Worse, research and practice both show fine-tuning on domain data can increase hallucination. This is because the model learns the confident tone and vocabulary of your domain without actually acquiring the underlying facts. So it answers fluently and wrongly.
The operational problems are just as serious:
- Updates: facts change; retraining for every price change or policy update is absurd.
- Deletion: you cannot reliably remove a fact from weights, which is a compliance problem for user data.
- Provenance: no citations, so users cannot verify answers.
- Access control: everyone who can query the model gets the knowledge; per-user permissions are impossible.
RAG solves all four: the index updates instantly, documents can be deleted, answers can cite sources, and retrieval can respect access control.
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 -
LoRA (Low-Rank Adaptation) fine-tunes a model without touching its original weights.
Why it took over:
- Memory: optimizer states and gradients exist only for the tiny adapter, not the billions of frozen weights. So an 8B model fine-tunes on a single modest GPU instead of a multi-GPU cluster.
- Artifact size: the adapter is tens of megabytes instead of tens of gigabytes, so you can store, version, and ship dozens of variants cheaply.
- Swappability: many adapters can share one loaded base model, enabling per-customer or per-task fine-tunes on shared serving infrastructure.
- No inference penalty: after training you can merge the adapter into the base weights, so the served model is exactly as fast as the original.
- Quality: for most product tasks (style, format, domain behavior), LoRA matches full fine-tuning closely. The low-rank constraint even acts as a regularizer that reduces catastrophic forgetting.
Hosted fine-tuning APIs generally run LoRA-style training under the hood for the same economics.
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?
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 does the parameter-efficient fine-tuning landscape look like?
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?
How do you mitigate catastrophic forgetting in practice?
What signals tell you a fine-tune is overfitting, and how do you respond?
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?
What is a data flywheel in the context of fine-tuning, and what makes one work?
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 choose a base model for fine-tuning?
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?
Architect a continued fine-tuning program with data flywheels, eval gates, and rollback for a production feature.
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 (data mix, learning rate, tokenizer changes)?
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 cheatsheet
- The Customization Decision Tree01
- Supervised Fine-Tuning (SFT) Mechanics02
- Parameter-Efficient Fine-Tuning (PEFT)03
- Full Fine-Tuning vs PEFT Tradeoffs04
- Preference Optimization & Alignment05
- Knowledge Distillation (Teacher-Student)06
- When Fine-Tuning Is Right vs Wrong07
- Dataset Preparation Checklist08
- Overfitting & Catastrophic Forgetting09
- Evaluating Fine-Tunes10
- Hosted vs Open-Source Tooling (2026)11
- Serving Fine-Tuned Models12
- + 3 more inside
- + 9 more inside
48 of 55 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.