Holdout-Loss-Based Data Selection for LLM Finetuning via In-Context Learning

Ling Zhang, Xianliang Yang, Juwon Yu, Park Cheonyoung, Lei Song, Jiang Bian

The "Garbage In, Garbage Out" Problem in Fine-Tuning

Fine-tuning is the critical "last mile" of Large Language Model (LLM) development, aligning raw predictive power with human preferences. However, this process is highly sensitive to data quality. Recent studies suggest that 20–40% of preference data used in alignment is noisy, off-target, or inconsistent. While a small amount of "gold-standard" data yields better results than a mountain of "bronze-standard" data, identifying those high-value nuggets is traditionally expensive and complex.

Existing data selection methods usually fall into two camps:

  1. Heuristics: Relying on simple metrics (like response length) or qualitative "vibes" to filter data, which often lacks theoretical grounding.
  2. Expensive Retraining: Methods like RHO-Loss require training a separate "reference model" on a holdout set to score the rest of the training data. This process is computationally heavy and difficult to scale.

To address this, researchers have developed a principled, resource-efficient framework for data selection and reweighting based on In-Context Approximation (ICA).

The Solution: In-Context Approximation (ICA)

The core innovation of this paper builds on a Bayesian concept: the most valuable training example is the one that most effectively reduces the model's loss on a high-quality holdout set.

To avoid the massive computational bill of actually retraining a model to test this, the authors leverage a fascinating property of LLMs: In-context learning (ICL) can mimic the effects of gradient-based updates. Instead of updating the model's weights to see how it performs on the holdout set, the framework provides a small sample of the holdout set as demonstrations directly in the prompt.

The system then calculates an ICA Score for each candidate training example:

  • ICA Score = [Loss on example] - [Loss on example given the holdout set in context]

A high score indicates that the holdout set "helped" the model understand that specific example, suggesting the example is highly relevant to the target behavior.

Rather than simply discarding "low-value" data—which can harm batch diversity—the framework uses these ICA scores to dynamically reweight gradients during training. High-value examples are given a louder "voice" in the optimization process, while noisy or irrelevant examples are turned down.

Experimental Setup and Efficiency

The authors tested their method across several scenarios, including Supervised Fine-Tuning (SFT) and preference optimization (DPO/SimPO). Datasets included:

  • High-Quality Selection: Alpaca (training) vs. Alpaca-cleaned (holdout), and UltraFeedback-binarized.
  • Domain-Relevant Selection: Yahoo Answers Topics and StanfordNLP/SHP-2 (prioritizing specific domains).
  • Noise Robustness: A corrupted version of GSM8K where 40% of the chain-of-thought explanations were intentionally sabotaged.

Crucially, ICA is highly efficient. Because it bypasses the need for a reference model, ICA adds only ~1.5% overhead to training time, compared to ~10% for RHO-Loss or the massive overhead of influence-function methods. Furthermore, the framework only requires a tiny in-context holdout set (e.g., $k=3$ similar examples found via k-Nearest Neighbors) to provide a strong signal.

Key Results

Tested on LLaMA-3 (3B/8B) and Qwen (4B/8B), the ICA framework demonstrated superior alignment and robust noise filtering.

Win rates of ICA-reweighted models against baselines on SFT datasets (Alpaca and Yahoo Answers).
Win rates of ICA-reweighted models against baselines on preference optimization datasets (UltraFeedback and StanfordNLP).

As shown in the tables above (where a score >50 indicates a win for the ICA method), the dynamic reweighting approach yielded several major successes:

  • Superior Alignment: In head-to-head GPT-4o evaluations, ICA-reweighted models consistently beat standard training (the "w/o" column), often achieving win rates of 70-80%.
  • Matching Expensive Baselines: ICA consistently outperformed "One-shot learning" baselines and matched or slightly exceeded the performance of the computationally expensive RHO-Loss method.
  • Noise Filtering: On the corrupted GSM8K dataset, ICA-based reweighting recovered nearly all the performance lost to noise, proving it can effectively "ignore" bad data by down-weighting it dynamically as the model learns.

Limitations and Future Work

While highly effective, the ICA framework has a few limitations:

  • The "Gold" Requirement: The method's success is entirely dependent on having a high-quality holdout set. If the holdout set is biased or noisy, the resulting data selection will be compromised.
  • Embedding Dependency: The quality of the kNN search used to find the best in-context examples depends heavily on the embedding model (e.g., all-mpnet-base-v2). Upgrading to stronger embedding models can further improve results.
  • On-Policy Drift: The current paper focuses on off-policy settings (SFT, DPO). Applying ICA to on-policy Reinforcement Learning (like PPO)—where the model generates its own data on the fly and the "training set" constantly shifts—remains a computational challenge for future research.

Summary updated

BibTeX
@inproceedings{zhang2026holdout,
  author = {Ling Zhang and Xianliang Yang and Juwon Yu and Park Cheonyoung and Lei Song and Jiang Bian},
  title = {{Holdout-Loss-Based Data Selection for LLM Finetuning via In-Context Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=Cw9Bxpda2h},
}
Figure