Average Sensitivity of Hierarchical $k$-Median Clustering

Shijie Li, Weiqiang He, Ruobing Bai, Pan Peng

Introduction

Hierarchical clustering is a fundamental tool in unsupervised learning, utilized to generate dendrograms that reveal the nested, multi-scale structure of data. Despite its popularity, many classic hierarchical algorithms suffer from significant instability. Small perturbations in the input data—such as the removal of a single data point—can lead to radical changes in the resulting tree structure. This "brittleness" limits the reliability of hierarchical clustering in high-stakes applications and raises concerns regarding data privacy.

This paper addresses these challenges by introducing a theoretically grounded algorithm for hierarchical $k$-median clustering. By leveraging the "exponential mechanism" from the field of differential privacy, the authors develop a method that minimizes average sensitivity—a measure of how much the output hierarchy changes on average when a random point is deleted—while maintaining high clustering quality.

The Stability Problem in Hierarchical Clustering

Traditional hierarchical methods, such as Ward’s linkage or complete linkage, often rely on greedy, deterministic choices at each step of the hierarchy construction. While efficient, these deterministic decisions are the primary source of instability. If two potential cluster merges have nearly identical costs, a minor change in the dataset can flip the decision, leading to a cascade of different merges throughout the rest of the tree.

The authors focus specifically on the hierarchical $k$-median objective. This objective combines the structural benefits of hierarchical trees with the clear mathematical goals of $k$-median clustering, which seeks to minimize the sum of distances from points to their nearest cluster centers.

Methodology: Randomized Stability

The proposed algorithm builds upon the CLNSS framework, incorporating randomization to "smooth" the decision-making process. The core components of the method include:

  1. Tree Embedding (2-RHST): The algorithm begins by embedding the data into a 2-hierarchically well-separated tree (2-RHST). This structure simplifies the distance metrics and provides a foundation for the subsequent hierarchical decomposition.
  2. The Exponential Mechanism: To avoid the pitfalls of deterministic greedy selection, the authors employ the exponential mechanism. Instead of selecting the absolute best center point for a cluster, the algorithm selects centers probabilistically. Points that result in lower $k$-median costs are assigned higher probabilities. This ensures that no single data point can exert a "veto" or disproportionate influence over the final structure.
  3. The Stability-Utility Parameter ($\epsilon$): A user-defined parameter, $\epsilon$, controls the trade-off between stability and clustering cost. A lower $\epsilon$ increases the randomness, leading to higher stability (lower sensitivity) but potentially higher clustering costs. Conversely, a higher $\epsilon$ pushes the algorithm toward a more deterministic, cost-optimized behavior.

Theoretical Insights

A significant contribution of this work is the rigorous mathematical proof of the algorithm's performance. The authors demonstrate that the algorithm achieves an average sensitivity of $O(k \ln n / \epsilon)$. Furthermore, it maintains a competitive approximation ratio for the $k$-median cost, ensuring that the pursuit of stability does not come at the expense of meaningful clustering results.

The paper also addresses the "Single Linkage Paradox." While Single Linkage clustering is theoretically known for poor worst-case sensitivity, it often appears stable in practice. The authors provide a theoretical explanation: in datasets with "strong cluster structures" (where clusters are separated by significant gaps), Single Linkage becomes naturally stable. However, the proposed randomized algorithm provides a more robust solution across a wider variety of data distributions.

Experimental Evaluation

The researchers evaluated the algorithm against several baselines, including Average, Complete, and Ward’s linkage, as well as the deterministic CLNSS algorithm. Testing was conducted on synthetic "hard cases" designed to induce instability and a suite of real-world datasets from the UCI and Scikit-learn repositories, including Iris, Wine, Wholesale, Diabetes, WDBC (Breast Cancer), Digits, and Yeast.

Key Results

  • Superior Stability: The randomized algorithm consistently outperformed traditional linkage methods and the deterministic CLNSS in terms of average sensitivity across all real-world benchmarks.
  • Competitive Quality: The $k$-median cost remained comparable to established baselines. Notably, the algorithm significantly outperformed Single Linkage in terms of utility (clustering tightness).
  • Computational Efficiency: With a time complexity of $O(dn \log \Lambda + n^3)$, the algorithm is computationally feasible for standard research datasets, matching the complexity of many existing hierarchical methods.

Limitations and Future Directions

While the algorithm represents a major step forward in stable hierarchical clustering, several areas for future work remain. The $O(n^3)$ complexity, while standard, may pose challenges for datasets with millions of points, suggesting a need for further optimization or approximation techniques. Additionally, the current framework is specifically optimized for the $k$-median objective; extending these stability proofs to $k$-means or $k$-center objectives is a promising avenue for research. Finally, practical application requires careful tuning of the $\epsilon$ parameter to find the optimal balance for specific use cases.

Summary updated

BibTeX
@inproceedings{li2025average,
  author = {Shijie Li and Weiqiang He and Ruobing Bai and Pan Peng},
  title = {{Average Sensitivity of Hierarchical $k$-Median Clustering}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=6BJFle1f23},
}
Figure