HyperTree: Scalable Unsupervised Hierarchy Discovery in Hyperbolic Space

Thomas Lang, Kevin Sidak, Anna Beer, Sebastian Tschiatschek, Yllka Velaj, Claudia PlantNeurIPS 2026

TL;DR

Nature loves trees—from biological taxonomies to object hierarchies—yet standard flat Euclidean geometry struggles to represent branching structures without massive distortion. HyperTree introduces a way to discover deep visual hierarchies completely unsupervised in hyperbolic space, fixing a fundamental geometric flaw in previous work and breaking an $\mathcal{O}(n^3)$ computational bottleneck so it can scale to millions of images. Remarkably, its compact, label-free embeddings outperform even supervised hyperbolic baselines that rely on explicit class labels and up to $8\times$ more dimensions.

What Problem Does This Paper Address?

Look around you: a trout is a fish, which is an animal; a pickup truck is a vehicle. Real-world visual data is inherently hierarchical. Yet nearly all modern self-supervised learning embeds images into standard Euclidean space. Because the number of nodes in a tree grows exponentially with depth, while the volume of Euclidean space only grows polynomially, squeezing trees into flat space inevitably crushes branches together—especially in low dimensions.

Hyperbolic space (negatively curved space, like a continuous version of a tree) solves this because its volume also grows exponentially.

Figure 1: Geometry is decisive at low dimension. Two-dimensional embeddings of three CIFAR- 100 superclasses (fish, trees, vehicles 1) together with their fine-grained classes. In Euclidean space (left), superclasses collapse into an indistinct cluster, while the Poincaré Ball under our framework (right) recovers a clean hierarchy. White markers denote the rectified hyperbolic LCAs (Section 4.2), and the gray edge joins all three superclasses at the root.

However, getting unsupervised hierarchical learning to actually work in hyperbolic space has hit two walls:

  1. A geometric bug: Defining the Lowest Common Ancestor (LCA)—the point where two branches meet—previously lacked a consistent, closed-form formula that properly handled cases where one point is a direct ancestor of another.
  2. A scaling wall: Measuring the quality of a learned tree typically relies on Dasgupta’s cost, which requires evaluating triplets of data points. At $\mathcal{O}(n^3)$ complexity, prior continuous relaxations choked beyond a few thousand images unless they leaned on human-annotated class labels.

Methods

HyperTree pairs a standard visual backbone with a hyperbolic head, mapping standard Euclidean features into hyperbolic space (supporting both the Poincaré Ball and Hyperboloid models at arbitrary curvatures).

Figure 2: Hybrid model architecture. Euclidean features are mapped to the hyperbolic space via the exponential map and a hyperbolic linear layer for joint contrastive and hierarchical optimization.

While the model uses a standard InfoNCE contrastive loss ($\mathcal{L}_{\text{C}}$) to pull similar images together, its magic lies in three novel contributions powering the hierarchical loss ($\mathcal{L}_{\text{H}}$):

  • Rectified Hyperbolic LCA: Previous methods found the LCA of two points by projecting the origin onto the infinite geodesic line passing through them. If one node was an ancestor of the other, this projection landed outside the segment connecting them! HyperTree restricts the LCA strictly to the connecting geodesic segment and derives exact, closed-form equations for arbitrary dimensions and curvatures across both hyperbolic manifolds.
Illustration of how previous LCA definitions fall outside the geodesic segment connecting ancestor-descendant pairs.
  • Scale-Invariant Hierarchical Objective: Building on a normalized version of Dasgupta’s cost, the authors formulate $\mathcal{L}_{\text{H}}$—an almost-everywhere differentiable objective bounded cleanly in $[0, 1]$. Unlike raw Dasgupta relaxations, $\mathcal{L}_{\text{H}}$ doesn't blow up as dataset size or edge weights change, and it shares the exact same minimizers under fixed similarities.
  • Constant-Cost Triplet Sampling: By rewriting $\mathcal{L}_{\text{H}}$ as a ratio of expectations, the authors use importance-rejection sampling within each batch to estimate the loss. Crucially, rejected triplets are evaluated gradient-free and never enter the backward pass.

Datasets

No new datasets are introduced; instead, HyperTree is stress-tested across four standard vision benchmarks spanning massive jumps in scale and taxonomic depth:

  • CIFAR-100: 100 classes across an 8-level WordNet hierarchy.
  • TinyImageNet: 200 classes across 7 WordNet levels.
  • ImageNet-1k: 1,000 classes across 8 WordNet levels.
  • iNaturalist-2018: A fine-grained biological dataset of 8,142 species nested within a 7-level taxonomy.

