Fast $k$-means Seeding Under The Manifold Hypothesis

Poojan Shah, Shashwat Agrawal, Ragesh Jaiswal · DOI

Abstract

We study beyond worst-case analysis for the $k$-means problem, modeling typical instances arising in practice. Existing theoretical approaches provide guarantees under assumptions on optimal solutions that are difficult to validate. We propose the manifold hypothesis—where data in ambient dimension $D$ concentrates around a low-dimensional manifold of intrinsic dimension $d$—as a realistic model for real-world clustering. Using optimum quantization theory, we identify geometric properties with predictable scaling laws depending on the quantization exponent $\varepsilon = 2/d$. We exploit these to design Qkmeans, a fast seeding method providing $O(\rho^{-2} \log k)$ approximate solutions in near-linear time. Empirical studies across 12 domains validate our theoretical predictions and demonstrate significant speedups.

Introduction

The $k$-means problem is a cornerstone of data science, yet it remains NP-hard. In practice, Lloyd’s algorithm is the standard solver, but its performance depends heavily on initial "seeds." The gold standard, $k$-means++, provides a provable $O(\log k)$ approximation guarantee but suffers from a major bottleneck: it is inherently sequential. To select $k$ centers, it requires $k$ passes over the entire dataset, leading to an $O(nkD)$ runtime that is prohibitively slow for modern large-scale datasets.

Existing "beyond worst-case" theories attempt to explain $k$-means efficiency but often rely on unverifiable assumptions like "cluster separability." This paper introduces a faster seeding method based on the more realistic and verifiable manifold hypothesis.

Theoretical Scaling Laws

The authors propose that real-world data concentrates around a low-dimensional manifold with intrinsic dimension $d \ll D$. Using Zador’s Theorem from optimum quantization theory, they prove that under this hypothesis, the $k$-means cost follows predictable scaling laws. Specifically, the ratio of the initial cost to the optimal $k$-cluster cost ($\beta_k$) grows polynomially with $k$ based on a "quantization exponent" $\varepsilon = 2/d$.

Empirical validation of $\beta$ and $\eta$ scaling laws across 12 diverse datasets.

As shown in the figure above, these scaling laws are not merely theoretical; they exhibit nearly perfect linear fits ($R^2 > 0.95$) across a wide variety of modalities, from raw images to text embeddings.

The Qkmeans Algorithm

To bypass the $O(nkD)$ bottleneck, Qkmeans uses rejection sampling to simulate the $k$-means++ distribution efficiently:

  1. Preprocessing: A Johnson-Lindenstrauss (JL) transform reduces the ambient dimension, and $\ell_2$ norms are computed for all points.
  2. Proposal Distribution: Instead of exact distance calculations, points are sampled from a simpler distribution based on their norms. A point's distance from the origin serves as a highly effective proxy for its initial importance.
  3. Fast Correction: The algorithm employs an Approximate Nearest Neighbor Search (ANNS) data structure (like HNSW) to quickly estimate distances to existing centers. This estimate is used in a rejection step to "correct" the sample to match the target $k$-means++ distribution.

Key Results

The authors evaluated Qkmeans on 12 datasets, including MNIST, CIFAR-10, and high-dimensional CLIP embeddings. The results demonstrate that the "quantization exponent" $\varepsilon$ directly controls the efficiency of rejection sampling. Because real data lives on low-dimensional manifolds, the proposal distribution is "close enough" to the target that very few samples are rejected.

Performance comparison showing seeding cost vs. time. Qkmeans (blue) consistently reaches the Pareto frontier.

As illustrated in the performance plots, Qkmeans consistently outperforms prior fast seeding methods like AFKMC² and PRONECoreset, achieving 5–10x speedups while maintaining clustering costs comparable to standard $k$-means++.

Conclusion

Qkmeans bridges the gap between abstract geometry and algorithmic performance. By leveraging the manifold hypothesis, it offers a verifiable theoretical framework and a practical, high-speed alternative to $k$-means++ for large-scale clustering. Future work may extend this manifold-based approach to other fundamental problems like hierarchical clustering or dimensionality reduction.

Summary updated

BibTeX
@inproceedings{shah2026fast,
  author = {Poojan Shah and Shashwat Agrawal and Ragesh Jaiswal},
  title = {{Fast $k$-means Seeding Under The Manifold Hypothesis}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=lgsMOTIAYu},
}
Figure