All models

ImageFolder

An image tokenizer whose two aligned token sets fold into one sequence for next-scale autoregressive generation.

Diffusion and generative · 2,039 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,039 operations (723 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
547.6M
Operations
2,039
Framework
PyTorch
Recurrent
No
Published
ICLR 2025
Cited by
0 (as of 28 October 2026)
Authors
Xiang Li, Kai Qiu, Hao Chen and others
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
m17542
Graph hash
29639d56f4c40e975a03e49474ec1c6aeadd804d8143dc8ead72d49f2b06a782
Skeleton hash
871fd2c82388cd442576d45b62590969b0dfa3b5b197359e2aaac0261ff54c11
Architecture hash
9c8608d03fdfa7b9f3906ebfa983fd9258c5b241e552f222c0412d6d59773639
Diagram SHA-256
b7cd6433ca94f195eacf2caecf56261ce46ef00c2ba52a13df99489ed1b872b7
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

ImageFolder is an image tokenizer for autoregressive image generation: it turns an image into two sets of spatially aligned discrete tokens, and the generator predicts both tokens of a position at once, which shortens the sequence it has to model. The paper starts from a trade-off: more tokens help reconstruction, but a tokenizer with longer token length is not guaranteed to generate better images.

The tokenizer encodes and decodes images with vision transformers and quantizes with product quantization, which gives two branches of tokens. A semantic regularization is applied to one branch, so that it holds compact semantic information, while the other branch captures the remaining pixel-level details. The semantic target comes from a frozen pre-trained DINOv2 model, and the image encoder is initialized with DINOv2-base weights. Each branch uses multi-scale residual quantization, with scales [1, 1, 2, 3, 3, 4, 5, 6, 8, 11], 286 tokens in total, and a codebook of 4096 entries.

The generator follows VAR's next-scale autoregressive modeling with a GPT-2-based architecture, and the channel count of its output head is doubled so that two tokens are predicted in parallel. On class-conditional ImageNet 256x256 the paper reports 3.53 gFID with a token length of 286. The code repository lists the released 362M generator at 2.60 gFID.

Key idea. ImageFolder is a semantic image tokenizer whose spatially aligned tokens can be folded during autoregressive modeling, shortening the sequence while keeping the number of tokens.

  • ImageFolder
  • folded tokens
  • image tokenizer
  • semantic tokenizer
  • product quantization
  • autoregressive image generation
  • visual tokenizer
  • class-conditional ImageNet generation
  • quantizer dropout

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

Cite the paper

@misc{li2024imagefolderautoregressiveimagegeneration,
      title={ImageFolder: Autoregressive Image Generation with Folded Tokens}, 
      author={Xiang Li and Kai Qiu and Hao Chen and Jason Kuen and Jiuxiang Gu and Bhiksha Raj and Zhe Lin},
      year={2024},
      eprint={2410.01756},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2410.01756}, 
}