(Note: No target class labels are used during HyperTree's training, though on iNaturalist-2018, the frozen BioCLIP backbone was originally pretrained on taxonomic-text-paired images).

Key Insights and Ideas

  • Escaping the $\mathcal{O}(n^3)$ trap with constant sample complexity: The biggest "aha" moment is Theorem 4.5. Because the normalized loss terms are strictly bounded, the number of accepted triplets needed to estimate $\mathcal{L}_{\text{H}}$ within precision $\varepsilon$ and confidence $1-\delta$ does not depend on dataset size $n$. Roughly $27,000$ triplets per step is mathematically sufficient whether you are training on $100,000$ images or $10,000,000$.
  • Geometry beats supervision at low dimensions: You might expect a model given ground-truth fine-grained labels (like the hyperbolic baseline HIER) to easily beat an unsupervised model. Instead, explicitly optimizing a geometrically sound tree objective lets unsupervised embeddings organize hierarchies better than supervised metric learning—even in a tiny 16-dimensional space.
  • Manifold flexibility: Providing exact math for both the Poincaré Ball and Hyperboloid lets practitioners choose whichever numerical properties suit their pipeline, though empirically the Poincaré Ball held a slight, consistent edge with lower variance across seeds.

Key Results

Evaluated via Hierarchical Dendrogram Purity ($h\text{DP} \in [0, 1]$, higher is better) under a shared Ward linkage decoder, HyperTree sets a new unsupervised state of the art:

  • Crushing Euclidean Baselines: On ImageNet-1k, HyperTree ($d=32$, Poincaré Ball) hits $0.934$ $h\text{DP}$, dwarfing top unsupervised Euclidean deep-clustering methods like SCAN ($0.276$) and SeCu ($0.334$) operating at $d=128$. On TinyImageNet, HyperTree reaches $0.862$ vs. SeCu's $0.121$.
  • Beating Supervised Hyperbolic Learning: HyperTree outperforms the supervised hyperbolic method HIER across every tested benchmark—scoring $0.898$ vs. $0.797$ on CIFAR-100 ($d=16$), $0.862$ vs. $0.447$ on TinyImageNet ($d=16$), and $0.934$ vs. $0.531$ on ImageNet-1k ($d=32$), remaining ahead even when HIER is given up to $8\times$ more dimensions.
  • Scaling to 8,000+ Species: On iNaturalist-2018 ($d=128$), HyperTree achieves $0.921$ Ward $h\text{DP}$, improving direct LCA-decoded tree purity by $+0.111$ over the pretrained epoch-0 anchor.

Limitations and Future Work

  • Frozen Backbones at Scale: While CIFAR-100 and TinyImageNet were trained end-to-end, experiments on ImageNet-1k and iNaturalist-2018 kept the pretrained backbones (DINO and BioCLIP) frozen, updating only the projection head and hyperbolic layers. Whether full end-to-end training at massive scale improves hierarchy discovery remains an open question.
  • Curvature vs. Decoder Sensitivity: While tree recovery was largely insensitive to the choice of linkage decoder on three datasets, on iNaturalist-2018, Ward linkage and the direct LCA-induced tree peaked at different manifold curvatures. Investigating where and why tree branches disagree across curvatures could help automate curvature selection in future work.

Summary updated

Abstract

Real-world image datasets are deeply hierarchical, yet unsupervised hierarchical representation learning remains underdeveloped. Hyperbolic space is geometrically ideal for embedding trees with low distortion due to its exponential volume growth, but existing unsupervised hyperbolic methods either fail to scale beyond a few thousand points or depend heavily on class supervision. We bridge this gap with \method, a scalable, capacity-efficient framework with a fully unsupervised objective, built on three contributions: (i) a geometrically consistent, closed-form definition of the hyperbolic Lowest Common Ancestor, valid across hyperbolic manifolds of arbitrary curvatures; (ii) an almost everywhere differentiable hierarchical objective based on Dasgupta's cost that is bounded and invariant to dataset scale; and (iii) a sample-complexity guarantee that enables scaling to datasets such as ImageNet-1k and iNaturalist-2018. Across four benchmarks, \method outperforms Euclidean deep-clustering baselines by wide margins on hierarchical dendrogram purity and surpasses supervised hyperbolic baselines even when the baseline uses up to 8× more dimensions. We release our code at [github.com/univie-dm/HyperTree](https://github.com/univie-dm/HyperTree).
BibTeX
@inproceedings{lang2026hypertree,
  author = {Thomas Lang and Kevin Sidak and Anna Beer and Sebastian Tschiatschek and Yllka Velaj and Claudia Plant},
  title = {{HyperTree: Scalable Unsupervised Hierarchy Discovery in Hyperbolic Space}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=eKnZ75qpqp},
}
Figure