Influence Functions for Efficient Data Selection in Reasoning

Prateek Humane, Paolo Cudrano, Daniel Z Kaplan, Matteo Matteucci, Supriyo Chakraborty, Irina Rish

TL;DR

Current methods for curating chain-of-thought (CoT) reasoning data rely on indirect heuristics like solution length or problem difficulty. This paper introduces an influence-function approach that directly measures each training example's causal impact on downstream reasoning accuracy. Pruning unhelpful or actively harmful reasoning data using these scores outperforms perplexity and embedding-based baselines within a model family, though cross-family data transfer remains an open challenge.

What Problem Does This Paper Address?

Recent work shows that fine-tuning large language models (LLMs) on small, meticulously curated reasoning datasets can match or exceed training on massive datasets. However, defining data "quality" remains a major open question.

Standard heuristic filters (such as selecting for longer traces, higher difficulty, or topic diversity) and automated instruction-tuning methods (like perplexity filtering or embedding clustering) only offer indirect proxies for performance. They cannot quantify whether fine-tuning on a specific problem causally improves or degrades a model’s problem-solving behavior. The authors address this gap by directly calculating the causal contribution of individual training points to downstream task accuracy.

Methods

The authors frame data pruning around influence functions (IFs) using an empirical Kronecker-factored approximate curvature (EK-FAC) approximation applied to MLP layers:

  1. Behavioral Partitioning on Validation Data: They fine-tune a base model ($\theta$, LLaMA-3-8B-Instruct) on the LIMO dataset to obtain $\theta^{\text{LIMO}}$ and evaluate greedy completions on MATH500 before and after training. This partitions validation queries into:
  2. $\mathcal{C}$ (Correct): Queries the base model failed, but the fine-tuned model solved.
  3. $\mathcal{I}$ (Incorrect): Queries the base model solved, but fine-tuning broke.
  4. Influence Scoring: Using cross-entropy loss on completions, they compute the influence score $\mathcal{I}(d; v)$ of each training point $d$ with respect to each validation point $v \in \mathcal{C} \cup \mathcal{I}$, then aggregate raw scores ($s_{\mathcal{C}}, s_{\mathcal{I}}$) and rank-based positions ($r_{\mathcal{C}}, r_{\mathcal{I}}$) to prevent outlier query bias.
  5. Pruning Strategies:
  6. Correct: Prune the bottom 20% that contribute least to correct completions.
  7. Incorrect: Prune the top 10% that most strongly push the model toward wrong answers.
  8. Combined: Prune the 10% satisfying both criteria.
  9. Aggressive Combined: Prune 50% based on normalized score differentials.

Datasets

  • Training Dataset: LIMO (a curated dataset of ~800 complex reasoning examples).
  • Validation (Target) Set: MATH500 (used to identify improved vs. degraded queries and compute influence).
  • Evaluation Benchmarks:
  • Math reasoning: GSM8k, AMC23, AIME24, and OlympiadBench.
  • General scientific reasoning (out-of-domain transfer): GPQA.
  • No new benchmarks were introduced.

Key Insights and Ideas

  • Harmful examples have long tails: In the distribution of influence scores on incorrect queries ($s_{\mathcal{I}}$), a small group of high-influence outliers disproportionately steers the model toward errors. Removing this small subset yields disproportionate gains.
  • Math fine-tuning degrades broad reasoning, but pruning helps: Supervised fine-tuning solely on math reasoning severely degrades general scientific reasoning on GPQA (dropping from 0.2973 zero-shot to 0.1199 post-SFT). Pruning harmful math data mitigates this degradation (up to 0.1654 for 10% pruning and 0.2134 for 50% pruning).
  • Reasoning data quality may be model-dependent: Data subsets selected using LLaMA-3-8B-Instruct did not consistently transfer improvements when used to fine-tune Qwen2.5-Math-7B-Instruct, suggesting that data quality in reasoning is partly specific to model architecture and pretraining rather than purely intrinsic to the data.

Key Results

Evaluated on LLaMA-3-8B-Instruct (pass@1, $N=8$, zero-shot CoT):

  • 10% Pruning (90% data kept):
  • GSM8k: Combined achieves 0.8113 (vs. 0.7722 unpruned, 0.7839 Random, 0.8052 Mid-PPL, 0.8015 RDS+).
  • AMC23: Combined achieves 0.1156 (vs. 0.0813 unpruned, 0.1094 Random).
  • OlympiadBench: Combined achieves 0.0880 (tied with RDS+; vs. 0.0685 unpruned).
  • GPQA: Combined achieves the highest post-SFT score of 0.1654 (vs. 0.1199 unpruned).
  • 50% Pruning (Aggressive):
  • Combined (50%) remains competitive or superior to baselines, achieving 0.7981 on GSM8k and 0.0969 on AMC23 (beating Random and PPL baselines).
  • Cross-Family Transfer:
  • When fine-tuning Qwen2.5-Math-7B-Instruct on subsets pruned via LLaMA-3, no strategy reliably beat Random across all benchmarks.

Limitations and Future Work

  • High Computational Cost: Inverting Hessians and computing per-example gradients at scale is compute-intensive, limiting its immediate use on massive corpora.
  • Dataset Scale: Experiments were restricted to LIMO, which is already heavily curated; testing on uncurated, large-scale reasoning pools (e.g., Open-R1) is needed.
  • Evaluation Variance: Results are reported from single training runs without confidence intervals.
  • Static Quality Assumption: Influence is treated as static, whereas data utility likely evolves as a model improves over the course of training.

Summary updated

BibTeX
@inproceedings{humane2025influence,
  author = {Prateek Humane and Paolo Cudrano and Daniel Z Kaplan and Matteo Matteucci and Supriyo Chakraborty and Irina Rish},
  title = {{Influence Functions for Efficient Data Selection in Reasoning}},
  booktitle = {FoRLM @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=zpXDLJ463g},
}

Loading related content...

Figure