NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Mini-Batch Kernel $k$-means

Ben Jourdan, Gregory Schwartzman

TL;DR

Kernel $k$-means is a powerful algorithm for clustering non-linearly separable data, but its $O(n^2)$ runtime makes it prohibitively slow for large datasets. This paper introduces the first mini-batch kernel $k$-means algorithm, which slashes per-iteration complexity to $\widetilde{O}(kb^2)$—making it independent of the total dataset size $n$. The result is a $10\times$ to $100\times$ speedup with virtually no sacrifice in clustering quality.

What Problem Does This Paper Address?

Standard $k$-means clustering is highly efficient but suffers from a major flaw: it assumes data clusters are linearly separable (e.g., shaped like neat hyperspheres). To cluster complex, interlocking, or non-linear shapes, researchers use the "kernel trick" to project data into a high-dimensional (or infinite-dimensional) feature space where the data becomes linearly separable.

While kernel $k$-means delivers superior clustering performance, it is notoriously slow. Because we cannot explicitly compute or store cluster centers in this abstract feature space, calculating distances requires computing a massive kernel matrix, leading to a quadratic runtime complexity of $O(n^2)$ per iteration.

For standard $k$-means, web-scale datasets are handled using mini-batch methods (sampling small subsets of data at each step). However, applying mini-batches to kernel $k$-means has remained an open challenge because cluster centers in feature space cannot be explicitly maintained as simple averages of a static subset of data.

Methods

The authors overcome the challenge of implicit centers by introducing two key innovations:

  1. Recursive Distance Tracking: They derive a recursive mathematical expression that allows the algorithm to compute distances between new data points and the implicit cluster centers using only the inner products (kernel evaluations) from previous iterations.
  2. Center Truncation: A naive recursive approach still scales with $n$ over time. To fix this, the authors introduce a truncation technique. Since the influence of older data points on a cluster center decays exponentially based on the learning rate, they safely "forget" history beyond a threshold of approximately $\tau$ points. This bounds the per-iteration complexity to $\widetilde{O}(kb^2)$, where $b$ is the batch size and $k$ is the number of clusters.

Additionally, the algorithm adopts a novel learning rate that does not decay to zero over time, paired with an early stopping condition to guarantee fast convergence.

Datasets

The authors evaluated their algorithm against full-batch kernel $k$-means and standard mini-batch $k$-means across four widely used benchmarks:

  • MNIST: 70,000 images of handwritten digits (784 features, 10 clusters).
  • PenDigits: 10,992 instances of 2D pen movements (16 features, 10 clusters).
  • Letters: 20,000 instances of English letters (16 features, 26 clusters).
  • HAR (Human Activity Recognition): 10,299 smartphone sensor recordings of physical activities (561 features, 6 clusters).

Key Insights and Ideas

  • The Power of Forgetting: The core "aha!" moment is that you don't need an infinite memory to track cluster centers in Hilbert space. Truncating the history to a small number of points ($\tau$) introduces a negligible, theoretically bounded additive error while drastically reducing computational overhead.
  • Bypassing Infinite Dimensions: Theoretical guarantees for mini-batch algorithms usually depend on the dimensionality of the data space. Because kernel spaces can be infinite-dimensional, the authors parameterized their proofs using $\gamma$ (the maximum norm of points in the feature space). For normalized kernels like Gaussian or Laplacian, $\gamma = 1$, completely removing dimensional dependence from the runtime bounds.
  • Rethinking Learning Rates: Standard machine learning libraries (like scikit-learn) use a learning rate that decays to zero for mini-batch $k$-means. The authors found that a non-decaying learning rate actually prevents the algorithm from getting stuck and yields significantly better clustering quality.

Key Results

  • Massive Speedups: The truncated mini-batch kernel $k$-means consistently achieved a $10\times$ to $100\times$ speedup compared to the full-batch version.
  • Quality Preservation: Across all datasets, the mini-batch variant matched the clustering quality (measured via Adjusted Rand Index and Normalized Mutual Information) of the full-batch algorithm, while easily outperforming non-kernel mini-batch $k$-means on non-linear data.
  • Theory vs. Practice: Empirically, the truncation parameter $\tau$ worked exceptionally well even at tiny values (e.g., $\tau = 50$), which is far lower than the conservative bounds demanded by the theoretical proofs.

Limitations and Future Work

  • Kernel Parameter Tuning: The performance of the algorithm still heavily relies on choosing the right kernel parameters (such as the $\kappa$ parameter in the Gaussian kernel), which required manual tuning following heuristic initialization.
  • Theoretical Gap: There is a gap between the large batch sizes and $\tau$ values required by the theoretical proofs and the much smaller, highly successful values observed in practical experiments. Bridging this gap remains open for future analysis.
  • Algorithmic Composition: While the paper notes that their method is complementary to other scaling techniques like coresets, dimensionality reduction, or kernel sparsification, they did not explicitly test combinations of these methods in this work.

Summary updated

BibTeX
@inproceedings{jourdan2026mini,
  author = {Ben Jourdan and Gregory Schwartzman},
  title = {{Mini-Batch Kernel $k$-means}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=11weH1o7qw},
}
Figure