The Power of Uniform Sampling for $k$-Median

Lingxiao Huang, Shaofeng H. -c. Jiang, Jianing Lou

TL;DR

This paper demonstrates that simple uniform sampling—often dismissed as too blunt a tool for complex clustering—is surprisingly powerful for the $k$-median problem. By introducing a "balancedness" parameter ($\beta$), the authors prove that you can achieve near-optimal clustering results using a sample size independent of the total number of data points, effectively bypassing the need to read entire massive datasets.

What Problem Does This Paper Address?

Clustering is a cornerstone of machine learning, and the $k$-median problem is one of its most fundamental formulations: find $k$ points (centers) such that the sum of distances from every data point to its nearest center is minimized.

As datasets have grown to include millions or billions of points, researchers have turned to coresets—small, weighted subsets of the data that act as accurate proxies for the whole. However, there is a catch: almost all known coreset constructions require "importance sampling." To figure out which points are "important," you usually have to read the entire dataset at least once. This creates an $\Omega(n)$ query complexity barrier that makes sublinear-time processing impossible.

The authors ask: Can we get away with uniform sampling? It’s "data-oblivious" (you don't need to look at the data to decide what to sample), but it’s historically been criticized because it might miss small, distant clusters that are crucial for the global solution.

Methods

The researchers bridge the gap between theory and practice by focusing on a dataset property called balancedness ($\beta$).

  • Definition: A dataset is $\beta$-balanced if every cluster in the optimal solution contains at least a $\beta/k$ fraction of the total points. A perfectly balanced dataset has $\beta=1$.
  • Lower Bound Proof: They first prove that any algorithm (not just uniform sampling) must make at least $\Omega(1/\beta)$ queries to find a good approximation. If a cluster is tiny and far away, you simply have to look at enough points to find it.
  • Upper Bound Proof: They show that a uniform sample of size $\text{poly}(k, \epsilon^{-1}, \beta^{-1})$ is sufficient to find a $(1+\epsilon)$-approximation.
  • Technical Innovations: To prove this for Euclidean space without the sample size depending on the dimension ($d$), they used a "chaining argument" (a sophisticated way to bound the complexity of a space) combined with a terminal Johnson-Lindenstrauss transform to project the data into lower dimensions while preserving distances to the centers.

Datasets

The authors validated their theoretical findings on three large-scale real-world datasets representing different metric spaces:

  1. Twitter Dataset: 21 million points normalized into 2D Euclidean space.
  2. Census1990 Dataset: 2.4 million points in 68-dimensional Euclidean space.
  3. NY Road Network: A weighted graph with 2.2 million vertices and 2.9 million edges, representing the road network of New York State (shortest-path metric).

Key Insights and Ideas

  • Balancedness is the Key: The difficulty of $k$-median isn't just about the number of clusters ($k$) or the desired accuracy ($\epsilon$); it's fundamentally tied to how "hidden" the smallest optimal cluster is.
  • Weak Coresets are Enough: While uniform sampling doesn't produce a "strong coreset" (which must work for any possible set of centers), it produces a "weak coreset" that works for the near-optimal centers. For most practical applications, this is all you need.
  • Dimension Independence: In Euclidean space, the required sample size doesn't care if your data has 2 dimensions or 2,000. This makes the approach highly scalable for high-dimensional feature vectors.
  • Data-Oblivious Efficiency: Because uniform sampling doesn't require pre-calculating weights, it is incredibly fast. In their tests, sampling took $10^{-3}$ seconds, while building a traditional coreset took hundreds of seconds.

Key Results

  • Theoretical Match: The authors' upper bound for the sample size nearly matches their lower bound regarding the balancedness parameter $\beta$.
  • Real-World Balancedness: Experiments showed that real datasets are rarely "adversarial." Even for large $k$, the balancedness $\beta$ remained high enough that uniform sampling performed excellently.
  • Performance vs. Coresets: On the Twitter and Census datasets, uniform sampling achieved accuracy comparable to state-of-the-art coreset methods but was orders of magnitude faster to construct.
  • Negative Error: In some cases (like the NY dataset with $k=20$), the solution found on the uniform sample actually outperformed the baseline approximation used for comparison, showing the robustness of the approach.

Limitations and Future Work

  • The "Needle in a Haystack" Problem: The primary limitation remains the dependence on $\beta$. If a dataset has a "singleton" cluster (one point very far from everything else), uniform sampling will almost certainly fail unless you sample nearly the entire dataset.
  • Finding the Balanced Solution: The theory suggests solving a "balanced $k$-median" problem on the sample. While the authors found that a standard local search worked fine in practice, developing more efficient algorithms specifically for the balanced constraint could be a future direction.
  • Extension to Other Objectives: This paper focuses on $k$-median. Extending these "beyond worst-case" results to $k$-means or other clustering objectives (like $k$-center) remains an open challenge.

Summary updated

BibTeX
@inproceedings{huang2023power,
  author = {Lingxiao Huang and Shaofeng H. -C. Jiang and Jianing Lou},
  title = {{The Power of Uniform Sampling for $k$-Median}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=CAK03E6JCG},
}
Figure