Neighboring Autoregressive Modeling for Efficient Visual Generation

Yefei He, Yuanyu He, Shaoxuan He, Feng Chen, Hong Zhou, Kaipeng Zhang, Bohan Zhuang

TL;DR

Standard visual autoregressive (AR) models flatten images into 1D sequences and predict tokens sequentially in raster order, ignoring visual locality and resulting in slow inference. Neighboring Autoregressive Modeling (NAR) re-imagines visual generation as a progressive outpainting process that predicts tokens in ascending order of their Manhattan distance from a starting point. By using dedicated, orthogonal "dimension-oriented decoding heads" (e.g., horizontal, vertical, temporal), NAR generates all adjacent frontier tokens in parallel, cutting forward steps by up to ~92–97% while improving image and video quality.

What Problem Does This Paper Address?

Autoregressive language models predict text sequentially from left to right. When applied to visual generation, models typically serialize 2D images or 3D video volumes into a 1D sequence via raster-scan order. This approach has two fundamental flaws:

  1. Ignoring Visual Locality: A pixel/token has strong local correlations with its spatial (and temporal) neighbors. Raster scanning separates vertically adjacent tokens by an entire row, breaking local structure.
  2. Slow Generation: Generating an $n \times n$ token image takes $n^2$ sequential forward passes. Prior attempts to parallelize AR generation either sacrifice context (predicting distant or consecutive tokens naively), require complex multi-scale tokenizers and longer sequences (e.g., VAR's next-scale prediction), or need tedious hyperparameter tuning (e.g., PAR).

Methods

NAR formulates visual generation as a near-to-far progressive outpainting process, replacing "next-token prediction" with "next-neighbor prediction."

Step 1: [x0]
Step 2: [x0,0] -> predicts [x1,0] (horizontal) & [x0,1] (vertical)
Step 3: Predicts wavefront of tokens at Manhattan distance D = 2 ...

Key technical components include:

  • Manhattan Distance Ordering: Generation starts from an initial corner token $x_0$ and expands outward in discrete wavefront steps $S_i = \{x \mid D(x, x_0) = i\}$, where $D$ is the Manhattan distance. An $n \times n$ image is completed in only $2n - 1$ steps (instead of $n^2$ steps).
  • Dimension-Oriented Decoding Heads: Multiple equidistant tokens exist along orthogonal spatial/temporal directions. Instead of forcing a single head to learn disparate conditional distributions, NAR equips the transformer backbone with orthogonal decoding heads (e.g., horizontal and vertical heads for 2D images; adding a temporal head for 3D videos). Each head is a lightweight module (one Transformer block + a linear projection).
  • Proximity-Aware Attention Mask: During training, causal masking enforces that tokens only attend to tokens closer to the origin (smaller Manhattan distance), while bidirectional attention is allowed within the same distance step to ensure consistency across tokens generated in parallel.
  • Mixed Logits Sampling: At step $i \ge 3$, adjacent tokens generated from different parents overlap on the grid (e.g., moving down from the top neighbor vs. right from the left neighbor). NAR combines/ensembles logits across the respective dimension heads for these overlapping positions, significantly improving coherence.

Datasets

The authors evaluate NAR across three visual generation tasks:

  • Class-Conditional Image Generation: ImageNet $256 \times 256$ (50k sample evaluation; using an off-the-shelf 72M parameter VQ-VAE tokenizer).
  • Class-Conditional Video Generation: UCF-101 (evaluating $16 \times 128 \times 128$ clips tokenized into $4 \times 16 \times 16$ tokens with LARP's video tokenizer).
  • Text-to-Image Generation: Trained in two stages on 4M image-text pairs from LAION-COCO ($256 \times 256$) and 2M high-resolution recaptioned images ($512 \times 512$), evaluated on the GenEval benchmark.

Key Insights and Ideas

  • Decoupled Heads Solve Parallel Degradation: Direct parallel prediction under standard AR usually collapses because one head cannot simultaneously model different conditional distributions across dimensions. Specialized heads (horizontal vs. vertical vs. temporal) eliminate this conflict. Ablations show that without separate heads, NAR’s FID on ImageNet collapses from 3.06 to 66.31.
  • Overlaps as Free Ensembles: In outpainting, wavefront paths intersect. Treating these intersections not as collisions, but as multi-head ensembles via mixed logits sampling improves FID from 25.73–75.91 (single head) down to 3.06.
  • Compatibility with Standard Tokenizers: Unlike next-scale models (VAR) that require multi-scale tokenizers and concatenate token hierarchies into long sequences (which scale quadratically in attention cost), NAR works directly on standard, single-scale tokenizers with short sequences.

Key Results

  • Class-Conditional ImageNet ($256 \times 256$):
  • NAR-L (372M) achieves an FID of 3.06 in 31 steps, beating LlamaGen-XXL (1.4B, FID 3.09, 256 steps) while cutting forward steps by 87.8% and delivering 13.8$\times$ higher throughput (195.4 vs. 14.1 img/s).
  • NAR-M (290M) achieves a lower FID (3.27 vs. 3.30) and 1.92$\times$ higher throughput (248.5 vs. 129.3 img/s) compared to VAR-d16.
  • Video Generation (UCF-101):
  • NAR-LP (694M) reaches an FVD of 71.1 in just 34 steps (1.30s), achieving a 97.3% reduction in generation steps compared to standard AR methods (1280 steps) and outperforming parallel baseline PAR-XL (FVD 94.1–103.4).
  • Text-to-Image (GenEval):
  • NAR-XL (0.8B) trained on only 6M samples achieves an overall GenEval score of 0.43, outperforming Chameleon-7B (0.39, trained on 1.4B pairs) and LlamaGen-XL (0.32, trained on 60M pairs), while achieving 15.0 img/s throughput.

Limitations and Future Work

  • Tokenizer Bounds: The authors intentionally used a moderate-size 72M VQ-VAE on ImageNet (rFID = 2.19) for fair comparison with LlamaGen/PAR. Integrating more modern, higher-fidelity tokenizers remains for future work.
  • Scale of Video Datasets: Video experiments are currently confined to UCF-101; scaling NAR to web-scale video datasets is untested.

Summary updated

BibTeX
@misc{he2025neighboring,
  author = {Yefei He and Yuanyu He and Shaoxuan He and Feng Chen and Hong Zhou and Kaipeng Zhang and Bohan Zhuang},
  title = {{Neighboring Autoregressive Modeling for Efficient Visual Generation}},
  year = {2025},
  eprint = {2503.10696},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.10696},
}

Loading related content...

Figure