Introduction
Fine-tuning Large Language Models (LLMs) has become the standard approach for adapting pre-trained models to specific downstream tasks. However, this process is often governed by the principle of "garbage in, garbage out." While high-quality datasets are essential, real-world data is frequently contaminated with noise, mislabeled instances, or detrimental examples that can degrade model performance. Identifying these harmful data points is a significant challenge.
The theoretical gold standard for measuring the value of a specific data point is the Shapley value, a concept derived from cooperative game theory. It quantifies the average marginal contribution of a single data point across all possible subsets of a dataset. Despite its theoretical appeal, calculating exact Shapley values is computationally impossible for LLMs due to exponential complexity; it would require retraining the model for every possible data subset. This paper introduces TS-DSHAPLEY (Transferred Sampling Data Shapley), a method designed to overcome these computational constraints and make data valuation practical for modern NLP pipelines.
Methodology: TS-DSHAPLEY
TS-DSHAPLEY addresses the computational bottleneck through two primary innovations: value transfer via proxy models and multi-chain Monte Carlo sampling.
1. Value Transfer via Proxy Models
To avoid the prohibitive cost of retraining a massive target LLM ($A_{tgt}$), the authors propose using a simpler proxy model ($A_{src}$). The process involves:
- Extracting internal representations (embeddings) from the penultimate layer of the target LLM.
- Reducing these high-dimensional embeddings using Principal Component Analysis (PCA) to a manageable 32 dimensions.
- Training a fast, linear Support Vector Machine (SVM) on these reduced embeddings.
The core hypothesis is that data points which are harmful or low-value for a simple linear classifier will also be detrimental to the full fine-tuning process of the LLM.
2. Multi-chain Monte Carlo Sampling
Rather than attempting to estimate values across the entire dataset simultaneously, TS-DSHAPLEY employs Monte Carlo sampling on small subsets, referred to as sampling chains. By aggregating these subset-level Shapley values, the algorithm can estimate the value for the entire training set. This approach allows for massive parallelization across multiple GPUs or CPUs, significantly reducing the time required for model evaluations.
Experimental Setup and Datasets
The researchers evaluated TS-DSHAPLEY using three benchmark datasets from the GLUE (General Language Understanding Evaluation) suite, representing a range of tasks and scales:
- SST-2: Sentiment analysis (Single-sentence task).
- QQP: Quora Question Pairs (Similarity/Paraphrase task, ~364k instances).
- RTE: Recognizing Textual Entailment (Inference task, ~2.5k instances).
These datasets allowed the authors to test the algorithm's scalability and its effectiveness across different linguistic challenges.
Key Insights and Results
The "Less is More" Paradox
One of the most significant findings is that training on the entire dataset is often suboptimal. By using TS-DSHAPLEY to identify and remove the lowest-value data points, the authors achieved higher accuracy than the full-dataset baseline. This confirms that certain data points are not merely redundant but actively harmful to the model's learning process.
Performance and Efficiency
TS-DSHAPLEY consistently outperformed standard baselines such as Leave-One-Out (LOO) and KNN-Shapley. Notable results include:
- Accuracy Gains: On the RTE dataset, selecting high-value data improved RoBERTa’s accuracy by 1.3% and DistilBERT’s accuracy by 3.4% compared to training on the full dataset.
- Sampling Robustness: The method remained effective even when using sampling subsets as small as 2% of the original training data.
- Embedding Transferability: The authors demonstrated that data values transfer remarkably well. Interestingly, using embeddings from one model (e.g., DistilBERT) to select data for a different model (e.g., RoBERTa) still yielded performance improvements over the full-dataset baseline.
Data Characteristics
Using "Data Maps," the authors observed that TS-DSHAPLEY prunes both mislabeled "hard" examples and certain "easy-to-learn" instances. This aligns with prior research suggesting that an overabundance of easy examples can hinder a model's ability to generalize to out-of-distribution data.
Conclusion and Future Work
TS-DSHAPLEY provides a scalable, efficient framework for data selection in LLM fine-tuning. By leveraging proxy models and parallelized sampling, it makes the theoretical benefits of Shapley values accessible for large-scale NLP tasks.
While the empirical results are robust, the authors note several areas for future exploration. These include a deeper theoretical analysis of why linear proxy models transfer so effectively to deep Transformers, the investigation of alternative proxy architectures (such as small neural networks), and the development of automated methods to determine the optimal subset size threshold for different datasets.
Summary updated