AdaNAT: Exploring Adaptive Policy for Token-Based Image Generation

Zanlin Ni, Yulin Wang, Renping Zhou, Rui Lu, Jiayi Guo, Jinyi Hu, Zhiyuan Liu, Yuan Yao, Gao Huang

Abstract

AdaNAT introduces a learnable, adaptive policy for non-autoregressive Transformers (NATs) in image generation. Traditional NATs rely on hand-tuned, static scheduling rules for hyperparameters like masking ratios and sampling temperatures. AdaNAT replaces these heuristics with a reinforcement learning (RL) agent and an adversarial reward system. This allows the model to tailor the generation process for each individual image dynamically. Evaluated on benchmarks like ImageNet and MS-COCO, AdaNAT achieves state-of-the-art image quality with significantly lower computational costs compared to traditional NATs and diffusion models.

Introduction

In the field of AI-generated imagery, non-autoregressive Transformers (NATs) have emerged as high-speed alternatives to traditional autoregressive models. By utilizing parallel decoding, NATs can predict multiple tokens simultaneously, often generating high-quality images in as few as 4 to 8 steps. However, NATs typically suffer from a "manual transmission" problem: they require complex, hand-designed policies to manage hyperparameters such as masking ratios and sampling temperatures. These rules are usually static and sub-optimal, applying the same refinement strategy regardless of image complexity. AdaNAT aims to replace these "one-size-fits-all" heuristics with a system that learns to adjust itself on the fly.

Overview of the AdaNAT framework, comparing it to existing works (b) and detailing the RL-based adaptive policy (c).

Methodology

The authors propose AdaNAT, which treats the image generation process as a Markov Decision Process (MDP). The framework consists of three primary components:

  1. The RL Agent: A lightweight policy network ($\eta_\phi$) acts as a Reinforcement Learning (RL) agent. At each step of the generation, the agent observes the current state of the image (partially decoded tokens) and selects the best hyperparameters—including masking ratio, temperature, and guidance scale—for the subsequent step.
  2. Optimization via PPO: The policy is trained using Proximal Policy Optimization (PPO), a robust RL algorithm that ensures stable updates.
  3. Adversarial Reward Modeling: To overcome the limitations of static metrics like FID, which can lead to "overfitting" or lack of diversity, AdaNAT employs an adversarial reward system. A reward model is trained alongside the policy to distinguish between real and generated images, forcing the policy network to produce increasingly realistic and diverse results.

Experimental Results

AdaNAT was evaluated on major benchmarks including ImageNet (256×256 and 512×512), MS-COCO, and CC3M.

  • Superior Quality: On ImageNet 256×256, AdaNAT-L achieved an FID of 2.86 in just 8 steps, significantly outperforming the MaskGIT baseline (FID 4.02).
  • High-Resolution Performance: On ImageNet 512×512, it secured an FID of 3.66, surpassing many leading diffusion models with substantially less computation.
  • Computational Efficiency: AdaNAT-S achieved a competitive FID of 4.54 on ImageNet 256 using only 0.2 TFLOPs, demonstrating extreme efficiency compared to diffusion-based alternatives.
  • Ablation Studies: Results showed that making the policy learnable improved baseline FID by 30%, while adding adaptivity (image-specific adjustments) provided an additional 16% improvement.

Discussion and Insights

A key insight from this work is that adaptivity matters: the model learns to allocate more refinement effort to "hard" samples (complex scenes) while rapidly reducing the refinement level for simpler structures. Furthermore, the authors highlight the "static reward trap," where optimizing directly for metrics like FID can degrade visual quality, justifying the use of an adversarial reward.

Conclusion

AdaNAT demonstrates that replacing heuristic-based scheduling with a learnable RL agent significantly enhances both the quality and efficiency of NAT-based image generation. While the current implementation keeps the NAT backbone frozen, future work may explore joint fine-tuning of the backbone and policy, as well as expanding the agent's control over more architectural aspects during inference.

Summary updated

BibTeX
@inproceedings{ni2024adanat,
  author = {Zanlin Ni and Yulin Wang and Renping Zhou and Rui Lu and Jiayi Guo and Jinyi Hu and Zhiyuan Liu and Yuan Yao and Gao Huang},
  title = {{AdaNAT: Exploring Adaptive Policy for Token-Based Image Generation}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72640-8\_17},
}
Figure