Towards Sequence Modeling Alignment between Tokenizer and Autoregressive Model

Pingyu Wu, Kai Zhu, Yu Liu, Longxiang Tang, Jian Yang, Yansong Peng, Wei Zhai, Yang Cao, Zheng-Jun Zha

Abstract

Autoregressive (AR) models have achieved unprecedented success in natural language processing by predicting sequences in a unidirectional manner. However, applying this paradigm to image generation is challenging because visual data is inherently bidirectional. Standard image tokenizers often create a mismatch by using bidirectional encoders that embed "future" information into tokens, complicating the task for causal AR models. This paper introduces AliTok, an Aligned Tokenizer that enforces a causal structure on image tokens. By utilizing a causal decoder constraint and a two-stage training process, AliTok aligns the tokenizer's output with the AR model's predictive nature. Experimental results on ImageNet-1K demonstrate that AliTok-XL achieves a state-of-the-art gFID of 1.28, outperforming diffusion models while offering 10x faster sampling speeds.

Introduction

The "GPT-style" transformer architecture has become the standard for sequence modeling due to its scalability and efficiency in next-token prediction. While this approach works seamlessly for text, which is naturally sequential, images present a structural conflict. Images are spatial and bidirectional; the value of a pixel is influenced by its neighbors in all directions.

Existing image generation pipelines typically bridge this gap by first compressing images into discrete tokens using a Vector Quantized Variational Autoencoder (VQ-VAE) and then training an AR model to predict these tokens in a raster-scan order. However, because standard tokenizers use bidirectional encoders, a token at the beginning of a sequence may contain information derived from the end of the image. This "information leakage" from the future creates a misalignment that hinders the AR model's ability to learn the underlying distribution effectively.

The AliTok Framework

AliTok addresses this misalignment by rethinking the relationship between the tokenizer and the generative model. Rather than modifying the AR model to handle bidirectional data, AliTok modifies the data representation to fit the AR model's causal constraints.

1. Causal Decoder Constraint

To instill a forward-dependency in the tokens, AliTok introduces a causal decoder constraint during the initial training phase. While the encoder remains bidirectional to capture global context, it is paired with a causal decoder. This setup forces the encoder to organize information such that any given patch can only be reconstructed using its corresponding token and the tokens that preceded it in the sequence. This acts as a powerful regularizer, ensuring that the tokens generated are "predictable" for a causal transformer.

2. Prefix Tokens

A common issue in causal modeling is the "cold start" problem: the first tokens in a sequence have no prior context, leading to poor reconstruction of the top-left portion of an image. AliTok solves this by introducing 16 learnable prefix tokens. These tokens provide a learned contextual prior that assists the model in generating the initial rows of the image with higher fidelity.

3. Two-Stage Training for Fidelity

To ensure that the causal constraint does not come at the cost of visual quality, AliTok employs a two-stage training strategy:

  • Stage 1: The encoder and a causal decoder are trained to establish the causal token structure.
  • Stage 2: The encoder is frozen to preserve the causal alignment, and a powerful bidirectional decoder is trained. This allows the model to recover fine-grained textures and details during the final image synthesis without altering the tokens that the AR model must predict.

Experimental Results

AliTok was evaluated primarily on the ImageNet-1K benchmark at $256 \times 256$ and $512 \times 512$ resolutions, as well as on CC12M for text-to-image tasks.

Generative Quality and Efficiency

AliTok-XL (662M parameters) achieved a Fréchet Inception Distance (gFID) of 1.28 on ImageNet-256. This performance surpasses leading diffusion-based models like LightningDiT (gFID 1.35). Crucially, because AliTok utilizes a standard decoder-only transformer architecture, it is fully compatible with Key-Value (KV) caching. This architectural compatibility allows AliTok-XL to generate images up to 10 times faster than diffusion models, which require multiple iterative refinement steps.

Predictability and Scaling

The alignment between the tokenizer and the AR model resulted in a significant jump in training accuracy. Using standard tokenizers, AR models typically achieve approximately 5.4% accuracy in next-token prediction; with AliTok, this accuracy rose to 12.2%. This suggests that the tokens produced by AliTok are substantially easier for the model to interpret and predict. Furthermore, the method scales effectively; on ImageNet-512, a 318M parameter AliTok model achieved a SOTA gFID of 1.39.

Conclusion and Future Work

AliTok demonstrates that aligning the data representation with the model's inductive bias is a highly effective strategy for image generation. By forcing the tokenizer to "think" like an autoregressive model, AliTok achieves superior image quality and sampling efficiency compared to more complex diffusion frameworks.

Despite these gains, challenges remain. The discrete nature of the tokenizer remains a bottleneck for further quality improvements, and scaling the codebook vocabulary (e.g., to 16,384 entries) increases training complexity. Future research will focus on scaling AliTok to the billion-parameter level and optimizing large-vocabulary tokenization to further close the gap between autoregressive and continuous generative modeling.

Summary updated

BibTeX
@inproceedings{wu2026towards,
  author = {Pingyu Wu and Kai Zhu and Yu Liu and Longxiang Tang and Jian Yang and Yansong Peng and Wei Zhai and Yang Cao and Zheng-Jun Zha},
  title = {{Towards Sequence Modeling Alignment between Tokenizer and Autoregressive Model}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=GT3obnZ5Fk},
}
Figure