ControlAR: Controllable Image Generation with Autoregressive Models

Zongming Li, Tianheng Cheng, Shoufa Chen, Peize Sun, Haocheng Shen, Longjin Ran, Xiaoxin Chen, Wenyu Liu, Xinggang Wang

TL;DR

ControlAR introduces an efficient framework for adding spatial controls—such as edges, depth maps, and segmentation masks—to autoregressive (AR) image models. By shifting from the traditional method of "prefilling" control tokens to a novel "conditional decoding" approach, the authors achieve state-of-the-art image quality. Furthermore, this method enables AR models to generate images at arbitrary resolutions and aspect ratios for the first time without extensive retraining.

What Problem Does This Paper Address?

In the rapidly evolving landscape of AI-generated imagery, Diffusion models have long held the crown for "controllability" thanks to robust tools like ControlNet. These adapters allow users to guide image generation using precise structural inputs like Canny edges, depth maps, or user-drawn sketches. Meanwhile, Autoregressive (AR) models—which treat image generation as a "next-token prediction" task similar to how Large Language Models (LLMs) generate text—have shown massive potential but have historically struggled with fine-grained spatial control.

The most intuitive way to control an AR model is to treat the control image like a text prompt: tokenize it and "prefill" it at the start of the sequence. However, this approach is computationally expensive because it drastically increases the sequence length. It also frequently results in poor spatial alignment; the model essentially "forgets" the exact layout of the control map by the time it reaches the final pixels of the generated image. ControlAR aims to fix this inefficiency and lack of precision, bringing ControlNet-level guidance to the AR domain.

Methods

The researchers introduce two primary innovations to solve the spatial control problem in AR models:

  1. Lightweight Control Encoder: Instead of relying on heavy convolutional networks, ControlAR utilizes a small Vision Transformer (ViT), often initialized with pre-trained weights from DINOv2. This encoder efficiently transforms a spatial control map (e.g., a sketch or segmentation mask) into a sequence of "control tokens."
  2. Conditional Decoding: This is the core breakthrough of the paper. Rather than prepending control tokens at the beginning of the sequence, ControlAR fuses them with image tokens at every single step of the decoding process. Specifically, the $i$-th control token is added to the $(i-1)$-th image token before it enters the model to predict the $i$-th image token. This acts like a dynamic, content-aware positional encoding that keeps the model strictly "on the rails" of the desired spatial layout.

The framework was rigorously tested on both Transformer-based backbones (like LlamaGen) and Mamba-based backbones (like AiM), proving its versatility and robustness across different underlying architectures.

Key Insights and Ideas

  • The "Alignment" Advantage: By fusing control tokens at every layer, the model does not have to "learn" the complex relationship between a distant prompt and a currently generating pixel. The spatial information is physically present at the exact moment the token is generated, ensuring high fidelity to the control map.
  • Efficiency is King: Conditional decoding does not increase the overall sequence length. This means it avoids the quadratic complexity hit that "prefilling" takes in standard Transformer models. As a result, training is nearly 2x faster and uses significantly less memory than the prefilling baseline.
  • Breaking the Resolution Barrier: Standard AR models are usually locked into fixed resolutions (e.g., 256x256) due to their positional embeddings. Because ControlAR relies on the sequence length of the control map, the authors discovered they could generate images of any size or aspect ratio simply by providing a larger control map and adjusting the positional embeddings accordingly.

Key Results

ControlAR was trained and evaluated across a wide range of standard benchmarks, including ImageNet-1K, ADE20K, COCOStuff, and LAION-Aesthetics. The results demonstrate significant leaps in AR capabilities:

  • Superior Quality: On ImageNet, ControlAR (using a LlamaGen-L backbone) achieved a Fréchet Inception Distance (FID) of 4.19, significantly outperforming the previous state-of-the-art AR control model, ControlVAR (FID 6.50).
  • Competitive with Diffusion: In text-to-image tasks, ControlAR surpassed ControlNet++ in several key metrics. For instance, it achieved a higher SSIM (0.85 vs 0.80) for HED edge control, indicating better structural fidelity to the source edges.
  • Zero-Shot Resolution: The model successfully generated high-quality panoramic (1024x512) and tall (448x768) images, a feat previously difficult for AR models without extensive retraining.
Examples of ControlAR generating images at various resolutions and aspect ratios using different spatial controls (edges, depth, segmentation).

Limitations and Future Work

While highly powerful, ControlAR currently requires updating the parameters of the base generative model during training. This makes it less "portable" than the original ControlNet, which acts more like a plug-and-play adapter that leaves the base model frozen.

Additionally, the current iteration of the model supports only one type of control at a time. The authors suggest that future work will focus on "multi-control" scenarios (e.g., using depth maps and Canny edges simultaneously) and improving the "migratability" of the control encoder so it can be attached to new AR models without requiring full fine-tuning.

Summary updated

BibTeX
@inproceedings{li2025controlar,
  author = {Zongming Li and Tianheng Cheng and Shoufa Chen and Peize Sun and Haocheng Shen and Longjin Ran and Xiaoxin Chen and Wenyu Liu and Xinggang Wang},
  title = {{ControlAR: Controllable Image Generation with Autoregressive Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=BWuBDdXVnH},
}
Figure