Legacy Concept Lab

Instruction Tuning

Unlocks instruction-following—base models don't understand "summarize"

Concept 84 of 100Scaling & AlignmentPhase 7
#84InstructScaling & Alignment
key equation\mathcal{L} = -\sum_t \log p(y_t | \text{instr}, y_{<t})
Phase 7: Alignment & RLHFConcept 84 of 100

Why It Matters for Modern Models

  • Unlocks instruction-following—base models don't understand "summarize"
  • FLAN showed dramatic zero-shot improvements
  • First step before RLHF: instruct → RM → PPO

What Tutorials Skip

What is still poorly explained in textbooks and papers:

  • Base models predict text; instruct models follow commands
  • Diversity matters: more task types = better generalization
  • CoT in the mix teaches reasoning as an instruction

Interactive Visualization

Core Math (Optional Deep Dive)

If you want intuition first, start with the key equation and the visualization. Come back here for the full walkthrough.

Key Equation
L=tlogp(ytinstr,y<t)\mathcal{L} = -\sum_t \log p(y_t | \text{instr}, y_{<t})

Fine-tune on (instruction, response) pairs:

L=tlogp(ytinstruction,y<t)\mathcal{L} = -\sum_{t} \log p(y_t | \text{instruction}, y_{<t})

Multi-task format:

Task: descInput: xOutput: y\text{Task: } \langle\text{desc}\rangle \quad \text{Input: } x \quad \text{Output: } y

Instruction-tuned models generalize to new tasks (zero-shot).

Canonical Papers

Finetuned Language Models Are Zero-Shot Learners

Wei et al.2022ICLR
Read paper →

Connections

Prerequisites

Next Moves

Explore this concept from different angles — like a mathematician would.