instruction tuning
**Instruction Tuning** is a **supervised fine-tuning technique that trains LLMs to follow natural language instructions** — transforming raw language models into capable assistants that can generalize to unseen tasks described in instruction format.
**The Problem Before Instruction Tuning**
- Pretrained LLMs (GPT-3, etc.) complete text — they don't follow instructions.
- Prompt: "Write a poem about semiconductors." → Model continues the prompt instead of writing a poem.
- Solution: Fine-tune on (instruction, response) pairs to teach instruction-following behavior.
**Key Instruction Tuning Works**
- **FLAN (2021)**: Fine-tuned T5/PaLM on 62+ NLP tasks framed as instructions. First showed zero-shot task generalization.
- **InstructGPT (2022)**: RLHF-based, human-written demonstrations. Basis for ChatGPT.
- **FLAN-T5**: Massively scaled instruction tuning — 1,836 tasks across diverse task types.
- **Alpaca**: Fine-tuned LLaMA-7B on 52K GPT-3.5-generated instructions. Showed quality instruction data matters more than quantity.
- **WizardLM**: "Evol-Instruct" — automatically creates progressively harder instructions.
**Data Quality vs. Quantity**
- LIMA (2023): 1,000 carefully selected examples match models trained on 52K examples.
- Quality filters (diversity, difficulty, format) matter far more than raw count.
- GPT-4-generated instruction data (Orca, WizardLM) produces stronger models than human-generated data at scale.
**Instruction Format**
- Most models use a chat template: `[INST] {instruction} [/INST] {response}`
- Format must be consistent between training and inference.
- System prompts define assistant behavior/persona.
**Tasks Taught**
- Summarization, translation, QA, classification, coding, math, creative writing.
- Task diversity is key — models that see only coding instructions won't generalize to writing.
Instruction tuning is **the essential bridge between raw language modeling and practical AI assistants** — without it, LLMs are pattern-completers rather than task-solvers.