Table of Contents
Fetching ...

Provably faster randomized and quantum algorithms for $k$-means clustering via uniform sampling

Tyler Chen, Archan Ray, Akshay Seshadri, Dylan Herman, Bao Bach, Pranav Deshpande, Abhishek Som, Niraj Kumar, Marco Pistoia

TL;DR

This work presents both a simple randomized mini-batch k-means algorithm with uniform sampling and a quantum counterpart that mimics the one-step Lloyd update. The classical method achieves provable accuracy with batch sizes scaling with a data-dependent partition quality parameter $\phi$, improving over prior data-norm based guarantees. The quantum algorithm attains a quadratic improvement in the estimation error dependence via QRAM-based mean estimation, yielding a per-iteration QRAM query bound that scales as $\tilde{O}\left(k^{3/2} k_C \sqrt{d}\left( \frac{\sqrt{\phi}}{\varepsilon} + \sqrt{\frac{dk}{k_C}}\right)\right)$ and, under balanced clusters, simplifies to $\tilde{O}\left(k^{5/2} \sqrt{d} \left(\frac{\sqrt{\phi}}{\varepsilon} + \sqrt{d}\right)\right)$. A key contribution is highlighting the symmetry-preserving role of uniform sampling, quantified by $\phi$, which can be substantially smaller than prior η-based parameters, thereby enabling tighter worst-case guarantees. Together, these results offer practical guidance for fast one-step approximations to k-means in both classical and quantum settings, with potential benefits in big-data clustering where $n$ is large and cluster structure is favorable.

Abstract

The $k$-means algorithm (Lloyd's algorithm) is a widely used method for clustering unlabeled data. A key bottleneck of the $k$-means algorithm is that each iteration requires time linear in the number of data points, which can be expensive in big data applications. This was improved in recent works proposing quantum and quantum-inspired classical algorithms to approximate the $k$-means algorithm locally, in time depending only logarithmically on the number of data points (along with data dependent parameters) [q-means: A quantum algorithm for unsupervised machine learning, Kerenidis, Landman, Luongo, and Prakash, NeurIPS 2019; Do you know what $q$-means?, Cornelissen, Doriguello, Luongo, Tang, QTML 2025]. In this work, we describe a simple randomized mini-batch $k$-means algorithm and a quantum algorithm inspired by the classical algorithm. We demonstrate that the worst case guarantees of these algorithms can significantly improve upon the bounds for algorithms in prior work. Our improvements are due to a careful use of uniform sampling, which preserves certain symmetries of the $k$-means problem that are not preserved in previous algorithms that use data norm-based sampling.

Provably faster randomized and quantum algorithms for $k$-means clustering via uniform sampling

TL;DR

This work presents both a simple randomized mini-batch k-means algorithm with uniform sampling and a quantum counterpart that mimics the one-step Lloyd update. The classical method achieves provable accuracy with batch sizes scaling with a data-dependent partition quality parameter , improving over prior data-norm based guarantees. The quantum algorithm attains a quadratic improvement in the estimation error dependence via QRAM-based mean estimation, yielding a per-iteration QRAM query bound that scales as and, under balanced clusters, simplifies to . A key contribution is highlighting the symmetry-preserving role of uniform sampling, quantified by , which can be substantially smaller than prior η-based parameters, thereby enabling tighter worst-case guarantees. Together, these results offer practical guidance for fast one-step approximations to k-means in both classical and quantum settings, with potential benefits in big-data clustering where is large and cluster structure is favorable.

Abstract

The -means algorithm (Lloyd's algorithm) is a widely used method for clustering unlabeled data. A key bottleneck of the -means algorithm is that each iteration requires time linear in the number of data points, which can be expensive in big data applications. This was improved in recent works proposing quantum and quantum-inspired classical algorithms to approximate the -means algorithm locally, in time depending only logarithmically on the number of data points (along with data dependent parameters) [q-means: A quantum algorithm for unsupervised machine learning, Kerenidis, Landman, Luongo, and Prakash, NeurIPS 2019; Do you know what -means?, Cornelissen, Doriguello, Luongo, Tang, QTML 2025]. In this work, we describe a simple randomized mini-batch -means algorithm and a quantum algorithm inspired by the classical algorithm. We demonstrate that the worst case guarantees of these algorithms can significantly improve upon the bounds for algorithms in prior work. Our improvements are due to a careful use of uniform sampling, which preserves certain symmetries of the -means problem that are not preserved in previous algorithms that use data norm-based sampling.
Paper Structure (38 sections, 14 theorems, 56 equations, 3 figures, 1 table)

This paper contains 38 sections, 14 theorems, 56 equations, 3 figures, 1 table.

Key Result

Theorem 2.1

Suppose where $k_C$ and $\phi$ are defined in eqn:kc_L0. Then, with probability at least $1-\delta$, the output $(\widehat{\mathbf{c}}_1,\ldots,\widehat{\mathbf{c}}_k)$ of alg:minibatch_kmeans

Figures (3)

  • Figure 1: Visualization of the probability of sampling a given data point when using uniform sampling or row-norm sampling. For row-norm sampling, we show two versions of the data-set, corresponding to a shift (origin is indicated with a plus). Rigid-body transforms of the data do not change the clustering objective \ref{['eqn:cost']} or the behavior of the $k$-means algorithm. However, row-norm sampling is sensitive to such transforms, and is unlikely to sample points in clusters near the origin.
  • Figure 2: Median and 5%-95% error range of cluster error $\max_{j\in[k]} \| \mathbf{c}_j - \widehat{\mathbf{c}}_j\|$ over 100 trials for \ref{['alg:minibatch_kmeans']} (solid), doriguello_luongo_tang_25 (dash-dot), and cornelissen_doriguello_luongo_tang_25 (dash). Dotted line is the rate $\sqrt{\phi/b}$ predicted by \ref{['thm:main']}.
  • Figure 3: Median and 5%-95% error range of cluster error $\max_{j\in[k]} \| \mathbf{c}_j^{(t)} - \widehat{\mathbf{c}}_j^{(t)} \|$ at iteration $t$ over 100 trials for \ref{['alg:minibatch_kmeans']} (solid), doriguello_luongo_tang_25 (dash-dot), and cornelissen_doriguello_luongo_tang_25 (dash).

Theorems & Definitions (16)

  • Theorem 2.1
  • Corollary 2.1
  • remark 1
  • Theorem 3.1
  • remark 2
  • Theorem 3.2: Cluster assignment
  • Corollary 3.3
  • Corollary 3.4
  • lemma 1: Local optimality
  • lemma 2
  • ...and 6 more