NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

On the Inflation of KNN-Shapley Value

Ziao Yang, Han Yue, Jian Chen, Hongfu Liu · Submission to ICLR 2025 · Rejected

TL;DR

KNN-Shapley is a popular, retrain-free tool for data valuation, but it suffers from severe value inflation—causing many harmful training samples to be assigned positive values. The authors reveal that this inflation is driven by unrealistic, tiny training subsets considered during valuation, and introduce Calibrated KNN-Shapley (CKNN-Shapley) to eliminate these artifacts by constraining subset sizes. This simple semi-value calibration restores zero as a reliable threshold between beneficial and detrimental data, boosting performance across data cleaning, stream learning, and active learning.

What Problem Does This Paper Address?

In data-centric machine learning, determining which training samples help or hurt model performance is critical. Shapley value-based data valuation quantifies each sample’s average marginal contribution across all potential training subsets. However, classical Shapley requires exponential model retrainings ($2^N$), making it impractical for large models.

KNN-Shapley solved this computational bottleneck by using a K-Nearest Neighbors surrogate to compute exact Shapley values recursively in $\mathcal{O}(N \log N)$ time without retraining. Conventionally, practitioners assume that samples with Shapley value $\nu(z) > 0$ help performance, while those with $\nu(z) < 0$ hurt it.

The authors uncover a widespread failure mode: KNN-Shapley values are heavily inflated. Many samples with positive values actually degrade performance when included in training. For instance, on the SST-2 dataset, over 4,500 harmful samples are misidentified with positive values. Consequently, zero can no longer serve as a dependable threshold to prune toxic or mislabeled data.

Methods

The paper pinpoints the root cause of valuation inflation: unrealistic subset evaluations in cooperative game formulations.

  • When evaluating the farthest samples from a validation point ($z_{\alpha_N}$), KNN-Shapley gives them a positive marginal utility when subset sizes are tiny ($|S| \le K$) and labels match, even though these distant points have zero relevance in realistic subset sizes ($|S| > K$).
  • Because KNN-Shapley computes values recursively backward from the farthest point, these artificial non-zero rewards accumulate into massive positive bias for closer samples.

To fix this, the authors propose Calibrated KNN-Shapley (CKNN-Shapley):

  • Restricting Subset Size ($|S| \ge T$): CKNN-Shapley evaluates contributions only on subsets of size at least $T$, treating tiny subsets as unrepresentative proxies for the full dataset.
  • Semi-Value Formulation: Mathematically, it directly assigns zero valuation to the $T$ farthest samples: $$\nu^c(z_{\alpha_N}) = \dots = \nu^c(z_{\alpha_{N-T+1}}) = 0$$ $$\nu^c(z_{\alpha_{N-T}}) = \frac{\mathbb{I}[y_{\alpha_{N-T}} = y_v]}{N - T}$$ $$\nu^c(z_{\alpha_i}) = \nu^c(z_{\alpha_{i+1}}) + \frac{\mathbb{I}[y_{\alpha_i} = y_v] - \mathbb{I}[y_{\alpha_{i+1}} = y_v]}{\max\{K, i\}}$$
  • Default Parameter: Setting $T = N - 2K$ balances diversity of evaluated subsets with the exclusion of noisy, tiny subsets. Because $T$ values are set to 0 without recursive steps, CKNN-Shapley is even faster than standard KNN-Shapley.

Datasets

The authors evaluate CKNN-Shapley across nine benchmark datasets spanning tabular, image, and text modalities:

  • Image Datasets: MNIST, Fashion-MNIST (FMNIST), and CIFAR-10 (using pre-trained ResNet-50 embeddings; 2,048 dimensions).
  • Tabular/Scientific Datasets: Pol (telecommunication), Wind (meteorology), and CPU (hardware).
  • Text Datasets: AGNews, SST-2, and News20 (using Sentence-BERT embeddings; 384 dimensions).

Key Insights and Ideas

  • Tiny subsets cause false rewards: In tiny subsets, far-away samples artificially dominate the nearest-neighbor set simply because there are fewer than $K$ candidates. This inflates the base term of the recursive formula.
  • Restoring Zero as a Natural Cutoff: By eliminating the impact of small subsets, CKNN-Shapley shifts empirical classification thresholds back to near zero (e.g., reducing the threshold from $2.36 \times 10^{-4}$ for standard KNN-Shapley down to $0.60 \times 10^{-4}$ on average).
  • Beta Shapley exacerbates the problem: Methods like Beta Shapley intentionally weight smaller subsets more heavily. As a result, KNN-Beta Shapley assigns virtually all samples positive values, completely failing to detect detrimental points.
  • Model-agnostic cleaning: Detrimental data identified via CKNN-Shapley transfers effectively to non-KNN classifiers such as Logistic Regression, Support Vector Machines (SVM), and Multi-Layer Perceptrons (MLP).

Key Results

  • Detrimental Misidentification Ratio: KNN-Shapley misclassifies detrimental samples as beneficial more than 50% of the time across 6 of the 9 datasets (average misidentification ratio: 55.99%). CKNN-Shapley reduces this misidentification ratio to an average of 10.11% (achieving 0% on Pol, Wind, and CPU).
  • Model Performance Boost:
  • Removing samples with negative CKNN-Shapley values improves test accuracy on CIFAR-10 from 0.5956 (vanilla KNN) and 0.6456 (KNN-Shapley) to 0.7164.
  • On SST-2, removing negative CKNN-Shapley samples achieves 0.8980 accuracy versus 0.8160 for KNN-Shapley.
  • Noisy & Mislabeled Data: When up to 30% of labels are randomly flipped, CKNN-Shapley identifies mislabeled samples (which occupy negative value bins) and maintains nearly invariant model accuracy.
  • Online & Active Learning: In streaming/online settings, CKNN-Shapley discards fewer false-positive beneficial samples, outperforming baselines with fewer retained points. In active learning, training a 2-layer network to predict CKNN-Shapley values outperforms standard margin, entropy, and uncertainty sampling.

Limitations and Future Work

  • Heuristic Choice of $T$: While the authors demonstrate that $T = N - 2K$ consistently delivers the best empirical performance across diverse domains, the paper lacks a rigorous theoretical derivation for the optimal $T$.
  • Surrogate Reliance: Although demonstrated to transfer well to MLPs and SVMs, data valuation still depends on the feature space quality (e.g., pre-trained foundation embeddings like Sentence-BERT or ResNet-50) and the assumption that the KNN proxy reflects the target model's geometry.

Summary updated

BibTeX
@misc{yang2024inflation,
  author = {Ziao Yang and Han Yue and Jian Chen and Hongfu Liu},
  title = {{On the Inflation of KNN-Shapley Value}},
  year = {2024},
  eprint = {2405.17489},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.17489},
}
Figure