Instruction Mining: High-Quality Instruction Data Selection for Large Language Models

Yihan Cao, Yanbin Kang, Lichao Sun · DOI

Introduction

Instruction fine-tuning is the critical process that transforms a raw, pretrained Large Language Model (LLM) into a helpful assistant. While the "LIMA" hypothesis suggests that "less is more"—implying a small amount of high-quality data is superior to a large volume of mediocre data—identifying that high-quality subset has traditionally required expensive human expertise. INSTRUCTMINING is a novel framework that automates this selection process, predicting model performance through natural language indicators and identifying a "double descent" phenomenon in fine-tuning.

Methodology: The INSTRUCTMINING Pipeline

The authors propose a pipeline that treats data selection as a predictable science, focusing on three core components:

1. The Quality Proxy

Dataset quality is defined as being inversely proportional to the inference loss a model incurs on a "golden" evaluation set post-training. To avoid the prohibitive cost of constant fine-tuning, the framework uses a set of natural language indicators as proxies:

  • Reward Scores: Judging response quality via models like oasst-rm-pythia.
  • Perplexity: Assessing the naturalness of the language.
  • UniEval Scores: Evaluating coherence and understandability.
  • Diversity Metrics: Using Lexical Diversity (MTLD) and embedding distance (KNN) to ensure non-repetitive data.

2. The Linear Rule and BLENDSEARCH

By training 129 models on various data blends, the researchers established a linear regression "rule" to weight these indicators. Reward Scores and UniEval-Understandability emerged as the most significant predictors.

Crucially, the authors observed a double descent phenomenon: as data size increases, performance initially improves (loss decreases), then degrades as the model encounters noise or conflicting patterns, before eventually improving again in a "quantity-dominated" phase. To find the optimal subset size (K), they employed BLENDSEARCH, an economical hyperparameter optimization tool.

Loss vs. Data Size showing the double descent phenomenon and the optimal data selection point.

Experimental Setup

The study utilized several prominent open-source datasets for rule fitting (Alpaca, Open-Assistant, StackExchange, WikiHow) and evaluation (OpenOrca, Dolly-15k). Models were benchmarked using MT-Bench (LLM-as-a-Judge) and the Huggingface OpenLLM Leaderboard.

Key Results and Insights

The framework demonstrates that quality significantly outweighs quantity. For instance, just 2,532 high-quality samples from OpenOrca outperformed the full 100,000-sample dataset.

  • Efficiency: Selecting the top 1,000 samples allowed for high-performing model training in just 15 minutes, a massive reduction from the 30 hours required for the full dataset.
  • Performance: INSTRUCTMINING-7B (based on Llama-2) achieved state-of-the-art results on the OpenLLM Leaderboard, rivaling models trained on significantly more data. In head-to-head GPT-4 evaluations, it outperformed or equaled Vicuna-7B-v1.5 in 64.67% of cases.
Performance comparison of InstructMining-7B against Llama-2-7B and GPT-3.5-turbo across various task categories.

Discussion and Limitations

A notable finding was the negative correlation between "Understandability" and data quality. The authors suggest that complex instructions—which score lower on simple understandability—are more effective at "stretching" model capabilities.

However, the framework has limitations: the quality rule is calibrated to specific evaluation sets (like MT-Bench), which may introduce bias. Furthermore, the current focus is on single-turn instructions; multi-turn dialogue may require different indicators. Future work will explore more sophisticated, model-based indicators to further refine the selection process.

Summary updated

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