RICo: Refined In-Context Contribution for Automatic Instruction-Tuning Data Selection

Yixin Yang, Qingxiu Dong, Linli Yao, Fangwei Zhu, Zhifang Sui · OpenReview

Abstract

Data selection for instruction tuning is crucial for improving the performance of large language models (LLMs) while reducing training costs. In this paper, we propose Refined Contribution Measurement with In-Context Learning (RICo), a novel gradient-free method that quantifies the fine-grained contribution of individual samples to both task-level and global-level model performance. RICo enables more accurate identification of high-contribution data, leading to better instruction tuning. We further introduce a lightweight selection paradigm trained on RICo scores, enabling scalable data selection with a strictly linear inference complexity. Extensive experiments on three LLMs across 12 benchmarks and 5 pairwise evaluation sets demonstrate the effectiveness of RICo. Remarkably, on LLaMA3.1-8B, models trained on 15% of RICo-selected data outperform full datasets by 5.42% points and exceed the best performance of widely used selection methods by 2.06% points. We further analyze high-contribution samples selected by RICo, which show both diverse tasks and appropriate difficulty levels, rather than just the hardest ones.

Introduction

In the development of Large Language Models (LLMs), the prevailing paradigm has shifted from maximizing data quantity to optimizing data quality. While massive instruction-tuning datasets were once considered essential, recent research indicates that "data hunger" can lead to "data indigestion," where redundant or low-quality samples dilute model performance. Existing data selection methods often struggle with high computational costs (gradient-based) or insufficient accuracy (heuristics). RICo (Refined In-Context Contribution) addresses these challenges by using In-Context Learning (ICL) as a proxy for fine-tuning impact, allowing for efficient and precise data selection.

Methodology

The core principle of RICo is that ICL serves as an "implicit fine-tuning" mechanism. If a training sample, when provided as context, improves a model's performance on a separate assessment task, it is likely to be a high-quality candidate for actual fine-tuning.

The RICo pipeline for measuring data contribution and selecting optimal instruction-tuning subsets.

The RICo pipeline involves three primary stages:

  1. Assessment Set Construction: A curated set of 1,020 diverse tasks (math, coding, creative writing) serves as the benchmark for measuring contribution.
  2. Refined Contribution Measurement: RICo measures the reduction in perplexity (uncertainty) on the assessment set when a training sample is included in the context. To eliminate length bias, a "Fairness Adjustment" compares the sample against a meaningless string of equal length.
  3. Scalable Selection Paradigm: To handle large-scale datasets, a lightweight selection model is trained on a small subset of RICo scores using Low-Rank Adaptation (LoRA). This model can then filter millions of samples with linear inference complexity.

Experimental Results

Experiments were conducted using LLaMA3.1-8B, Qwen2.5-3B, and LLaMA2-7B across 12 benchmarks (including MMLU, IFEval, and GSM8K).

The 15% Optimal Subset

A key finding is the existence of an "inverted U-curve" in model performance relative to data volume. As shown in the figure below, performance peaks when using approximately 15% of the highest-contribution data.

Model performance across different training data percentages, highlighting the 15% optimal subset.

Beyond this 15% threshold, adding more data actually degrades performance, suggesting that the remaining 85% of the dataset acts as noise. On LLaMA3.1-8B, the 15% subset outperformed the full 100% dataset by an average of 5.42 percentage points.

Efficiency and Baselines

RICo-selected models achieved superior results while utilizing significantly fewer FLOPs—ranging from 1/5th to 1/100th of the computational resources required for full-dataset training. Furthermore, RICo consistently outperformed state-of-the-art selection methods like Deita and Alpagasus by an average of 2.06 points.

Analysis: Difficulty vs. Contribution

Analysis of the selected samples reveals that RICo does not simply select the most difficult tasks. Instead, it favors "appropriately difficult" samples that provide clear learning signals while avoiding extreme outliers that may be nonsensical or overly niche. This balanced approach ensures both task diversity and instructional clarity.

Conclusion

RICo demonstrates that strategic data selection can significantly enhance LLM performance while drastically reducing training costs. By leveraging ICL as a fine-grained contribution metric, RICo identifies the most impactful 15% of training data, turning "data indigestion" into refined model intelligence. Future work will explore the application of RICo to specialized domains by tailoring the assessment sets to specific fields like medicine or law.

Summary updated

BibTeX
@inproceedings{yang2026rico,
  author = {Yixin Yang and Qingxiu Dong and Linli Yao and Fangwei Zhu and Zhifang Sui},
  title = {{RICo: Refined In-Context Contribution for Automatic Instruction-Tuning Data Selection}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i40.40732},
}
Figure