TiTok
A ViT-based tokenizer that encodes a 256 × 256 image as a 1D sequence of 32 discrete tokens and decodes it back.
Diffusion and generative · 1,727 operations Checked
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
- 641.1M
- Operations
- 1,727
- Framework
- PyTorch
- Recurrent
- No
- Published
- NeurIPS 2024
- Cited by
- 24 (as of 23 October 2026)
- Authors
- Qihang Yu, Mark Weber, Xueqing Deng and others
- License
- Apache-2.0
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m3098
- Graph hash
- 8bf9e52d3c22c6f6cf5d52d612b0eae1903e39b96d6deaaf1303c8200f65d0d1
- Skeleton hash
- 35053a3b47d0a2f474d3a5abb4a0960cfc802b4eda1b76f55211ebcfcd29e82b
- Architecture hash
- 050d3e4a7cf8d8631cdf6e9c8214c3c883eeb79c7d6c9c785d036ec6a489408d
- Diagram SHA-256
- d420e381a8657285e0f22f2341a04427adfc2080d14101f3556e6074c94dcbce
- 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
TiTok (Transformer-based 1-Dimensional Tokenizer) turns an image into a short 1D sequence of discrete tokens and can decode that sequence back into an image. Earlier tokenizers such as VQGAN typically use 2D latent grids with fixed downsampling factors. The paper argues that this grid restricts how far a tokenizer can exploit the redundancy in images. Its example of the alternative is a 256 × 256 × 3 image reduced to just 32 discrete tokens, against the 256 or 1024 tokens of prior methods.
The model consists of a Vision Transformer (ViT) encoder, a ViT decoder and a vector quantizer. Image patches are passed through the encoder together with a few latent tokens, and only the latent tokens are kept from the encoder output. After quantization, those tokens and a set of mask tokens are fed to the ViT decoder to reconstruct the image.
Training has two stages. The first trains the model against discrete codes from an off-the-shelf MaskGIT-VQGAN model, which the paper calls proxy codes. The second, optional stage keeps the encoder and quantizer frozen and trains only the decoder toward pixel space. The paper reports that TiTok-L-32, the large model with 32 tokens, reaches an rFID of 2.21 on ImageNet 256 × 256, comparable to the 2.28 of the VQGAN from MaskGIT. With the same generator framework and sampling steps, it reports a gFID of 2.77 against 6.18 for MaskGIT.
Key idea. TiTok tokenizes an image into a 1D sequence of discrete latent tokens instead of a 2D grid, so a 256 × 256 image can be represented by 32 tokens.
- TiTok
- Transformer-based 1-Dimensional Tokenizer
- 1D tokenizer
- image tokenizer
- An Image is Worth 32 Tokens
- TiTok-L-32
- image tokenization
- vector quantization
- 1D latent sequence
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{yu2024imageworth32tokens,
title={An Image is Worth 32 Tokens for Reconstruction and Generation},
author={Qihang Yu and Mark Weber and Xueqing Deng and Xiaohui Shen and Daniel Cremers and Liang-Chieh Chen},
year={2024},
eprint={2406.07550},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2406.07550},
}