TRIM: Token-wise Attention-Derived Saliency for Data-Efficient Instruction Tuning
Manish Nagaraj, Sakshi Choudhary, Utkarsh Saxena, Deepak Ravikumar, Kaushik Roy
TL;DR
TRIM introduces a token-centric, forward-only data-selection method for instruction tuning that leverages attention-derived token fingerprints from a small target set to identify high-signal examples. It builds fingerprints by aggregating token saliency from multi-layer attention and matches candidate samples to these fingerprints via cosine similarity, yielding a robust, one-pass scoring process. Empirically, TRIM achieves up to 9% improvement with only 5% coresets, surpasses some full-data fine-tuning results, and transfers effectively across models, while reducing length bias and enabling task-adaptive data selection. This approach offers a scalable, efficient alternative for constructing high-quality instruction-tuning datasets in large-scale settings, reducing computational cost without sacrificing performance. The work demonstrates substantial practical impact for data selection in LLM fine-tuning, particularly in resource-constrained or rapidly evolving scenarios where data quality matters more than sheer quantity.
Abstract
Instruction tuning is essential for aligning large language models (LLMs) to downstream tasks and commonly relies on large, diverse corpora. However, small, high-quality subsets, known as coresets, can deliver comparable or superior results, though curating them remains challenging. Existing methods often rely on coarse, sample-level signals like gradients, an approach that is computationally expensive and overlooks fine-grained features. To address this, we introduce TRIM (Token Relevance via Interpretable Multi-layer Attention), a forward-only, token-centric framework. Instead of using gradients, TRIM operates by matching underlying representational patterns identified via attention-based "fingerprints" from a handful of target samples. Such an approach makes TRIM highly efficient and uniquely sensitive to the structural features that define a task. Coresets selected by our method consistently outperform state-of-the-art baselines by up to 9% on downstream tasks and even surpass the performance of full-data fine-tuning in some settings. By avoiding expensive backward passes, TRIM achieves this at a fraction of the computational cost. These findings establish TRIM as a scalable and efficient alternative for building high-quality instruction-tuning datasets.
