TL;DR
This paper introduces SpectralAR, a novel autoregressive visual generation framework that treats images as causal sequences in the spectral domain, rather than spatial patches. By leveraging the frequency components of images, SpectralAR achieves improved token efficiency and sequence causality, leading to competitive generation quality with fewer tokens.
What Problem Does This Paper Address?
Autoregressive models have shown promise in visual generation due to their scalability and compatibility with multimodal tasks. However, existing methods often tokenize images into spatial patches, which inherently violates the causality principle of autoregressive modeling. This spatial tokenization leads to suboptimal performance and can complicate integration with other modalities. While some methods attempt to address this by using multi-scale tokenization or bidirectional attention, they still struggle with token efficiency or deviate from the standard autoregressive paradigm. The paper aims to bridge this gap by proposing a method that enforces causality from the spectral perspective, leading to more efficient and causally consistent visual generation.
Methods
SpectralAR's core innovation lies in its spectral tokenization and autoregressive generation process.
- Nested Spectral Tokenization (NST): Instead of spatial patches, images are transformed into the spectral domain using the Discrete Cosine Transform (DCT). The DCT coefficients, representing different frequency components, are then organized into a 1D causal sequence. This sequence is "nested," meaning tokens representing lower frequencies (overall structure) are generated first, followed by tokens for higher frequencies (details). This coarse-to-fine progression aligns with human perception.
- Non-uniform Token-Frequency Mapping: To further enhance token efficiency, the paper proposes a non-uniform mapping that allocates more tokens to low-frequency components (which carry more visual information) and fewer to high-frequency components (which are less perceptually significant). This is inspired by image compression techniques like JPEG.
- Spectral Causal Mask: To enforce strict causality, causal masks are applied to both the encoder and decoder. This ensures that each spectral token only attends to tokens representing lower frequencies, preventing information leakage from high to low frequencies.
- Autoregressive Generation: The generated spectral tokens are then used by a standard autoregressive model (similar to GPT-2) to reconstruct the image. The generation process is also coarse-to-fine, starting with the DC component and progressively predicting tokens for higher frequencies.
Datasets
The paper uses the ImageNet-1K dataset for training and evaluating class-conditional generation. For a proof-of-concept experiment on causality, they use the CIFAR-100 dataset.
Key Insights and Ideas
- Spectral Causality is Key: The paper argues that the frequency domain offers a more natural way to establish causality for visual sequences than spatial arrangements. Low-frequency components inherently precede high-frequency components in terms of visual information.
- Token Efficiency Through Frequency Prior: By understanding that low-frequency components are more critical for image structure and human perception, SpectralAR can be more efficient by dedicating more tokens to these components and fewer to high-frequency details.
- Hierarchical Refinement: The coarse-to-fine nature of spectral decomposition naturally leads to a hierarchical generation process, mirroring how humans often perceive and create images.
Key Results
- Competitive Generation Quality: SpectralAR achieves competitive generation quality on ImageNet-1K, with a gFID of 3.02 using only 64 tokens and 310M parameters.
- Superior Token Efficiency: Compared to VAR and 2D scan-based methods, SpectralAR uses significantly fewer tokens (e.g., 64 tokens) while maintaining comparable or better performance.
- Improved Causality: Quantitative analysis (Table 1) shows that SpectralAR's spectral sequences exhibit significantly higher linear correlation between consecutive tokens compared to raster-scan and scale-wise methods, indicating better causality.
- Applications: The paper demonstrates SpectralAR's potential for super-resolution and truncated autoregressive generation, showing its flexibility.
Limitations and Future Work
- Reconstruction Performance: While generation performance is competitive, SpectralAR's reconstruction performance (rFID) is noted to be slightly inferior to TiTok. This is attributed to the more complex task of reconstructing sub-images corresponding to different frequencies with varying token lengths.
- Further Token Efficiency: The paper suggests that truncation of the last few tokens can be used to further improve token efficiency, depending on the desired generation quality. This hints at future work in balancing quality and efficiency through adaptive truncation.
- Generalization: While demonstrated on ImageNet, exploring SpectralAR's performance on other diverse datasets and tasks would be a natural next step.
Summary updated