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

Coresets for Kernel Clustering

Shaofeng H.-c. Jiang, Robert Krauthgamer, Jianing Lou, Yubo Zhang

Introduction

Clustering is a fundamental task in unsupervised machine learning, with $k$-means serving as the standard approach for partitioning data into $k$ groups. However, traditional $k$-means is limited to finding linearly separable clusters. To address complex, non-linear structures, researchers employ Kernel $k$-means. By mapping data into a high-dimensional (often infinite-dimensional) feature space via a kernel function, the algorithm can identify clusters that are linearly separable in that transformed space.

Despite its power, Kernel $k$-means suffers from a significant computational bottleneck. The "Kernel Trick" allows distance computations without explicit mapping, but calculating the clustering cost for $n$ points typically requires $O(n^2)$ kernel evaluations. For large-scale datasets, this quadratic scaling becomes a prohibitive wall. This paper introduces the first efficient coreset construction for kernel $k$-means that works for general kernels, reducing the dataset to a size independent of both the original data size $n$ and the feature space dimension.

The Problem: The Computational Cost of Non-Linearity

In the kernelized version of $k$-means, the objective is to minimize the sum of squared distances to centers in a Hilbert space. Previous attempts to scale this process faced several hurdles:

  1. Kernel Specificity: Many solutions only worked for specific kernels (e.g., only Gaussian or only Polynomial).
  2. Exponential Growth: Some coreset sizes grew exponentially with the desired error margin $\epsilon$.
  3. Mathematical Complexity: Previous methods often introduced "shifts" in the kernel space that complicated the optimization landscape.

This research seeks a "strong coreset"—a small, weighted subset of the original data that approximates the clustering cost of the full dataset for any possible set of centers within a $(1 \pm \epsilon)$ error margin.

Methodology

The authors propose a construction method that combines importance sampling with a novel geometric embedding. The technical framework relies on three pillars:

1. Sensitivity-Based Importance Sampling

Rather than uniform sampling, which might miss critical outliers or small, dense clusters, the authors use a sensitivity-based approach. Points that contribute significantly to the potential clustering cost are assigned higher sampling probabilities, ensuring the coreset remains representative of the overall data structure.

2. Dimension-Independent Embedding

A key mathematical breakthrough in this work is Lemma 3.2. The authors prove that any $n$ points in an infinite-dimensional Hilbert space can be embedded into an $(n+1)$-dimensional Euclidean space without distorting the distances to potential cluster centers. This allows the application of powerful coreset techniques originally designed for finite Euclidean spaces to abstract, infinite-dimensional kernel spaces.

3. Iterative Construction

The algorithm (Algorithm 2) utilizes a recursive importance sampling framework. This process whittles the dataset down until the coreset size reaches a theoretical bound that is entirely independent of $n$, specifically $poly(k\epsilon^{-1})$.

Experimental Results

The authors validated their approach using four large-scale benchmarks: Twitter (21M points), Census1990 (2.4M points), Adult (48k points), and Bank (41k points). They tested both RBF (Gaussian) and Polynomial kernels to verify the general-kernel claim.

Efficiency and Accuracy

The coreset construction is highly efficient, running in $\tilde{O}(nk)$ time—near-linear relative to the number of points. Empirically, the coreset achieved less than 10% error using only 1,000 points, consistently outperforming uniform sampling baselines across all datasets.

Application to Spectral Clustering

Spectral clustering can be framed as a weighted kernel $k$-means problem. When applied here, the coreset-based approach was over 1,000x faster than the standard Scikit-learn implementation for datasets of 40,000 points. Remarkably, in some instances, the coreset approach achieved better objective values than the full-batch implementation, likely due to the reduced noise in the representative subset.

Key Insights

  • Breaking the $n$ Dependency: The coreset size depends only on the number of clusters $k$ and the error tolerance $\epsilon$. This means the representative dataset size remains constant whether the input is a million or a billion points.
  • Composability and Streaming: Because these are strong coresets, they are mergeable. One can compute a coreset for separate chunks of a data stream and merge them to maintain a global coreset. This enables the first streaming algorithm for kernel $k$-means with space complexity logarithmic in $n$.
  • Center Preservation: The authors demonstrate that their coreset accurately preserves distances even when centers are implicit linear combinations of points from the entire feature space, not just the span of the input data.

Limitations and Future Work

While the theoretical coreset size is independent of $n$, the polynomial constant $poly(k\epsilon^{-1})$ involves high powers. In practice, the authors found that a simplified, single-pass importance sampling approach yielded excellent results, suggesting the theoretical bounds may be conservative. Additionally, the performance remains sensitive to the choice of kernel hyperparameters (e.g., $\sigma$ in RBF kernels), an area where coresets do not provide a direct solution. Future work may focus on integrating weight estimation for spectral clustering more tightly into the coreset construction process.

Summary updated

BibTeX
@article{jiang2024coresets,
  author = {Shaofeng H.-C. Jiang and Robert Krauthgamer and Jianing Lou and Yubo Zhang},
  title = {{Coresets for Kernel Clustering}},
  journal = {Machine Learning},
  year = {2024},
  doi = {10.1007/s10994-024-06540-z},
}
Figure