Learning-Augmented $k$-means Clustering

Jon C. Ergun, Zhili Feng, Sandeep Silwal, David P. Woodruff, Samson Zhou

$k$-means clustering is one of the most ubiquitous tools in a data scientist's belt, yet it is plagued by a frustrating theoretical reality: finding the optimal solution is NP-hard, and even finding a "good enough" approximation is computationally taxing. To bypass these classical limits, researchers have introduced a "learning-augmented" framework. By leveraging potentially noisy "advice" from a predictor (like a neural network or historical data) and applying robust statistical techniques, this approach achieves nearly optimal clustering in nearly linear time.

The Challenge of Noisy Advice

The $k$-means problem—finding $k$ centers to minimize the sum of squared distances to the nearest center—is notoriously difficult. Standard polynomial-time algorithms are theoretically limited to "constant-factor" approximations; they might guarantee a solution within a factor of 50 of the optimum, but cannot get arbitrarily close (e.g., within a factor of 1.01).

While we often have access to external "advice"—such as labels from a previous run on similar data or predictions from a pre-trained model—this advice is rarely perfect. The major challenge is that blindly following a noisy predictor can be disastrous. Even if a predictor is 99% accurate, mislabeling the remaining 1% of points by placing them in a distant cluster will cause the resulting $k$-means cost to skyrocket. The goal is to create an algorithm that improves as the predictor improves, but remains robust when the predictor fails.

A Robust, Learning-Augmented Solution

To solve this, the authors propose an algorithm that accesses a predictor $\Pi$ suggesting a cluster label for every point, but processes this advice carefully.

  1. Robust Mean Estimation: Instead of simply averaging all points with the same predicted label, the algorithm uses a "training and testing" approach inspired by robust statistics. It randomly partitions points of the same label into two groups. The first group is used to find a "safe" coordinate-wise interval, effectively filtering out outliers. The algorithm then calculates the mean of the second group strictly within that interval. This prevents adversarial or high-variance errors in the predictor from pulling the cluster centers too far away.
  2. Efficiency via Dimensionality Reduction: To scale to massive datasets, the authors incorporate the Johnson-Lindenstrauss (JL) transform to reduce the dimensionality of the points, alongside Approximate Nearest Neighbor (ANN) search. This allows the algorithm to assign points to centers in $O(nd \log n)$ time, a massive improvement over the $O(ndk)$ time required for standard exhaustive search.
  3. Theoretical Guarantees: The researchers prove that if the predictor has an error rate $\lambda$, their algorithm provides a $(1 + O(\lambda))$-approximation. This "best-of-both-worlds" result breaks the constant-factor barrier when the advice is good, without failing catastrophically when it is flawed.

Key Results and Insights

The researchers evaluated their approach on several real-world datasets, including Oregon (internet router communication snapshots), PHY (KDD Cup 2004), and CIFAR-10.

Significant Cost Reduction

One of the primary takeaways is that the "advice" doesn't have to be a sophisticated model—it can be a quick heuristic or a previous day's labels. By treating the predictor's errors as outliers in a robust mean estimation problem, the algorithm effectively "cleans" the advice.

Clustering cost on the Oregon dataset ($k=10$), comparing the learning-augmented algorithm against baselines.

On the Oregon dataset, using the learning-augmented algorithm on the predictor's labels reduced the clustering cost by 55% compared to using the predictor's labels directly. Furthermore, on the CIFAR-10 dataset, using $k$-means++ as a predictor allowed the algorithm to outperform standard $k$-means++ seeding by 13%.

Noise Tolerance and Robustness

The core "aha moment" of the paper is its robustness. Under the Exponential Time Hypothesis, you cannot get a $(1+\epsilon)$-approximation for $k$-means in polynomial time. External advice acts as a "cheat code" to bypass this, but only if the algorithm can survive the noise.

Clustering cost vs. corruption percentage on the Oregon dataset, illustrating the algorithm's robustness to noisy advice.

As demonstrated in corruption experiments, the algorithm remains remarkably stable. Even when the predictor is corrupted with significant random noise (up to 25-50%), the learning-augmented algorithm maintains a cost significantly lower than the noisy baseline, whereas blindly trusting the noisy predictor causes the error to climb linearly.

Limitations and Future Work

While highly effective, the approach has limitations. The theoretical bound includes a constant factor that the authors did not attempt to fully optimize (currently 20 in their $(1 + 20\alpha)$ approximation), though practical performance is much tighter. Additionally, while robust, the algorithm still relies on the predictor having a relatively small error rate $\lambda$ to see massive gains; if the advice is completely random, the benefits naturally diminish.

Future work may explore applying similar learning-augmented logic to more complex clustering objectives, such as $k$-median clustering, or integrating different types of advice like "must-link" constraints.

Summary updated

BibTeX
@inproceedings{ergun2022learning,
  author = {Jon C. Ergun and Zhili Feng and Sandeep Silwal and David P. Woodruff and Samson Zhou},
  title = {{Learning-Augmented $k$-means Clustering}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=OM6jlI81wvC},
}
Figure