Influential Language Data Selection via Gradient Trajectory Pursuit

Zhiwei Deng, Tao Li, Yang Li · Submission to ICLR 2025 · Withdrawn

TL;DR

Data selection based on independent gradient ranking (such as top-$k$) often selects redundant samples, while traditional joint matching techniques (like Orthogonal Matching Pursuit) scale poorly. Gradient Trajectory Pursuit (GTP) reformulates subset selection as matching target gradient trajectories within a low-dimensional subspace under an $\ell_0$-norm objective. By using compressive sampling pursuit, GTP jointly selects diverse, high-impact data points—achieving state-of-the-art results on targeted instruction tuning while utilizing as little as 0.5% of the training dataset.

What Problem Does This Paper Address?

Selecting the right data subset is critical for training large language models (LLMs) efficiently and adapting them to specific tasks. While gradient information directly reflects training dynamics and serves as a strong signal for data influence, existing gradient-based selection methods run into two main roadblocks:

  1. Redundancy from independent selection: Methods like LESS rank data points individually and pick the top-$k$. However, samples with high gradient alignment with the target are often near-duplicates of each other, leading to high redundancy and wasted capacity.
  2. Poor scalability of joint selection: Algorithms that jointly optimize subsets, such as Orthogonal Matching Pursuit (OMP), select only one sample per iteration and solve non-negative least squares repeatedly, making them prohibitively slow for large candidate pools.

Methods

GTP introduces a framework to jointly select data samples that collectively match the gradient vector trajectory of a target dataset over model checkpoints:

  • Trajectory Matching in Evolving Subspaces: Instead of storing massive full-parameter gradient vectors across training, GTP projects model gradients at each checkpoint onto low-dimensional subspaces calculated via Principal Component Analysis (PCA) on target or training gradients.
  • $\ell_0$-Regularized Formulation: Subset selection is cast as finding a sparse non-negative weight vector $w$ that minimizes the residual difference between the weighted sum of training gradients and the target trajectory across time steps: $$\min_w \|w\|_0 \quad \text{subject to} \quad \|Aw - b\|_2^2 = 0$$
  • Iterative Compressive Sampling (IterCoSaMP): Rather than adding one data point at a time (like OMP), GTP adapts compressive sampling pursuit to greedily select $2M$ candidates based on gradient correlations, solves a non-negative least-squares (NNLS) problem to re-estimate weights (implicitly pruning duplicates), and keeps the top $M$ samples across successive iterations until convergence (typically ~5 steps).
  • Distributed Variant (DistCoSaMP): To scale to massive data pools, GTP supports partitioning gradient feature matrices across machines via column separation in a centralized star network.

Datasets

The authors evaluate GTP across two primary regimes:

  • LLM Agent Benchmark (In-Domain Selection):
  • ALFWorld: Interactive text-based task trajectories. The experiment uses a pool of 10k state-action training pairs and evaluates per-step action prediction accuracy on 1,861 test pairs using OPT-125M (with LoRA).
  • Targeted Instruction Tuning (Target-Domain Selection):
  • Candidate Training Pool: A mixture of four public datasets: Flan V2, CoT, Dolly, and Open Assistant.
  • Target Test Benchmarks: MMLU (multi-subject knowledge), BBH (complex reasoning), and TyDiQA (multilingual QA), evaluated on Mistral-7B (with LoRA).

Key Insights and Ideas

  • Individual vs. Joint Selection: An individual data point with high gradient similarity may seem ideal, but a cluster of identical high-scoring points provides zero marginal utility. Joint optimization enforces that once a gradient direction is accounted for, other samples pointing in that same direction receive lower weight.
  • Top-$k$ Failure Mode: On ALFWorld, top-$k$ gradient selection performs worse than simple random sampling because it repeatedly picks minor variations of the exact same environment state and action.
  • Compressive Sampling Solves the Scalability Bottleneck: By updating entire blocks of samples simultaneously and solving smaller submatrix least-squares problems, CoSaMP achieves up to a 17× speedup over standard OMP while retaining the benefits of joint selection.

Key Results

  • Targeted Instruction Tuning: Using only 0.5% of the training pool (1,353 samples), Mistral-7B trained with GTP outperformed models trained with the previous state-of-the-art method (LESS):
  • MMLU: 62.0% vs. 61.8% (+0.2%)
  • BBH: 60.0% vs. 56.0% (+4.0%)
  • TyDiQA: 64.5% vs. 60.3% (+4.2%)
  • ALFWorld Agent Performance: GTP consistently outperformed random sampling, representation-based selection (RDS), and gradient clustering (G-DIG). At a 10% budget (1,000 samples), GTP achieved 72.1% accuracy compared to 41.6% for top-$k$ LESS and 61.3% for random sampling.
  • Fast Convergence: The residual norm drops drastically and plateaus within 5 iterations, showing that full iterative recalculation is unnecessary.

Limitations and Future Work

  • Warmup Training Overhead: Like other gradient-based influence methods, GTP still requires training warmup checkpoints to capture model parameter trajectories, which is computationally heavier than purely static representation- or feature-based filtering.
  • Extending Matching Pursuit Beyond Gradients: The authors suggest future investigations into applying matching pursuit algorithms directly to representations or influence approximations to bypass the need for checkpoint-based gradient caching.

Summary updated

BibTeX
@misc{deng2024influential,
  author = {Zhiwei Deng and Tao Li and Yang Li},
  title = {{Influential Language Data Selection via Gradient Trajectory Pursuit}},
  year = {2024},
  eprint = {2410.16710},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.16710},
}
Figure