ICML 2026

A Flat Vocabulary or a Rich Hierarchy?
Re-introducing Intrinsic Structure Transforms
Autoregressive Image Generation

A principled, plug-and-play hierarchical prior over the visual codebook — turning a flat N-way token prediction into a structured k-way one.

1Tsinghua University   2Shanghai Jiao Tong University
MASC high-fidelity samples
Figure 1. MASC enables strong high-fidelity and diverse image generation across a wide range of ImageNet classes.

Abstract

Autoregressive (AR) models have shown great promise in image generation, yet they face a fundamental inefficiency stemming from their core component: a vast, unstructured vocabulary of visual tokens. By treating tokens as a flat set, standard models overlook the manifold structure where geometric proximity reflects semantic similarity. This oversight unnecessarily complicates the prediction task, hindering training efficiency and limiting generation quality.

To resolve this, we propose Manifold-Aligned Semantic Clustering (MASC), a principled framework that constructs a hierarchical semantic tree directly from the codebook's intrinsic geometry. Using a geometry-aware distance metric and a density-driven agglomerative construction, MASC faithfully models the token-embedding manifold. By transforming the flat, high-dimensional prediction into a structured hierarchical task, MASC introduces a powerful inductive bias that simplifies learning. As a plug-and-play module, MASC accelerates training by up to 71% and significantly boosts generation quality, improving LlamaGen-XL's FID from 2.87 to 2.49. Crucially, MASC further serves as a convergence enabler for complex architectures — establishing that structuring the prediction space is as vital as architectural innovation.

2.87 → 2.49
LlamaGen-XL FID
+71%
faster training
7+
AR backbones boosted
0
architectural changes

How MASC works

MASC is a one-time, offline preprocessing step. It reads a trained tokenizer's codebook, builds a density-driven hierarchical semantic tree, and emits a mapping that the AR model trains against — what the model predicts changes, how it predicts does not.

MASC pipeline overview
Figure 2. Overview of the MASC-integrated AR generation pipeline. Stage 1: a standard tokenizer yields a finalised codebook. MASC Preprocessing: our framework constructs a hierarchical semantic tree from the codebook, producing a mapping M from fine-grained tokens to coarse semantic branches. Stage 2: the transformer is trained on these simplified branch indices.
MASC versus k-means
Figure 3. Conceptual illustration of MASC versus k-means. Left: visual tokens reside on a semantic manifold where geodesic distance is a better similarity measure than Euclidean distance. Right: geometry-agnostic k-means produces incoherent clusters, whereas MASC's manifold-aligned, centroid-free approach preserves the intrinsic data structure.

A plug-and-play prior in three lines

MASC changes a training pipeline in exactly three places: build the coarse vocabulary once, relabel the targets, and decode a predicted cluster back to a token at sampling time.

masc_quickstart.py
from masc import build_masc_tree, relabel_targets, random_sample_decode

# (1) OFFLINE, ONCE — build the coarse vocabulary from the codebook (Algorithm 1)
tree = build_masc_tree(codebook_embeddings, k=8192)

# (2) TRAIN — predict the next coarse cluster instead of the next fine token (Eq. 5)
coarse_targets = relabel_targets(fine_token_ids, tree.mapping)

# (3) SAMPLE — decode a predicted cluster back to a token (default strategy)
fine_tokens = random_sample_decode(coarse_cluster_indices, mapping)

Main results on LlamaGen

On ImageNet 256×256, MASC consistently improves efficiency and final quality across all model scales, and decisively outperforms a naïve k-means prior (vocabulary k = 8,192).

ModelMethodParamsAccel.↑FID↓IS↑Prec. / Rec.↑
LlamaGen-B
(111M)
Baseline111M5.56185.10.85 / 0.45
+ k-means94M−5%5.72186.60.83 / 0.44
+ MASC (Ours)94M+42%4.81206.40.86 / 0.48
LlamaGen-L
(343M)
Baseline343M3.38246.30.83 / 0.51
+ k-means311M−10%3.81221.20.77 / 0.55
+ MASC (Ours)311M+55%2.92259.20.85 / 0.57
LlamaGen-XL
(775M)
Baseline775M2.87267.60.82 / 0.55
+ k-means719M−8%3.09244.30.76 / 0.56
+ MASC (Ours)719M+57%2.58272.10.83 / 0.58

