Introduction
Supervised Fine-Tuning (SFT) is a critical step in adapting Large Language Models (LLMs) to specific domains. While massive datasets are often used, research increasingly suggests that data quality is more important than sheer volume. Gradient-based data selection methods, such as LESS and Dynamic, identify high-influence samples by calculating the inner product of gradients between training data and a target validation set. However, these methods are computationally expensive, requiring gradient calculations for every sample in a pool that may contain hundreds of thousands of instances.
ClusterUCB addresses this bottleneck by intelligently allocating a limited computing budget to identify high-influence data without exhaustive computation.
Methodology
The ClusterUCB framework operates in three distinct stages to optimize the selection process while minimizing computational overhead.
- Clustering with Gradients: The system computes gradients for the entire training pool once using a pretrained model. Samples are then grouped into $k$ clusters using K-means based on the cosine similarity of their gradients. This step assumes that samples with similar gradient profiles will exert similar influence on the model.
- Inter-Cluster Data Selection: The selection process is modeled as a multi-armed bandit problem where each cluster represents an "arm." Drawing an arm involves calculating the actual influence of a random sample from that cluster.
- Modified UCB Algorithm: A modified Upper Confidence Bound (UCB) algorithm ($U_c = \hat{\mu}_c + \beta * \hat{\sigma}_c$) is used to prioritize clusters. This formula balances exploration (sampling clusters with high variance or "hidden gems") and exploitation (sampling clusters with high average historical influence).
Key Insights and the "Cold Start" Problem
A pivotal finding of the study is that high-influence data points are "clumpy"—they tend to aggregate within specific gradient-defined clusters. This validates the use of clustering as an effective pre-filter.
However, the UCB algorithm requires initial data to avoid local optima. The authors implemented a "cold start" phase where 5% of the budget is distributed proportionally across all clusters. As shown in the performance analysis, an appropriate cold start ratio is essential for maintaining high recall rates of influential samples.
Experimental Results
The authors evaluated ClusterUCB using a training pool of over 400,000 instances across models like LLaMA-2-7B and Qwen2.5-3B. The benchmarks included MMLU, TydiQA, GSM8k, and HumanEval.
- Efficiency: ClusterUCB achieved performance parity with full-budget methods (LESS and Dynamic) using only 20% of the computing budget.
- Performance: On the MMLU benchmark, LESS-ClusterUCB (20% budget) achieved a score of 47.8, slightly exceeding the 47.0 score of the original LESS method using 100% of the budget.
- Robustness: The method proved model-agnostic and significantly outperformed random re-ranking baselines, demonstrating the effectiveness of the UCB-based cluster selection strategy.
Conclusion
ClusterUCB demonstrates that gradient-based data selection can be made significantly more efficient without sacrificing performance. By leveraging the natural clustering of influential data and employing a bandit-based allocation strategy, researchers can achieve state-of-the-art fine-tuning results at a fraction of the traditional computational cost. Future work may explore more sophisticated clustering techniques and methods to account for mutual influence between data samples.
Summary updated