HyperVQ: MLR-based Vector Quantization in Hyperbolic Space

Nabarun Goswami, Yusuke Mukuta, Tatsuya Harada

Abstract

The success of models operating on tokenized data has heightened the need for effective tokenization methods, particularly in vision and auditory tasks where inputs are naturally continuous. A common solution is to employ Vector Quantization (VQ) within VQ Variational Autoencoders (VQVAEs), transforming inputs into discrete tokens by clustering embeddings in Euclidean space. However, Euclidean embeddings not only suffer from inefficient packing and limited separation—due to their polynomial volume growth—but are also prone to codebook collapse, where only a small subset of codebook vectors are effectively utilized. To address these limitations, we introduce HyperVQ, a novel approach that formulates VQ as a hyperbolic Multinomial Logistic Regression (MLR) problem, leveraging the exponential volume growth in hyperbolic space to mitigate collapse and improve cluster separability. Additionally, HyperVQ represents codebook vectors as geometric representatives of hyperbolic decision hyperplanes, encouraging disentangled and robust latent representations. Our experiments demonstrate that HyperVQ matches traditional VQ in generative and reconstruction tasks, while surpassing it in discriminative performance and yielding a more efficient and disentangled codebook.

Introduction

Vector Quantization (VQ) is a fundamental component of modern generative AI, enabling models like VQ-VAE to convert continuous signals—such as images or audio—into discrete sequences of tokens. Despite its utility, standard VQ in Euclidean space faces a significant challenge known as "codebook collapse." Because Euclidean volume grows only polynomially ($r^n$), it is difficult to pack numerous distinct clusters without them overlapping or becoming underutilized. Consequently, a few "dominant" vectors often represent the majority of the data, while much of the codebook remains "dead," wasting representational capacity and hindering downstream performance.

HyperVQ addresses this by reimagining VQ within hyperbolic geometry. By utilizing the Poincaré ball model, where volume grows exponentially toward the boundary, HyperVQ provides an "expanding pie" of latent space. This geometric property naturally encourages more balanced codebook usage and better cluster separation, leading to more efficient and discriminative discrete representations.

Methods: Quantization via Hyperbolic MLR

HyperVQ reformulates the quantization process by projecting latent embeddings into hyperbolic space and treating codebook selection as a classification task.

The HyperVQ architecture: Euclidean embeddings are projected into the Poincaré ball, quantized using hyperbolic hyperplanes, and mapped back for decoding.

The pipeline consists of several key stages:

  1. Hyperbolic Projection: The encoder produces a Euclidean embedding $z_e$, which is mapped into the Poincaré ball using an exponential map $\exp_0^c(z_e)$.
  2. VQ as Multinomial Logistic Regression (MLR): Rather than a simple nearest-neighbor search, HyperVQ uses hyperbolic MLR. It calculates the probability of an embedding belonging to a specific codebook entry based on its position relative to hyperbolic decision hyperplanes.
  3. Geometrically Constrained Codebook: In HyperVQ, codebook entries are not just points but are defined as "representative points" of these hyperplanes. This structure partitions the latent space with well-defined geometric boundaries, fostering implicit disentanglement.
  4. Differentiable Training: To maintain end-to-end differentiability, the model employs a Gumbel-Softmax distribution over the logits and a straight-through estimator (STE) for gradient propagation.
  5. Logarithmic Mapping: The selected codebook vector $q_k$ is projected back to Euclidean space via a logarithmic map $\log_0^c(q_k)$, yielding $z_q$ for the standard decoder.

Experimental Evaluation

The authors evaluated HyperVQ across diverse benchmarks, including image reconstruction on CIFAR-100 and ImageNet (128x128), speech processing on LibriSpeech 960h, and robustness tests on ImageNet-C.

Mitigating Codebook Collapse

A primary advantage of HyperVQ is its ability to utilize the codebook more effectively. On CIFAR-100 with a codebook size of 512, HyperVQ achieved a perplexity of 220.22, a dramatic improvement over the 58.09 achieved by standard KmeansVQ. This indicates that HyperVQ uses nearly four times as many unique tokens, maximizing the model's capacity.

Generative and Discriminative Performance

HyperVQ not only improves codebook utilization but also enhances the quality of generated data. As shown in the table below, HyperVQ outperforms standard KmeansVQ in both Fréchet Inception Distance (FID) and Inception Score (IS) on ImageNet.

Generative performance comparison on ImageNet: HyperVQ achieves lower FID and higher IS than standard KmeansVQ.

Furthermore, the hyperplane-based approach provides superior discriminative features. In classification tasks on CIFAR-100, HyperVQ reached 31.59% accuracy, outperforming both KmeansVQ (30.04%) and GumbelVQ (25.99%).

Robustness and Disentanglement

HyperVQ demonstrates increased robustness to data corruptions. In the VQ-SA framework on ImageNet-C, it achieved a mean Corruption Error (mCE) of 47.61, compared to 52.65 for the Euclidean baseline. Additionally, the geometric constraints of the hyperbolic hyperplanes lead to more structured and interpretable latent spaces, as evidenced by disentanglement visualizations on MNIST.

Conclusion and Future Work

HyperVQ offers a robust solution to codebook collapse by leveraging the unique properties of hyperbolic geometry. By treating vector quantization as a hyperbolic MLR problem, the model achieves better token utilization, superior discriminative performance, and enhanced robustness without sacrificing generative quality.

While promising, hyperbolic operations are more computationally complex and can be sensitive to numerical precision near the Poincaré ball boundary. Future research will focus on optimizing these operations for mixed-precision training and scaling the approach to larger foundation models.

Summary updated

BibTeX
@article{goswami2025hypervq,
  author = {Nabarun Goswami and Yusuke Mukuta and Tatsuya Harada},
  title = {{HyperVQ: MLR-based Vector Quantization in Hyperbolic Space}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=WgJgIULL9Q},
}
Figure