Introduction
Hierarchical structure is ubiquitous, from biological taxonomies to social networks. In machine learning, hierarchical clustering allows us to understand data at multiple granularities. Recently, the field has shifted toward "deep hierarchical clustering"—complex, end-to-end neural networks designed specifically to learn these structures. However, researchers have identified significant limitations in these specialized models, prompting the development of Logits to Hierarchies (L2H). L2H is a lightweight algorithm that builds high-quality hierarchical structures using only the output logits of pre-trained "flat" models. By bypassing complex deep architectures and expensive pairwise distance calculations, L2H outperforms state-of-the-art specialized models in both accuracy and scalability.
The Problem with Deep Hierarchical Clustering
While end-to-end deep models for hierarchical clustering are conceptually appealing, they suffer from two major "fail states" in practice:
- Scalability Bottlenecks: These models struggle with large-scale datasets due to high computational demands, often failing to scale beyond a few dozen classes.
- The "Leaf-Level" Gap: Surprisingly, specialized hierarchical models often perform significantly worse at the finest level of detail (the "leaves" of the tree) compared to standard, non-hierarchical clustering models.
The core argument of the L2H approach is that practitioners should not have to sacrifice the accuracy of their base clusters simply to organize them into a tree structure.
The L2H Methodology
The core innovation of this research is the L2H algorithm, a post-hoc method that requires no fine-tuning and works with any model that outputs logits (unnormalized predicted probabilities).
The algorithm operates iteratively in two main stages:
- Selection: It identifies a group of clusters ($G^*$) that the model is least confident about, based on aggregated predicted probabilities.
- Merging via Reassignment: To determine which group is most related to $G^*$, the algorithm performs a "what-if" analysis. It masks the logits for the clusters in $G^*$ and observes where the data points would be "reassigned" by the model. For instance, if the model's second-best guesses for "dogs" are predominantly "cats," the algorithm merges those two groups.
Because L2H relies solely on simple operations applied to existing logits, it is computationally trivial compared to training a new deep model or computing massive $N \times N$ distance matrices.
Key Insights and Results
The authors evaluated L2H across several standard and large-scale vision benchmarks, including CIFAR-10, CIFAR-100, Food-101, ImageNet-1K, and the massive iNaturalist21 dataset.
- Logits as "Dark Knowledge": The research reinforces the idea that the relative values in a logit vector—not just the top prediction—contain rich information about how a model perceives similarities between classes.
- Unmatched Scalability and Speed: While deep hierarchical models like TreeVAE or DeepECT struggle with scale, L2H handles 1,000 classes with ease. It can compute a hierarchy for ImageNet in just 0.45 seconds on a standard CPU (excluding initial inference time).
- Preserving Leaf Accuracy: Because L2H is built on top of a flat model, it retains 100% of that model's leaf-level performance. The hierarchy is essentially obtained "for free."
- Superior Performance: On CIFAR-100, L2H (using a TURTLE backbone) achieved a Dendrogram Purity of 0.803, vastly outperforming specialized models like TreeVAE (0.103) and DeepECT (0.052). On the iNaturalist dataset, L2H was better at recovering coarse taxonomic levels (like "Kingdom" or "Phylum") by starting from fine-grained "Family" labels than models trained specifically at those coarse levels.
- Interpretability and Bias Discovery: When applied to a supervised ImageNet classifier, L2H successfully recovered much of the WordNet hierarchy. Interestingly, it also revealed spurious correlations. For example, it merged "dogsleds" and "snowmobiles" with "arctic animals" (like Huskies), demonstrating how the model relies on snowy backgrounds rather than the objects themselves.
Limitations and Future Work
While highly effective, L2H has a few limitations. Its success relies entirely on the quality and calibration of the pre-trained model's logits; if a model is poorly trained or overconfident, the reassignment logic may fail. Furthermore, while theoretically general, the current evaluation is heavily vision-centric, necessitating future validation on NLP or tabular data. Finally, the algorithm currently produces a full tree, and future research could focus on automatically identifying which levels of the hierarchy are the most semantically meaningful for human users.
Summary updated