Also for k-means: more data does not imply better performance

Marco Loog, Jesse H. Krijthe, Manuele BicegoMachine Learning 2023 · DOI

Abstract

In machine learning, it is widely assumed that increasing the size of a training set leads to improved model performance. This property, known as monotonicity, is well-documented in many supervised learning contexts. However, this paper demonstrates that for $k$-means clustering, one of the most fundamental unsupervised learning algorithms, more data can actually lead to worse expected performance. While 1-means clustering is shown to be globally monotonic, we prove that 2-means clustering can exhibit nonmonotonic behavior, where adding training samples increases the expected error indefinitely for specifically constructed distributions.

Introduction

A fundamental intuition in data science is that "more is better" regarding training data. Formally, this is the property of monotonicity: as the number of training samples $N$ increases, the expected risk (error) of the learner should decrease or remain constant. Recent studies in supervised learning have challenged this, identifying phenomena such as "double descent" where error spikes before eventually decreasing.

This research investigates whether similar counterintuitive behaviors exist in unsupervised learning, specifically within $k$-means clustering. By analyzing the learning curve—the relationship between average performance and sample size—the authors seek to determine if $k$-means is a "smart" learner that consistently improves with more information.

Methodology

The study approaches $k$-means through the framework of Empirical Risk Minimization (ERM). The "risk" is defined as the expected within-group squared (WGS) loss, which measures the average squared distance from any data point to its nearest cluster center.

To test for monotonicity, the researchers utilized two primary approaches:

  1. Analytical Derivation for $k=1$: The authors derived the expected risk for 1-means clustering to verify its behavior across varying sample sizes.
  2. Constructive Proof for $k=2$: The authors developed a "Three-Point Problem," a 1D distribution consisting of three point masses at $-1, 0,$ and $c \in (0, 1)$. By adjusting the probabilities and locations of these masses, they created scenarios where the expected performance of cluster centers derived from $N+1$ samples is worse than those derived from $N$ samples.

Theoretical Results

The Monotonicity of 1-Means

The paper first establishes a baseline with Theorem 1, which proves that 1-means clustering is globally monotonic. In this simplest case, the algorithm's performance consistently improves as more data is provided, aligning with traditional expectations.

The Nonmonotonicity of 2-Means

The transition from one to two clusters introduces a fundamental change in learning dynamics. Theorem 2 proves that for 2-means clustering, there exists a distribution for any $N \ge 14$ such that the expected risk increases when moving from $N$ to $N+1$ samples. This suggests that 2-means is not even "weakly" monotonic.

Crucially, this deterioration is not a transient effect of small sample sizes; the authors demonstrate that for any sufficiently large $N$, a distribution can be constructed to trigger this performance dip. Because a 1D counter-example can be embedded into higher dimensions, these results hold for any $d$-dimensional feature space $\mathbb{R}^d$.

Discussion and Implications

Optimization vs. Evaluation

Nonmonotonicity in supervised learning is often attributed to a mismatch between the training objective (e.g., log-loss) and the evaluation metric (e.g., accuracy). This study shows that for $k$-means, nonmonotonicity occurs even when the algorithm optimizes for the exact same loss used for evaluation (WGS loss). This implies that the issue is inherent to the geometric nature of the $k$-means objective itself.

The "Smartness" of Learners

The findings reinforce the idea that being a minimizer of empirical risk does not automatically qualify a learner as "smart." The geometry of the $k$-means objective can lead the algorithm to make "worse" decisions as it attempts to incorporate more data points into its cluster center estimations.

Limitations and Future Work

While the paper provides a rigorous proof for $k=2$, several avenues for future research remain:

  • Higher Values of $k$: The authors suspect nonmonotonicity persists for all $k \ge 2$, though proving this would require more complex multi-point configurations.
  • Continuous Distributions: The current proof relies on discrete point masses. Future work could explore whether narrow continuous distributions exhibit identical behavior.
  • Heuristic Algorithms: This study assumes a global $k$-means solver. In practice, algorithms like Lloyd's or $k$-means++ are used. The authors hypothesize that the inherent suboptimality of these practical heuristics might actually serve as a form of regularization that could, ironically, improve monotonicity.
  • Probabilistic Clustering: Extending this analysis to "soft" assignment models, such as Gaussian Mixture Models (GMMs), would determine if this quirk is limited to "hard" clustering assignments.

Summary updated

BibTeX
@article{loog2023also,
  author = {Marco Loog and Jesse H. Krijthe and Manuele Bicego},
  title = {{Also for k-means: more data does not imply better performance}},
  journal = {Machine Learning},
  year = {2023},
  doi = {10.1007/s10994-023-06361-6},
}
Figure