TL;DR
MacTok introduces a novel 1D continuous image tokenizer that achieves extreme compression (down to just 64 or 128 tokens) without suffering from posterior collapse. By combining random and semantic image masking with dual-level representation alignment, it prevents latent space degeneration and sets a new state-of-the-art for continuous tokenization in high-fidelity image generation.
What Problem Does This Paper Address?
Modern visual generative models (like diffusion models or autoregressive transformers) rely heavily on image tokenizers to compress high-dimensional pixels into a manageable latent space. These tokenizers generally fall into two camps: discrete (VQ-VAE) and continuous (KL-VAE). While continuous tokenizers offer smooth, well-structured latent spaces, they suffer from a fatal flaw under high compression: posterior collapse.
When forced to compress an image into very few tokens, the Kullback-Leibler (KL) regularization term often over-constrains the latent space. The encoder gives up on encoding meaningful image features, and the decoder learns to ignore the latent tokens entirely, relying instead on the Gaussian prior. This results in highly degraded image reconstructions and poor generation quality. MacTok aims to break this compression bottleneck.
Methods
MacTok utilizes a Vision Transformer (ViT) architecture as its backbone, extending it to jointly process input image patches and a compact set of learnable 1D latent tokens. To combat posterior collapse and enforce robust feature learning, the authors introduce two main mechanisms:
- Image Masking for Latent Preservation: Instead of masking the latent space, MacTok applies masking directly to the input image patches during training. It alternates between two strategies with equal probability:
- Random Masking: Replaces a random subset of image patches with mask tokens, forcing the model to infer missing details from the surrounding context.
- Semantic Masking: Leverages a pretrained DINOv2 model to calculate the semantic importance of each patch. It then selectively occludes the most informative regions (e.g., the main subject of the image), forcing the tokenizer to capture high-level object structures and global context.
- Global and Local Representation Alignment: To keep the latent space organized and discriminative, MacTok aligns its latent tokens with pretrained DINOv2 features. It uses a dual-scale approach:
- Local Alignment: Maps individual latent tokens to DINOv2's local patch features.
- Global Alignment: Aggregates latent tokens via average pooling and aligns them with DINOv2's holistic image classification (
[CLS]) token.
Datasets
The model was trained and evaluated on the standard ImageNet benchmark, utilizing both $256 \times 256$ and $512 \times 512$ pixel resolutions to test reconstruction and generation performance.
Key Insights and Ideas
- Image Masking vs. Latent Masking: The authors discovered that while masking latent tokens only temporarily delays posterior collapse, masking input image tokens fundamentally stabilizes training. It forces a continuous information flow from the encoder to the decoder.
- Semantic Occlusion as a Teacher: By deliberately hiding the most critical semantic parts of an image, the network cannot rely on simple local pixel correlations. It must learn a robust, high-level semantic understanding to reconstruct the scene.
- Dual-Scale Regularization: Aligning the latent space at both the patch and image levels ensures that semantic coherence is maintained regardless of how short the token sequence length is.
Key Results
MacTok demonstrates exceptional efficiency and generation quality when paired with downstream generators like Scalable Interpolant Transformers (SiT):
- State-of-the-Art Generation: On ImageNet $512 \times 512$, MacTok paired with SiT-XL achieves a state-of-the-art generative Fréchet Inception Distance (gFID) of 1.52 using only 128 tokens.
- Extreme Token Reduction: On ImageNet $256 \times 256$, it achieves a gFID of 1.44 with 128 tokens, outperforming popular discrete tokenizers (like TiTok) and continuous alternatives (like SoftVQ-VAE) while reducing token usage by up to $64\times$ compared to standard 2D tokenizers.
- Robust Reconstruction: Even at extreme compression (64 tokens), MacTok maintains highly competitive reconstruction fidelity (rFID of 0.75 on ImageNet 256).
Limitations and Future Work
The authors note that aggressive image masking during training can cause a slight drop in pixel-level reconstruction fidelity. To counteract this, they employ a two-stage training process where the decoder is fine-tuned without masking for a few epochs.
Future work could focus on eliminating this secondary fine-tuning stage through more dynamic masking schedules, or extending the 1D continuous tokenization framework from static images to video generation tasks.
Summary updated