AI ENGVisual Encyclopedia

MODULE 1: SFT FOUNDATIONS · SCENE 01

Supervised Fine-Tuning Fundamentals

From base model to instruction-follower: the SFT pipeline that reshapes next-token distribution into assistant behavior.

SCALE RATIO · 15,000,000 : 1
NEXT-TOKEN DISTRIBUTION OVER RESPONSESalt--3alt--2alt--1web-textalt-1alt-2alt-3BASE MODEL MODE

A base model spreads mass over any plausible continuation. RUN to watch SFT reshape it.

TECHNICAL BREAKDOWNModule 1: SFT Foundations

From base model to assistant — the SFT pipeline

A base model only completes text; it has never been asked to answer. Supervised Fine-Tuning reshapes the same weights with tens of thousands of prompt→ideal-response pairs, so the mode of the distribution lands on helpful assistant behavior instead of plausible web text.

The Blunt Instrument Problem

A base model trained on petabytes of web text will answer a question by continuing it — often with more questions. Distribution alignment moves probability mass from 'any plausible continuation' to 'the response a good assistant would give'.

Scale Disparity

Pre-training consumes petabytes (trillions of tokens); post-training consumes megabytes-to-gigabytes (millions of tokens). A ratio of 10,000:1 or more means a tiny, high-signal dataset steers an enormous, low-signal substrate.

What SFT Teaches

Format (markdown, lists, code fences), turn-taking (stop when the answer ends), instruction following, and a shallow layer of domain competence — not new world knowledge.

MATHEMATICAL FORMULATION · DATA SCALE DISPARITY
ratio = (pre_tokens_B × 10⁹) / (post_tokens_M × 10⁶)

For 15 trillion pre-training tokens and 1 million post-training tokens the ratio is 15,000×. That asymmetry is why a few days of SFT can radically change behavior without disturbing learned knowledge.

REAL-WORLD PRODUCTION ENGINEERING
  • Llama-family instruct models use on the order of 10⁵–10⁶ curated SFT examples; quality dominates quantity at this stage.
  • Teams commonly mix public instruction sets (FLAN, ShareGPT-style) with thousands of in-house demonstrations for tone and policy.