[2502.13967] FlexTok: Resampling Images into 1D Token Sequences of Flexible Length
Abstract:Image tokenization has enabled major advances in autoregressive image generation by providing compressed, discrete representations that are more efficient to process than raw pixels. While traditional approaches use 2D grid tokenization, recent methods like TiTok have shown that 1D tokenization can achieve high generation quality by eliminating grid redundancies. However, these methods typically use a fixed number of tokens and thus cannot adapt to an image's inherent complexity. We introduce FlexTok, a tokenizer that projects 2D images into variable-length, ordered 1D token sequences. For example, a 256x256 image can be resampled into anywhere from 1 to 256 discrete tokens, hierarchically and semantically compressing its information. By training a rectified flow model as the decoder and using nested dropout, FlexTok produces plausible reconstructions regardless of the chosen token sequence length. We evaluate our approach in an autoregressive generation setting using a simple GPT-style Transformer. On ImageNet, this approach achieves an FID<2 across 8 to 128 tokens, outperforming TiTok and matching state-of-the-art methods with far fewer tokens. We further extend the model to support to text-conditioned image generation and examine how FlexTok relates to traditional 2D tokenization. A key finding is that FlexTok enables next-token prediction to describe images in a coarse-to-fine "visual vocabulary", and that the number of tokens to generate depends on the complexity of the generation task.
View PDF HTML (experimental) Abstract:Image tokenization has enabled major advances in autoregressive image generation by providing compressed, discrete representations that are more efficient to process than raw pixels. While traditional approaches use 2D grid tokenization, recent methods like TiTok have shown that 1D tokenization can achieve high generation quality by eliminating grid redundancies. However, these methods typically use a fixed number of tokens and thus cannot adapt to an image's inherent complexity. We introduce FlexTok, a tokenizer that projects 2D images into…
saved by
related reading
- [2404.02905] Visual Autoregressive Modeling: Scalable Image Generation via Next-Scale Predictionarxiv.org
- [2605.05331] ViTok-v2: Scaling Native Resolution Auto-Encoders to 5 Billion Parametersarxiv.org
- An In-Depth Analysis of VAR (NIPS 2024 Best Paper): Why Next-scale Prediciton Beats Diffusion Models?zhouyifan.net
- A Picture is Worth 170 Tokens: How Does GPT-4o Encode Images?oranlooney.com
- Generative modelling in latent space – Sander Dielemansander.ai
- The Bitter Lesson is coming for Tokenization – ⛰️ lucalplucalp.dev
- An Image is Worth One Word: Personalizing Text-to-Image Generation using Textual Inversiontextual-inversion.github.io
- Video Generation Models Explosion 2024yenchenlin.me
- [2603.05438] Planning in 8 Tokens: A Compact Discrete Tokenizer for Latent World Modelarxiv.org
- Fast Inference from Transformers via Speculative Decodingarxiv.org
- FLUX.1 Architecture | Demystifying FLUX.1orgreenberg.github.io
- Yang Songyang-song.net