Understand Before You Generate: Self-Guided Training for Autoregressive Image Generation

Xiaoyu Yue, ZiDong Wang, Yuqing Wang, Wenlong Zhang, Xihui Liu, Wanli Ouyang, Lei Bai, Luping Zhou

Introduction

Autoregressive (AR) models, the architectural backbone of Large Language Models like GPT and Llama, have recently been adapted for image synthesis by treating image patches as sequences of discrete tokens. While this approach benefits from the scalability of transformer architectures, it often struggles with global visual coherence. Unlike text, which is inherently sequential and semantic, images are spatial and contain significant local redundancy. This paper introduces ST-AR (Self-guided Training for AutoRegressive models), a framework designed to bridge the gap between local pixel prediction and global semantic understanding.

The Semantic Bottleneck in Autoregressive Vision

The authors identify three primary reasons why standard next-token prediction fails to capture high-level visual semantics effectively:

  1. Local and Conditional Dependence: AR models often become "myopic," relying too heavily on the initial class token and immediate spatial neighbors. This leads to a failure in maintaining a broader global context during the generation process.
  2. Inter-step Semantic Inconsistency: As the model generates an image token-by-token, it tends to "forget" the intended global structure. This results in a breakdown of semantic consistency across different stages of the generation sequence.
  3. Spatial Invariance Deficiency: Visual tokenizers, such as VQ-GAN, are notoriously brittle. Minor spatial shifts or augmentations can result in entirely different token sequences for the same object, confusing the AR model's ability to learn robust representations.

The ST-AR Framework

To address these bottlenecks, ST-AR integrates self-supervised learning (SSL) objectives directly into the autoregressive training loop. The framework utilizes a student-teacher architecture, where the teacher is an Exponential Moving Average (EMA) version of the student model.

Key Methodological Innovations

  • Masked Attention for Global Context: Traditional Masked Image Modeling (MIM) is incompatible with AR models because it disrupts the causal sequence needed for next-token prediction. ST-AR solves this by randomly masking the attention maps within the transformer layers rather than the input tokens. This forces the model to attend to a wider, more global receptive field to predict the next token.
  • Contrastive Learning for Semantic Stability: ST-AR employs two MoCo-style contrastive losses to ensure the model maintains a stable "understanding" of the image:
  • Inter-step Contrastive Loss: This aligns feature vectors from different generation steps of the same image, ensuring the model retains the global semantic intent from the first token to the last.
  • Inter-view Contrastive Loss: By aligning features from different augmented crops of the same image, the model learns spatial invariance, making it less sensitive to the brittleness of the tokenizer.

Importantly, these auxiliary objectives are only active during the training phase. At inference, the model functions as a standard autoregressive generator, requiring no specialized sampling strategies or external pre-trained models like CLIP.

Experimental Results

The authors evaluated ST-AR on the ImageNet-256x256 benchmark, demonstrating significant gains in both representation quality and generative fidelity.

Improved Image Understanding

Linear probing—a standard test for representation quality—showed that the top-1 accuracy for the LlamaGen-B model rose from 21.00% to 55.23% when trained with ST-AR. This confirms that the model is learning meaningful visual features rather than just local pixel patterns.

Generative Fidelity (FID Scores)

ST-AR achieved dramatic improvements in Fréchet Inception Distance (FID), a key metric for image quality:

  • LlamaGen-L (343M): FID improved by approximately 42% (dropping from 21.81 to 12.59).
  • LlamaGen-XL (775M): FID improved by approximately 49% (dropping from 19.42 to 9.81).
  • Efficiency: After 300 epochs of training, the LlamaGen-XL model with ST-AR reached an FID of 6.20. Remarkably, this outperforms the vanilla LlamaGen-3B model (FID 9.38), despite the 3B model having nearly four times the parameters.

Conclusion

ST-AR demonstrates that "understanding" is a prerequisite for high-quality generation. By forcing autoregressive models to learn invariant and consistent representations through self-guided objectives, the framework significantly enhances the performance of vision transformers without increasing inference complexity. While the additional training overhead—stemming from augmented views and the EMA teacher—remains a limitation, the substantial gains in parameter efficiency and image quality mark a significant step forward for autoregressive generative modeling.

Summary updated

BibTeX
@inproceedings{yue2025understand,
  author = {Xiaoyu Yue and ZiDong Wang and Yuqing Wang and Wenlong Zhang and Xihui Liu and Wanli Ouyang and LEI BAI and Luping Zhou},
  title = {{Understand Before You Generate: Self-Guided Training for Autoregressive Image Generation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=Z4hi1a9FsB},
}
Figure