Skip to main content
QUICK REVIEW

[Paper Review] Get more for less: Principled Data Selection for Warming Up Fine-Tuning in LLMs

Feiyang Kang, Hoang Anh Just|arXiv (Cornell University)|May 5, 2024
Natural Language Processing TechniquesComputer Science3 citations
TL;DR

This paper proposes GOT-D, a principled data selection method for pre-fine-tuning large language models by selecting samples that shift the pre-training distribution closer to the target distribution, using optimal transport to measure distributional divergence. It achieves superior performance across NLU, NLG, and zero-shot tasks with up to 2.7B models, outperforming baselines while scaling to millions of samples in a single GPU hour.

ABSTRACT

This work focuses on leveraging and selecting from vast, unlabeled, open data to pre-fine-tune a pre-trained language model. The goal is to minimize the need for costly domain-specific data for subsequent fine-tuning while achieving desired performance levels. While many data selection algorithms have been designed for small-scale applications, rendering them unsuitable for our context, some emerging methods do cater to language data scales. However, they often prioritize data that aligns with the target distribution. While this strategy may be effective when training a model from scratch, it can yield limited results when the model has already been pre-trained on a different distribution. Differing from prior work, our key idea is to select data that nudges the pre-training distribution closer to the target distribution. We show the optimality of this approach for fine-tuning tasks under certain conditions. We demonstrate the efficacy of our methodology across a diverse array of tasks (NLU, NLG, zero-shot) with models up to 2.7B, showing that it consistently surpasses other selection methods. Moreover, our proposed method is significantly faster than existing techniques, scaling to millions of samples within a single GPU hour. Our code is open-sourced (Code repository: https://anonymous.4open.science/r/DV4LLM-D761/ ). While fine-tuning offers significant potential for enhancing performance across diverse tasks, its associated costs often limit its widespread adoption; with this work, we hope to lay the groundwork for cost-effective fine-tuning, making its benefits more accessible.

Motivation & Objective

  • To address the high cost and limited data efficiency of fine-tuning large language models on scarce, task-specific datasets.
  • To improve performance in targeted fine-tuning by pre-fine-tuning on a curated subset of open, unlabeled data.
  • To design a data selection strategy that is scalable, generalizable, and effective under low-budget conditions.
  • To overcome the limitations of existing methods that prioritize data matching the target distribution, often selecting samples already well-represented in pre-training.
  • To establish a theoretically grounded, computationally efficient method for data selection in two-stage fine-tuning.

Proposed method

  • Propose GOT-D (Gradients of Optimal Transport for Data Selection), which selects data that minimizes the optimal transport distance between the pre-training distribution and the target distribution.
  • Use proxy pre-training data (e.g., common open-source datasets) to represent the pre-training distribution and compute distributional shifts.
  • Leverage sentence embeddings (e.g., sentence-transformer, distilled-BERT) to embed data points for efficient OT distance computation.
  • Formulate data selection as a submodular optimization problem to ensure diversity and coverage under budget constraints.
  • Apply gradient-based approximations to the optimal transport objective to enable scalable, GPU-accelerated selection on millions of samples.
  • Integrate the selected data into a two-stage fine-tuning pipeline: pre-fine-tuning on selected open data, followed by targeted fine-tuning on limited labeled data.
Figure 2: Data Selection Setting. Given a pretrained model trained on pretraining data (red), we select additional data (blue) to fine-tune the model for a target task. We divide fine-tuning into two parts: I. Pre-Fine-Tuning and II. Targeted Fine-Tuning. Since labeled target data (green) can be exp
Figure 2: Data Selection Setting. Given a pretrained model trained on pretraining data (red), we select additional data (blue) to fine-tune the model for a target task. We divide fine-tuning into two parts: I. Pre-Fine-Tuning and II. Targeted Fine-Tuning. Since labeled target data (green) can be exp

Experimental results

Research questions

  • RQ1Can data selection that minimizes the distributional gap between pre-training and target data lead to better performance in subsequent fine-tuning?
  • RQ2How does GOT-D compare to distribution-matching baselines (e.g., DSIR, TAPT/c) in terms of data efficiency and performance gain?
  • RQ3To what extent can GOT-D scale to large-scale open datasets while maintaining low computational cost?
  • RQ4Does the choice of embedding space significantly affect the performance of the data selection pipeline?
  • RQ5Can GOT-D generalize across diverse NLP tasks, including NLU, NLG, and zero-shot settings?

Key findings

  • On the AGNews dataset with GPT-2 XL, GOT-D achieved 61.4% accuracy at 20k pre-fine-tuning samples, a 11.9% improvement over the baseline, outperforming DSIR (53.1%) and TAPT/c (57.0%).
  • On the BoolQ dataset with gpt-neo (2.7B), GOT-D reached 57.7% accuracy at 40k samples, a 6.6% gain over the baseline, surpassing DSIR (53.3%) and TAPT/c (51.2%).
  • GOT-D achieved state-of-the-art performance across diverse tasks, including zero-shot evaluation, demonstrating consistent gains regardless of task type or model size.
  • The method scaled to millions of samples within a single GPU hour, significantly outperforming existing gradient-based or retraining-based methods in terms of computational efficiency.
  • Ablation studies showed that sentence-transformer embeddings performed comparably to distilled-BERT, indicating that the choice of embedding space is not critical as long as it captures semantic structure.
  • Visualization via LDA word clouds confirmed that GOT-D selected underrepresented, formal business news content (e.g., 'bank', 'market'), which were rare in the candidate set but crucial for target task alignment.
Figure 3: Consider an LLM pre-trained on a large corpus of $99$ % cat examples and $1$ % dog examples. The target task consists of 50% cat examples and 50% dog examples. The model’s relative lack of knowledge of dogs will be its performance bottleneck on the target task. Before deploying the LLM on
Figure 3: Consider an LLM pre-trained on a large corpus of $99$ % cat examples and $1$ % dog examples. The target task consists of 50% cat examples and 50% dog examples. The model’s relative lack of knowledge of dogs will be its performance bottleneck on the target task. Before deploying the LLM on

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.