Manuscript Offprint

arXiv:2610.34828

Transporting Quantiles to Codebook: Scalable Vector Quantization without Codebook Collapse

Yuwei Zeng, Zekun Shi

Abstract

Effective discrete representation learning with VQ-VAE serves as a fundamental component of modern autoregressive generative models. However, it is widely known to suffer from codebook collapse and inefficient code utilization. To address this issue, we propose FlowVQ, a simple yet effective alternative to standard vector quantization by formulating neural quantization as a joint modeling and clustering process. Specifically, we learn the latent space using a lightweight flow matching model alongside training, corresponding to a probability flow ODE that transports an often fixed well-behaved source distribution while preserving probability mass. Based on this, we define the codebook C1C_1 by transporting even-quantile partitioned prior codes C0C_0 from the source space through the learned flow, and obtaining the Voronoi centroids under the induced distribution, leading to a structured discretization. We evaluated on image tokenization and generation, as well as on two tasks requiring high-precision tokenization, demonstrating scalability and improved expressivity of the codebook with full utilization. Code is available at: GitHub repository.

1 Introduction

Vector Quantized Variational AutoEncoder (VQ-VAE), proposed by Van Den Oord et al. [1], [2] demonstrates effective discrete latent representation learning by incorporating Vector Quantization (VQ) into reconstruction. It learns a finite set of codebook vectors and tokenizes continuous data into discrete sequences by mapping to the nearest vectors, enabling large autoregressive models for continuous data generation while leveraging the design, training, and scaling principles behind large language models. By balancing fidelity, expressiveness, and computational efficiency, VQ-VAE remains an essential building block of modern generative models that are adopted across diverse domains, including state-of-the-art models for image generation and video-based world modeling.

With codebook collapse and unscalable model capacity remaining unresolved, existing works have explored numerous ways to mitigate such issues. Early improvements [3–5] involved various training techniques such as random restart, random replacement, and k-means initialization. Williams et al. [6] and Takida et al. [7, 8] proposed stochastic quantization, Zhu et al. [9] and Chang et al. [10] proposed adding an additional projector layer or bridging network after a frozen codebook. With an altered latent space, model performance can be compromised, leading to degenerate reconstruction and representation learning. Recently, Lookup-Free Quantization (LFQ) [11–13] methods proposed an alternative to VQ based on direct scalar quantization with fixed hypercube geometry, rounding values in each dimension to the nearest point, and showed scalable codebook capacity with improved image generation using large vocabulary sizes beyond 2142^{14}.

To circumvent codebook collapse, we propose that an ideal codebook should jointly model and cluster the latent space into even partitions alongside reconstruction training. The codebook vectors correspond to the Voronoi centers of these partitions, naturally allocating denser vectors to high-

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

Figure

Figure 1: FlowVQ on a three-mode 2D latent distribution (K = 50): the learned flow ψ1γ\psi_1^\gamma transports the approximately equal-mass quantile prior codebook C0∈N(0,I)\mathcal{C}_0 \in \mathcal{N}(\mathbf{0}, I), initialized using Sobol samples here and kept fixed thereafter, to the latent space. Self-correction refines each transported code using the pushed quantile samples S1S_1, yielding the density-adaptive posterior codebook C1\mathcal{C}_1.

density regions and sparser vectors to low-density regions, regardless of the manifold geometry. This ensures full and balanced utilization, addressing expressiveness and scalability. Based on this principle, we propose a flow-based vector quantization approach without interfering with the representation learning objective.

A flow matching model [14] learns a continuous transport mapping samples from a prior distribution, such as a Gaussian, to an arbitrary data distribution. This transport corresponds to a Probability Flow ODE (PF-ODE) [15, 16], which preserves probability mass and transports prior quantiles to data quantiles. Based on this, we define the prior codebook uniformly in the well-behaved source space, and co-train the flow model with VQ-VAE. The codebook vectors are then obtained as the pushforward of the prior codebook and move toward the Voronoi centers under the estimated density. Experiments show that a lightweight flow model introduces minor overhead relative to VQ-VAE while maintaining full code utilization and improving performance.

In summary, our contributions are as follows:

  1. We propose FlowVQ, a novel VQ technique that converts codebook learning into a quantile transport problem, where code utilization emerges as a geometric property of the latent space, enabling balanced usage and avoiding codebook collapse.

  2. We show that FlowVQ consistently achieves full codebook utilization across a range of tasks, improving reconstruction and generation quality within a unified tokenizer framework.

References (62)