VQ-VAE / VQ-GAN
What it is
A discrete codebook bottleneck turns continuous data into tokens that a prior model (often a transformer) can generate.
When to use it
Tokenizing images and audio for autoregressive generation; the latent space inside every latent diffusion model.
Caveats
The codebook can collapse, with only a fraction of codes ever used, and the commitment loss needs tuning. Quantization throws away fine detail, and generating new samples requires training a separate prior over the codes.
Key ideas
- Encoder outputs are snapped to the nearest entry in a learned codebook
- Images or audio become sequences of discrete tokens
- VQ-GAN adds adversarial and perceptual losses for sharper reconstructions
- The token sequences feed a transformer or diffusion prior
Related architectures
Original paper
Neural Discrete Representation Learning (2017, arXiv)