Improving Autoregressive Visual Generation with Cluster-Oriented Token Prediction

Teng Hu, Jiangning Zhang, Ran Yi, Jieyu Weng, Yabiao Wang, Xianfang Zeng, Zhucun Xue, Lizhuang Ma

Introduction

The success of Large Language Models (LLMs) has largely been driven by the "next-token prediction" paradigm. In the domain of computer vision, researchers have sought to replicate this success by quantizing images into discrete visual tokens—indices within a learned codebook. However, a fundamental discrepancy exists between linguistic and visual tokens. In natural language, token indices are categorical and independent; the index for "cat" provides no structural information about the index for "dog." In contrast, visual patches often exhibit high redundancy and semantic overlap. Standard autoregressive (AR) models, which utilize traditional Cross-Entropy loss, fail to account for this spatial correlation, treating all incorrect token predictions as equally erroneous.

The Challenge of Visual Token Independence

Current AR models for image generation typically employ a VQGAN-style codebook. When training with standard Cross-Entropy loss, the model is penalized identically whether it predicts a token that is visually similar to the ground truth or one that is completely unrelated. This "vision-agnostic" approach leads to several issues:

  1. Training Inefficiency: The model spends significant computational resources trying to distinguish between nearly identical visual primitives.
  2. Lack of Robustness: Small errors in token selection can lead to jarring visual artifacts.
  3. Optimization Difficulty: The loss landscape does not reflect the underlying manifold of the visual embedding space.

Methodology: Improved AutoRegressive (IAR) Generation

To bridge the gap between language-style modeling and visual reality, the authors introduce the Improved AutoRegressive (IAR) framework. This approach incorporates two key innovations designed to make the model "vision-aware."

1. Balanced Codebook Rearrangement

Analysis of standard VQGAN codebooks reveals that visually similar embeddings are often scattered randomly across the index space. IAR addresses this by applying a balanced k-means clustering algorithm to the codebook. By grouping the codebook into $n$ clusters of equal size, the researchers ensure that indices within the same cluster share high semantic and visual similarity. This rearrangement transforms the discrete index space into a more structured environment where proximity in index space correlates with proximity in feature space.

2. Cluster-Oriented Cross-Entropy Loss ($L_{CCE}$)

The core of the IAR method is a new training objective. In addition to the standard token-level Cross-Entropy loss, the authors introduce a cluster-oriented constraint.

The logic is intuitive: if the model fails to predict the exact token index, it should at least be encouraged to predict a token within the correct cluster. Because tokens within a cluster are visually similar, a "wrong" token from the correct cluster will still produce a decoded patch that is perceptually accurate. This relaxes the optimization constraint, allowing the model to learn the global structure of an image more effectively before refining local details. The final loss is a weighted combination of the token-level and cluster-level objectives.

Experimental Results

The IAR framework was evaluated on the ImageNet-1K dataset for class-conditional image generation at $256 \times 256$ and $384 \times 384$ resolutions, using the LlamaGen architecture as a baseline.

Training Efficiency and Speedup

One of the most significant findings is the acceleration of the training process. The IAR-XL model reached a target Fréchet Inception Distance (FID) score in just 175 epochs that the baseline LlamaGen-XL required 300 epochs to achieve. This represents a nearly 42% reduction in training time, demonstrating that "vision-aware" loss functions significantly streamline the learning process.

State-of-the-Art Performance

The largest iteration, IAR-XXL (1.4B parameters), achieved an FID of 2.19 and an Inception Score (IS) of 362.0 on ImageNet $256 \times 256$. These results outperform existing autoregressive models and even rival high-performing diffusion-based models of comparable scale.

Scalability

The researchers observed that the performance gap between IAR and standard AR models widened as the parameter count increased. This suggests that the cluster-oriented approach scales effectively with model size, making it a viable strategy for future large-scale visual foundation models.

Discussion and Future Directions

While IAR significantly improves the efficiency of AR visual generation, it remains dependent on pre-trained discrete codebooks. The non-differentiable nature of the quantization step continues to be a challenge for full end-to-end optimization. Future research may explore more continuous constraints or "soft" clustering methods to further refine the relationship between predicted and target embeddings. Additionally, the principles of spatial and temporal correlation suggest that IAR could be highly effective for video generation, where redundancy between frames is even more pronounced than within a single image.

Conclusion

By acknowledging and exploiting the inherent correlations in visual data, the IAR framework transforms autoregressive generation from a pure sequence-modeling task into a vision-centric one. Through balanced codebook clustering and a dual-level loss function, IAR achieves superior image quality with substantially lower computational overhead, setting a new benchmark for the field.

Summary updated

BibTeX
@inproceedings{hu2025improving,
  author = {Teng Hu and Jiangning Zhang and Ran Yi and Jieyu Weng and Yabiao Wang and Xianfang Zeng and Zhucun Xue and Lizhuang Ma},
  title = {{Improving Autoregressive Visual Generation with Cluster-Oriented Token Prediction}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  doi = {10.1109/cvpr52734.2025.00873},
}
Figure