NICE Data Selection for Instruction Tuning in LLMs with Non-differentiable Evaluation Metric

Jingtan Wang, Xiaoqiang Lin, Rui Qiao, Pang Wei Koh, Chuan-Sheng Foo, Bryan Kian Hsiang LowICML 2025

In the realm of Large Language Models (LLMs), bigger isn't always better—especially concerning training data. While instruction tuning is essential for transforming a raw base model into a helpful assistant, the quality of the tuning data often outweighs the sheer quantity.

The paper "NICE: Data Selection for Instruction Tuning in LLMs with Non-differentiable Evaluation Metric" introduces an innovative approach to curating these datasets. Instead of relying on simple training loss, NICE focuses on what truly matters: the final, task-specific performance metrics.

The Problem with Loss-Based Selection

Most existing data selection methods rely on Next-Token Prediction (NTP) loss as a proxy for data quality. The underlying assumption is straightforward: if a training example helps reduce the model's loss on a validation set, it is considered a "good" data point.

However, the authors highlight a significant flaw in this logic: minimizing loss does not consistently maximize performance. For complex tasks such as coding or long-form text generation, the metrics we actually care about—like whether code passes unit tests or if a summary is genuinely helpful—are non-differentiable. You cannot easily calculate a gradient for a binary "pass/fail" outcome in the same way you can for the probability of the next word.

As illustrated below, there is often a stark discrepancy: the training step with the lowest loss can actually correspond to the worst performance on the actual task reward.

Discrepancy between NTP loss and reward model performance

The NICE Approach

NICE (Non-differentiable evaluation metric-based InfluenCe Estimation) tackles the data selection problem through the lens of Reinforcement Learning (RL).

  1. Policy Gradient for Influence: NICE treats the LLM as a "policy" and the evaluation metric (e.g., a reward model or unit test) as a "reward." By employing the "log derivative trick" common in RL, the authors estimate the gradient of these non-differentiable metrics.
  2. Influence Estimation: The framework calculates the "influence" of each training point by measuring how well its gradient aligns with the policy gradient of the validation metric.
  3. Label-Free Selection: Because many evaluation metrics (like reward models) only require the model's output and not a ground-truth label, NICE can perform data selection even when validation labels are absent.
  4. Assisted Monte-Carlo (AMC): If the model being tuned is too weak to generate high-quality responses for validation, NICE can utilize a "teacher" model (such as GPT-4) to generate responses. This provides a cleaner signal for what the model should be learning.

Datasets and Evaluation

The authors evaluated NICE across four diverse tasks:

  • AlpacaEval: General instruction following (measured by length-controlled win rate).
  • TLDR: Text summarization (measured by a reward model).
  • RLHF: Human preference alignment (measured by a reward model).
  • HumanEval: Python code generation (measured by the pass@k metric).

They tested selection from both task-agnostic pools (like the diverse Tulu dataset) and task-aware pools (specifically curated for coding or RLHF).

Key Results

NICE consistently outperformed state-of-the-art loss-based methods, such as LESS, across various models (Llama2-7B, Mistral-7B) and tasks.

  • Outperforming the Full Dataset: Remarkably, training on just the top 5% of data selected by NICE often yielded better results than training on 100% of the data. For instance, on AlpacaEval with Llama2-7B, NICE achieved a 30.45 win rate, whereas the full dataset only reached 22.59.
  • Superiority over Baselines: NICE consistently beat the loss-based baseline (LESS), confirming that the policy gradient approach captures task-relevant information that simple loss gradients miss.
Comparison of NICE against various baselines

Limitations and Future Work

The primary trade-off for NICE's accuracy is its computational cost. Because NICE requires generating multiple responses (Monte-Carlo sampling) to estimate the policy gradient, it is significantly slower than loss-based methods.

Future work could focus on making the gradient computation more efficient, perhaps by reducing the number of samples needed or finding faster ways to approximate influence without full generation passes. Additionally, the method's success is inherently tied to the quality of the reward model or evaluation metric used; a biased metric will lead to biased data selection.

Summary updated

BibTeX
@inproceedings{wang2025nice,
  author = {Jingtan Wang and Xiaoqiang Lin and Rui Qiao and Pang Wei Koh and Chuan-Sheng Foo and Bryan Kian Hsiang Low},
  title = {{NICE Data Selection for Instruction Tuning in LLMs with Non-differentiable Evaluation Metric}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=2wt8m5HUBs},
}
Figure