Table 1. Comprehensive performance analysis on ImageNet 256×256. MASC reduces task complexity, accelerates training, and yields superior generation quality at every scale.

Training dynamics IS and FID
Figure 6. LlamaGen-L training dynamics: MASC reaches the baseline's final IS/FID in roughly half the training time (2× faster), and ultimately converges to a better result.
Training dynamics with prediction entropy
Figure 8. By operating in a low-entropy prediction space, MASC accelerates convergence — consistently higher IS, lower FID, and lower prediction entropy throughout training.

Impact of the coarse vocabulary size k

MASC is robust to k: it reaches its best FID of 2.49 at k=4,096 and its best acceleration of +71% at k=2,048 (LlamaGen-XL).

MethodVocab (k)FID↓IS↑Accel.↑
Baseline16,3842.87267.6
MASC8,1922.58272.1+57%
MASC4,0962.49269.8+63%
MASC2,0482.65264.4+71%

Table 2. Ablation on vocabulary size k with LlamaGen-XL.

A universal, plug-and-play booster

MASC is not tied to LlamaGen. As a drop-in module it improves FID, IS and training speed across diverse AR paradigms — and rescues advanced architectures that otherwise fail to converge.

FrameworkMethodWall-clock (h)Accel.↑FID↓IS↑
VAR-d24Baseline5202.09312.9
+ MASC (2k)374+28%1.98314.4
RandAR-XLBaseline4802.25317.8
+ MASC (8k)326+32%2.02320.5
CTF-LlamaGen-LBaseline3602.97291.5
+ MASC (8k)255+29%2.51296.9
IAR-XLBaseline4672.52248.1
+ MASC (8k)340+32%2.35284.3
GigaTok-LBaseline4203.39263.7
+ MASC (8k)340+19%3.35263.5

Table 3. MASC as a plug-and-play module across SOTA AR frameworks on ImageNet (selected rows). It consistently improves quality while substantially reducing wall-clock time.

Why it works: semantic coherence

MASC clusters group semantically interchangeable tokens. Replacing a token with a random member of its own cluster preserves global structure and object identity — geometry-agnostic k-means does not.

Semantic replacement test
Figure 4. Semantic Replacement Test. Replacing image tokens with random cluster members reveals that MASC (c) preserves semantic structure, whereas k-means (b) introduces artifacts. MASC yields higher intra-cluster semantic similarity (d) and groups coherent textures (e).
K-means versus MASC samples
Figure 5. Visual comparison between k-means and MASC. K-means results exhibit high-frequency noise and structural collapse; MASC preserves clean, coherent semantics.
MASC sample gallery
Figure 9. Additional samples generated by LlamaGen-XL + MASC (CFG scale 2.5), spanning animals, objects, food and scenes.

Get started

The reference implementation of the MASC construction, relabelling, decoding and diagnostics is open and self-verifiable. The AR backbones it enhances are obtained from their official repositories.

1

Build the tree

python scripts/build_masc_tree.py --codebook codebook.npy --k 8192 runs Algorithm 1 and writes the token→cluster mapping. Try --demo for a no-download verification.

2

Train

Relabel targets to coarse clusters and train any AR backbone with the provided objective and the Table 8 hyperparameters in configs/.

3

Sample

Decode predicted clusters back to tokens with the parameter-free random-sampling decoder, then render with the tokenizer decoder.

BibTeX

@inproceedings{he2026masc,
  title     = {A Flat Vocabulary or a Rich Hierarchy? Re-introducing Intrinsic
               Structure Transforms the Autoregressive Image Generation},
  author    = {He, Lixuan and Zheng, Shikang},
  booktitle = {Proceedings of the 43rd International Conference on Machine Learning (ICML)},
  year      = {2026}
}