arXiv(opens in a new tab)Computer ScienceApr 2023Cited by 26 papers on PaperVantageClassic Paper

Manuscript Offprint

arXiv:2304.12244

WizardLM: Empowering Large Pre-Trained Language Models to Follow Complex Instructions

Can Xu, Qingfeng Sun, Kai Zheng, Xiubo Geng, Pu Zhao, Jiazhan Feng, Chongyang Tao, Daxin Jiang

Abstract

Training large language models (LLMs) with open-domain instruction following data brings colossal success. However, manually creating such instruction data is very time-consuming and labor-intensive. Moreover, humans may struggle to produce high-complexity instructions. In this paper, we show an avenue for creating large amounts of instruction data with varying levels of complexity using LLM instead of humans. Starting with an initial set of instructions, we use our proposed Evol-Instruct to rewrite them step by step into more complex instructions. Then, we mix all generated instruction data to fine-tune LLaMA. We call the resulting model WizardLM. Both automatic and human evaluations consistently indicate that WizardLM outperforms baselines such as Alpaca (trained from Self-Instruct) and Vicuna (trained from human-created instructions). The experimental results demonstrate that the quality of instruction-following dataset crafted by Evol-Instruct can significantly improve the performance of LLMs.

1 Introduction

Large-scale language models (LLMs) have become the go-to approach for numerous natural language processing tasks (Brown et al., 2020; Ouyang et al., 2022; Touvron et al., 2023). LLMs are trained on large volumes of text data to predict the subsequent tokens, enabling them to generate coherent and fluent text in response to various inputs. However, these models often struggle to follow instructions or goals specified by users, which limits their usefulness and applicability in real-world scenarios.

The NLP community has recently witnessed many endeavors to train LLMs to follow instructions better and be more helpful (Zhao et al., 2023; He et al., 2023; Guo et al., 2023; Li et al., 2023b). Initial attempts (Aribandi et al., 2022; Wei et al., 2021; Xu et al., 2022; Sanh et al., 2022; Chung et al., 2022) to train instruction-following language models are based on a collection of various NLP tasks, with a small amount of hand-written instructions. These closed-domain instructions suffer from two main drawbacks: first, all the samples in an NLP dataset share only a few common instructions, severely limiting their diversity; second, the instructions usually only ask for one task. But in real life, human instructions often have multiple and varied task demands. By using open-domain instruction data generated by real human users, OpenAI’s LLMs (e.g., InstructGPT (Ouyang et al., 2022) and ChatGPT ) have achieved great success. These open-domain instructions can fully unleash the unlimited potential of LLMs (Luo et al., 2023; Ma et al., 2023; Hu et al., 2023; Zhu et al., 2023) and enable them to perform more complex and diverse tasks. However, using humans to create open-domain instruction datasets like OpenAI did will encounter the following challenges. The whole annotating process is extremely expensive and time-consuming (Kopf et al., 2023; Chen et al., 2023; Sun et al., 2023; Yuan et al., 2023). On the other hand, the difficulty level distribution of human-created instructions is skewed towards being easy or moderate, with fewer difficult ones (according to the difficulty statistics of ShareGPT (Chiang et al., 2023) from Figure 5(a)). Human annotators are prone to fatigue and cannot sustain high-intensity work to produce a sufficient proportion of high-difficulty instructions (Zhang et al., 2023; Xiao et al., 2023; Manakul et al., 2023; Zhong et al., 2023). Based on these issues, developing an automatic method that can mass-produce open-domain instructions (especially the more difficult ones) at a relatively low cost becomes the key to further advancing instruction-tuned language models (Bao et al., 2023; Liu et al., 2023; Bian et al., 2023; Cabannes et al., 2023).

Figure 1: Running Examples of Evol-Instruct.

In this work, we introduce Evol-Instruct, a novel method using LLMs instead of humans to automatically mass-produce open-domain instructions of various difficulty levels, to improve the performance of LLMs. Figure 1 shows the running examples of Evol-Instruct. Starting from a simple initial instruction “1+1=?”, our method randomly selects In-depth Evolving (blue direction line) or In-breadth Evolving (red direction line) to upgrade the simple instruction to a more complex one or create a new one (to increase diversity). The In-depth Evolving includes five types of operations: add constraints, deepening, concretizing, increase reasoning steps, and complicate input. The In-breadth Evolving is mutation, i.e., generating a completely new instruction based on the given instruction. These six operations are implemented by prompting an LLM with specific prompts. Since the evolved instructions are generated from LLMs, sometimes the evolving will fail. We adopt an instruction eliminator to filter the failed instructions, which is called Elimination Evolving. We repeat this evolutionary process for several rounds to obtain enough instruction data containing various complexities.

In order to verify the effectiveness of Evol-Instruct and whether the instructions it creates for fine-tuning surpass those created by humans, we evolve the instructions from Aplaca (Taori et al., 2023) data (created by machine), fine-tune the LLaMA (Touvron et al., 2023) model, and comprehensively compare the fine-tuned model WizardLM with Vicuna (Chiang et al., 2023) trained on ShareGPT (instructions are created by human). Alpaca data has a total of 52k52k samples and is generated using self-instruct (Wang et al., 2022a) from only 175175 human-created seed instructions. We choose Alpaca data as the initial data for evolution, which can ensure that the training instructions of WizardLM have almost no direct human participation in annotations. We execute four epochs of evolution using OpenAI ChatGPT API and finally obtain 250k250k instructions. To ensure a fair comparison with Vicuna’s 70k70k real user data, we sampled 70k70k from the full 250k250k data and fine-tuned the LLaMA 13B model. Because the original Alpaca data only has 52k52k samples, we used its self-instruct method to generate an additional 18k18k data, and retrained the LLaMA 13B model with its code to get Alpaca 13B as our baseline. Due to the low proportion of difficult instructions in the previous instruction-following test dataset, we manually created a new difficulty-balanced test dataset, named WizardEval. We evaluate Alpaca, Vicuna, ChatGPT, and WizardLM on a wide range of LLM benchmarks (covering reasoning, code, mathematics, general conversation, etc.). Our main findings are as follows:

  • We introduce Evol-Instruct, a novel approach that enhances the performance of the open-source LLMs by a large margin via automatically mass-producing open-domain instructions of various topics and difficulty levels.
  • We develop WizardLM model, which significantly surpasses typical open-source LLMs such as Alpaca and Vicuna in a series of benchmarks. Notably, WizardLM outperforms baselines by a substantial margin in terms of code, math, GPT-4 and human evaluations.
  • We have undertaken a preliminary investigation that underscores the importance of instruction complexity in attaining outstanding performance in supervised fine-tuning large pre-trained language models.

References (55)

Cited by (26)