LearnThatStack Ace your next interview
AI Engineering
Fine-Tuning & Model Customization.
Change topic Change
Practice · Questions

All questions

Showing of 55
Beginner 12
01

What is fine-tuning, and how is it different from pretraining a model from scratch?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

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.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

02

Walk me through the customization spectrum. When would you reach for prompting, RAG, fine-tuning, or pretraining?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

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.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

03

What actually happens during supervised fine-tuning, mechanically?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Supervised fine-tuning (SFT) is ordinary gradient-descent training applied to a pretrained model on labeled input-output pairs. Mechanically:

  1. 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.
  2. A forward pass computes the model's predicted probability for each next token, and cross-entropy loss compares predictions to the actual tokens.
  3. 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.
  4. Repeat for a few passes over the dataset, using a small learning rate, a short warmup, and a decay schedule.
  5. 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.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

04

What does a fine-tuning dataset look like in practice?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

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.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

05

What kinds of problems is fine-tuning actually good at solving?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

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.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

06

Why is fine-tuning usually the wrong tool for teaching a model new facts?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

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.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

07

In simple terms, what is LoRA and why did it become the default fine-tuning method?

Beginner ·

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:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

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.

Rewriting in plainer words…

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 ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

08

Why do you need a validation split when fine-tuning, and how do you use it?

Part of Pro
09

What is catastrophic forgetting in the context of fine-tuning?

Part of Pro
10

What do hosted fine-tuning APIs actually provide, and what are the main options in 2026?

Part of Pro
11

What is model distillation, and why has it become so central to model customization?

Part of Pro
12

How much data do you need to fine-tune a model?

Part of Pro
Intermediate 20
13

How does LoRA actually work under the hood?

Part of Pro
14

What do rank and alpha control in LoRA, and how do you pick them?

Part of Pro
15

What is QLoRA, and when do you choose it over standard LoRA?

Part of Pro
16

Compare full fine-tuning with parameter-efficient fine-tuning. When is full fine-tuning worth it?

Part of Pro
17

Besides LoRA, what does the parameter-efficient fine-tuning landscape look like?

Part of Pro
18

Which modules should LoRA target, and does it matter?

Part of Pro
19

What are the key hyperparameters in an SFT run, and what are sensible starting points?

Part of Pro
20

What is loss masking in SFT, and why does it matter?

Part of Pro
21

Why do chat templates and formatting consistency matter so much in fine-tuning?

Part of Pro
22

How do you deduplicate a fine-tuning dataset, and why does it matter so much?

Part of Pro
23

How would you generate synthetic training data, and what are the risks?

Part of Pro
24

Explain RLHF at a concept level. Why was it so important, and what are its costs?

Part of Pro
25

What is DPO, and how does it simplify the RLHF pipeline?

Part of Pro
26

How do you build a good preference dataset for DPO or similar methods?

Part of Pro
27

How do you evaluate whether a fine-tuned model is actually better?

Part of Pro
28

Your LoRA fine-tune is ready for production. Do you merge the adapter or serve it separately?

Part of Pro
29

Compare the main open-source fine-tuning stacks: Hugging Face TRL, Axolotl, and Unsloth.

Part of Pro
30

How do you estimate the cost of a fine-tuning project?

Part of Pro
31

Your fine-tuned model is worse than the base model: it rambles, never stops, or ignores instructions. How do you debug it?

Part of Pro
32

How would you fine-tune an embedding or reranker model for retrieval, and how does it differ from fine-tuning an LLM?

Part of Pro
Expert 23
33

How do you mitigate catastrophic forgetting in practice?

Part of Pro
34

What signals tell you a fine-tune is overfitting, and how do you respond?

Part of Pro
35

Explain the mechanics of distillation: hard versus soft labels, and off-policy versus on-policy.

Part of Pro
36

What are DPO's known failure modes, and what do successors like IPO, KTO, ORPO, and SimPO change?

Part of Pro
37

Where do GRPO and RL with verifiable rewards fit relative to SFT and DPO?

Part of Pro
38

Walk me through QLoRA's key technical innovations.

Part of Pro
39

How does serving hundreds of fine-tuned variants on shared infrastructure actually work?

Part of Pro
40

How do you handle versioning and rollback for fine-tuned models?

Part of Pro
41

What is a data flywheel in the context of fine-tuning, and what makes one work?

Part of Pro
42

How do you detect and prevent contamination between training data and evaluations?

Part of Pro
43

How do you choose the data mixture for a domain fine-tune?

Part of Pro
44

When can a fine-tuned small model replace a frontier model, and how do you de-risk the swap?

Part of Pro
45

How do you choose a base model for fine-tuning?

Part of Pro
46

How do you rigorously evaluate style and format adherence in a fine-tuned model?

Part of Pro
47

Estimate the GPU memory needed to fine-tune an 8B-parameter model: full fine-tuning versus LoRA versus QLoRA.

Part of Pro
48

How do fine-tuning and RAG work together, and what does "fine-tuning for RAG" actually involve?

Part of Pro
49

At scale, what goes wrong with synthetic training data, and how do you counter it?

Part of Pro
50

Design a preference-optimization pipeline for a production assistant. What breaks, and how do you defend against it?

Part of Pro
51

How can fine-tuning degrade a model's safety alignment, and what do you do about it?

Part of Pro
52

Architect a continued fine-tuning program with data flywheels, eval gates, and rollback for a production feature.

Part of Pro
53

How do you fine-tune a model for tool calling and agentic use, and how do you evaluate it?

Part of Pro
54

When do you need continued pretraining instead of SFT, and how do you run it (data mix, learning rate, tokenizer changes)?

Part of Pro
55

How do you fine-tune a model that does not fit on one GPU? Explain FSDP, DeepSpeed ZeRO stages, and when you need each.

Part of Pro

No matches

Try a different filter or search term.

Know someone prepping for Fine-Tuning & Model Customization? Send them this set.
Pro · $10/mo

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.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

Serverless on AWS

Serverless Architecture on AWS

Flutter Mobile

Flutter Cross-Platform Mobile Development

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

AI Engineer

LLMs, RAG, Agents, Evals

AI-Powered Developer

Claude Code, Copilot, Agentic Workflows

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git