NesTok improves image generation quality with adaptive token compression

NesTok: Nested Self-Aligned 1D Tokenizer for Autoregressive Image Generation

Computer Vision and Pattern RecognitionArtificial Intelligence

Summary

Creating images with AI often involves breaking pictures into smaller pieces called tokens. When the number of tokens can change, the AI can choose to work faster or more accurately. The authors show that existing ways of training these tokenizers are not fully effective. They introduce NesTok, a new method that trains tokenizers to keep short token versions as good as the full ones by learning from longer sequences. This approach produces better image reconstructions and generation on a popular benchmark.

What this means in practice

  • For computer vision engineers: Generate high-quality images on devices with variable compute resources by adjusting token lengths without sacrificing visual quality.
  • For digital content creators: Produce diverse image generations efficiently by choosing optimal token sequence lengths guided by NesTok training.

Authors

Jiawei Zhang, Shuhao Liu, Rong Huang, Yuancheng Li, Zhihui Li, Xiaojun Chang, Changlin Li

Abstract

One-dimensional (1D) variable-length visual tokenizers enable adaptive compression by varying the number of tokens, allowing downstream autoregressive (AR) models to flexibly trade off generation quality against computational cost using a single tokenizer. However, existing approaches based on nested dropout often fail to fully exploit the representational capacity of the tokenizer, resulting in suboptimal performance in both image reconstruction and generation. In this work, we introduce NesTok, a nested self-alignment framework tailored to dynamic visual tokenizers. NesTok introduces cross-length training, which jointly optimizes reconstruction across token lengths while using the full-length sequence to guide shorter counterparts, enabling shorter token sequences to approach the reconstruction quality of full-length sequences. On ImageNet, NesTok improves substantially over standard training and achieves an rFID score of 0.98. On downstream image generation, it achieves the state-of-the-art gFID score of 1.46 on ImageNet 256$\times$256 among existing variable-length autoregressive image generation methods. Code will be available at https://github.com/jaiwei804/NesTok.