[Paper Review] An Image is Worth 32 Tokens for Reconstruction and Generation
This paper introduces TiTok, a 1D transformer-based image tokenizer that represents a $256\times256$ image with only 32 discrete tokens by leveraging regional redundancy, significantly reducing token count compared to 2D VQ-based methods. It achieves state-of-the-art performance with 1.97 gFID on ImageNet-256 and up to 74× faster generation at 512×512 resolution, demonstrating that compact 1D latent sequences can enable efficient, high-fidelity image reconstruction and generation.
Recent advancements in generative models have highlighted the crucial role of image tokenization in the efficient synthesis of high-resolution images. Tokenization, which transforms images into latent representations, reduces computational demands compared to directly processing pixels and enhances the effectiveness and efficiency of the generation process. Prior methods, such as VQGAN, typically utilize 2D latent grids with fixed downsampling factors. However, these 2D tokenizations face challenges in managing the inherent redundancies present in images, where adjacent regions frequently display similarities. To overcome this issue, we introduce Transformer-based 1-Dimensional Tokenizer (TiTok), an innovative approach that tokenizes images into 1D latent sequences. TiTok provides a more compact latent representation, yielding substantially more efficient and effective representations than conventional techniques. For example, a 256 x 256 x 3 image can be reduced to just 32 discrete tokens, a significant reduction from the 256 or 1024 tokens obtained by prior methods. Despite its compact nature, TiTok achieves competitive performance to state-of-the-art approaches. Specifically, using the same generator framework, TiTok attains 1.97 gFID, outperforming MaskGIT baseline significantly by 4.21 at ImageNet 256 x 256 benchmark. The advantages of TiTok become even more significant when it comes to higher resolution. At ImageNet 512 x 512 benchmark, TiTok not only outperforms state-of-the-art diffusion model DiT-XL/2 (gFID 2.74 vs. 3.04), but also reduces the image tokens by 64x, leading to 410x faster generation process. Our best-performing variant can significantly surpasses DiT-XL/2 (gFID 2.13 vs. 3.04) while still generating high-quality samples 74x faster.
Motivation & Objective
- To investigate whether 2D structural constraints in image tokenization are necessary for high-quality image representation.
- To address the inefficiency of 2D tokenizers in handling image redundancy by proposing a 1D latent sequence representation.
- To enable more compact, efficient, and semantically rich image representations that support high-resolution image generation.
- To demonstrate that 1D tokenization can outperform 2D counterparts in reconstruction fidelity and generation speed, especially at low token counts.
- To validate the effectiveness of 1D tokenization through ablation studies and comparisons with state-of-the-art models like MaskGIT and DiT-XL/2.
Proposed method
- TiTok uses a Vision Transformer (ViT) encoder to process flattened image patches concatenated with learnable 1D latent tokens.
- A vector quantizer (VQ) maps the encoded features into discrete tokens, forming a compact 1D sequence of discrete latent codes.
- A ViT decoder reconstructs the original image from the masked 1D token sequence, enabling end-to-end training with reconstruction loss.
- The model employs a two-stage training strategy with proxy codes to improve token quality, especially when using limited tokens.
- Masking schedules are applied during generation to simulate autoregressive autoregressive generation, with ablation showing improved robustness to linear and arccos schedules.
- The framework breaks 2D grid constraints, allowing each latent token to attend to non-local, semantically relevant image regions, enhancing representational efficiency.
Experimental results
Research questions
- RQ1Can a 1D latent sequence representation achieve competitive image reconstruction and generation performance compared to 2D grid-based tokenizers?
- RQ2Does 1D tokenization effectively exploit image redundancy to reduce token count without sacrificing fidelity?
- RQ3How does the performance of 1D tokenization scale with model size and token count, especially at low token counts like 32 or 64?
- RQ4To what extent does 1D tokenization improve generation speed and throughput compared to 2D counterparts?
- RQ5Is the two-stage training with proxy codes essential for achieving state-of-the-art performance in 1D tokenization?
Key findings
- TiTok reduces a $256\times256$ image to just 32 discrete tokens, a 64× reduction compared to 2D VQGAN methods.
- On ImageNet-256, TiTok achieves 1.97 gFID, outperforming the MaskGIT baseline by 4.21 gFID.
- At ImageNet-512, TiTok achieves 2.13 gFID, surpassing DiT-XL/2 (3.04 gFID) while generating samples 74× faster.
- With decoder fine-tuning and larger codebooks, TiTok-L-32 achieves 2.21 rFID on reconstruction, a 5.8× improvement over the baseline.
- The 1D variant of TiTok-B-64 outperforms its 2D counterpart by 10.43 rFID (5.15 vs. 15.58), proving the superiority of 1D design under compact latent space.
- Two-stage training with proxy codes enables TiTok to achieve 1.70 rFID, outperforming MaskGIT-VQGAN (2.28 rFID), demonstrating the effectiveness of the training recipe.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.