Spectral Image Tokenizer

Carlos Esteves, Mohammed Suhail, Ameesh Makadia

TL;DR

This paper introduces a novel "Spectral Image Tokenizer" (SIT) that represents images as sequences of discrete tokens derived from their wavelet transform spectrum. This approach enables more efficient and flexible autoregressive image generation, allowing for coarse-to-fine synthesis, multiscale reconstruction, and text-guided upsampling/editing with improved performance and speed.

What Problem Does This Paper Address?

Autoregressive (AR) transformers have revolutionized natural language processing, but applying them directly to image generation has been challenging. Traditional image tokenizers map pixels to tokens in a raster-scan order, which isn't ideal for AR models as it doesn't naturally capture the hierarchical or coarse-to-fine structure of images. This leads to inefficiencies and limitations in tasks like generating images at different resolutions or performing progressive generation. While diffusion models have become dominant, AR transformers still hold promise, especially with advances in large language models. This paper aims to bridge this gap by developing a tokenizer that inherently supports coarse-to-fine image representation, making it more amenable to AR modeling.

Methods

The core innovation is the Spectral Image Tokenizer (SIT). Instead of tokenizing raw pixels or latent representations, SIT tokenizes the Discrete Wavelet Transform (DWT) coefficients of an image. This has several advantages:

  • Coarse-to-Fine Representation: DWT naturally decomposes an image into approximation (low-frequency) and detail (high-frequency) coefficients across multiple scales. SIT leverages this to create token sequences that represent the image from coarse to fine.
  • Leveraging Image Sparsity: Natural images have more power concentrated in lower frequencies. SIT exploits this by assigning tokens to larger spatial regions at higher wavelet scales, leading to better compression.
  • Scale-Causal Attention: A key architectural feature is the "scale-causal attention" mechanism. This allows tokens at a given scale to attend to tokens from the same scale and lower scales. This is crucial for enabling multiscale processing and generation without retraining for different resolutions.
  • Approximation-Details Transformer (ADTransformer): SIT uses distinct codebooks and transformer parameters for approximation (low-frequency) and detail (high-frequency) coefficients, recognizing their different statistical properties.
  • Autoregressive Generative Model (AR-SIT): The SIT tokenizer is integrated with an autoregressive transformer (AR-SIT) for image generation. This model generates tokens sequentially, conditioned on previously generated tokens. Crucially, the conditioning can be on a coarse reconstruction of the entire image, rather than just previous rows, improving generation quality.

Datasets

  • ImageNet: Used for training and evaluating multiscale reconstruction and class-conditional generation.
  • MS-COCO: Used for evaluating coarse-to-fine text-to-image generation, text-guided upsampling, and text-guided image editing.
  • WebLI: A subset of around 128 million images used for training AR-SIT models.

Key Insights and Ideas

  • Spectrum is Key for AR Generation: Tokenizing the image spectrum (via DWT) rather than spatial pixels provides a natural coarse-to-fine hierarchy that aligns perfectly with autoregressive generation.
  • Flexibility in Resolution: The scale-causal attention mechanism allows the same trained model to handle inputs and generate outputs at various resolutions, a significant advantage over fixed-resolution tokenizers.
  • Faster Coarse Generation: The coarse-to-fine nature enables rapid generation of low-resolution previews, allowing users to select promising candidates for further refinement, significantly speeding up the interactive generation process.
  • Unified Architecture for Multimodality: The paper posits that AR transformers, empowered by better tokenizers like SIT, could offer a unified architecture for both image and language tasks, potentially benefiting from LLM advancements.

Key Results

  • Multiscale Reconstruction: SIT achieves competitive or superior reconstruction metrics compared to ViT-VQGAN on ImageNet, especially at lower resolutions, and is significantly faster.
  • Coarse-to-Fine Generation: AR-SIT matches the performance of baselines like Parti350M on MS-COCO but is several times faster and more memory-efficient, particularly at lower resolutions.
  • Text-Guided Upsampling: Achieves an FID of 6.2 for upsampling 32x32 images to 256x256, outperforming a prompt-only baseline.
  • Class-Conditional Generation: AR-SIT-4* outperforms ViT-VQGAN on ImageNet class-conditional generation.

Limitations and Future Work

  • Text-to-Image Metrics: While SIT improves tokenizer accuracy and enables new applications, the text-to-image generation metrics were similar to the fair baseline, suggesting that tokenizer improvements don't always directly translate to better generative quality in this specific setup.
  • Model Scale: The paper primarily experiments with smaller AR-SIT models (350-650M parameters), while baselines like Parti use much larger models (up to 22B parameters). Future work could explore scaling up AR-SIT.
  • Orthogonal Improvements: The authors acknowledge that their method can be combined with other advancements like convolutional tokenizers, AdaLN, and attention normalization, suggesting avenues for future research.

Summary updated

BibTeX
@inproceedings{esteves2025spectral,
  author = {Carlos Esteves and Mohammed Suhail and Ameesh Makadia},
  title = {{Spectral Image Tokenizer}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure