{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/self-instruct-aligning-language-model-with","title":"Self-Instruct: Aligning Language Models with Self-Generated Instructions","arxiv_id":"2212.10560","date":"2022-12-20","proceeding":null,"authors":["Yizhong Wang","Yeganeh Kordi","Swaroop Mishra","Alisa Liu","Noah A. Smith","Daniel Khashabi","Hannaneh Hajishirzi"],"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.","url_abs":"https://arxiv.org/abs/2212.10560v2","url_pdf":"https://arxiv.org/pdf/2212.10560v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/tatsu-lab/stanford_alpaca","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/yizhongw/self-instruct","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":null},{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/baai-zlab/coig","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/beomi/koalpaca","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/camel-ai/camel","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/daniel-furman/sft-demos","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/databrickslabs/dolly","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/facico/chinese-vicuna","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/flagopen/flaginstruct","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/fsoft-ai4code/codecapybara","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/imoneoi/openchat","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/jondurbin/airoboros","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/lightaime/camel","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/ofa-sys/expertllama","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/phoebussi/alpaca-cot","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/replicate/cog_stanford_alpaca","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/sahil280114/codealpaca","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/teelinsan/camoscio","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"self-instruct-aligning-language-model-with","repo_url":"https://github.com/xzhang97666/alpacare","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"instruction-following","task_name":"Instruction Following"},{"task_slug":"language-modelling","task_name":"Language Modelling"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2212.10560","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2212.10560"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/camel-ai/camel","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/databrickslabs/dolly","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/lightaime/camel","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/teelinsan/camoscio","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/beomi/koalpaca","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/phoebussi/alpaca-cot","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/daniel-furman/sft-demos","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/baai-zlab/coig","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yizhongw/self-instruct","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tatsu-lab/stanford_alpaca","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/replicate/cog_stanford_alpaca","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/flagopen/flaginstruct","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/imoneoi/openchat","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/fsoft-ai4code/codecapybara","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/sahil280114/codealpaca","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/jondurbin/airoboros","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ofa-sys/expertllama","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/facico/chinese-vicuna","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/xzhang97666/alpacare","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":3,"ran_draft_wrong":4,"unverified":10},"by_repo_kind":{"official":{"samples":1,"ran":1,"repositories":1},"listed":{"samples":15,"ran":5,"repositories":4}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":1,"samples":[{"code_sha256_prefix":"1afe396e11afa85e","entry":"ModelDataConfig","repo":"imoneoi/openchat","repo_kind":"listed","path":"ochat/experimental/generate_dataset_old.py","file_url":"https://github.com/imoneoi/openchat/blob/HEAD/ochat/experimental/generate_dataset_old.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1afe396e11afa85e"}},{"code_sha256_prefix":"bde7f9e76c0f398c","entry":"encode_prompt","repo":"fsoft-ai4code/codecapybara","repo_kind":"listed","path":"data_generation/data_generation.py","file_url":"https://github.com/fsoft-ai4code/codecapybara/blob/HEAD/data_generation/data_generation.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bde7f9e76c0f398c"}},{"code_sha256_prefix":"e0456866b386ce58","entry":"encode_prompt","repo":"yizhongw/self-instruct","repo_kind":"official","path":"self_instruct/bootstrap_instructions.py","file_url":"https://github.com/yizhongw/self-instruct/blob/HEAD/self_instruct/bootstrap_instructions.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e0456866b386ce58"}},{"code_sha256_prefix":"8ca6a5f9f77053c2","entry":"find_word_in_string","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"8ca6a5f9f77053c2"}},{"code_sha256_prefix":"f56f83bd10a33749","entry":"instruct_prompt","repo":"facico/chinese-vicuna","repo_kind":"listed","path":"prompt.py","file_url":"https://github.com/facico/chinese-vicuna/blob/HEAD/prompt.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f56f83bd10a33749"}},{"code_sha256_prefix":"0396d7986c9245e0","entry":"post_process_1st_response","repo":"fsoft-ai4code/codecapybara","repo_kind":"listed","path":"data_generation/data_generation.py","file_url":"https://github.com/fsoft-ai4code/codecapybara/blob/HEAD/data_generation/data_generation.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0396d7986c9245e0"}},{"code_sha256_prefix":"1171a8f3cf445159","entry":"prompt","repo":"facico/chinese-vicuna","repo_kind":"listed","path":"prompt.py","file_url":"https://github.com/facico/chinese-vicuna/blob/HEAD/prompt.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1171a8f3cf445159"}},{"code_sha256_prefix":"4c1e8ffec89c5351","entry":"average_pool","repo":"jondurbin/airoboros","repo_kind":"listed","path":"airoboros/embeddings.py","file_url":"https://github.com/jondurbin/airoboros/blob/HEAD/airoboros/embeddings.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4c1e8ffec89c5351"}},{"code_sha256_prefix":"d2f185ffba2db890","entry":"calculate_embeddings","repo":"jondurbin/airoboros","repo_kind":"listed","path":"airoboros/embeddings.py","file_url":"https://github.com/jondurbin/airoboros/blob/HEAD/airoboros/embeddings.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d2f185ffba2db890"}},{"code_sha256_prefix":"deed53aece8a579f","entry":"calculate_fragment_embeddings","repo":"jondurbin/airoboros","repo_kind":"listed","path":"airoboros/embeddings.py","file_url":"https://github.com/jondurbin/airoboros/blob/HEAD/airoboros/embeddings.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"deed53aece8a579f"}},{"code_sha256_prefix":"a035d0e0d1e7dd67","entry":"generate_dataset","repo":"imoneoi/openchat","repo_kind":"listed","path":"ochat/experimental/generate_dataset_old.py","file_url":"https://github.com/imoneoi/openchat/blob/HEAD/ochat/experimental/generate_dataset_old.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a035d0e0d1e7dd67"}},{"code_sha256_prefix":"750d305ce32e0643","entry":"generate_instruction_following_data","repo":"fsoft-ai4code/codecapybara","repo_kind":"listed","path":"data_generation/data_generation.py","file_url":"https://github.com/fsoft-ai4code/codecapybara/blob/HEAD/data_generation/data_generation.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"750d305ce32e0643"}},{"code_sha256_prefix":"3df9ac239aea5147","entry":"generate_prompt","repo":"jondurbin/airoboros","repo_kind":"listed","path":"airoboros/instructors/contextual.py","file_url":"https://github.com/jondurbin/airoboros/blob/HEAD/airoboros/instructors/contextual.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3df9ac239aea5147"}},{"code_sha256_prefix":"a4fc9157b8751af4","entry":"generate_split","repo":"imoneoi/openchat","repo_kind":"listed","path":"ochat/experimental/generate_dataset_old.py","file_url":"https://github.com/imoneoi/openchat/blob/HEAD/ochat/experimental/generate_dataset_old.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a4fc9157b8751af4"}},{"code_sha256_prefix":"da03aab82afbcc6b","entry":"num_tokens_from_messages","repo":"fsoft-ai4code/codecapybara","repo_kind":"listed","path":"data_generation/data_generation.py","file_url":"https://github.com/fsoft-ai4code/codecapybara/blob/HEAD/data_generation/data_generation.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"da03aab82afbcc6b"}},{"code_sha256_prefix":"0fd35c82026b1481","entry":"one_call","repo":"fsoft-ai4code/codecapybara","repo_kind":"listed","path":"data_generation/data_generation.py","file_url":"https://github.com/fsoft-ai4code/codecapybara/blob/HEAD/data_generation/data_generation.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0fd35c82026b1481"}},{"code_sha256_prefix":"f53b42abf295354b","entry":"printf","repo":"facico/chinese-vicuna","repo_kind":"listed","path":"prompt.py","file_url":"https://github.com/facico/chinese-vicuna/blob/HEAD/prompt.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f53b42abf295354b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}