NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

MacTok: Robust Continuous Tokenization for Image Generation

Hengyu Zeng, Xin Gao, Guanghao Li, Yuxiang Yan, Jiaoyang Ruan, Junpeng Ma, Haoyu Albert Wang, Jian Pu

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.

Figure 1. Effect of random masking in continuous tokenizers. Left: plain KL-VAE, latent token masking, and image token mask- ing, with only the latter preventing posterior collapse. Right: col- lapsed latent space shows poor structure, while the uncollapsed one yields well-structured and diverse representations.

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:

  1. 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:
  2. Random Masking: Replaces a random subset of image patches with mask tokens, forcing the model to infer missing details from the surrounding context.
  3. 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.
  4. 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:
  5. Local Alignment: Maps individual latent tokens to DINOv2's local patch features.
  6. Global Alignment: Aggregates latent tokens via average pooling and aligns them with DINOv2's holistic image classification ([CLS]) token.
Figure 4. Overview of the MacTok framework. Top: Transformer-based encoder and decoder operating on image, latent, and mask tokens. Bottom left: DINO-guided image masking introduces semantic priors. Bottom center: Global and local representation alignment between latent and pretrained visual representations. Bottom right: Discriminator and perceptual networks provide auxiliary supervision.

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

BibTeX
@inproceedings{zeng2026mactok,
  author = {Hengyu Zeng and Xin Gao and Guanghao Li and Yuxiang Yan and Jiaoyang Ruan and Junpeng Ma and Haoyu Albert Wang and Jian Pu},
  title = {{MacTok: Robust Continuous Tokenization for Image Generation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=rn4McQ2kxV},
}
Figure