Introduction
Instruction tuning has become the standard method for transforming base Large Language Models (LLMs) into helpful, general-purpose assistants. Typically, this involves training the model on a massive, diverse mixture of datasets. However, this "more is better" approach has a significant downside: irrelevant or low-quality data can actually hinder the development of specific, high-level skills like mathematical reasoning or multilingual question answering.
The core challenge lies in identifying which specific examples from a pool of millions will actually help a model learn a target capability. Traditional methods for estimating "data influence"—how much a training point helps performance on a test point—are computationally prohibitive for LLMs because they require calculating gradients for billions of parameters across millions of examples. Furthermore, standard influence formulas assume the use of simple SGD optimizers, whereas LLMs are almost always tuned using the more complex Adam optimizer.
To solve this, researchers introduce LESS (Low-rank gradiEnt Similarity Search), a new algorithm that identifies the most influential data for "targeted instruction tuning." LESS allows models to gain specific skills using only a tiny fraction of available data.
The LESS Methodology
The authors propose a four-step pipeline designed to be both "optimizer-aware" and practically efficient:
- Warmup LoRA Training: The model is briefly trained on a small, random subset (e.g., 5%) of the data using LoRA (Low-Rank Adaptation). This "primes" the model to understand the general data distribution.
- Gradient Datastore Construction: For every example in the full training pool, the algorithm computes a "gradient feature." To make this efficient, LESS uses LoRA to reduce the number of parameters and applies Random Projections to compress these high-dimensional gradients into small, manageable vectors (e.g., 8192 dimensions).
- Similarity Search: Given a handful of "target" examples (e.g., 5-10 math problems), LESS computes their average gradient. It then ranks all training examples based on the cosine similarity between their stored gradient features and this target gradient.
- Targeted Training: The final model is trained only on the top-ranked examples.
Crucially, LESS uses cosine similarity rather than a simple dot product. This is a key innovation to fix a "length bias" where shorter sequences naturally have larger gradient norms, which would otherwise trick the algorithm into only picking short, simple examples.
Datasets and Evaluation
The researchers built a training pool of ~270,000 examples from four major sources: FLAN V2, CoT (Chain-of-Thought), Dolly, and Open Assistant 1.
To evaluate the effectiveness of LESS, they tested models on several benchmarks:
- MMLU: 57 tasks covering elementary math, US history, computer science, and more.
- TyDiQA: A multilingual question-answering dataset.
- BBH (Big-Bench Hard): A suite of 23 challenging reasoning tasks.
- GSM8K and TruthfulQA (used for additional validation).
Key Findings and Performance
- "Less is More": Training on just the top 5% of data selected by LESS frequently outperformed training on 100% of the data. For instance, on TyDiQA, the 5% LESS subset achieved a score of 56.2, beating the full 100% dataset (54.0). On BBH, the 5% subset scored 41.5, compared to 38.9 for random selection and 43.2 for the full dataset. This suggests that large instruction-tuning mixtures contain significant amounts of "noise" for specific tasks.
- Transferability is a Superpower: Data selected using a small model (e.g., Llama-2-7B) works remarkably well for training much larger models (13B) or models from entirely different families (Mistral). This means you can build your "gradient datastore" once using a cheap model and reuse it for many others.
- Reasoning over Surface Forms: Unlike simpler methods (like BM25) that look for keyword overlap, LESS identifies data based on the type of reasoning required. For a Bengali math problem, it might select an English math problem because the underlying logic—and thus the gradient—is similar.
- Optimizer Awareness Matters: The paper demonstrates that influence formulas must account for the Adam optimizer's internal states (like momentum) to be accurate. Standard SGD-based influence estimates performed significantly worse.
- Efficiency: While the initial setup (warmup and datastore building) takes about 54 GPU hours on an A100, selecting data for a new task once the datastore exists takes less than one minute.
Limitations and Future Work
While highly effective, LESS has a few limitations. First, the method still requires an initial warmup training phase on a random subset to be effective; directly using "off-the-shelf" pre-trained models for selection was much less successful. Second, LESS averages gradients across all tokens in a sequence. Moving toward token-level selection could be even more powerful, though it is currently too computationally expensive. Finally, the first-order approximation used assumes that the influence of multiple data points is simply the sum of their individual influences, which may not hold true for duplicate or highly redundant data.
Summary updated