[Paper Review] Efficient Task-Specific Data Valuation for Nearest Neighbor Algorithms
This paper proposes exact and approximate algorithms for computing Shapley value-based data valuation in K-nearest neighbor (KNN) models, achieving O(N log N) exact computation and sublinear O(N h(ϵ,K) log N) approximation via Locality Sensitive Hashing (LSH). The key contribution is an exponential performance improvement over baseline methods, enabling efficient, fair data valuation at scale—demonstrated on datasets up to 10 million points.
Given a data set $\mathcal{D}$ containing millions of data points and a data consumer who is willing to pay for \$$X$ to train a machine learning (ML) model over $\mathcal{D}$, how should we distribute this \$$X$ to each data point to reflect its "value"? In this paper, we define the "relative value of data" via the Shapley value, as it uniquely possesses properties with appealing real-world interpretations, such as fairness, rationality and decentralizability. For general, bounded utility functions, the Shapley value is known to be challenging to compute: to get Shapley values for all $N$ data points, it requires $O(2^N)$ model evaluations for exact computation and $O(N\log N)$ for $(ε, δ)$-approximation. In this paper, we focus on one popular family of ML models relying on $K$-nearest neighbors ($K$NN). The most surprising result is that for unweighted $K$NN classifiers and regressors, the Shapley value of all $N$ data points can be computed, exactly, in $O(N\log N)$ time -- an exponential improvement on computational complexity! Moreover, for $(ε, δ)$-approximation, we are able to develop an algorithm based on Locality Sensitive Hashing (LSH) with only sublinear complexity $O(N^{h(ε,K)}\log N)$ when $ε$ is not too small and $K$ is not too large. We empirically evaluate our algorithms on up to $10$ million data points and even our exact algorithm is up to three orders of magnitude faster than the baseline approximation algorithm. The LSH-based approximation algorithm can accelerate the value calculation process even further. We then extend our algorithms to other scenarios such as (1) weighed $K$NN classifiers, (2) different data points are clustered by different data curators, and (3) there are data analysts providing computation who also requires proper valuation.
Motivation & Objective
- To address the challenge of fair, scalable data valuation in large-scale machine learning markets where data contributors expect revenue sharing.
- To overcome the exponential computational cost of exact Shapley value computation for utility functions in KNN models.
- To develop practical, efficient algorithms that compute data values with provable guarantees for unweighted and weighted KNN classifiers and regressors.
- To extend data valuation to scenarios involving multiple data points per contributor and valuation of computational contributions.
Proposed method
- Define data value using the Shapley value (SV), which ensures fairness, rationality, and decentralizability in revenue allocation.
- Develop an exact O(N log N) algorithm for unweighted KNN classifiers by exploiting geometric properties of nearest neighbors and sorting-based aggregation.
- Propose an LSH-based approximation method with sublinear complexity O(N h(ϵ,K) log N) for large-scale datasets, where h(ϵ,K) < 1 when K* = max{1/ϵ, K} < C.
- Extend the framework to weighted KNN, multiple data points per contributor, and computation valuation using Monte Carlo approximation.
- Use a novel Monte Carlo approximation with O(N (log N)^2 / (log K)^2) complexity, which is significantly faster than baseline sampling.
- Leverage locality and symmetry in KNN to reduce redundant utility evaluations and enable efficient marginal contribution estimation.
Experimental results
Research questions
- RQ1Can the Shapley value for all data points in a KNN model be computed exactly in sub-exponential time?
- RQ2Can we achieve sublinear time complexity for (ϵ, δ)-approximate data valuation in KNN using LSH?
- RQ3How can we extend efficient data valuation to weighted KNN and multi-point contributions from data curators?
- RQ4Can we efficiently value both data and computational contributions in a collaborative ML setting?
- RQ5What is the theoretical and empirical performance gain of the proposed algorithms over baseline approximation methods?
Key findings
- The exact Shapley value computation for unweighted KNN classifiers runs in O(N log N) time, representing an exponential improvement over the standard O(2^N) complexity.
- The LSH-based approximation achieves sublinear complexity O(N h(ϵ,K) log N), enabling faster processing on datasets with up to 10 million points.
- The exact algorithm is up to three orders of magnitude faster than baseline approximation methods in empirical evaluation.
- For weighted KNN, the exact algorithm scales as O(NK), which remains exponential but is improved via a Monte Carlo approximation that is O(N (log N)^2 / (log K)^2) times faster than baseline.
- The proposed algorithms maintain theoretical guarantees on approximation error (ϵ, δ) while drastically reducing runtime, making Shapley-based valuation practical at scale.
- Empirical results show that the LSH-based approximation further accelerates computation, especially when ϵ is not too small and K is moderate.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.