Papers
Topics
Authors
Recent
Search
2000 character limit reached

Hyperbolic Residual Quantization

Updated 4 July 2026
  • Hyperbolic Residual Quantization is a method that replaces Euclidean operations with hyperbolic counterparts to align discrete representations with latent hierarchies.
  • It employs gyrovector operations like Möbius addition and subtraction to iteratively quantize residuals within the Poincaré ball model.
  • Empirical evaluations show up to 20% improvements in hierarchy modeling, enhancing code selection and reconstruction in tasks such as WordNet and recommendation systems.

Hyperbolic Residual Quantization (HRQ) is a residual quantization method for learning discrete multitoken representations of data with latent hierarchies by replacing Euclidean operations with hyperbolic counterparts in the quantization pipeline. Introduced as an extension of residual quantization (RQ), HRQ embeds data in a hyperbolic manifold, performs nearest-neighbor codeword selection with a hyperbolic distance, and updates residuals and partial reconstructions with manifold-native operations. The resulting discrete identifiers are intended to inherit an inductive bias aligned with hierarchical branching, addressing the mismatch between Euclidean geometry and tree-like structure that arises in standard RQ (Piękos et al., 18 May 2025).

1. Conceptual basis and motivation

Residual quantization in Euclidean space constructs a multitoken representation by iteratively quantizing the residual of a vector relative to a partial reconstruction. With codebooks C=[C0,,Ck1]C = [C_0, \dots, C_{k-1}], each CiC_i containing ss vectors in Rh\mathbb{R}^h, Euclidean RQ selects codewords greedily so as to minimize reconstruction error, producing a reconstruction y=e0++ek1y = e_0 + \dots + e_{k-1} and a token sequence [t0,,tk1][t_0, \dots, t_{k-1}] (Piękos et al., 18 May 2025).

In the formulation reported for RQ, the greedy objective at level kk selects ckCkc_k \in C_k to minimize

x(c1++ck)2,\|x - (c_1 + \dots + c_k)\|_2,

with residual

rk=x(c1++ck).r_k = x - (c_1 + \dots + c_k).

In RQ-VAE, codebooks are learned end-to-end with an autoencoder and the residual-commitment loss

CiC_i0

where CiC_i1 denotes stop-gradient (Piękos et al., 18 May 2025).

The motivation for HRQ is geometric. Euclidean volume grows polynomially with radius, whereas hierarchical branching grows exponentially with depth. The paper argues that this mismatch hinders faithful representation of hierarchical data, even though Euclidean RQ induces a hierarchical structure in the code selection sequence. Hyperbolic geometry, by contrast, has constant negative curvature and exponential volume expansion, and is therefore more naturally aligned with tree-like organization (Piękos et al., 18 May 2025).

This leads to the central claim of HRQ: by adapting the embedding network, residual computation, and distance metric to hyperbolic geometry, the learned discrete tokens can better capture latent hierarchies and become more useful for downstream tasks than Euclidean RQ tokens (Piękos et al., 18 May 2025).

2. Hyperbolic geometry and manifold structure

HRQ uses the CiC_i2-dimensional Poincaré ball model with curvature CiC_i3. The manifold is

CiC_i4

and its Riemannian metric is conformal to the Euclidean metric with conformal factor

CiC_i5

For nearest-neighbor search in codebooks, HRQ uses the hyperbolic distance

CiC_i6

and equivalently

CiC_i7

These definitions supply the metric structure underlying codeword selection and manifold-native residual updates (Piękos et al., 18 May 2025).

HRQ replaces Euclidean arithmetic with gyrovector operations. The Möbius addition used in the method is

CiC_i8

and Möbius subtraction is defined as

CiC_i9

The exponential and logarithmic maps at base point ss0 are

ss1

and

ss2

These maps transfer vectors between the manifold and the tangent space ss3, making it possible to implement hyperbolic neural network layers and stable optimization in the Poincaré ball (Piękos et al., 18 May 2025).

The geometric intuition emphasized in the work is that negative curvature induces an inductive bias matching tree-like branching. Two effects are highlighted. First, radial organization places cluster centers, interpreted as common ancestors, closer to the origin while pushing leaves outward. Second, branch separation increases because metric expansion away from the center enlarges distances across distinct branches while preserving relative proximity within a branch. In Appendix D, the paper connects the Fréchet mean under hyperbolic distance to an analogue of the nearest common ancestor and reports that hierarchical clustering in hyperbolic space places cluster centers nearer the origin than their leaves (Piękos et al., 18 May 2025).

