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

Yixin Yang, Qingxiu Dong, Linli Yao, Fangwei Zhu, Weilin Luo, Bin Wang, Zhifang Sui

TL;DR

RICO (Refined In-Context Contribution) is a novel, gradient-free data selection method for LLM instruction tuning that uses in-context learning to quantify the fine-grained value of individual training samples. By filtering out low-contribution data and correcting for length bias, RICO selects a high-quality 15% subset of data that actually outperforms training on the full dataset while slashing computational costs by up to 80%.

What Problem Does This Paper Address?

Instruction tuning is essential for transforming raw base language models into helpful assistants, but training on massive, uncurated datasets is computationally wasteful and often introduces noisy or redundant signals.

To solve this, researchers use automated data selection. However, existing approaches suffer from a nasty trade-off:

  1. Gradient-based methods accurately calculate a sample’s influence on a model but are incredibly expensive computationally.
  2. Heuristic-based methods (like measuring text length or keyword diversity) are cheap but rely on human intuition and fail to capture how data actually impacts model training.
  3. In-context probing (ICP) methods use the model's in-context learning (ICL) ability as a proxy for fine-tuning, but they typically provide only coarse, binary signals, suffer from a severe bias toward longer text samples, and require a massive number of inference calls.

RICO bridges this gap by providing a fine-grained, gradient-free, and length-agnostic contribution score that scales efficiently to large datasets.

Methods

The RICO framework consists of three core components:

  1. Assessment Set Construction: The authors curate a high-quality reference set of 1,020 diverse instructions spanning various tasks, sourced from ChatGPT, GPT-4, and human-generated data (Dolly-15K). This serves as the ground-truth benchmark for evaluating data quality.
  2. Refined Contribution Quantification (RICO Score): To measure a training sample's value, RICO inserts it as an in-context exemplar and measures the change in the model's perplexity on the assessment set. Crucially, the authors introduce a Fairness Adjustment to counteract the natural tendency of language models to yield lower perplexity for longer inputs. They establish a baseline by replacing the training sample with a semantically meaningless, random token sequence of the identical length. The true task-level RICO score is the performance lift over this length-matched baseline.
  3. RICO-guided Selection Paradigm: Evaluating every training sample against every assessment sample would require $O(nm)$ inference calls. To make this scalable, RICO trains a lightweight selection model (using LoRA on the target LLM) on a small scored subset. This model learns to classify whether a sample is "high-contribution" based on its text, reducing the full dataset selection complexity to a strictly linear $O(m)$ inference cost.
Overview of the RICO Method

Datasets

  • Candidate Training Sets: The classic Stanford Alpaca dataset (52,002 samples) and WizardLM-70K (used to test cross-dataset generalization).
  • Assessment Sources: OpenOrca-GPT3.5, OpenOrca-GPT4, and Dolly-15K.
  • Evaluation Suite: 12 benchmarks categorized into:
  • Instruction Following: IFEval, AlpacaEval.
  • Knowledge: GLUE, GPQA, MMLU, TruthfulQA.
  • Reasoning: ARC, BBH, HellaSwag, LogiQA, MuSR, Winogrande.
  • Pairwise Test Sets: Human-curated sets from Vicuna, Koala, WizardLM, SInstruct, and LIMA.

Key Insights and Ideas

  • The Perplexity Length Bias: The paper highlights a subtle trap in data selection: LLM perplexity naturally drops as context gets longer, even if that context is pure gibberish. RICO's length-controlled random baseline successfully isolates actual semantic contribution from length artifacts.
  • The "Less is More" Sweet Spot: As shown in the data scale analysis, model performance peaks when trained on the top 15% of RICO-selected data. Adding more data beyond this point actually degrades performance, proving that low-quality data dilutes beneficial training signals.
Model performance across varying proportions of RICO-selected data
  • The Goldilocks Zone of Difficulty: Conventional wisdom suggests that harder instructions are always better for tuning. However, RICO’s distribution analysis reveals that high-contribution samples favor moderately challenging data while actively avoiding extreme difficulty outliers, which might just be noisy or unlearnable formatting anomalies.
Difficulty distribution of top 15% high-contribution samples vs. full dataset

Key Results

  • Performance Boost: On LLaMA3.1-8B, training on just 15% of RICO-selected Alpaca data outperformed the full dataset baseline by 5.42 percentage points on average across all 12 benchmarks.
  • Baseline Defeat: RICO outperformed prominent data selection baselines—including Alpagasus, Deita, and Superfilter—by up to 2.06 percentage points on average.
  • Compute Efficiency: Models trained on RICO subsets required only 1/5 to 1/100 of the training FLOPs compared to full-dataset training.
  • Strong Generalization: A RICO selection model trained purely on Alpaca data was directly applied to filter the WizardLM dataset, where it achieved a 4.54 percentage point improvement over the full WizardLM baseline using only 5% of the data.

Limitations and Future Work

The authors note that while in-context learning acts as an excellent proxy for fine-tuning, it is an implicit approximation and does not perfectly mirror the exact weight update dynamics of full-batch gradient descent. Additionally, the current implementation is tailored specifically for instruction tuning; adapting RICO to other domains (like alignment or pre-training) would require redesigning the assessment sets and reformulating the global scoring metrics.

Summary updated

BibTeX
@inproceedings{yang2026rico,
  author = {Yixin Yang and Qingxiu Dong and Linli Yao and Fangwei Zhu and Weilin Luo and Bin Wang 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