Diversify and Conquer: Diversity-Centric Data Selection with Iterative Refinement

Simon Yu, Liangyu Chen, Sara Ahmadian, Marzieh Fadaee · DOI

Introduction

Fine-tuning large language models (LLMs) on instruction data is a critical step in aligning models for helpfulness and safety. However, as datasets grow to hundreds of thousands of examples, training on the full set becomes computationally prohibitive and often introduces noise. Traditional data selection methods focus on "local quality"—scoring individual examples to find the best ones. This paper argues that such an approach often sacrifices diversity, leading to models that lack the broad skill set required for general-purpose tasks.

The $k$MQ Framework

The authors introduce Iterative $k$MQ, a strategy that prioritizes global data diversity through a two-stage process:

1. Static Selection ($k$MQ)

The process begins by embedding the dataset into a vector space and applying $k$-means clustering. By sampling from every cluster rather than just the highest-scoring individual points, the method ensures the selected subset is globally representative of the entire data distribution. Within each cluster, a quality score is used to prioritize the most effective examples.

2. Iterative Refinement

The core innovation is an active learning loop. Instead of a single selection step, the budget is split across multiple iterations. The model is briefly trained on an initial subset, and its performance is evaluated to identify "difficult" clusters.

The proposed pipeline for static and iterative data selection.

During subsequent iterations, the system adjusts cluster weights: increasing the sampling rate for clusters where the model struggles and decreasing it for those that are already mastered or contain outliers.

Experimental Results

The researchers evaluated their method by fine-tuning Llama-2-7B on a 10,000-sample subset (approx. 5%) of the WizardLM dataset. Performance was measured across a diverse set of benchmarks, including MMLU (general knowledge), GSM8k (math), and HumanEval (coding).

Main results comparing kMQ and Iterative kMQ against various baselines.

As shown in the results table, Iterative $k$MQ achieved an average score of 46.9%, outperforming random selection (43.8%) and state-of-the-art methods like Deita (45.0%) and QDIT (45.2%). These gains were consistent across other model families, such as Mistral-7B and Llama-3-8B.

Key Insights

  • Diversity over Quality: Simple clustering and random sampling within clusters performed as well as expensive LLM-based scoring methods, validating the "diversity-first" hypothesis.
  • Optimal Clustering: The number of clusters ($k$) is a critical hyperparameter. The authors found that the Silhouette Score serves as a reliable, low-cost proxy for predicting downstream performance, helping to find the "Goldilocks" zone of diversity without exhaustive training.
  • Feedback Efficacy: Using a reward model for iterative feedback proved more effective than perplexity or GPT-4 based scoring in refining the selection process.

Conclusion and Future Work

Iterative $k$MQ demonstrates that selecting data based on global distribution and iterative feedback is superior to static, quality-only selection. While the method is highly effective, it remains dependent on the quality of the initial scorer and carries a risk of "reward hacking." Future research could extend these diversity-centric techniques to the pre-training phase, where data volume and noise are significantly higher.

Summary updated

BibTeX
@misc{yu2024diversify,
  author = {Simon Yu and Liangyu Chen and Sara Ahmadian and Marzieh Fadaee},
  title = {{Diversify and Conquer: Diversity-Centric Data Selection with Iterative Refinement}},
  year = {2024},
  eprint = {2409.11378},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.11378},
}
Figure