Introduction: The Data Valuation Problem
Data valuation is a critical task in machine learning, allowing practitioners to quantify the impact of individual data points on model performance. This process helps identify highly valuable training examples and flag harmful ones, such as mislabeled data. The Shapley value, rooted in cooperative game theory, is widely considered the gold standard for this task because it fairly distributes a model's performance score among its training points based on their marginal contributions.
However, Shapley values are notoriously difficult to compute. Traditionally, they require retraining a model on every possible subset of data ($2^n$ combinations), making exact computation computationally prohibitive for modern datasets.
The Challenge of Weighted $k$-Nearest Neighbors
Recent breakthroughs have enabled the exact and fast computation of Shapley values for unweighted $k$-Nearest Neighbor ($k$NN) classifiers in $O(n \log n)$ time. Yet, extending this efficiency to weighted $k$NN models—where closer neighbors exert more influence on the prediction—has remained a significant open challenge.
Prior state-of-the-art methods for weighted $k$NN either required quadratic time complexity ($O(n^2)$), rendering them impractical for large datasets, or relied on Monte Carlo sampling, which introduces noise and imprecision.
The Proposed Solution: Conceptual Data Duplication
To bridge this gap, the authors introduce DkNN-SV, an algorithm that leverages a surprisingly intuitive concept: data duplication. If a data point has a weight of $w$, it can be conceptualized as $w$ identical copies of that point, each with a weight of 1. This elegantly transforms a complex weighted $k$NN problem into a simpler, unweighted one.
Algorithmic Efficiency
A naive implementation of data duplication would cause the dataset size and memory usage to explode. However, the authors exploit the symmetry axiom of Shapley values—which dictates that all identical copies of a point must share the same value. By leveraging the recursive properties of $k$NN-Shapley, they developed an algorithm that processes each original point just once. It mathematically accounts for the "copies" without ever materializing them in memory.
This breakthrough reduces the computational complexity to near-linear time, $O(dn + n \log n)$, where $d$ is the number of features and $n$ is the number of data points.
Key Theoretical Insights
- Weights as Groups: The duplication approach is theoretically linked to Owen values, a variation of Shapley values designed for games with coalitional structures (where players belong to groups).
- Scaling is Insufficient: The authors demonstrate that simply multiplying unweighted Shapley values by a point's weight is a poor proxy. A simple scaling approach fails to capture how weights fundamentally alter local neighborhood dynamics.
- Soft-Label Utility: Unlike previous "hard-label" attempts that only register when a neighbor flips the final classification, DkNN-SV uses soft-label utility. This captures fine-grained marginal contributions, significantly improving the algorithm's sensitivity to subtle data interactions.
Empirical Evaluation and Key Results
The researchers evaluated DkNN-SV across 11 diverse datasets, ranging from 5,000 to 1,000,000 instances, including standard benchmarks and the massive Poker dataset.
- Superior Noisy Label Detection: In experiments where 5% of labels were intentionally flipped, DkNN-SV consistently outperformed both unweighted $k$NN-SV and sampling-based methods in identifying the corrupted points.
- Massive Scalability: On the 1-million-point Poker dataset, DkNN-SV completed the valuation in roughly 10 minutes. In contrast, previous exact methods for weighted $k$NN would have taken hours, days, or timed out entirely.
- Computational Parity: The runtime of the weighted DkNN-SV method is nearly identical to its unweighted counterpart. This effectively offers the predictive benefits of weighted models at no extra computational cost.
Limitations and Future Directions
The authors note that DkNN-SV computes a variant of the weighted $k$NN Shapley value rather than the exact value derived from the standard weighted utility function, though the two are highly correlated.
Future research directions include extending this efficient duplication logic to $k$NN regression tasks, which remain an open challenge. Additionally, while $k$NN serves as a powerful proxy for many models (especially when using pre-trained embeddings), the authors aim to explore whether this duplication framework can be applied to other "local" machine learning models.
Summary updated