Hyperbolic geometry is the "secret sauce" for data that naturally resembles a tree. From phylogenetic lineages to social networks and language taxonomies, hierarchical structures fit perfectly into hyperbolic space because its volume grows exponentially with its radius—just like the number of leaves in a branching tree.
However, training classifiers in these curved spaces has historically been a headache. It typically requires slow, complex mathematics that makes standard machine learning algorithms crawl. A new paper, "Fast Hyperboloid Decision Tree Algorithms," introduces HyperDT and HyperRF, bringing the speed, scalability, and interpretability of decision trees to the hyperbolic world.
The Computational Bottleneck of Curved Space
Machine learning usually operates in Euclidean space—the flat geometry we learn in school. But for hierarchical data, Euclidean space is a poor fit, forcing data points to "crowd" at the edges. Hyperbolic embeddings solve this crowding issue, but they introduce a significant new problem: computational overhead.
Existing hyperbolic classifiers typically rely on:
- Riemannian Optimization: Iterative gradient descent on curved manifolds, which is notoriously slow and sensitive to initialization.
- Horospheres: Complex geometric constructs that are mathematically heavy to compute.
- Euclidean Projections: Projecting data back to flat space, which often distorts or destroys the very hierarchical structure the embeddings were meant to capture.
The authors identified a critical need for a classifier that is geometrically native (respects the curvature of the space), fast (scales linearly), and interpretable.
Methods: Rethinking the Decision Tree
The authors built HyperDT by rethinking the core of the CART (Classification and Regression Trees) algorithm specifically for the Hyperboloid model (also known as the Lorentz model).
Key Innovations
- Geodesic Splits: Instead of standard "axis-parallel" splits used in flat space (e.g., $x > 5$), HyperDT uses homogeneous hyperplanes—planes passing through the origin of the ambient Minkowski space. As shown in the figure above, these planes intersect the hyperboloid to form "geodesic submanifolds," which are the hyperbolic equivalent of straight lines.
-
Inner Product Formulation: The authors proved that a hyperbolic split can be calculated using a simple inner product: $$S(x) = \text{sign}(\max(0, \sin(\theta)x_d - \cos(\theta)x_0))$$ This elegant formulation entirely avoids the numerically unstable exponential and logarithmic maps usually required for manifold mathematics.
-
Hyperbolic Midpoints: In Euclidean trees, finding a split point halfway between two data points is trivial. In hyperbolic space, "halfway" is non-linear. The authors derived a closed-form equation to find the exact equidistant midpoint between two angles natively in hyperbolic space.
- HyperRF: Building on the single tree, they extended this logic to an ensemble model (Random Forest), utilizing multi-threading to maintain high performance across large datasets.
Key Insights and Visualizing the Splits
Because HyperDT uses geodesic submanifolds, the resulting decision regions are mathematically guaranteed to be convex and topologically continuous. This is a major theoretical win over methods that project data to flat space, where decision boundaries can become fragmented or distorted.
As visualized above, the algorithm recursively partitions the hyperbolic space (represented here as a Poincaré disk) into distinct, convex regions.
Furthermore, most hyperbolic methods scale quadratically ($O(N^2)$) because they must compare pairs of points to calculate distances. By leveraging the inner product formulation, HyperDT scales linearly ($O(N)$), making it viable for massive, real-world datasets. The authors also noted that because the geometry of the tree matches the geometry of the data, a single HyperDT often performs incredibly well, reducing the need for massive, "black-box" ensembles.
Results and Performance
The models were rigorously benchmarked on challenging datasets, including synthetic wrapped Gaussians, RNA sequence embeddings (NeuroSEED), political blog networks (Polblogs), WordNet hierarchies, and high-dimensional image/text embeddings (MERU/CLIP).
- Performance Leader: HyperDT and HyperRF achieved the highest score in 28 out of 36 benchmark tests against both Euclidean and other hyperbolic competitors.
- Massive Speedups: On the NeuroSEED dataset, HyperRF was orders of magnitude faster than its closest hyperbolic ensemble competitor (HORORF). While HORORF showed quadratic runtime growth, HyperRF maintained linear scaling.
- Biological Accuracy: On 16-dimensional RNA data, HyperDT significantly outperformed standard Scikit-Learn decision trees, proving that respecting the underlying geometry leads to better scientific downstream tasks.
Limitations and Future Work
While HyperDT represents a significant leap forward, the authors note a few areas for future exploration:
- Greedy Heuristics: Like standard CART, HyperDT makes "greedy" splits. Future versions could incorporate global optimization or gradient boosting techniques.
- Implementation Optimization: While asymptotically fast, the current Python implementation is slightly slower than the highly-optimized C-based Scikit-Learn by a constant factor.
- Advanced Geometries: The current work focuses on the hyperboloid model. Extending these "inner product splits" to other manifolds, such as spherical or mixed-curvature spaces, is a promising next step.
Want to try it out? The authors have released their code on GitHub: pchlenski/hyperdt.
Summary updated