TL;DR
This paper introduces GRIT-VQ, a novel framework for differentiable vector quantization (VQ) that addresses the instability and under-utilization issues common in current VQ methods. By employing a generalized radius-based surrogate and an integrated transform for codebook updates, GRIT-VQ achieves more stable training, better codebook usage, and improved performance across image generation, reconstruction, and recommendation tasks.
What Problem Does This Paper Address?
Vector quantization (VQ) is a powerful technique for converting continuous data into discrete tokens, essential for many generative and representation learning models. However, the core operation of VQ – finding the nearest neighbor in a codebook – is non-differentiable. This has led to the widespread use of "straight-through estimators" (STEs), which are heuristic workarounds that can cause unstable gradients, sensitivity to hyperparameters, and severe under-utilization of the codebook, especially at scale. These issues make training VQ models fragile and limit their effectiveness. Existing methods often tackle these problems in isolation, failing to account for the coupled nature of quantization geometry and optimization dynamics.
Methods
GRIT-VQ proposes a unified surrogate framework to make VQ fully differentiable while retaining hard assignments during inference. It introduces two key innovations:
- Generalized Radius-Based Surrogate: Instead of the standard STE, GRIT-VQ uses a differentiable surrogate that moves latent vectors along the quantization direction. This movement is controlled by a "generalized radius" function, which allows for a geometry-aware, controllable step size. This approach aims to provide stable gradients and a more faithful surrogate for backpropagation.
- Integrated Transform of the Codebook: GRIT-VQ applies a data-agnostic integrated transform to the codebook. This transform uses shared parameters to update all code vectors coherently, rather than updating each code independently. This encourages coordinated codebook evolution and helps mitigate collapse. The paper explores both linear and attention-style transforms.
Datasets
The paper evaluates GRIT-VQ on a variety of standard datasets across different domains:
- Image Generation: AFHQ, CelebA-HQ, FFHQ, LSUN Bedroom, LSUN Church (all at 256x256 resolution).
- Recommendation: Amazon Product Reviews (Beauty, Sports and Outdoors, Toys & Games subsets) and Amazon-ESCI Product Search, JDsearch.
- Image Reconstruction: ImageNet-1k (at 256x256 resolution).
No new benchmarks were introduced; instead, GRIT-VQ is evaluated within existing benchmark settings.
Key Insights and Ideas
- The coupling of geometry and optimization is crucial: The paper emphasizes that the geometry of the quantization regions and the optimization dynamics are intrinsically linked. GRIT-VQ's design explicitly addresses this coupling.
- Radius matters for stability and smoothness: The generalized radius function provides a principled way to control gradient flow, making training more stable and less sensitive to quantization gaps.
- Integrated transforms prevent codebook collapse: Updating codebooks through shared parameters, rather than in isolation, leads to better coordination and significantly improves codebook utilization, especially for large codebooks.
- GRIT-VQ is robust across diverse tasks: The framework demonstrates consistent improvements in image generation, reconstruction, and recommendation, highlighting its generality.
Key Results
- Image Generation: GRIT-VQ consistently improves FID scores across various datasets and bitrates, outperforming strong baselines, especially in low-bitrate regimes. It also achieves better rate-distortion trade-offs and reduces the burden on autoregressive models.
- Recommendation: GRIT-VQ achieves state-of-the-art performance in both sequential and retrieval-based recommendation tasks, demonstrating statistically significant gains over strong baselines.
- Image Reconstruction: GRIT-VQ achieves top-tier reconstruction quality (PSNR, SSIM, LPIPS, FID) and significantly higher codebook utilization, with fewer dead codes, compared to existing methods.
- Codebook Utilization: GRIT-VQ consistently shows higher codebook utilization across all experiments, particularly with larger codebooks, and avoids the late-stage collapse seen in many other VQ variants.
- Computational Overhead: The default linear integrated transform adds only a modest 6-7% training time overhead and 3-4% peak memory usage compared to standard VQ baselines, while the attention-style mixer adds slightly more.
Limitations and Future Work
- Limitations:
- The paper acknowledges that while GRIT-VQ is robust, aggressive clipping of the radius can slightly reduce codebook utilization and generative quality.
- The integrated transform's effectiveness depends on its ability to preserve semantic structure, which is addressed by design but could be a point of failure for more complex transforms.
- Future Work:
- Extending the framework to multi-stage quantizers.
- Exploring richer transform families.
- Applying GRIT-VQ to large multimodal tokenizers.
- Investigating learnable hyperparameters for the radius and transform.
Summary updated