3. Residual quantization in the hyperbolic manifold

HRQ performs residual quantization directly in the manifold rather than in Euclidean latent space. The input is first represented in the Poincaré ball, and the quantizer then iteratively selects codewords from level-specific codebooks using hyperbolic nearest-neighbor search. The procedure initializes the residual as ss4 in ss5 and the partial reconstruction as ss6, the origin. At level ss7, it selects ss8 and token ss9 by nearest neighbor under Rh\mathbb{R}^h0, updates the residual via Möbius subtraction,

Rh\mathbb{R}^h1

and updates the partial reconstruction via Möbius addition,

Rh\mathbb{R}^h2

After Rh\mathbb{R}^h3 levels, the method returns the multitoken Rh\mathbb{R}^h4 and the hyperbolic reconstruction Rh\mathbb{R}^h5 (Piękos et al., 18 May 2025).

This construction mirrors Euclidean RQ structurally while changing the ambient geometry. The novelty claimed for HRQ is not merely the use of hyperbolic embeddings before quantization, but the full residual quantization procedure in hyperbolic space: manifold-native residuals, hyperbolic nearest neighbors, and hyperbolic autoencoding (Piękos et al., 18 May 2025).

The encoder and decoder are also adapted to the manifold. Inputs Rh\mathbb{R}^h6 are first mapped onto the manifold through the exponential map at the origin, Rh\mathbb{R}^h7, then processed by hyperbolic layers relying on combinations of logarithmic and exponential maps with gyrovector operations. Decoding back to Euclidean space uses Rh\mathbb{R}^h8. In the notation reported for HRQ-VAE, the encoder Rh\mathbb{R}^h9 maps in-manifold embeddings, the decoder y=e0++ek1y = e_0 + \dots + e_{k-1}0 maps hyperbolic latents back, and the quantizer operates within y=e0++ek1y = e_0 + \dots + e_{k-1}1 (Piękos et al., 18 May 2025).

A practical implication is that the entire representation pathway is geometry-consistent: embedding, quantization, residual computation, and reconstruction all use operations compatible with the same negatively curved manifold. The paper presents this consistency as the mechanism by which hierarchical structure is better preserved in the learned discrete codes (Piękos et al., 18 May 2025).

4. Objective, optimization, and implementation

HRQ adopts the RQ-VAE residual-commitment loss unchanged in form,

y=e0++ek1y = e_0 + \dots + e_{k-1}2

but the residuals and codebook vectors live in y=e0++ek1y = e_0 + \dots + e_{k-1}3 and nearest neighbors are computed with the hyperbolic distance y=e0++ek1y = e_0 + \dots + e_{k-1}4 (Piękos et al., 18 May 2025).

The end-to-end HRQ-VAE training procedure reported in the paper proceeds in five stages. First, given Euclidean input y=e0++ek1y = e_0 + \dots + e_{k-1}5, the model computes y=e0++ek1y = e_0 + \dots + e_{k-1}6 and encodes it hyperbolically as y=e0++ek1y = e_0 + \dots + e_{k-1}7, which lies either in y=e0++ek1y = e_0 + \dots + e_{k-1}8 or y=e0++ek1y = e_0 + \dots + e_{k-1}9 depending on the design. Second, it performs level-wise codeword selection by initializing [t0,,tk1][t_0, \dots, t_{k-1}]0 and [t0,,tk1][t_0, \dots, t_{k-1}]1, then selecting codewords by hyperbolic nearest neighbor. Third, it updates residuals and partial reconstructions with Möbius subtraction and addition. Fourth, it decodes via [t0,,tk1][t_0, \dots, t_{k-1}]2, converts back to Euclidean space by [t0,,tk1][t_0, \dots, t_{k-1}]3, computes reconstruction loss [t0,,tk1][t_0, \dots, t_{k-1}]4, and optimizes the total loss

[t0,,tk1][t_0, \dots, t_{k-1}]5

Finally, it returns the multitoken representation (Piękos et al., 18 May 2025).

