# Self-Instruct: Aligning Language Models with Self-Generated Instructions

Yizhong Wang, Yeganeh Kordi, Swaroop Mishra, Alisa Liu, Noah A. Smith, Daniel Khashabi and 1 more · arXiv · 2022-12-20

- **Problem** Human-written instruction data is costly to collect and skews toward popular NLP benchmarks, which limits how far instruction tuning generalizes.
- **Method** Starting from 175 seed tasks, GPT3 generates instructions and instances in a bootstrapping loop, filters them with similarity and validity heuristics, and is then finetuned on the result.
- **Results** GPT3SELF-INST reached a ROUGE-L of 39.9 on unseen SUPERNI tasks against 6.8 for vanilla GPT3, a +33.1% gain in the paper's reporting, and was 5% behind InstructGPT001 on the user-oriented human evaluation when rating B counts as valid.

![Figure 2: A high-level overview ofSELF-INSTRUCT. The process starts with a small seed set of tasks as the task pool. Random tasks are sampled from the task poo…](https://refivu.com/papers/b7e9c5f5-b8d4-4382-9c03-d006766b8f88/figures/figure-6a15f75c002582b7a76ce77367c5b937.png?thumb=512)

**Figure 2** : A high-level overview ofSELF-INSTRUCT. The process starts with a small seed set of tasks as the task pool. Random tasks are sampled from the task pool, and used to prompt an off-the-shelf LM to generate both new instructions and corresponding instances, followed by filtering low-quality or similar generations, and then added backtotheinitialrepositoryoftasks. Theresultingdatacanbeusedfortheinstructiontuningofthelanguagemodel itself later to follow instructions better. Tasks shown in the figure are generated by GPT3.

[Original paper](https://arxiv.org/abs/2212.10560v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Yizhong Wang, Yeganeh Kordi, Swaroop Mishra, Alisa Liu, Noah A. Smith, Daniel Khashabi, Hannaneh Hajishirzi · Self-Instruct: Aligning Language Models with Self-Generated Instructions · Original paper figure · Extracted the figure area from page 2 of the original PDF.

## Why human-written instructions run short

Recent progress in instruction-following models depends on two inputs: a large pretrained language model and human-written instruction data such as PROMPTSOURCE and SUPER-NATURALINSTRUCTIONS.

Writing that data by hand is expensive. Because human-written tasks lean toward popular NLP benchmarks, the variety of tasks and of ways to phrase them stays narrow.

The study asks whether a model can produce its own instructional signal, starting from a small set of human-written tasks. The proposed framework, SELF-INSTRUCT, targets this, and the authors describe it as nearly free of annotation.

## How one bootstrapping round works

Each round starts from a task pool of 175 seed tasks, each with one instruction and one instance, written by the authors and their labmates. Generated valid tasks are added back to the pool, so later rounds draw on a growing set. At each step eight instructions are sampled as in-context examples: six from the human-written set and two from earlier model generations, which keeps some diversity in the prompt.

Here classification means a task whose output label space is small and limited.

The two task types use different generation orders. Input-first has the model write the input fields and then the output, which suits non-classification tasks. Input-first alone tends to produce inputs biased toward one label; for grammar error detection, for example, it mostly yields grammatical sentences. For classification tasks, output-first generates the class labels first and then conditions each input on a label.

Filtering keeps the pool diverse. A new instruction is added only when its ROUGE-L similarity to existing instructions stays below 0.7. Instructions containing keywords such as image, picture or graph are dropped because language models usually cannot process them. Among instances, exact duplicates and pairs that share an input but have different outputs are removed, and generations that fail length or repetition heuristics are discarded.

The filtered data then finetunes the original model. Each instruction and input are concatenated into a prompt, and the model is trained to produce the output in a standard supervised way. Several templates vary prefixes, output markers and line breaks, so the model handles different formats.

## What the generated data contains

Running the pipeline on vanilla GPT3 yields 52,445 instructions and 82,439 instances after filtering. Of the instructions, 11,584 are classification and 40,861 are not, and 35,878 instances have an empty input. Average lengths are 15.9 words for instructions, 12.7 words for non-empty inputs and 18.9 words for outputs.

Parsing the instructions with the Berkeley Neural Parser finds a verb-noun structure in 26,559 of the 52,445 instructions. The top 20 root verbs and their top four direct noun objects cover 14% of the whole set, so the intents are varied.

Each generated instruction was also compared with its most similar seed instruction by ROUGE-L. The distribution shows many instructions with little overlap with the seeds, so many are new tasks rather than rephrasings.

Quality was checked on 200 randomly sampled instructions, with one randomly selected instance each. An expert annotator, one of the authors, judged the instruction, the input and the output. 92% of instructions described a valid task and 79% had an appropriate input, but only 58% had a correct and acceptable output. 54% had all fields valid.

Instructions are therefore more reliable than their instances, and the outputs carry the most noise.

## Setting up the finetuning and baselines

GPT3SELF-INST is the davinci GPT3 model finetuned on its own generated data through the OpenAI finetuning API.

Two vanilla baselines, T5-LM and GPT3, receive only pretraining. T0 and Tk-INSTRUCT are public instruction-tuned models built from T5 checkpoints, and the 11B versions are used.

InstructGPT is included as a reference. On SUPERNI the comparison uses the text-davinci-001 engine, since newer engines were trained on later user data and may have seen the SUPERNI test set. The human evaluation also includes the 002 and 003 engines.

For a comparison with other public data, GPT3 is also finetuned on PROMPTSOURCE data (T0 training) and on SUPERNI training data. Each uses 50K sampled instances that cover all their instructions, a size close to the generated set. Reducing the instances per training task does not degrade generalization to unseen tasks, according to prior findings and the authors' early experiments.

## Zero-shot results on SUPERNI

GPT3 variants decode deterministically, with temperature 0 and no nucleus sampling, and no stop sequences.

Vanilla GPT3 reaches a ROUGE-L of 6.8, while GPT3SELF-INST reaches 39.9, which the paper reports as a +33.1% gain. Vanilla GPT3 usually produces irrelevant and repetitive text and fails to stop generating at a sensible point.

Among models not trained on SUPERNI, GPT3SELF-INST scores above T0 at 33.1 and above GPT3 + T0 Training at 37.9, and sits just below InstructGPT001 at 40.8. The T0 training data takes substantial human labeling effort, while GPT3SELF-INST nearly matches InstructGPT001, which was trained on private user data and human-annotated labels.

Models trained on SUPERNI training data score higher on SUPERNI: Tk-INSTRUCT reaches 46.0 and GPT3 + SUPERNI Training reaches 49.5. Adding SELF-INSTRUCT data on top of SUPERNI training lifts the score to 51.6. The authors attribute the advantage of SUPERNI-trained models to similar instruction style and formatting.

## Ratings on novel user-oriented instructions

The user-oriented set has 252 instructions with one instance each, drawn from domains such as email writing, social media, productivity tools, entertainment and programming. Output formats vary, including bullet points, tables, code and equations.

The authors who wrote the instructions rated each response on four levels: A for valid and satisfying, B for acceptable with minor imperfections, C for relevant with significant content errors, and D for irrelevant or invalid.

Vanilla GPT3 is largely unable to respond to instructions, and all instruction-tuned models do better. GPT3SELF-INST outperforms the GPT3 variants trained on T0 or SUPERNI training data by a large margin. Inter-rater agreement on the four-class scale is 0.57.

Counting RATING-B responses as valid, GPT3SELF-INST is only 5% behind InstructGPT001 in absolute terms. InstructGPT002 and InstructGPT003 also perform strongly in this evaluation. The authors conjecture that better generated data, obtained from human annotators or a reward model that selects better generations, would help close the gap.

## Effect of data size and output quality

The authors subsample generated instructions at sizes from 100 to 51200, finetune GPT3 on each subset and run the same human evaluation on the 252 user-oriented instructions. The share of responses rated A rises from 31.0% at the smallest size to 54.4% at the largest.

The gain levels off after about 16K instructions on the user-oriented set. On SUPERNI the gain levels off much earlier, at around hundreds of instructions. The authors link this to the generated data being distinct from typical SUPERNI tasks, and suggest that combining different instruction data may serve different task types.

To test output quality, InstructGPT003 regenerates the output field of every instance, and GPT3 is finetuned on this version. The authors describe this as distilling InstructGPT003 with their data. The model trained on the improved outputs outperforms the counterpart trained on the original data by 10%.

## How the work relates to prior approaches

Earlier instruction-following work tunes models on annotated instructional data, and performance tracks the size and diversity of that data on unseen tasks.

Unnatural Instructions, developed in parallel by Honovich et al. (2022a), also generates instruction data with GPT3. It uses SUPERNI tasks as seeds and InstructGPT002 for generation, whereas SELF-INSTRUCT relies only on the vanilla LM.

SELF-INSTRUCT can be viewed as knowledge distillation, but the source and the target are the same model, and the distilled content is an instruction task with examples.

## Limitations

Gains may be skewed toward tasks and instructions that appear often in pretraining data. The authors expect the approach to be brittle on uncommon and creative instructions.

Because the method draws on biases extracted from language models, it may work best for larger models, which could raise access barriers for groups without large compute. Instruction tuning with human annotation also gains more on larger models (Wei et al., 2022).

The authors also note possible amplification of social biases, and a difficulty in producing balanced labels that reflects model priors.

The quality review covers 200 instructions with one instance each, judged by one author. The user-oriented human evaluation covers 252 instructions with one instance each, judged by their authors. The SUPERNI comparison in Table 3 uses ROUGE-L only.

## Paper info

- **Authors**: Yizhong Wang, Yeganeh Kordi, Swaroop Mishra, Alisa Liu, Noah A. Smith, Daniel Khashabi, Hannaneh Hajishirzi
- **Venue**: arXiv · Preprint
- **First published**: 2022-12-20
- **Added**: 2026-10-20
- **Updated**: 2023-5-25
- **Version**: v2
- **arXiv**: 2212.10560
- **Category**: cs.CL · cs.AI
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2212.10560v2) · [PDF ↗](https://arxiv.org/pdf/2212.10560v2)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

Large "instruction-tuned" language models (i.e., finetuned to respond to instructions) have demonstrated a remarkable ability to generalize zero-shot to new tasks. Nevertheless, they depend heavily on human-written instruction data that is often limited in quantity, diversity, and creativity, therefore hindering the generality of the tuned model. We introduce Self-Instruct, a framework for improving the instruction-following capabilities of pretrained language models by bootstrapping off their own generations. Our pipeline generates instructions, input, and output samples from a language model, then filters invalid or similar ones before using them to finetune the original model. Applying our method to the vanilla GPT3, we demonstrate a 33% absolute improvement over the original model on Super-NaturalInstructions, on par with the performance of InstructGPT-001, which was trained with private user data and human annotations. For further evaluation, we curate a set of expert-written instructions for novel tasks, and show through human evaluation that tuning GPT3 with Self-Instruct outperforms using existing public instruction datasets by a large margin, leaving only a 5% absolute gap behind InstructGPT-001. Self-Instruct provides an almost annotation-free method for aligning pre-trained language models with instructions, and we release our large synthetic dataset to facilitate future studies on instruction tuning. Our code and data are available at https://github.com/yizhongw/self-instruct.

## Quote from the paper

Yizhong Wang, Yeganeh Kordi, Swaroop Mishra, Alisa Liu, Noah A. Smith, Daniel Khashabi, Hannaneh Hajishirzi (2022). Self-Instruct: Aligning Language Models with Self-Generated Instructions. arXiv:2212.10560v2. https://arxiv.org/abs/2212.10560v2

**BibTeX**

```
@misc{wang2022self,
  title = {{Self-Instruct: Aligning Language Models with Self-Generated Instructions}},
  author = {Yizhong Wang and Yeganeh Kordi and Swaroop Mishra and Alisa Liu and Noah A. Smith and Daniel Khashabi and Hannaneh Hajishirzi},
  year = {2022},
  eprint = {2212.10560},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.10560v2}
}
```

## Related papers

- [Code Llama: Open Foundation Models for Code](https://refivu.com/en/papers/d1b3e035-fd64-4a9c-a7a6-cfb45de54052-code-llama-open-foundation-models-for-code.md)
- [A Multitask, Multilingual, Multimodal Evaluation of ChatGPT on Reasoning, Hallucination, and Interactivity](https://refivu.com/en/papers/a220e44a-f4ac-4a9b-9268-eefcbafeda8e-a-multitask-multilingual-multimodal-evaluation-of-chatgpt-on.md)
- [CLEAR: Legible and Steerable Recommendation via Grounded Natural-Language Interests](https://refivu.com/en/papers/2fa163bb-6806-45fb-bf55-7e557d1f4855-clear-legible-and-steerable-recommendation-via-grounded.md)
- [DriveMLM: Aligning Multi-Modal Large Language Models with Behavioral Planning States for Autonomous Driving](https://refivu.com/en/papers/a8c14912-7460-43dd-9905-2047682d37fa-drivemlm-aligning-multi-modal-large-language-models-with.md)

## Other paper commentary

- [DeepSeek-V3 Technical Report](https://refivu.com/en/papers/761895a4-08f3-446f-98de-60152a184c97-deepseek-v3-technical-report.md)
- [The Llama 3 Herd of Models](https://refivu.com/en/papers/27985e84-42ca-486e-8e0e-2fa739789ab4-the-llama-3-herd-of-models.md)
- [Gemma: Open Models Based on Gemini Research and Technology](https://refivu.com/en/papers/e2b5810b-65da-4a36-9bd2-a17a9a6f8512-gemma-open-models-based-on-gemini-research-and.md)
- [Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phone](https://refivu.com/en/papers/1ae6b2e4-9099-4676-8fc3-523fa63b6919-phi-3-technical-report-a-highly-capable-language.md)
- [BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models](https://refivu.com/en/papers/3bd907be-414a-4e3b-b195-d25379e2be77-blip-2-bootstrapping-language-image-pre-training-with.md)
- [Visual Instruction Tuning](https://refivu.com/en/papers/760eaf17-9dbc-40d5-afee-d36c375c59e3-visual-instruction-tuning.md)
- [Rethinking Attention with Performers](https://refivu.com/en/papers/be31745a-9080-4105-b177-3b88d23e4f59-rethinking-attention-with-performers.md)
- [Linformer: Self-Attention with Linear Complexity](https://refivu.com/en/papers/470ce67a-0f79-4a06-ae89-f26384095187-linformer-self-attention-with-linear-complexity.md)
- [DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning](https://refivu.com/en/papers/2227da56-269c-4116-84dc-2bc76bf3e6c7-deepseek-r1-incentivizing-reasoning-capability-in-llms-via.md)
- [RT-2: Vision-Language-Action Models Transfer Web Knowledge to Robotic Control](https://refivu.com/en/papers/01f24caf-5337-46f9-abb9-a961b79018a1-rt-2-vision-language-action-models-transfer-web.md)
- [Reformer: The Efficient Transformer](https://refivu.com/en/papers/0dd490a3-709f-4bac-ae3f-de0bc9e197db-reformer-the-efficient-transformer.md)

## Terms in this paper

- [knowledge distillation](https://refivu.com/en/terms/b8544f4ba83e-knowledge-distillation)
- [Human evaluation](https://refivu.com/en/terms/b64307b0a4d2-human-evaluation)
- [ROUGE-L](https://refivu.com/en/terms/b00e147f8ed4-rouge-l)
- [instruction tuning](https://refivu.com/en/terms/0a2a2d11f238-instruction-tuning)
- [self-instruct](https://refivu.com/en/terms/599304dadef6-self-instruct)
- [PROMPTSOURCE](https://refivu.com/en/terms/4f103449e500-promptsource)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/b7e9c5f5-b8d4-4382-9c03-d006766b8f88-self-instruct-aligning-language-models-with-self-generated)
