IN THIS BREAKDOWN · 10 SECTIONS
You can read 20% of this breakdown.
The paper in one minute
The setting is targeted instruction tuning: you have a big, mixed pool of instruction data (here about 270,000 examples from FLAN v2, CoT, Dolly and Open Assistant) and a handful of examples of the capability you want, and you want to pick the training subset that builds that capability.
LESS (Low-rank gradiEnt Similarity Search) uses a first-order idea from earlier influence work: if training on example z moves the model's weights in a direction that also lowers the loss on target example z′, then z helps. With SGD that is the dot product of the two gradients. LESS adapts it in three ways. It uses the Adam update direction for the training example, since instruction tuning uses Adam. It uses cosine instead of a dot product, because an example's gradient averages over its tokens and so shrinks for long examples, which made the dot product pick very short data. And it makes the computation cheap with LoRA gradients and a random projection to 8,192 dimensions.
The steps: warm up a LoRA model on a random 5% of the pool for 4 epochs; compute and store every example's projected gradient at each checkpoint; for each target subtask, average the target examples' gradients and score every candidate by cosine similarity, summed over checkpoints; keep the top 5% and train the target model on it.
The selected 5% beat a random 5% everywhere and beat the full pool in 5 of 9 cases across LLaMA-2-7B, LLaMA-2-13B and Mistral-7B. Data selected with LLaMA-2-7B worked for the other two models. Word-frequency, n-gram and hidden-state selectors did not beat random consistently.
Research notes: the problem, approach and results
model-task cells where training on the LESS-selected 5% beat training on the full pool
one-time cost to warm up and compute gradients for about 270K examples; selecting for a new task takes under a minute
average length of examples picked with dot products instead of cosine, against 105 for random picks
Teams have large mixed instruction datasets but want a model good at one skill. Training on everything can dilute or even hurt that skill, and picking data by keyword or embedding similarity finds examples that look like the target rather than ones that teach it.
Estimate each training example's influence on a few target examples from gradients: warm up a LoRA model briefly, store each example's Adam-adjusted LoRA gradient projected to 8,192 dimensions, and pick the examples with the highest cosine similarity to the target's average gradient.
On MMLU, TydiQA and BBH, the LESS-selected 5% beat a random 5% on every model and beat the full 270K-example pool in 5 of 9 model-task cells. Data chosen with a 7B model's gradients also worked for a 13B model and for Mistral-7B. Keyword, n-gram and embedding selectors did about as well as random or worse.
Why it matters to an FDE
Customers often arrive with a pile of data (old tickets, chat logs, generic instruction sets) and a short list of examples of what they want the model to do well. The usual moves are to fine-tune on everything or to filter by keyword or embedding similarity. This paper shows both can be worse than a principled selection, and gives a method that is affordable.
Less data can be better. Training on the selected 5% beat the full pool in 5 of 9 cells, because much of a generic pool is irrelevant or harmful for a specific skill. The authors also note that fine-tuning on this pool lowered MMLU below the untuned base model for LLaMA-2-13B and Mistral-7B, a reminder that fine-tuning can take capability away.
Similar-looking is not the same as useful. Selecting by words, n-grams or the model's hidden representations picked data on the same topic or in the same language, and scored about as well as random or worse. Gradients pick data that exercises the same reasoning.
The cost is front-loaded and reusable. About 54 A100 hours and 17.7 GB of storage for 270K examples, once. After that, each new target skill is a sub-minute query. A team serving several customers or skills from one data pool pays the cost once.
Understand the mechanism. Try it on a real problem.
Unlock this breakdown and 149 more papers.
Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.
6 months · One payment · No auto-renewal
- ◇1 architecture diagram
- </>1 runnable code experiment
- ▦2 results tables
- ?5 interview questions with answers
- 03Key takeaways
What made selection work, what each choice was worth, transfer, and three misreadings
Free account - 04How it works
The influence formula with Adam, the length problem, the datastore and the selection rule
Premium - 05The numbers that matter
Main results with variance, baselines, costs, ablations and the transfer results
Premium - 06Try it yourself
Check the paper's tables, then select data by gradients on a toy pool and watch the length bias
Premium - 07Where it breaks
Up-front compute, fixed 5%, uneven gains, fragile transfer, loss versus accuracy and slips
Premium - 08Using it on a deployment
Building a gradient datastore from a customer's data and selecting for each skill they care about
Premium - 09Interview angles
Five questions this paper prepares you for, with answer hints
Premium - 10Read next
Where to go from here on this site
Premium