The main training-time difference from Euclidean RQ-VAE lies in optimization. HRQ uses Riemannian optimizers, such as Riemannian SGD or Riemannian Adam, for hyperbolic parameters including embeddings and codebooks, while Euclidean parameters use standard optimizers. The paper states that the curvature [t0,,tk1][t_0, \dots, t_{k-1}]6 is treated as a hyperparameter in experiments and is not learned in the reported runs (Piękos et al., 18 May 2025).

Several implementation constraints are highlighted. Operations are executed within the ball using exponential and logarithmic maps and Riemannian retractions; in practice, one keeps [t0,,tk1][t_0, \dots, t_{k-1}]7 and clips norms near the boundary to avoid numerical issues. The reported complexity for quantization is [t0,,tk1][t_0, \dots, t_{k-1}]8 per datapoint, since each level performs nearest-neighbor search over [t0,,tk1][t_0, \dots, t_{k-1}]9 codewords with hyperbolic distance of the same asymptotic cost as Euclidean distance, albeit with additional manifold-map overhead (Piękos et al., 18 May 2025).

The paper also provides practical guidance for reproducibility. It recommends normalizing vectors before the exponential map, using batched kk0 or kk1 formulations for distance, and considering approximate nearest-neighbor search adapted to hyperbolic metrics when codebook size is large. These recommendations reflect numerical and computational considerations rather than changes to the underlying algorithm (Piękos et al., 18 May 2025).

5. Empirical evaluation

The reported experiments evaluate HRQ against Euclidean RQ in two distinct scenarios: supervised hierarchy modeling using WordNet hypernym trees, and hierarchy discovery without explicit hierarchical supervision using recommendation datasets (Piękos et al., 18 May 2025).

For hierarchy modeling, the dataset is the WordNet nouns subnetwork with 82,115 nouns and 743,241 hypernymy edges, using an 85% train and 15% test split of relations. Training learns multitokens by embedding nouns and optimizing a contrastive objective on kk2 together with the quantization loss:

kk3

where kk4 is Euclidean distance for RQ and hyperbolic distance for HRQ, and kk5 is a sampled set of negatives not in hypernymy with kk6. The downstream task fixes the learned multitokens and trains a sequence-to-sequence transformer to map a noun’s multitoken to its hypernym’s multitoken, evaluated with Recall@10 on the held-out 15% edges (Piękos et al., 18 May 2025).

For this WordNet setting, the reported hyperparameters are token lengths kk7, codebook sizes kk8, and embedding dimensions kk9. Encoders are optimized with SGD or Riemannian SGD, learning rate ckCkc_k \in C_k0, for 1500 epochs with a 20-epoch warmup at ckCkc_k \in C_k1. The downstream transformer has 4 encoder and 4 decoder layers, hidden size 256, FFN size 1024, 8 heads, tied embeddings, and is trained for 100 epochs with Adam at learning rate ckCkc_k \in C_k2 (Piękos et al., 18 May 2025).

The principal result is that HRQ multitokens consistently outperform RQ multitokens in hierarchy modeling, with gains of up to about 20% in Recall@10. The paper states that, for example, with ckCkc_k \in C_k3 and ckCkc_k \in C_k4, HRQ sustains higher Recall@10 across embedding dimensions and remains more stable across dimensionality than RQ. Table 1 reports improvements such as ckCkc_k \in C_k5, ckCkc_k \in C_k6, and ckCkc_k \in C_k7, with typical gains between ckCkc_k \in C_k8 and ckCkc_k \in C_k9 depending on x(c1++ck)2,\|x - (c_1 + \dots + c_k)\|_2,0 and x(c1++ck)2,\|x - (c_1 + \dots + c_k)\|_2,1 (Piękos et al., 18 May 2025).

For hierarchy discovery, the datasets are Amazon Reviews 2014 subsets and MovieLens 10M. The reported sizes are Beauty with 22,363 users and 12,101 items, Toys & Games with 35,598 users and 18,357 items, Sports & Outdoors with 19,412 users and 11,924 items, and MovieLens 10M with 71,567 users and 10,681 items. For MovieLens, item descriptions are generated with Claude 3.5 Sonnet and all item descriptions are embedded by MPNet (768-D). HRQ-VAE and RQ-VAE are trained on item embeddings without direct hierarchical supervision. The encoder has 3 layers of sizes 512, 256, and 128 with hyperbolic ReLU activations, output latent size 32, and a symmetric decoder. Codebook size is 256 per token and codebooks are not shared across levels. Training uses 5000 epochs, batch size 128, and learning rates in x(c1++ck)2,\|x - (c_1 + \dots + c_k)\|_2,2 chosen by validation performance on the downstream task. The downstream recommender is a T5-like transformer encoder-decoder that predicts the next item multitoken from previous history, with histories limited to 20, filtered to at least 5 interactions, and evaluated using leave-one-out splitting. Metrics are Recall@x(c1++ck)2,\|x - (c_1 + \dots + c_k)\|_2,3 and NDCG@x(c1++ck)2,\|x - (c_1 + \dots + c_k)\|_2,4 for x(c1++ck)2,\|x - (c_1 + \dots + c_k)\|_2,5 (Piękos et al., 18 May 2025).

