"Private Prediction Strikes Back!" Private Kernelized Nearest Neighbors with Individual Renyi Filter

Yuqing Zhu, Xuandong Zhao, Chuan Guo, Yu-Xiang Wang · DOI

Abstract

In the landscape of privacy-preserving machine learning, Differentially Private Stochastic Gradient Descent (DP-SGD) has become the standard for private training. However, DP-SGD faces significant challenges regarding computational overhead, inflexibility toward data updates, and the inability to efficiently handle "right to be forgotten" requests under regulations like GDPR. This paper presents Individual Kernelized Nearest Neighbor (Ind-KNN), a private prediction framework that shifts the privacy mechanism from training to inference. By employing an Individual Rényi Filter, Ind-KNN tracks privacy loss for each data point independently, enabling a more flexible, updatable, and efficient approach to Differential Privacy (DP) that remains competitive with state-of-the-art private training methods.

1. Introduction

Standard private training paradigms, while robust, are often rigid. Once a model is trained using DP-SGD, its weights are fixed; any modification to the underlying training set—such as the deletion of a user's data or the addition of new streaming information—requires a costly retraining process to maintain formal privacy guarantees. Furthermore, the "all-or-nothing" threat model of global DP often imposes a higher utility cost than necessary for applications where users only interact with their own query results.

We revisit the concept of Private Prediction, where raw data is maintained in an index and privacy is injected at the moment of query. Our proposed method, Ind-KNN, addresses the limitations of previous private prediction models by introducing a granular accounting mechanism that allows for dynamic dataset management and superior accuracy in high-update environments.

2. The Ind-KNN Framework

The core of Ind-KNN is a non-parametric approach to classification that leverages kernel similarity. Unlike traditional k-Nearest Neighbors (k-NN), which identifies a fixed number of neighbors, Ind-KNN utilizes a similarity threshold ($\tau$).

2.1 Kernelized Prediction

By using a kernel function (such as RBF or Cosine similarity), the model identifies all samples within a specific distance $\tau$ of the query. This thresholding is critical for privacy: in a standard top-k search, the inclusion of the $k$-th neighbor depends on the presence or absence of other points, which complicates the sensitivity analysis. A fixed threshold decouples the samples, allowing for cleaner individual privacy accounting.

2.2 Individual Rényi Filtering

The most significant innovation is the Individual Rényi Filter. In this system, every training sample is assigned its own "privacy budget"—analogous to a debit card. When a sample contributes to a prediction, a specific amount of privacy "alpha" is deducted from its individual budget. Once a sample’s budget is exhausted, it is "retired" from the dataset and no longer participates in future queries. This allows the system to adapt to the density of the data; samples in popular regions of the feature space may be retired faster, while rare samples persist longer.

2.3 Scalability and Optimization

To ensure the method scales to large datasets, we introduce Ind-KNN-Hash, which utilizes Locality-Sensitive Hashing (LSH). This allows the algorithm to restrict its search to relevant buckets, significantly reducing the computational cost per query. Additionally, we implement Prediction Reuse, where previous query-response pairs are added back into the training set as non-private data, effectively growing the available information pool without further depleting the privacy budgets of the original samples.

3. Experimental Evaluation

We evaluated Ind-KNN across multiple domains, including Computer Vision (CIFAR-10, Fashion MNIST) and Natural Language Processing (AG News, DBPedia), using pre-trained feature extractors (Vision Transformer and RoBERTa, respectively).

3.1 Accuracy and Efficiency

On the CIFAR-10 dataset, Ind-KNN demonstrated superior accuracy compared to NoisySGD when the number of queries was relatively small (under 2,000). More importantly, in scenarios requiring frequent data updates (e.g., retraining every 100 queries), Ind-KNN maintained high utility at a much lower privacy cost. For instance, to reach $96\%$ accuracy in a dynamic setting, NoisySGD required a privacy budget of $\epsilon=6.2$, whereas Ind-KNN achieved the same result with $\epsilon=2.0$.

3.2 Computational Performance

The integration of LSH in Ind-KNN-Hash provided a $6\times$ speedup over the standard Ind-KNN implementation. On CIFAR-10, the amortized cost per query was reduced from $0.25s$ to $0.04s$, demonstrating the feasibility of the approach for real-time production environments.

4. Discussion and Limitations

While Ind-KNN offers a flexible alternative to private training, it is not without trade-offs:

  • Data Retirement: The eventual exhaustion of privacy budgets means that without a stream of new data, the model's utility will eventually degrade as key samples are retired.
  • Feature Dependency: The performance of Ind-KNN is heavily contingent on the quality of the public pre-trained feature extractor. If the features do not adequately represent the private data distribution, the kernel similarity will fail to produce accurate predictions.
  • Query Volume: For static datasets where millions of queries must be answered, the cumulative privacy cost of Ind-KNN may eventually exceed that of a single DP-SGD training run.

5. Conclusion

Ind-KNN represents a significant step forward for flexible differential privacy. By treating privacy as a data-adaptive, individual resource rather than a global constraint, we enable machine learning systems that are faster to update, easier to manage under legal mandates like GDPR, and highly efficient for streaming data applications. This "return" to private prediction suggests that for many real-world use cases, the most effective way to protect data is not to bake it into a model, but to manage its use at the moment of prediction.

Summary updated

BibTeX
@inproceedings{zhu2023private,
  author = {Yuqing Zhu and Xuandong Zhao and Chuan Guo and Yu-Xiang Wang},
  title = {{"Private Prediction Strikes Back!" Private Kernelized Nearest Neighbors with Individual Renyi Filter}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2023},
}
Figure