← Research papers
2023arXivunread

Demystifying Instruction Mixing for Fine-tuning Large Language Models

Renxi WangHaonan LiMinghao WuYuxia WangXudong HanChiyu ZhangTimothy Baldwin
Publisher pagePDF
Open graph

Citations

0

Open access

No

Source

arxiv

OpenAlex

Not enriched

arXiv

2312.10793

Abstract

Instruction tuning significantly enhances the performance of large language models (LLMs) across various tasks. However, the procedure to optimizing the mixing of instruction datasets for LLM fine-tuning is still poorly understood. This study categorizes instructions into three primary types: NLP downstream tasks, coding, and general chat. We explore the effects of instruction tuning on different combinations of datasets on LLM performance, and find that certain instruction types are more advantageous for specific applications but can negatively impact other areas. This work provides insights into instruction mixtures, laying the foundations for future research.

Included in

Collections

Add to collection

Paper intelligence

Research analysis

Confidence 95%

11 source chunks

Summary

Instruction tuning significantly enhances the performance of large language models (LLMs) across various tasks. However, the procedure to optimizing the mixing of instruction datasets for LLM fine-tuning is still poorly understood. This study categorizes instructions into three primary types: NLP downstream tasks, coding, and general chat. We explore the effects of instruction tuning on different combinations of datasets on LLM performance, and find that certain instruction types are more advantageous for specific applications but can negatively impact other areas. This work provides insights into instruction mixtures, laying the foundations for future research.

Plain-language summary

Instruction tuning significantly enhances the performance of large language models (LLMs) across various tasks. However, the procedure to optimizing the mixing of instruction datasets for LLM fine-tuning is still poorly understood. This study categorizes instructions into three primary types: NLP downstream tasks, coding, and general chat. We explore the effects of instruction tuning on different combinations of datasets on LLM performance, and find that certain instruction types are more advantageous for specific applications but can negatively impact other areas. This work provides insights into instruction mixtures, laying the foundations for future research.

Research problem

However, the procedure to optimizing the mixing of instruction datasets for LLM fine-tuning is still poorly understood. However, a key unresolved issue is determining how to com- bine various instruction datasets to optimize overall LLM performance. However, combining all instruction types does not uniformly improve performance across all tasks. • Instructions reformulated from NLP down- stream tasks (such as P3) can negatively im- pact the model’s conversational abilities.

Methodology

For instance, using general-purpose, chat-like in- structions can improve the performance of LLMs as chat assistants (Chiang et al., 2023; Ouyang et al., 2022; Taori et al., 2023; Ding et al., 2023), while training LLMs on instructions based off NLP tasks improves their performance on NLP bench- marks (Sanh et al., 2022; Chung et al., 2022; Muen- nighoff et al., 2023b), and incorporating coding instructions enhances LLM code generation (Fu and Khot, 2022; Gunasekar et al., 2023). For P3, the statistics come from the original dataset, while for Alpaca, we use a dependency parsing approach to extract the root verb of each instruction. The core of our investigation revolves around un- derstanding the influence of instruction dataset dis- tributions on model performance in these differ- ent areas. We fine-tune models across all eight potential combinations of these in- struction datasets, and carry out detailed evaluation of model performance in terms of NLP downstream tasks, coding proficiency, and chat capabilities. However, combining all instruction types does not uniformly improve performance across all tasks. • Instructions reformulated from NLP down- stream tasks (such as P3) can negatively im- pact the model’s conversational abilities.

Main findings

Instruction tuning significantly enhances the performance of large language models (LLMs) across various tasks. We explore the effects of instruction tuning on different combinations of datasets on LLM performance, and find that certain instruction types are more advantageous for specific applications but can negatively impact other areas. Demystifying Instruction Mixing for Fine-tuning Large Language Models Renxi Wang1,2 Haonan Li1,2 Minghao Wu3 Yuxia Wang1,2 Xudong Han1,2 Chiyu Zhang4 Timothy Baldwin1,2,5 1Mohamed bin Zayed University of Artificial Intelligence 2LibrAI 3Monash University 4 University of British Columbia 5 The University of Melbourne {renxi.wang,haonan.li,yuxia.wang,xudong.han,timothy.baldwin}@mbzuai.ac.ae minghao.wu@monash.edu chiyuzh@mail.ubc.ca Abstract Instruction tuning significantly enhances the performance of large language models (LLMs) across various tasks. We explore the effects of instruction tuning on different combinations of datasets on LLM performance, and find that certain instruction types are more advantageous for specific applications but can negatively im- pact other areas. For instance, using general-purpose, chat-like in- structions can improve the performance of LLMs as chat assistants (Chiang et al., 2023; Ouyang et al., 2022; Taori et al., 2023; Ding et al., 2023), while training LLMs on instructions based off NLP tasks improves their performance on NLP bench- marks (Sanh et al., 2022; Chung et al., 2022; Muen- nighoff et al., 2023b), and incorporating coding instructions enhances LLM code generation (Fu and Khot, 2022; Gunasekar et al., 2023).

