NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

StableVQ: Practical Guidelines for Stable Vector-Quantized Tokenizer Training

Bao Tang, Jiahao Guo, Haoxiang Cao, Wenyu Liu, Changqian Yu, Kun Gai, Xinggang Wang

TL;DR

Training vector-quantized (VQ) tokenizers is notoriously unstable because the encoder-decoder and codebook optimization paths are heavily entangled. StableVQ resolves this by introducing three lightweight, parameter-free interventions—Dynamic STE, Region VQ Loss, and Decoupled Scheduling—that separate these modular concerns. This approach guarantees full codebook utilization and robust training stability across diverse codebook sizes without requiring complex architectural overhead.

What Problem Does This Paper Address?

Discrete visual tokenizers (like VQ-VAEs) are foundational to modern autoregressive and masked image generation models. However, a persistent obstacle in VQ training is "codebook collapse," where only a small fraction of code vectors are ever used, severely underutilizing the model's capacity.

While recent "shared-projection" methods improve codebook utilization, they introduce severe training instabilities. The authors argue that the root cause is inter-module entanglement: the Encoder-Decoder and the Codebook rely on each other to function, creating a fragile system prone to failure under stress. They identify three distinct failure modes driven by this entanglement: prolonged low utilization, permanent dead codes, and sudden scale divergence/utilization collapse.

Three characteristic failure modes of VQ training illustrated through token and code distribution relationships.

Methods

StableVQ introduces three modular, parameter-free components designed to let each part of the system fulfill its role independently:

  1. Dynamic Straight-Through Estimator (Dynamic STE): Standard STE passes gradients back to the encoder uniformly, even when tokens are assigned to very distant codes. This creates unreliable gradient estimates that conflict with the commitment loss, triggering training spikes. Dynamic STE applies a per-token weight based on its relative quantization error, attenuating gradients for distant, unreliable tokens while preserving full gradients for well-matched ones.
Dynamic STE design and its stabilizing effect on reconstruction and commitment losses compared to standard STE.
  1. Region VQ Loss: Standard VQ loss only updates codes selected in the current batch, leaving most codes unsupervised. Region VQ Loss shifts from point-wise to distribution-wise alignment by propagating targets from active codes to nearby inactive ones, ensuring the codebook tracks the encoder output distribution independently.
Region VQ Loss mechanism and t-SNE visualizations showing full codebook utilization by step 500.
  1. Decoupled Schedule: The encoder-decoder and codebook have fundamentally different optimization needs. The encoder-decoder benefits from a warmup-plus-annealing schedule to handle its complex multi-objective landscape, while the codebook requires a sustained high constant learning rate to continuously track the shifting encoder distribution. StableVQ decouples these into two independent schedules.
Pilot study demonstrating the benefits of decoupling learning rate schedules for different modules.

Datasets

The authors evaluate StableVQ on the standard ImageNet dataset at $256 \times 256$ resolution for reconstruction and downstream generation tasks. They also utilize a synthetic non-Gaussian mixture benchmark to specifically test distribution-fitting efficiency and robustness under extreme distribution mismatches.

Key Insights and Ideas

  • Separation of Concerns: Instability isn't an inherent flaw of vector quantization itself, but a consequence of entangled optimization objectives. Giving each module an independent, clean objective restores system-level robustness.
  • Self-Deactivating Interventions: Dynamic STE naturally reduces to standard STE when the model is training healthily (i.e., when tokens match codes well), meaning it requires no hyperparameter tuning or thresholding.
  • Simplicity Wins: Instead of building complex, heavily engineered shared projectors (like ViT blocks) to force stability, fixing the underlying optimization objectives allows a simple single-layer linear projector to achieve state-of-the-art results.

Key Results

  • 100% Codebook Utilization: StableVQ consistently achieves full codebook utilization across diverse codebook sizes (up to 262,144 codes) and initializations.
  • Superior Reconstruction Quality: On ImageNet, StableVQ achieves an rFID of 1.22 (with 16k codes) and 1.05 (with 262k codes) at 40 epochs, significantly outperforming baselines like SimVQ and FVQ. Extended training (120 epochs) pushes rFID down to 0.92.
  • Robustness to Mismatch: Using a new metric, Usage Recovery AUC (UR-AUC), the authors demonstrate that StableVQ rapidly restores full codebook usage under severe codebook-token distribution mismatches, whereas baseline methods stagnate or collapse.
Heatmaps showing rapid codebook usage recovery for StableVQ across diverse distribution relationships.
  • Downstream Generation Gains: Tokenizers trained with StableVQ lead to better class-conditional image generation using autoregressive transformers, achieving a downstream FID of 2.18 (compared to 2.45 for the IBQ baseline).

Limitations and Future Work

The paper primarily focuses on optimization stability and codebook utilization. The authors note that future work should explore recipes that better balance reconstruction quality with semantic structure and downstream generation-friendliness. Additionally, extending this "separation-of-concerns" framework to other domains like video, audio, and multimodal representation learning remains an open and promising direction.

Summary updated

BibTeX
@inproceedings{tang2026stablevq,
  author = {Bao Tang and Jiahao Guo and Haoxiang Cao and Wenyu Liu and Changqian Yu and Kun Gai and Xinggang Wang},
  title = {{StableVQ: Practical Guidelines for Stable Vector-Quantized Tokenizer Training}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=XrO6sGUEHB},
}
Figure