Instruction Mining: Instruction Data Selection for Tuning Large Language Models

Yihan Cao, Yanbin Kang, Chi Wang, Lichao Sun

TL;DR

This paper introduces InstructMining, an automated method for selecting high-quality instruction-following data to fine-tune Large Language Models (LLMs). By leveraging natural language indicators and discovering a "double descent" phenomenon in LLM finetuning, InstructMining significantly improves model performance while drastically reducing the amount of training data required.

What Problem Does This Paper Address?

Large Language Models (LLMs) are powerful but often need fine-tuning with instruction-following datasets to become adept at human interaction. However, selecting the best data from vast collections is a major bottleneck. Current methods often rely on human experts, which is time-consuming and expensive. The paper addresses the lack of standardized, automated guidelines for selecting high-quality instruction data that can optimize LLM performance during fine-tuning.

Methods

The core of the proposed method, InstructMining, involves two main components:

  1. Data Quality Estimation: Instead of directly finetuning a model for each potential dataset (which is computationally expensive), InstructMining uses a proxy for data quality. It hypothesizes that the inference loss of a finetuned model on a high-quality evaluation set is directly proportional to the instruction quality of the training dataset. To efficiently estimate this loss without full finetuning, the authors introduce a set of natural language indicators (e.g., reward model score, perplexity, naturalness, coherence). These indicators are used to predict the inference loss via a linear regression model.
  2. Data Selection: The authors observe a phenomenon called "double descent" during LLM finetuning, where performance initially improves with data size, then degrades, and finally improves again. This suggests an optimal data subset size exists, and simply picking the largest high-quality set isn't always best. To find this optimal subset, they employ BLENDSEARCH, an automated hyperparameter optimization technique, to efficiently search for the best data size and composition.

Datasets

The paper utilizes several datasets for different stages of their research:

  • Candidate Datasets for Rule Fitting: ALPACA, OPEN-ASSISTANT, STACKEXCHANGE, and WIKIHOW. These were used to train the initial quality estimation rule.
  • Test Set for Rule Fitting: SELF-INSTRUCT dataset, used to evaluate the learned rule.
  • Datasets for Rule Evaluation: OPENORCA (GPT-3.5 and GPT-4 versions) and DOLLY-15K. These are "unseen" datasets used to test the effectiveness of InstructMining in selecting data for finetuning.
  • Unseen Evaluation Set: MT-BENCH (specifically the first turn of conversations) was used to ensure the method's robustness beyond the SELF-INSTRUCT set.

No new benchmarks were introduced; instead, existing popular benchmarks like LLM-AS-A-JUDGE and OPENLLM were used for final model evaluation.

Key Insights and Ideas

  • Loss as a Proxy for Quality: The inference loss on a high-quality evaluation set is a surprisingly effective proxy for the quality of instruction data used for finetuning. This allows for efficient quality assessment without full model training for every dataset.
  • The "Double Descent" Phenomenon: The discovery that LLM finetuning exhibits a double descent curve (performance degrades then improves with data size) is crucial. It highlights that simply increasing data quantity isn't always beneficial and that finding an "optimal point" is key.
  • Natural Language Indicators are Predictive: A curated set of natural language indicators can effectively predict the inference loss, making the quality estimation process much faster than direct finetuning. Reward score and naturalness were found to be particularly important indicators.
  • Data Quality vs. Quantity Trade-off: The research suggests that while data quality is paramount initially, data quantity becomes a more dominant factor as the dataset size grows. This reinforces the need for intelligent selection rather than brute-force data aggregation.

Key Results

  • State-of-the-Art Performance: Models finetuned using InstructMining achieved state-of-the-art performance on two popular benchmarks: LLM-AS-A-JUDGE and OPENLLM.
  • Significant Data Reduction: InstructMining was able to select the top 2.5% (2,532 out of 100,000) of high-quality examples from a large dataset, achieving comparable or better results than full dataset finetuning.
  • Efficiency Gains: Finetuning with InstructMining required significantly less time and computational resources. For example, selecting 1,000 examples took about two hours, and finetuning took only 15 minutes, compared to 30 hours for full dataset finetuning.
  • Improved LLAMA-2-7B: InstructMining enhanced LLAMA-2-7B's performance by 4.93 on the Huggingface OPENLLM benchmark.
  • Competitive with VICUNA: Finetuned models generated equivalent or superior responses in 64.67% of instances compared to VICUNA-7B-v1.5.

Limitations and Future Work

  • Linear Assumption: The quality estimation rule assumes a linear relationship between indicators and loss. While effective, more complex relationships might exist.
  • Evaluation Set Dependency: The quality estimation relies on a "golden" evaluation set. The performance of InstructMining might be sensitive to the quality and representativeness of this evaluation set.
  • Generalizability: While tested on various models and settings, further exploration of its scalability to even larger models or different task types could be beneficial.
  • Future Work: The authors suggest further experiments to investigate the relationship between finetuning data size and LLM performance, particularly the double descent phenomenon. They also propose exploring more sophisticated search strategies beyond BLENDSEARCH.

Summary updated

BibTeX
@inproceedings{cao2024instruction,
  author = {Yihan Cao and Yanbin Kang and Chi Wang and Lichao Sun},
  title = {{Instruction Mining: Instruction Data Selection for Tuning Large Language Models}},
  booktitle = {COLM},
  year = {2024},
  url = {https://openreview.net/forum?id=wF6k0aWjAu},
}
Figure