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 C_1 by transporting even-quantile partitioned prior codes C_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.
Figures & tables
Figure 1: FlowVQ on a three-mode 2D latent distribution (K = 50): the learned flow ψ1γ transports the approximately equal-mass quantile prior codebook C0∈N(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 S1 , yielding the density-adaptive posterior codebook C1 .
d
∣C∣
rFID ↓
IS ↑
SSIM ↑
PSNR ↑
LPIPS ↓
MAE ↓
Entropy ↑
Util %↑
VQ-GAN+
10
1024
2.40
10.77
0.78
23.62
0.130
0.050
8.81
45.6
10
10240
2.65
10.70
0.75
23.27
0.143
0.052
8.07
2.7
w/o Lent
14
16384
1.93
10.88
0.81
24.79
0.115
0.044
8.71
2.6
14
16384
1.65
10.87
0.81
24.82
0.114
0.044
8.57
2.8
LFQ
10
1024
3.00
10.65
0.74
23.01
0.149
0.058
8.46
50.0
w/o Lent
14
16384
2.95
10.83
0.73
22.57
0.161
0.056
5.91
0.8
Table 1: Evaluation of image quality and codebook utilization on CIFAR-10. By default, all baselines optimize the auxiliary entropy loss while FlowVQ does not if not specified. As the entropy maximization is tightly coupled in the OptVQ optimization process, we did not explore removing it.
Figure 2: Visualization of (left) the latent vectors on the evaluation set ∙ ; (middle) the codebook ▲ ; (right) the joint plot of latent vectors ∙ and codebook vectors ▲ in each plot. For each model, the latent vectors and code vectors are randomly down-sampled to the same number, then jointly reduced to 3D using t-SNE for visualization.
Figure 3: class-conditioned generation on ImageNet-1K 256×256 trained model. Each image corresponds to a different class. More samples can be found in Appendix C.3 .
Model
Tokenizer
∣C∣
#tokens
#params
rFID ↓
gFID ↓
IS ↑
ImageNet-1K val. data [ 21 ]
1.78
236.9
LDM-4-G [ 23 ]
Continuous ∗
8192
642
400M
-
3.60
247.7
LDM-8-G [ 23 ]
Continuous ∗
16384
322
506M
-
7.76
209.5
MAR-L-407M [ 38 ]
Continuous
-
162
407M
1.22
1.97
291.2
FSQ [ 11 ]
LFQ
1000
162
155M
-
4.53
-
MAGVIT-v2 [ 12 ]
LFQ
262144
162
307M
-
1.78
319.4
Table 2: Image reconstruction and generation on ImageNet-1K 256×256 with classifier free guidance. We compare FlowVQ with the existing works with similar model capacity and their guided or rejection sampling scores. * LDM reconstructs on continuous space, but generation discretizes input to the nearest token.
Figure 4: Reconstruction on unseen images from COCO-2017 validation data on ImageNet-1K 256×256 trained model.
VQVAE
LFQ
OptVQ ( ϵ=10∗ )
KM-VQVAE
KM-OptVQ ( ϵ=10 )
KM-OptVQ ( ϵ=1 )
FlowVQ
FlowVQ (w/ oc)
Match Rate ↑
47.16 %
24.63%
10.81%
78.38%
17.85%
53.27%
90.81 %
90.66 %
Table 3: Match rate between the reconstructed and ground-truth material on MP-20.
FAST+
KM-VQVAE
FlowVQ
MSE(e-4) ↓
2.40
1.88
1.71
Utilization ↑
97.02%
10.89%
100%
Table 4: Trajectory reconstruction error of 50-step action chunks on DROID dataset.
FID ↓
IS ↑
SSIM ↑
PSNR ↑
LPIPS ↓
MAE ↓
Entropy ↑
Util ↑
C0→C1
1.49
10.79
0.856
26.11
0.086
0.038
13.92
100%
C0→C1 + sc
1.52
10.70
0.841
25.73
0.094
0.039
13.97
100%
C0→C1 + sc + oc
1.40
10.72
0.861
26.50
0.086
0.036
13.97
100%
Table 5: Ablation study on FlowVQ components on CIFAR-10 image tokenization and MP-20 material tokenization tasks. With details in Sec 3.3 , sc refers to self-correction mechanism, and oc refers to the optional online-correction mechanism.