Abstract
Fine-tuning Large Language Models (LLMs) often requires a "warm-up" or pre-fine-tuning phase using large unlabeled datasets. However, existing data selection methods typically rely on distribution matching, which ignores the knowledge the model has already acquired during pre-training. This paper introduces GOT-D (Gradients of Optimal Transport for Data Selection), a mathematically principled approach that selects data based on the gradient of the Optimal Transport distance between the model's current state and the target task. By identifying samples that most effectively bridge the gap between pre-training and the target domain, GOT-D achieves superior performance with significantly less data, including a 30% reduction in toxicity and a 14% boost in zero-shot accuracy.
Introduction
The success of LLMs on specific downstream tasks often hinges on a two-stage fine-tuning process. While high-quality labeled data is the gold standard, it is frequently scarce. Consequently, researchers often employ a "warm-up" phase, using massive, unlabeled open-source corpora to adapt the model's weights before final task-specific training.
The efficiency of this warm-up phase depends entirely on data selection. Traditional methods focus on distribution matching, seeking unlabeled samples that most closely resemble the target task. This approach is fundamentally flawed because it ignores the model's existing knowledge. If a model has already seen similar data during its initial pre-training, additional exposure provides diminishing returns. The core challenge is not finding similar data, but finding informative data that fills the specific knowledge gaps between the model's current state and the target objective.
Methodology: GOT-D
The researchers propose GOT-D (Gradients of Optimal Transport for Data Selection) to move beyond simple distribution matching. This method treats data selection as a geometric optimization problem using the framework of Optimal Transport (OT).
The Gradient-Based Approach
Optimal Transport provides a rigorous way to measure the distance between two probability distributions. GOT-D calculates the gradient of this OT distance. By analyzing the dual solution of the OT problem, the method identifies specific samples in a candidate pool that possess the largest negative gradients.
In practical terms, these samples represent the "vectors" that would most rapidly pull the model’s current distribution toward the target task's distribution. Instead of selecting data that is simply similar to the target, GOT-D selects data that provides the strongest corrective push in the right direction.
Computational Efficiency
To make this approach viable for datasets containing millions of samples, the authors utilize entropy regularization and parallelized GPU computing. This optimization allows the selection process to be completed in under an hour on a single A100 GPU, making it significantly faster and more scalable than previous state-of-the-art methods like DSIR or TAPT.
Experimental Setup
The effectiveness of GOT-D was evaluated across several diverse scenarios:
- Candidate Pools: Unlabeled data was drawn from the OpenWebTextCorpus (OWTC) and subsets of "The Pile" (Wikipedia, Arxiv, PubMed).
- Detoxification: GPT-2 was fine-tuned to reduce toxicity using the RealToxicityPrompts (RTP) dataset.
- Domain Adaptation: Tested on eight tasks, including medical abstracts (RCT), chemical-protein interactions (ChemProt), and news classification (AGNews).
- General NLU: Evaluated using the GLUE benchmark (e.g., SST-2, CoLA).
- Zero-shot Learning: Performance was measured on AGNews and BoolQ for models up to 2.7B parameters.
Key Results and Insights
1. Superior Performance with Less Data
GOT-D demonstrates that principled selection allows for high performance with minimal data volume:
- Detoxification: Selecting just 10,000 clean samples via GOT-D reduced GPT-2's toxicity by 30%, outperforming both random selection and standard toxicity filters.
- Zero-Shot Accuracy: For larger models, GOT-D improved zero-shot performance on AGNews by 13.9% using only 40,000 unlabeled samples.
- Domain Adaptation: On BERT-based models, GOT-D improved average performance across eight tasks by 1.13% using 150,000 samples, consistently outperforming specialized baselines like TAPT/c in resource-constrained settings.
2. The Trap of Distribution Matching
The research confirms that simply matching distributions is inefficient if the model is already "saturated" with that information from pre-training. GOT-D identifies samples that are often underrepresented in the original pre-training but are critical for the target task, providing a more effective shift in the model's effective distribution.
Limitations and Future Work
While GOT-D is highly effective, its performance is tied to the relevance of the candidate pool. If the pool has no overlap with the target domain, unsupervised warm-up remains a challenge. Additionally, because the pre-training data for many proprietary models is secret, GOT-D relies on open-source proxies (like The Pile) to estimate the model's current state. Future research will explore how this strategy scales to models with hundreds of billions of parameters and its potential integration into multi-stage curriculum learning pipelines.
Conclusion
GOT-D represents a shift in how we approach data selection for LLM fine-tuning. By leveraging the gradients of Optimal Transport, researchers can move away from redundant distribution matching and toward a more surgical, efficient method of model adaptation. This "less is more" approach not only saves computational resources but also yields significantly better performance on downstream tasks.
Summary updated