TL;DR
This paper refines the state-of-the-art "Data Shapley" valuation method for $K$-Nearest Neighbor (KNN) models by introducing a more natural and accurate utility function. The new approach, dubbed soft-label KNN-SV, fixes a subtle flaw in how small data subsets are evaluated, maintaining the highly efficient $O(N \log N)$ exact computation time while consistently outperforming the original method at detecting mislabeled training data.
What Problem Does This Paper Address?
Data valuation answers a crucial question in modern machine learning: How much does an individual data point contribute to a model's performance? This is vital for building equitable data marketplaces and debugging datasets (e.g., finding mislabeled examples).
The gold standard for this task is the Shapley value (SV), a concept borrowed from cooperative game theory. However, computing exact Shapley values typically requires training a model on an exponential number of data subsets, making it computationally prohibitive for large datasets.
In 2019, Jia et al. discovered a remarkable exception: for unweighted KNN models, the exact Data Shapley can be computed efficiently in $O(N \log N)$ time. However, this paper points out a flaw in their formulation. The original utility function artificially penalized small subsets (where the number of available samples is less than $K$) by dividing their performance by a fixed $K$ rather than the actual subset size. This paper corrects that formulation to better reflect how soft-label KNN classifiers actually behave in practice.
Methods
The authors introduce soft-label KNN-SV by redefining the utility function.
- Refined Utility Function: When evaluating a subset of data $S$, if the subset size is smaller than $K$, the new utility function calculates the true likelihood by dividing by $|S|$ instead of $K$. If the subset is empty ($|S| = 0$), the utility defaults to a random guess ($\frac{1}{C}$, where $C$ is the number of classes).
- Exact Recursive Algorithms: Despite the more complex, conditional utility function, the authors mathematically derive new recursive formulas for both KNN classification (Theorem 2) and KNN regression (Theorem 5). Crucially, these formulas preserve the original $O(N \log N)$ time complexity per validation point.
- Corrected LSH Approximation: To handle massive datasets where sorting the entire training set is too slow, the authors extend a Locality Sensitive Hashing (LSH) approximation algorithm. Along the way, they provide a refined theoretical analysis (Theorem 4) that corrects mathematical flaws in prior literature (He et al., 2012), which had relied on vacuous assumptions about data point distributions.
Datasets
The authors evaluated their method across 13 standard classification datasets commonly used in data valuation benchmarks:
- Image Datasets: MNIST, FMNIST, and CIFAR10 (using feature vectors extracted from a pre-trained ResNet18 to differentiate between dogs and cats).
- Tabular/Other Datasets from OpenML: Click, Fraud, Creditcard, Vehicle, Apsfail, Phoneme, Wind, Pol, CPU, and 2DPlanes.
For tabular datasets, the authors balanced positive and negative labels via subsampling.
Key Insights and Ideas
- The Small-Subset Flaw Matters: The original KNN-SV method didn't properly evaluate a true soft-label KNN when data subsets were small, skewing the resulting data valuations. Fixing this edge case yields a more theoretically sound metric.
- Complexity is Preserved: It is rare to change a core utility function in game-theoretic metrics without breaking the underlying computational shortcuts. The authors proved that the elegant recursive nature of KNN-SV remains intact.
- Rigorous LSH Bounds: By pointing out that previous LSH bounds for KNN search assumed an unrealistic scenario (where all training points are equidistant to the validation point), the authors provide the community with a much more rigorous and accurate mathematical foundation for sublinear neighbor searches.
Key Results
The methods were tested on the task of mislabeled data detection, where 10% of the training labels were randomly flipped. Performance was measured using the F1-score under two detection rules: Ranking (flagging the bottom 10th percentile of data values) and Clustering (using K-Means to separate clean and noisy data).
- Consistent Improvements: Soft-label KNN-SV matched or outperformed the original KNN-SV on the vast majority of the 13 datasets.
- Quantitative Wins:
- On the Creditcard dataset, the F1-score improved from 0.23 to 0.24 (Ranking) and from 0.23 to 0.244 (Clustering).
- On the CPU dataset under the clustering rule, the F1-score jumped from 0.57 to 0.604.
- On the 2DPlanes dataset under the clustering rule, it improved from 0.553 to 0.571.
Limitations and Future Work
While the LSH-based approximation successfully reduces the runtime of finding nearest neighbors to sublinear time, it introduces a heavy data preprocessing bottleneck. The preprocessing step increases the complexity to $O(MLN) = \tilde{O}(N^{1+c})$. Consequently, this approximation strategy only provides a practical speedup when the validation dataset is significantly larger than the training dataset ($N_{\text{test}} \gg N$).
The authors suggest that due to its superior performance and identical complexity, soft-label KNN-SV should replace the original method as the standard baseline for future research in algorithmic data valuation.
Summary updated