TL;DR
Traditional discrete representation methods like Residual Quantization (RQ) struggle to capture hierarchical data because Euclidean space cannot accommodate the exponential growth of tree structures. This paper introduces Hyperbolic Residual Quantization (HRQ), which natively embeds data and computes residuals within a hyperbolic manifold. By aligning the underlying geometry with the data's latent hierarchy, HRQ yields more semantically rich discrete tokens, achieving up to a 20% performance boost on downstream tasks.
What Problem Does This Paper Address?
From biological taxonomies to product catalogs, hierarchical structures are everywhere. In machine learning, we often want to represent these entities as a sequence of discrete tokens (a "multitoken") rather than continuous vectors to improve interpretability and simplify generative tasks into straightforward predictions.
Residual Quantization (RQ) is the standard method for creating these hierarchical tokens by iteratively quantizing the "leftover" residual vector across multiple codebook levels. However, standard RQ operates in Euclidean space. This creates a fundamental geometric mismatch: the volume of Euclidean space grows polynomially with distance from the origin, whereas the number of nodes in a tree hierarchy grows exponentially with depth. As a result, Euclidean models inevitably crowd and distort hierarchical branching structures, losing vital semantic relationships during encoding.
Methods
To solve this geometric mismatch, the authors propose Hyperbolic Residual Quantization (HRQ) and integrate it into a Variational Autoencoder framework (HRQ-VAE). Instead of forcing data into a flat space, HRQ maps data natively into the Poincaré ball model—a hyperbolic manifold where space expands exponentially toward the boundary, acting like a continuous tree.
The core technical adaptations include:
- Hyperbolic Neural Networks: The encoder and decoder are built using hyperbolic layers to ensure data representations remain natively within the manifold.
- Möbius Operations: Standard vector subtraction and addition are replaced with hyperbolic analogues (Möbius subtraction $\ominus_c$ and Möbius addition $\oplus_c$) to compute residuals and reconstruct vectors without breaking the geometric properties of the space.
- Hyperbolic Distance Metrics: The model uses hyperbolic distance to find the closest codebook vectors during clustering, naturally capturing hierarchical depth and branching.
To interface with standard Euclidean inputs and outputs, the architecture utilizes exponential and logarithmic maps to project vectors smoothly back and forth between the hyperbolic manifold and its flat tangent space.
Datasets
The authors evaluated HRQ across two distinct experimental setups:
- Hierarchy Modeling (Supervised): The transitive closure of the WordNet noun taxonomy (82,115 nouns and 743,241 hypernymy relations) was used to explicitly train and evaluate the model's ability to predict hypernyms (e.g., predicting a general category given a specific word).
- Hierarchy Discovery (Unsupervised): The model was tested on datasets with latent hierarchies but without explicit hierarchical training labels. This included three categories from the Amazon Reviews 2014 dataset (Beauty, Toys and Games, Sports and Outdoors) and the MovieLens 10M dataset (with text descriptions generated via Claude 3.5 Sonnet).
Key Insights and Ideas
- Natural Inductive Bias: Hyperbolic space acts as a "continuous tree." Because the space splits radially, different branches naturally claim their own infinite portions of the space near the boundary, leading to sharper, cleaner boundaries between categories than Euclidean space can provide.
- Stable Vector Norms: In Euclidean RQ, leaf nodes end up splattered haphazardly across the space. In HRQ, the exponential expansion naturally pushes leaf nodes out to a uniform distance from the center. Quantitatively, HRQ exhibits a significantly lower Coefficient of Variation (CV) in its vector norms compared to RQ, which provides a more stable landscape for gradient-based learning.
Key Results
HRQ consistently outperformed its Euclidean counterpart across all configurations:
- Hierarchy Modeling: When translating nouns to their hypernyms using a sequence-to-sequence transformer, tokens generated by HRQ achieved up to a 20% relative gain in Recall@10 over standard RQ tokens. Notably, HRQ maintained high performance even when the embedding dimensionality was highly constrained (down to 4 dimensions).
- Hierarchy Discovery: In downstream sequential recommendation tasks (predicting the next item a user will interact with), HRQ-VAE tokens consistently beat standard RQ-VAE and random baselines across NDCG and Recall metrics, proving that hyperbolic tokens capture richer latent semantic hierarchies even without direct supervision.
Limitations and Future Work
The primary limitation of HRQ is its strong dependency on the data's underlying structure; it is explicitly designed for datasets with clear latent hierarchies. The authors note that they have not yet tested HRQ in general domains where Euclidean RQ traditionally excels, such as raw image or audio processing.
Additionally, the massive surge in popularity of continuous generative approaches (like diffusion models) somewhat reduces the demand for discrete token retrieval methods. For future work, the authors suggest combining HRQ with orthogonal hyperbolic quantization methods, such as HyperVQ, which frames vector quantization as a hyperbolic multinomial logistic regression.
Summary updated