Table of Contents
Fetching ...

ResTok: Learning Hierarchical Residuals in 1D Visual Tokenizers for Autoregressive Image Generation

Xu Zhang, Cheng Da, Huan Yang, Kun Gai, Ming Lu, Zhan Ma

TL;DR

The paper tackles AR image generation by addressing tokenization shortcomings in existing 1D visual tokenizers, notably the lack of cross-level fusion and high codebook entropy. It introduces ResTok, a 1D visual tokenizer that builds hierarchical residuals and enables semantic residuals across multiple scales, coupled with a hierarchical AR (HAR) generator to accelerate sampling. Key contributions include hierarchical representations in ViT, semantic residuals for latent and image tokens, and an optimization framework with VF alignment losses and nested dropout, achieving a gFID of $2.34$ with $9$ sampling steps on ImageNet-256. The results demonstrate that restoring vision-specific priors in tokenization yields both reconstruction quality and generation efficiency, with practical impact for scalable AR image synthesis and potential extension to unified multimodal modeling.

Abstract

Existing 1D visual tokenizers for autoregressive (AR) generation largely follow the design principles of language modeling, as they are built directly upon transformers whose priors originate in language, yielding single-hierarchy latent tokens and treating visual data as flat sequential token streams. However, this language-like formulation overlooks key properties of vision, particularly the hierarchical and residual network designs that have long been essential for convergence and efficiency in visual models. To bring "vision" back to vision, we propose the Residual Tokenizer (ResTok), a 1D visual tokenizer that builds hierarchical residuals for both image tokens and latent tokens. The hierarchical representations obtained through progressively merging enable cross-level feature fusion at each layer, substantially enhancing representational capacity. Meanwhile, the semantic residuals between hierarchies prevent information overlap, yielding more concentrated latent distributions that are easier for AR modeling. Cross-level bindings consequently emerge without any explicit constraints. To accelerate the generation process, we further introduce a hierarchical AR generator that substantially reduces sampling steps by predicting an entire level of latent tokens at once rather than generating them strictly token-by-token. Extensive experiments demonstrate that restoring hierarchical residual priors in visual tokenization significantly improves AR image generation, achieving a gFID of 2.34 on ImageNet-256 with only 9 sampling steps. Code is available at https://github.com/Kwai-Kolors/ResTok.

ResTok: Learning Hierarchical Residuals in 1D Visual Tokenizers for Autoregressive Image Generation

TL;DR

The paper tackles AR image generation by addressing tokenization shortcomings in existing 1D visual tokenizers, notably the lack of cross-level fusion and high codebook entropy. It introduces ResTok, a 1D visual tokenizer that builds hierarchical residuals and enables semantic residuals across multiple scales, coupled with a hierarchical AR (HAR) generator to accelerate sampling. Key contributions include hierarchical representations in ViT, semantic residuals for latent and image tokens, and an optimization framework with VF alignment losses and nested dropout, achieving a gFID of with sampling steps on ImageNet-256. The results demonstrate that restoring vision-specific priors in tokenization yields both reconstruction quality and generation efficiency, with practical impact for scalable AR image synthesis and potential extension to unified multimodal modeling.

Abstract

Existing 1D visual tokenizers for autoregressive (AR) generation largely follow the design principles of language modeling, as they are built directly upon transformers whose priors originate in language, yielding single-hierarchy latent tokens and treating visual data as flat sequential token streams. However, this language-like formulation overlooks key properties of vision, particularly the hierarchical and residual network designs that have long been essential for convergence and efficiency in visual models. To bring "vision" back to vision, we propose the Residual Tokenizer (ResTok), a 1D visual tokenizer that builds hierarchical residuals for both image tokens and latent tokens. The hierarchical representations obtained through progressively merging enable cross-level feature fusion at each layer, substantially enhancing representational capacity. Meanwhile, the semantic residuals between hierarchies prevent information overlap, yielding more concentrated latent distributions that are easier for AR modeling. Cross-level bindings consequently emerge without any explicit constraints. To accelerate the generation process, we further introduce a hierarchical AR generator that substantially reduces sampling steps by predicting an entire level of latent tokens at once rather than generating them strictly token-by-token. Extensive experiments demonstrate that restoring hierarchical residual priors in visual tokenization significantly improves AR image generation, achieving a gFID of 2.34 on ImageNet-256 with only 9 sampling steps. Code is available at https://github.com/Kwai-Kolors/ResTok.
Paper Structure (22 sections, 4 equations, 9 figures, 11 tables, 2 algorithms)

This paper contains 22 sections, 4 equations, 9 figures, 11 tables, 2 algorithms.

Figures (9)

  • Figure 1: Comparison between (a) existing 1D tokenizers yu2024titokli2025imagefolderhuang2025spectralarliu2025detailflow querying features along only depth and (b) ResTok querying along both depth and hierarchy. By progressively merging image tokens, ResTok brings multi-scale hierarchies back to the ViT-based tokenizer, which encourages implicit alignments between image tokens and latent tokens and enforces better causalities of latent tokens for AR generation.
  • Figure 2: Overview of ResTok. (a) Pipeline of encoding and decoding processes. There are $S-1$ residual merging blocks uniformly replacing the original transformer blocks in the encoder, where $S$ denotes the number of scales. (b) Residual 1D latent token initialization. When increasing the target size of pooling, we first double the width, and then alternately double the height and width in subsequent steps. (c) Residual merging block. Average pooling is used as the merging method in our experiments.
  • Figure 3: Representation alignment. The image $\bm{x}$ is processed by a VF model to get the [CLS] token $\bm{f}^\texttt{[CLS]}_\text{vf}$ and the visual tokens of image patches $\bm{f}^\text{patch}_\text{vf}$. The coarsest image tokens $\bm{p}^{(N)}_{1}$ and mask VF tokens $\bm{m}^{(N)}_\text{vf}$ are aligned with $\bm{f}^\texttt{[CLS]}_\text{vf}$ and $\bm{f}^\text{patch}_\text{vf}$, respectively.
  • Figure 4: Hierarchical autoregressive generator. The numbers in the colored tokens stand for the indices of the latent tokens. [Mi] denotes the mask token filled at the i-th missing position.
  • Figure 5: Visualizations of reconstructions with various token lengths and attention weights in the encoder. The first 16 latent tokens are more closely associated with the coarser image scales S1 and S2, capturing high-level semantics (e.g., object, position, color, etc.). In contrast, the subsequent latent tokens progressively refine fine-grained details, primarily querying the finer image tokens from S3 and S4.
  • ...and 4 more figures