All models

UniTok

Image tokenizer trained to reconstruct images and align with text, using eight small codebooks per token.

Diffusion and generative · 2,855 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

This diagram has 2,855 operations (33 KB) and is drawn when you ask.

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
820.3M
Operations
2,855
Framework
PyTorch
Recurrent
No
Published
NeurIPS (arXiv 2025)
Cited by
12 (as of 30 October 2026)
Authors
Chuofan Ma, Yi Jiang, Junfeng Wu and others
License
MIT
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
m21205
Graph hash
f0910384b6f80dcc96bf0e4b240e7867396ddf0f582653289229db9047424c7a
Skeleton hash
0ed5c3671603fe7364580ae6d85167974d6ca05f23573617dbc087b1f28e9405
Architecture hash
d0d5f8faed36d9935c7ac67d1df89622a9328fa1b49925b3c5e5d15e506603b0
Diagram SHA-256
532d6c04d438aaf965a00d223bec903905c21d212a9670a34ba732b600b05cac
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

UniTok is a visual tokenizer built to serve both image generation and image understanding. The two normally rely on distinct tokenizers, which makes it hard to unify them in one framework. UniTok is trained with two objectives at once: a VQVAE-based reconstruction loss to keep low-level information and an image-text contrastive loss for high-level semantics.

The paper argues that the two objectives do not inherently conflict, and that the bottleneck is the limited representational capacity of the discrete token space. Its remedy is multi-codebook quantization: each visual token is split into chunks, and each chunk is looked up in its own sub-codebook. UniTok uses eight sub-codebooks of 4,096 entries, each 8-dimensional, for a 64-dimensional latent. Attention modules replace the usual linear projection layers for token factorization. The backbone is ViTamin-L/16, a hybrid architecture.

The paper reports 0.38 rFID and 78.6% zero-shot accuracy on ImageNet. The accuracy figure is for a version initialized with pretrained CLIP weights, up from 70.8% with random initialization. The authors note that random initialization leads to better downstream understanding performance. The released checkpoint is therefore the one trained from scratch.

Key idea. UniTok shows that reconstruction and semantic supervision can be trained together in one tokenizer once multi-codebook quantization enlarges the discrete token space.

  • UniTok
  • UniTok-Large
  • unified tokenizer
  • visual tokenizer
  • image tokenizer
  • multi-codebook quantization
  • MCQ
  • discrete visual tokens
  • vector quantization

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

Cite the paper

@misc{ma2025unitokunifiedtokenizervisual,
      title={UniTok: A Unified Tokenizer for Visual Generation and Understanding}, 
      author={Chuofan Ma and Yi Jiang and Junfeng Wu and Jihan Yang and Xin Yu and Zehuan Yuan and Bingyue Peng and Xiaojuan Qi},
      year={2025},
      eprint={2502.20321},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2502.20321}, 
}