Key contributions

Contribution 1

We first select representative instruction datasets: P3 (Sanh et al., 2022) for NLP down- stream tasks, CodeAlpaca (Chaudhary, 2023) for code generation, and Alpaca (Taori et al., 2023) for general-purpose instructions.

Contribution 2

Our main contribution in this work is to shed light on instruction mixing when fine-tuning LLMs through comprehensive experimentation.

Contribution 3

Novel to this work, we classify the instructions and model skills into three types, and conduct a deep analysis of the influence of data mixture on the models.

Contribution 4

As Figure 2 shows, with the number of general instruc- tions fixed to 20K, scores in both NLP task and code benchmarks first decrease and then increase as the ratio of specialized instructions increases.

Contribution 5

Free Dolly: Introducing the world’s first truly open instruction-tuned LLM. https://github.com/ databrickslabs/dolly.

Contribution 6

Insightfulness Is the response creative, original or novel, including new perspectives or interpreta- tions of existing information?

Contribution 7

Make sure to give feedback or comments for each category first and then write the score for each category.

Limitations

  • However, combining all instruction types does not uniformly improve performance across all tasks. • Instructions reformulated from NLP down- stream tasks (such as P3) can negatively im- pact the model’s conversational abilities.
  • Since the vanilla model cannot follow instructions, we exclude it from this table.

Future work

  • This work provides insights into instruction mixtures, laying the foundations for future research.
  • This work provides insights into instruction mixtures, laying the founda- tions for future research.1 1 Introduction Instruction tuning has been shown to have surpris- ing efficacy for aligning large language models (LLMs) with human instructions (Chung et al., 2022; Li et al., 2023; Wu et al., 2023; Xu et al., 2023; Touvron et al., 2023; Muennighoff et al., 2023a; Gunasekar et al., 2023).
  • Limitations Our work is subject to several limitations that should be addressed in future research. (1) We only use LLaMA-2 7B and 13B models in our ex- periments.
  • We leave the exploration of the impact of more instructions and mixing ratios to future work.
  • We acknowledge these limitations and propose that future work should focus on addressing them to help the community better understand the impact of instruction mixture on LLMs.

Models and methods

BERTGPT

Datasets

Dataset 1

For P3, the statistics come from the original dataset, while for Alpaca, we use a dependency parsing approach to extract the root verb of each instruction.

Dataset 2

The core of our investigation revolves around un- derstanding the influence of instruction dataset dis- tributions on model performance in these differ- ent areas.

Dataset 3

For instance, Sanh et al. (2022) crafted an instruc- tional dataset by reformulating supervised datasets with various prompts to create P3.

Dataset 4

Recent work has fur- ther expanded the dataset size (Wu et al., 2023), language coverage (Li et al., 2023), and task types (Chaudhary, 2023; Yue et al., 2023).

Dataset 5

In contrast, Anand et al. (2023) ex- cluded P3 from their fine-tuning dataset, seemingly to enhance alignment.

Dataset 6

They fur- ther identified the optimal dataset combination, and trained a single model to achieve the best overall performance.

Dataset 7

3 Experimental Setup Datasets We select Alpaca (Taori et al., 2023) as the general instruction dataset to align models, in the form of 52K instruction–response pairs.

Dataset 8

We use P3 (Sanh et al., 2022) as our NLP task instruc- tion dataset, which is reformatted for a wide range of NLP downstream tasks using diverse human- written templates.

Dataset 9

Since the number of samples in each task varies vastly, we randomly sample 1K instances from each subtask formatted with sev- eral corresponding prompts for diversity, resulting in 660K samples.

Dataset 10

For coding data, we choose CodeAlpaca (Chaudhary, 2023), which is an in- struction dataset focusing on code generation.

Code repositories

Keywords

artificial intelligencelarge language modelnatural language processingstatistics

No graph connections yet.

Sync citations or add papers to shared collections to build this network.

Knowledge graph

Citation network

Explore references, papers that cite this work and related papers in your Codex library.

References

0

No references have been linked yet.

Cited by

0

No saved paper is currently linked as citing this work.

Related papers

0

Add papers to shared collections or enrich their topics to find related work.

Research workspace

Attach the paper PDF, extract its text, classify its contents and create semantic embeddings.

Attach PDF

Upload the research paper so Codex can extract, chunk and search its contents.

Paper resources

Demystifying Instruction Mixing for Fine-tuning Large Language Models.pdf

Status: completed11 chunks33557 charactersapplication/pdf