VFlash: Fast, Accurate Visual Planning via Flash Primitive Decoding
u_Unrolled
D6: Post-training & Alignment · Supervised Fine-Tuning — Teaching a Base Model to Answer
Phase 4/Domain 6/Lesson 1

Supervised Fine-Tuning — Teaching a Base Model to Answer

25 min read·Advanced· Unrolled Pro
Supervised Fine-Tuning — Teaching a Base Model to Answer

You already know: next-token cross-entropy, ignore_index, and the training loop (Build an LLM from scratch); a base model continues text instead of answering (D5 → D6 bridge); data deduplication and decontamination (LLM pretraining §1).

Why this matters for Atlas. Supervised fine-tuning (SFT) is the step that turns a pretrained base model into something that answers questions. It is cheap compared with pretraining (thousands of times fewer tokens), and almost every model you will ever deploy has been through it — usually more than once, because domain fine-tuning (Atlas on course material) is SFT too. Getting it wrong is easy and quiet: the wrong template, the wrong loss mask or a poor dataset gives a model that looks fine on a demo and fails on real users.


1. What SFT is — and what it is not

The question. If the base model already has the knowledge, what does SFT actually teach?

Start from nothing. SFT is ordinary next-token training on a different kind of data: demonstrations of the behaviour you want. Each example is a conversation — usually a user request and an ideal assistant response — and the model is trained to produce the response.

That's the preview. The full lesson, with its code and exercises, is part of Unrolled Pro.
Staff AI & Pro Tier Lesson

Unlock "Supervised Fine-Tuning — Teaching a Base Model to Answer"

The foundations are free forever. Unrolled Pro unlocks the complete lesson, production architectures, and 55 battle-tested ML system design case studies.

Everything included with Pro:
All 234+ Deep-Dive Lessons across transformer internals, inference, RAG & agents
55 Staff-Level ML & System Design Case Studies with mathematical capacity estimates
AI Engineer Sheet & Exercises with worked solutions, self-checks, and code
100 Landmark Research Papers guided walkthroughs & progress tracking
14-Day Money-Back Guarantee — 100% full refund if you aren't satisfied
View Plans & Unlock All Lessons

From ₹167/mo (~$2/mo) · Cancel anytime · Instant activation

100% Risk-Free: 14-day no-questions-asked money-back guarantee
Build Atlas · Part 5 of 9: Make it helpfulUse this lesson in the project: Teach TinyGPT to answer questions with a chat template and a loss mask, then compare full fine-tuning with LoRA on unseen questions.