TRIM: Token-wise Attention-Derived Saliency for Data-Efficient Instruction Tuning

Manish Nagaraj, Sakshi Choudhary, Utkarsh Saxena, Deepak Ravikumar, Kaushik Roy

Instruction tuning is the critical step that transforms a raw, pretrained Large Language Model (LLM) into a highly capable assistant. However, training on massive, diverse datasets is computationally expensive and often introduces redundant information. To optimize this process, researchers seek to identify "coresets"—small, high-quality subsets of data that can achieve comparable or superior results to the full dataset.

The primary challenge in coreset curation is that existing selection methods are either computationally prohibitive or too coarse. Most rely on sample-level signals, such as gradient calculations, which evaluate entire sequences rather than the specific tokens carrying task-defining information.

To address these inefficiencies, researchers introduce TRIM (Token Relevance via Interpretable Multi-layer Attention), a forward-only, token-centric framework. By analyzing token-level attention patterns rather than gradients, TRIM outperforms state-of-the-art methods by up to 9% while operating at a fraction of the computational cost.

The Problem with Sample-Level Signals

When selecting data for fine-tuning, traditional methods evaluate the model's loss drop or gradient across an entire sample. This approach introduces three major bottlenecks:

  1. Computational Cost: Calculating gradients for every sample in a massive candidate pool requires memory-intensive backward passes.
  2. Length Bias: Sample-level scores are often confounded by sequence length. Gradient-based methods tend to favor short, dense examples, inadvertently filtering out longer, more complex reasoning chains.
  3. Loss-Centric Bias: In a complex instruction, only a few critical tokens (e.g., mathematical operators or logical connectives) may define the task. Standard methods distribute credit uniformly across the entire sample, diluting the signal from these essential tokens.

The TRIM Framework: A Token-Centric Approach

TRIM shifts the paradigm from the sample to the token. It operates in two primary stages using only forward passes, eliminating the need for backpropagation and drastically reducing compute time.

Stage I: Building Token Fingerprints

Given a small "target set" of examples representing the desired task, TRIM identifies the most critical tokens using Attention-Derived Saliency. It evaluates two metrics:

  • Row Saliency: Measures how focused a token's attention is. Low entropy indicates the token is attending to specific, important information.
  • Column Saliency: Measures how much attention a token receives from others. High received attention suggests the token acts as an information "hub."

By combining these metrics, TRIM generates a structural "fingerprint" for different token classes, capturing the underlying representational patterns of the task.

Stage II: Scoring Candidates

TRIM then evaluates a large candidate pool. For every token in a candidate sample, it calculates a similarity score against the fingerprints generated in Stage I. A robust pooling function—combining mean, max, and a coverage bonus—aggregates these token-level scores into a single relevance score for the entire sample. Samples containing tokens that closely match the target task's fingerprints receive the highest scores.

Experimental Setup

The researchers evaluated TRIM using a massive candidate pool of 270,679 examples aggregated from Dolly, CoT (Chain of Thought), OASST1, and FLAN V2. The resulting coresets were tested across rigorous benchmarks:

  • MMLU: General knowledge across 57 subjects.
  • BBH (Big-Bench Hard): Challenging logic and reasoning tasks.
  • TyDiQA: Multilingual question answering.
  • GSM8K: Grade-school math word problems.
  • MATHINSTRUCT: A specialized math corpus for in-domain selection.

Key Findings and Results

TRIM demonstrates significant improvements in efficiency, performance, and data quality:

  • Superior Performance: Using only a 5% coreset, TRIM achieved a mean accuracy of 48.56%, outperforming the strongest gradient-based baseline (LESS, which scored 48.27%).
  • Surpassing Full Data: On the TyDiQA benchmark, models trained on TRIM's 5% coreset outperformed those trained on 100% of the dataset.
  • Massive Efficiency Gains: TRIM completed the selection process in just 4.4 hours. In contrast, baseline methods LESS and S2L required 35.7 hours and 87.9 hours, respectively.
  • Enhanced Mathematical Reasoning: In the GSM8K task, TRIM outperformed the next best method by approximately 8.8%, proving its ability to identify latent reasoning structures even when selecting from non-math pools.
  • Mitigating Length Bias: TRIM naturally selects a broader distribution of sequence lengths. In GSM8K tests, TRIM's selected samples were 38% to 72% longer than those chosen by baselines, successfully capturing richer reasoning chains.
  • Cross-Model Transferability: Coresets selected using a smaller model (e.g., LLaMA-2-7B) transfer remarkably well to larger models (LLaMA-2-13B) or different architectures (Mistral-7B), allowing researchers to use cheaper models for data curation.

Limitations and Future Directions

While highly effective, TRIM has a few limitations. It requires a brief "warmup" phase where the model is fine-tuned on a small random subset (5%) to prime the attention layers. Additionally, as a data selection tool, TRIM inherently reflects the biases of its target set; if the fingerprint examples are biased, the resulting coreset will be as well, necessitating standard safety filtering. Finally, the authors note an intriguing connection between TRIM's methodology and "Linguistic Collapse" (where token representations align toward class centroids), presenting an open question for future research into the causal mechanisms of attention-based selection.

Summary updated

BibTeX
@inproceedings{nagaraj2026trim,
  author = {Manish Nagaraj and Sakshi Choudhary and Utkarsh Saxena and Deepak Ravikumar and Kaushik Roy},
  title = {{TRIM: Token-wise Attention-Derived Saliency for Data-Efficient Instruction Tuning}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=25AaIQjAg9},
}
Figure