[Paper Review] Fast and Accurate $k$-means++ via Rejection Sampling
This paper proposes a near-linear time algorithm for k-means++ seeding using multi-tree embeddings and rejection sampling to achieve the same O(log k) approximation guarantee as k-means++ while significantly improving runtime. By approximating distances via trees and correcting sampling bias through LSH-based rejection sampling, the method runs in Õ(nd + (n log Δ)^{1+ε}) time and outperforms k-means++ and Afkmc2 by up to an order of magnitude for large k, with solution quality preserved.
$k$-means++ \cite{arthur2007k} is a widely used clustering algorithm that is easy to implement, has nice theoretical guarantees and strong empirical performance. Despite its wide adoption, $k$-means++ sometimes suffers from being slow on large data-sets so a natural question has been to obtain more efficient algorithms with similar guarantees. In this paper, we present a near linear time algorithm for $k$-means++ seeding. Interestingly our algorithm obtains the same theoretical guarantees as $k$-means++ and significantly improves earlier results on fast $k$-means++ seeding. Moreover, we show empirically that our algorithm is significantly faster than $k$-means++ and obtains solutions of equivalent quality.
Motivation & Objective
- To develop a faster k-means++ seeding algorithm that maintains strong theoretical guarantees while scaling to large datasets.
- To overcome the Ω(k²) runtime bottleneck of prior fast k-means++ methods, especially for moderate to large k.
- To achieve near-linear time complexity Õ(nd + (n log Δ)^{1+ε}) without sacrificing solution quality.
- To ensure the algorithm's output distribution matches the original k-means++ D²-distribution via rejection sampling with LSH-aided nearest neighbor estimation.
- To empirically validate that the method is significantly faster than k-means++ and Afkmc2 while maintaining comparable clustering cost.
Proposed method
- The method uses a multi-tree embedding to approximate squared Euclidean distances between points, enabling fast D²-sampling over tree distances.
- It introduces Fastk-means++ to compute seeding in Õ(nd) time using the tree-approximated distances.
- Rejection sampling is applied to correct for approximation errors: each candidate point is accepted only if its true distance to the current center set is within a factor c of the tree-estimated distance.
- Locality-sensitive hashing (LSH) is used to efficiently estimate the nearest neighbor in the original space, enabling fast rejection probability computation.
- The algorithm maintains the same O(log k) approximation guarantee as k-means++ by ensuring the final sampling distribution closely emulates the true D²-distribution.
- The method computes valid k-means++ seeds for all k=1,2,…,n within the same near-linear time budget.
Experimental results
Research questions
- RQ1Can we achieve near-linear time k-means++ seeding while preserving the O(log k) approximation guarantee?
- RQ2Can multi-tree embeddings combined with rejection sampling produce a solution indistinguishable from k-means++ in distribution and quality?
- RQ3Does the method scale beyond the Ω(k²) runtime barrier of prior fast k-means++ algorithms, especially for large k?
- RQ4Can LSH-based nearest neighbor estimation be used effectively to enable fast rejection sampling without degrading solution quality?
- RQ5How does the proposed method compare empirically to k-means++ and Afkmc2 in terms of speed and clustering cost for large k?
Key findings
- The proposed algorithm runs in Õ(nd + (n log Δ)^{1+ε}) time, achieving near-linear complexity while maintaining O(log k) approximation guarantee.
- For k=1000, the method achieves a speed-up of up to an order of magnitude over k-means++ and Afkmc2 on real-world datasets like Song and KDD-Cup.
- On the Song dataset, RejectionSampling achieved a clustering cost of 74,654 (scaled by 10⁵) at k=1000, comparable to k-means++ (26,784) and better than Afkmc2 (82,700).
- On the KDD-Cup dataset, the method maintained low variance across runs, with RejectionSampling achieving 799 (scaled by 10²) at k=1000, close to k-means++ (269) and significantly better than Afkmc2 (883).
- The expected number of rejection sampling iterations is bounded by O(c²d²k), and each iteration runs in time dominated by LSH operations, ensuring overall efficiency.
- The method outputs valid k-means++ seeds for all k=1,2,…,n within the same time budget, enabling efficient multi-k analysis.
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.