What Makes Good Data for Alignment? A Comprehensive Study of Automatic Data Selection in Instruction Tuning

Wei Liu, Weihao Zeng, Keqing He, Yong Jiang, Junxian He

Introduction

The researchers behind DEITA (Data-Efficient Instruction Tuning for Alignment) demonstrate that "less is more" when it comes to aligning Large Language Models (LLMs). By automatically selecting just 6,000 high-quality, complex, and diverse instruction-tuning samples, they produced models that outperform state-of-the-art baselines trained on 10x more data.

The Challenge of Data Selection

While pre-training provides an LLM with vast world knowledge, instruction tuning (or Supervised Fine-Tuning, SFT) teaches the model to follow human directions and behave like a helpful assistant. Recent findings suggest that a small amount of high-quality data is better than a mountain of "noisy" data.

However, the field has lacked a principled, automatic way to identify what actually constitutes "good" data. Most researchers either manually curate datasets or use simple heuristics like response length. The authors of this paper sought to move beyond trial-and-error by defining and measuring the three pillars of alignment data: Complexity, Quality, and Diversity.

Methodology: Scoring and Selecting Data

The authors developed a comprehensive framework to score and select data based on these three dimensions.

DEITA Data Selection Framework
  1. Evol Complexity & Quality: Inspired by the "Evol-Instruct" method, the authors used ChatGPT to "evolve" a small seed dataset into versions with varying levels of difficulty and response quality. They then asked ChatGPT to rank these versions. Using these rankings, they trained a small LLaMA-based Complexity Scorer and Quality Scorer. This allows them to assign a numerical score to any new piece of data without needing expensive API calls to GPT-4.
  2. Diversity (Repr Filter): To ensure the model doesn't just see 6,000 variations of the same prompt, they used an embedding-based filter. They calculated the cosine distance between a candidate sample and the samples already selected. If a sample is too similar to what’s already in the "bucket," it’s discarded.
  3. DEITA Selection Strategy: The final algorithm is "score-first, diversity-aware." They sort the entire data pool by a combined score ($Complexity \times Quality$) and then iteratively pick the top samples that pass the diversity filter until the data budget (e.g., 6,000 samples) is met.

Datasets and Evaluation

The authors tested their approach on two major data pools:

Dataset Pools
  • $X_{sota}$: A 300K sample pool consisting of high-quality datasets like ShareGPT, UltraChat, and WizardLM.
  • $X_{base}$: A 100K sample pool of more "standard" datasets like Alpaca, Dolly, and FLAN.

For evaluation, they used the industry-standard MT-Bench (multi-turn conversations), AlpacaEval (simulated head-to-head battles against GPT-4), and the Open LLM Leaderboard.

Key Insights

  • Ranking > Absolute Scoring: Training a scorer to rank variants of the same prompt is much more effective than asking a model for an absolute score (e.g., "Rate this 1-10"). Ranking helps the scorer capture subtle, fine-grained differences in data quality.
  • The "Good Data" Ceiling: Performance doesn't always go up as you add more data. In data-scaling experiments, performance often peaked and then slightly declined. This suggests that even in "high-quality" pools, the amount of truly "optimal" alignment data is limited; adding more can introduce redundancy or noise.
  • Synergy with DPO: While the paper focuses on SFT, starting with a DEITA-selected SFT model provides a much stronger foundation for Direct Preference Optimization (DPO), leading to top-tier performance.

Results and Future Work

The results are a striking testament to data efficiency:

  • DEITA-Mistral-7B (trained on only 6K samples) achieved a 7.22 on MT-Bench, outperforming models like Vicuna-13B and WizardLM-13B, which used 125K and 70K samples respectively.
  • DEITA-LLaMA-2-13B outperformed the official LLaMA-2-13B-Chat model, despite the latter using over 1 million RLHF samples.
  • When combined with DPO, DEITA-Mistral-7B + DPO reached a score of 7.55 on MT-Bench and 90.06% on AlpacaEval, making it one of the strongest open-source 7B models available at the time of publication.

The authors acknowledge that their current diversity filter is "greedy" and that more sophisticated global optimization algorithms could yield even better results. Additionally, while the trained scorers are efficient, the initial process of generating "evolved" data and ranking it requires an upfront investment. Future work may also explore applying this automatic selection framework directly to preference pairs for RLHF/DPO.

Summary updated

BibTeX
@inproceedings{liu2024what,
  author = {Wei Liu and Weihao Zeng and Keqing He and Yong Jiang and Junxian He},
  title = {{What Makes Good Data for Alignment? A Comprehensive Study of Automatic Data Selection in Instruction Tuning}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=BTKAeLqLMw},
}
Figure