All models

FQGAN

A visual tokenizer that quantizes images with several small sub-codebooks instead of one large codebook.

Diffusion and generative · 1,016 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (16 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
150.4M
Operations
1,016
Framework
PyTorch
Recurrent
No
Published
2024
Cited by
20 (as of 26 November 2026)
Authors
Zechen Bai, Jianxiong Gao, Ziteng Gao and others
License
CC-BY-NC-4.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m16591
Graph hash
db5ff4e61cf459fc217b56a8e845f8b59e156319e81dc5f1b716b58803bcf0e8
Skeleton hash
30b861c727e966e2ee7d3152f9aa3da1cdb8f7cf028d46d8c36254a3b99f0e5a
Architecture hash
6acdc6c735e83d587d2d0a3dd1b0c0d1beb01d3a202f0a9b6afb03cb0fb6e3ed
Diagram SHA-256
bc0f3aaedafb7389265cd8dc72d7341aaef7cab9708f2e16ede84c1e3c7fbd43
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

FQGAN is a visual tokenizer: it converts an image into discrete tokens that transformer-based models can then use for image generation. The paper starts from a limit of VQ-based tokenizers such as VQGAN, where simply expanding the codebook often leads to training instability and diminishing performance gains. Its answer, Factorized Quantization, splits one large codebook into several smaller, independent sub-codebooks.

Two additions keep the sub-codebooks from learning the same information. A disentanglement regularization enforces orthogonality between sub-codebooks, and a representation learning objective draws on features from pretrained vision models. FQGAN-Dual has two sub-codebooks and uses CLIP, while FQGAN-Triple has three and uses CLIP and DINOv2 together. In the paper's visualizations of FQGAN-Dual, sub-codebook 1 highlights low-level structures, shapes and edges, and the CLIP-supervised sub-codebook 2 gives a high-level abstract version of the image.

In the paper's ablation on ImageNet, splitting a single 32,768-entry codebook into two 16,384-entry sub-codebooks changed the reconstruction FID (rFID) from 3.60 to 2.00. The code repository lists reconstruction FID at 256x256 of 0.94 for FQGAN-Dual and 0.76 for FQGAN-Triple at downsample 16. For generation, the paper adds FAR, an autoregressive transformer with a factorized head that predicts the sub-tokens of each image patch one after another.

Key idea. The paper showed that decomposing one large VQ codebook into several independent sub-codebooks, with disentanglement regularization and representation learning, improves the reconstruction quality of visual tokenizers.

  • fqgan
  • factorized quantization
  • factorized visual tokenization
  • visual tokenizer
  • image tokenizer
  • fqgan-dual
  • fqgan-triple
  • sub-codebooks
  • far
  • discrete image reconstruction

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{bai2024factorizedvisualtokenizationgeneration,
      title={Factorized Visual Tokenization and Generation}, 
      author={Zechen Bai and Jianxiong Gao and Ziteng Gao and Pichao Wang and Zheng Zhang and Tong He and Mike Zheng Shou},
      year={2024},
      eprint={2411.16681},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2411.16681}, 
}