The reported recommendation results show consistent advantages for HRQ-VAE over Euclidean RQ-VAE and random tokens. On Amazon Beauty, NDCG@5 is 2.41% versus 2.29%, and Recall@10 is 5.01% versus 4.83%. On Amazon Toys & Games, Recall@10 is 4.53% versus 4.22%, and NDCG@5 is 1.94% versus 1.91%. On Amazon Sports & Outdoors, Recall@10 is 2.85% versus 2.78%, and Recall@5 is 1.62% versus 1.58%. On MovieLens 10M, NDCG@10 is 14.27% versus 13.89%, and Recall@10 is 25.49% versus 25.11% (Piękos et al., 18 May 2025).

The paper attributes HRQ’s gains to geometry-aligned code selection. In supervised hierarchy modeling, the hyperbolic metric is reported to align codebook selection with tree-like structure by placing ancestors closer to the origin and leaves farther out, thereby yielding multitokens that reflect ancestor-descendant relations more faithfully than Euclidean sums. In hierarchy discovery tasks, HRQ is said to encourage consistent radial stratification and clearer branch separation, improving the semantic coherence of discrete codes and making them better labels for sequence prediction (Piękos et al., 18 May 2025).

The work also reports a geometric comparison of learned latent spaces by examining the variability of norms of low-dimensional vectors before quantization. After mapping hyperbolic vectors to the tangent space via the logarithmic map, the mean norm is reported as 0.7213 for Euclidean RQ-VAE and 0.3251 for HRQ-VAE; the standard deviation is 0.2696 versus 0.0664; and the coefficient of variation, defined as x(c1++ck)2,\|x - (c_1 + \dots + c_k)\|_2,6, is 0.3738 versus 0.2042. The interpretation offered is that lower variability under HRQ-VAE supports a more regular, radially structured space in which norms are less exploited for cluster selection, which the authors argue benefits gradient-based learning and generalization (Piękos et al., 18 May 2025).

HRQ is positioned at the intersection of three research lines: hyperbolic embeddings and hyperbolic neural networks for hierarchical data, discrete quantization models such as VQ-VAE and RQ-VAE, and vector quantization in hyperbolic space such as HyperVQ. The paper describes HyperVQ as complementary to HRQ’s residual approach and states that the two can be combined. HRQ’s specific novelty is the full residual quantization procedure carried out in hyperbolic space rather than a Euclidean residual scheme applied to hyperbolic embeddings only (Piękos et al., 18 May 2025).

Several limitations are stated explicitly. The reported claims focus on data with latent hierarchies and a need for discrete tokens; broader modalities such as images and audio are left for future exploration. Numerical stability remains a concern near the ball boundary, requiring robust implementations of exponential and logarithmic maps and retractions, along with norm clipping or x(c1++ck)2,\|x - (c_1 + \dots + c_k)\|_2,7-buffers. Riemannian optimization introduces overhead, and efficient batched distance computations or approximate nearest-neighbor search in hyperbolic space may be useful. The impact on purely non-hierarchical domains is described as unclear, and the paper identifies learnable curvature, hybrid manifolds, mixed-manifold designs, and adaptive level depth as promising future directions (Piękos et al., 18 May 2025).

A common misunderstanding would be to treat HRQ as a universally superior replacement for Euclidean RQ. The paper does not make that claim. Its empirical and conceptual arguments are specific to data with latent hierarchies, where negative curvature provides an inductive bias that Euclidean geometry lacks. This suggests that the significance of HRQ lies less in quantization alone than in the alignment between discrete coding and the geometry of the latent structure it is intended to represent (Piękos et al., 18 May 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Hyperbolic Residual Quantization.