ElemedexA pocket encyclopedia of AI architectures

Glossary (TM) › Training and tuning

TM127

Instruction tuning

Also: supervised fine-tuning, SFT

In Spanish: Ajuste por instrucciones

Fine-tuning on instruction–response pairs so that a base model learns to carry out requests instead of merely continuing the text.

A base model, fresh out of pretraining, does not "obey": it continues. Asked to write an article, it may produce a list of other assignments; asked a question, it may append more questions, because that is what tends to follow a question in a questionnaire (Alammar & Grootendorst, 2024, pp. 356–357). Instruction tuning fixes this with fine-tuning on examples of the form instruction → desired response. Technically it is still next-token prediction, but only on the response and conditioned on the instruction, with a chat template whose special tokens mark who is speaking (<|user|>, <|assistant|>) (Alammar & Grootendorst, 2024, pp. 356, 367).

The name comes from FLAN: Wei, Bosma, et al. (2022) tuned a 137-billion-parameter model on more than 60 datasets rewritten as natural-language instructions, and that model outperformed zero-shot GPT-3 (175 billion) on 20 of the 25 datasets evaluated. In InstructGPT, the equivalent step was the first stage of the RLHF pipeline: hired labelers wrote demonstrations of the desired behavior for about 13,000 prompts, and GPT-3 was fine-tuned on them (Ouyang et al., 2022, secs. 3.1–3.2).

From the standpoint of pragmatics, what is learned is a change of discourse genre: treating an imperative as a request addressed to oneself rather than as the beginning of a text to be continued. But the mechanism does not change: as Shanahan (2024) insists, the system is still answering the question of which words are likely to follow the given sequence. Is learning the format of question–answer exchanges enough to have something like understanding a request?

Sources

  • Alammar, J., & Grootendorst, M. (2024). Hands-on large language models: Language understanding and generation. O’Reilly Media. §
  • Ouyang, L., Wu, J., Jiang, X., Almeida, D., Wainwright, C., Mishkin, P., Zhang, C., Agarwal, S., Slama, K., Ray, A., Schulman, J., Hilton, J., Kelton, F., Miller, L., Simens, M., Askell, A., Welinder, P., Christiano, P. F., Leike, J., & Lowe, R. (2022). Training language models to follow instructions with human feedback. In Advances in Neural Information Processing Systems (Vol. 35, pp. 27730–27744). Curran Associates. https://doi.org/10.52202/068431-2011 §
  • Shanahan, M. (2024). Talking about large language models. Communications of the ACM, 67(2), 68–79. https://doi.org/10.1145/3624724 §
  • Wei, J., Bosma, M., Zhao, V. Y., Guu, K., Yu, A. W., Lester, B., Du, N., Dai, A. M., & Le, Q. V. (2022). Finetuned language models are zero-shot learners. In 10th International Conference on Learning Representations (ICLR 2022). https://openreview.net/forum?id=gEZrGCozdqR §