# Instruction Fine-Tuning (IFT)

> Fine-tune on (instruction, response) pairs to transform a next-token-prediction base model into one that follows natural language directives.

- **Category**: Language Models
- **Subcategory**: Fine-Tuning
- **Canonical URL**: https://designpattern.fyi/patterns/instruction-fine-tuning/

---

## Description
**Intent**: A base LLM predicts next tokens — it doesn't answer questions or follow instructions. Instruction fine-tuning teaches it to interpret directives and produce task-appropriate responses.

**Context**: GPT-3 base, Llama-2 base — powerful completion models that don't inherently respond to "summarize this" or "write a function that does X." The underlying capability exists; the alignment to the instruction-following format does not.

**Solution**: Curate or generate a dataset of (instruction, optional-input, output) triplets covering diverse task types — summarization, QA, coding, reasoning, creative writing, formatting. Fine-tune the base model on these examples using standard supervised learning. Data quality matters far more than quantity — 10K high-quality curated examples consistently outperform 1M low-quality scraped ones.



## Use Cases
Converting a base pre-trained model into an assistant-style model. Adding instruction-following capability to a domain-specialized base model before RLHF or DPO alignment.





## Trade-offs


### Advantages

- Transforms a completion model into an instruction-following model at relatively low data and compute cost

- Serves as the required SFT foundation for further RLHF or DPO alignment

- Data quality over quantity — curated small datasets beat massive noisy ones




### Considerations & Drawbacks

- Low-quality instruction data produces compliant but incorrect or unsafe responses

- Model may learn to follow the surface format of examples without generalizing the underlying intent

- Does not guarantee alignment with human preferences — RLHF or DPO typically follows







