Adversarial examples—tiny, strategic tweaks to an input that flip a machine learning model's prediction—are a well-known vulnerability in deep neural networks. However, surprisingly little is known about the adversarial robustness of non-parametric methods like $k$-Nearest Neighbors ($k$-NN), Kernel classifiers, and Histograms.
Because non-parametric methods are "local" learners that make decisions based on nearby training points, intuition suggests they should be naturally robust. This paper provides the first rigorous theoretical framework to explain exactly when and why these classifiers converge to a robust solution, revealing that not all non-parametric methods are created equal.
Rethinking Consistency: Astuteness and $r$-Consistency
To evaluate robustness mathematically, the authors introduce a theoretical toolkit designed for the "large sample limit" (as the amount of training data grows to infinity).
Standard machine learning theory relies on the concept of consistency—the guarantee that a classifier will eventually reach the best possible accuracy (the Bayes optimal) given enough data. However, accuracy does not equal robustness. A classifier can be perfectly accurate but highly vulnerable to tiny perturbations.
To bridge this gap, the authors define two new metrics:
- Astuteness: A combined measure of accuracy and robustness. A classifier is "astute" at a specific data point if it not only predicts the correct label but also maintains that exact same prediction for every possible point within a perturbation radius $r$.
- $r$-Consistency: A robust parallel to standard consistency. An $r$-consistent classifier is guaranteed to eventually reach the highest possible astuteness as the training sample size grows to infinity.
The Winners and Losers of Robustness
By treating non-parametric methods as "weight functions" that assign importance to training points, the authors establish a general mathematical theorem detailing the conditions required for robustness. Applying this theorem yields surprising divergences between popular algorithms.
The Histogram Failure
Histogram classifiers are popular due to their simplicity and high standard accuracy. However, the authors prove they are not robustly consistent. Because histograms partition data using fixed grid cells, an adversary can almost always find a "gap" or an empty cell near a decision boundary to flip the prediction. Even with infinite training data, this structural vulnerability remains.
$k$-NN and Kernels Win
In contrast, Nearest Neighbor and Kernel classifiers are naturally robust on well-separated data.
- $k$-NN is proven to be $r$-consistent provided the number of neighbors ($k_n$) grows slower than the total number of data points ($n$).
- Kernel classifiers are robust as long as the kernel function $K(x)$ decays rapidly as distance $x$ increases (e.g., the Gaussian kernel, which decays faster than polynomials).
Adversarial Pruning for Overlapping Data
When classes overlap or are positioned too closely together, natural robustness degrades. To solve this, the authors analyze a preprocessing technique called Adversarial Pruning. This involves intentionally removing training points that sit too close to points of an opposing class.
The paper provides the first formal proof that Adversarial Pruning works. By "clearing a path" between classes and then applying $k$-NN or Kernel methods, the resulting model is mathematically guaranteed to converge to the most astute classifier possible for that specific data distribution.
Experimental Validation
While primarily a theoretical paper, the authors validated their proofs using the synthetic 2D "Half Moons" dataset. They tested both "Noiseless" (well-separated) and "Noisy" (overlapping) versions of the data.
The empirical results perfectly matched the theory. As the training size increased, the astuteness of the 1-NN classifier converged toward 1.0. Conversely, the astuteness of the Histogram classifier plummeted to around 0.5 and stayed there, confirming that adding more data cannot fix the inherent lack of robustness in a histogram's grid structure.
Limitations and Future Directions
This framework marks a significant step forward in understanding non-parametric robustness, but it comes with limitations. The results focus on asymptotic behavior ($n \to \infty$) and do not provide finite sample rates to tell practitioners exactly how much data is needed to achieve a specific robustness threshold. Additionally, Adversarial Pruning requires finding the largest $r$-separated subset of data—a computationally expensive task related to the Maximum Independent Set problem. Future work will need to bridge these theoretical guarantees with algorithmic efficiency.
Summary updated