Hierarchical clustering is a cornerstone of unsupervised learning, helping us organize everything from gene expressions to social networks into meaningful, multi-level structures. But for years, researchers have been caught between two worlds: discrete methods that are hard to optimize and continuous relaxations that don't quite match the discrete reality. A new paper, "Expected Probabilistic Hierarchies" (EPH), proposes a clever way to bridge this gap.
The Problem: Discrete vs. Continuous Optimization
Hierarchical clustering (HC) aims to create a "tree" (dendrogram) where data points are leaves and internal nodes represent clusters at different granularities. Traditionally, we solve this in one of two ways:
- Discrete Optimization: Using heuristics (like linkage algorithms) or searching a massive, non-differentiable space. These are often fast but can get stuck in local optima and don't benefit from modern deep learning optimization.
- Continuous Relaxations: Using "soft" scores that are differentiable. The problem? The "best" solution for a soft score often doesn't correspond to the "best" solution once you turn that soft result back into a hard, discrete tree.
The authors identify a specific gap: we need a way to use gradient-based optimization that is consistent—meaning the objective we optimize in the continuous space actually leads us to the global optimum of the discrete space.
Methods: Expected Probabilistic Hierarchies
The core innovation is Expected Probabilistic Hierarchies (EPH). Instead of optimizing a "relaxed" score, EPH optimizes the expected score of a discrete hierarchy sampled from a probabilistic model.
- Probabilistic Model: The hierarchy is defined by two matrices: $A$ (mapping leaves to their parents) and $B$ (mapping internal nodes to their parents). These are treated as categorical distributions.
- Differentiable Sampling: To make this trainable via backpropagation, the authors use the straight-through Gumbel-Softmax estimator. This allows them to sample a discrete tree in the forward pass while maintaining a differentiable path for gradients in the backward pass.
- Scalable Subgraph Sampling: For large vector datasets, calculating pairwise similarities is $O(n^2)$, which is a bottleneck. EPH introduces an unbiased subgraph sampling approach, estimating the clustering cost by looking at a subset of edges, allowing it to scale to datasets with tens of thousands of points.
- Objectives: They focus on two unsupervised metrics: the Dasgupta cost (which favors similar items having a low "lowest common ancestor") and Tree-Sampling Divergence (TSD).
Key Insights and Ideas
- The Consistency Proof: The most significant theoretical "aha" moment is the proof that the global optimum of the expected Dasgupta cost is exactly equal to the global optimum of the discrete Dasgupta cost. This isn't true for standard "soft" relaxations, which often "smear" the solution.
- Soft-Das is a Lower Bound: They show that the commonly used "Soft-Dasgupta" score is actually a lower bound of the expected cost. This explains why previous methods often failed to find the true discrete minimizer—they were optimizing a proxy that was too "optimistic."
- Non-Binary Flexibility: Unlike many traditional algorithms that force a binary tree structure, EPH naturally allows for nodes to have more than two children, which often better reflects real-world data.
Datasets and Key Results
The authors evaluated EPH across a diverse range of benchmarks, including graph datasets (like Polblogs, Cora-ML, and the massive DBLP with over 300,000 nodes) and vector datasets (like Iris, Digits, and Cifar-100).
- Quantitative Dominance: EPH outperformed all baselines (including linkage methods, hyperbolic clustering, and previous probabilistic models like FPH) on 20 out of 24 cases across 16 datasets.
- Scalability: Thanks to subgraph sampling, EPH successfully processed the DBLP graph and Cifar-100 dataset, whereas many continuous competitors ran out of memory (OOM).
- Qualitative Quality: In the Cifar-100 experiments, EPH successfully grouped semantically similar images (e.g., different types of insects) into the same high-probability clusters. On the OpenFlight dataset, it produced a hierarchy that clearly distinguished between different geographical world regions.
Limitations and Future Work
While powerful, EPH has a few limitations:
- Local Optima: While the global optima align, gradient descent still only guarantees finding a local optimum. The choice of initialization (like starting with Average Linkage) remains crucial for the best results.
- Gradient Bias: While the forward pass is unbiased, the Gumbel-Softmax gradients are biased, which can impact the stability of the optimization.
- Hyperparameter Sensitivity: The performance is linked to the number of sampled hierarchies ($N$) and sampled edges ($M$). While 20 samples generally worked well, very large datasets might require more tuning to balance runtime and accuracy.
The authors suggest that future work could explore using EPH for supervised hierarchical clustering or integrating it into deep representation learning pipelines.
Summary updated