Unifying visual understanding and generation requires representations that preserve both semantic information and fine-grained image details. Continuous tokenizers trained primarily for semantic alignment may omit fine-grained reconstruction details, whereas discrete tokenizers face information loss from codebook quantization. Conventional multi-codebook designs assign every token the same number of codewords regardless of local content. We instead view codewords as reusable visual primitives whose allocation and composition adapt to each token. We introduce PrimiTok, a compositional visual tokenizer that represents each visual token through adaptive allocation and weighted composition of learned codebook primitives. PrimiTok integrates two complementary components: Diverse Quantitative Primitives (DQP), which encourages diversity among sub-codebook centroids to reduce redundancy, and a Dynamic Primitive Allocator (DPA), which selects primitives according to token complexity. Embedding quantization error supervises how many primitives are selected from each sub-codebook, and DPA aggregates them with input-dependent weights. Joint reconstruction and image--text contrastive learning encourage the resulting representations to retain visual fidelity and semantic alignment. Experiments demonstrate improved reconstruction and semantic alignment over SOTA baselines, with further evaluations on multimodal understanding and visual generation.
Figures & tables
Figure 1: Tokenization Comparisons. CT trained primarily for semantic alignment may omit fine-grained reconstruction details and often rely on auxiliary models for high-quality image synthesis. DT can lose information through codebook quantization. PrimiTok adapts primitive allocation and composition, using reconstruction and image–text contrastive learning to preserve fidelity and semantics.
Figure 2: Framework Overview. PrimiTok consists of an image encoder, a text encoder, an image decoder, and two core components, Diverse Quantitative Primitives (DQP) and a Dynamic Primitive Allocator (DPA). (a) We train PrimiTok through joint image reconstruction and image–text contrastive learning. (b) DQP encourages centroid diversity across sub-codebooks to reduce redundancy. (c) DPA adapts primitive counts and composition weights to each token chunk. The quantized chunks are concatenated into the final image embedding.
Figure 3: Comparisons of Image Reconstruction between UniTok, QLIP, and PrimiTok. Here, rFID and PSNR are evaluated on ImageNet 50k validation. PrimiTok shows superior detail preservation and perceptual fidelity over the competitors, e.g. , text on the map (Row 2) and blackboard (Row 1) is notably clearer and more faithful to the inputs.
Method
Vision Encoder
LLM
Res.
POPE
GQA
TQA
MMV
MMB
MME-S
MME-P
Avg.
Understanding-only MLLMs
LLaVA-1.5
CLIP-L
Vicuna-7B
336
85.9
62.0
46.1
31.1
64.3
–
1510.7
–
Unified Tokenizers
VILA-U †
SigLIP-SO400M
Vicuna-7B
256
81.6
–
–
–
–
–
1311.6
–
UniTok †
ViTamin-L
Vicuna-7B
256
81.7
–
–
–
–
–
1448.0
–
SemHiTok †
SigLIP-L
Vicuna-7B
256
84.2
61.0
–
–
60.3
–
1400.6
–
Table 2: Multimodal understanding. Baseline results are taken from UniFlow [ 5 ] . † denotes the LLaVA-v1.5 training setting. MME-S denotes the sum of perception and cognition scores; MME-P denotes the perception score. Both MME scores are divided by 20 for Avg.
Method
CB
MSCOCO
ImageNet-1K
rFID
PSNR
SSIM
rFID
PSNR
SSIM
LlamaGen ‡
16K
8.40
20.28
0.55
2.47
20.65
0.54
Show-o
8K
9.26
20.90
0.59
3.50
21.34
0.59
Cosmos
64K
11.97
19.22
0.48
4.57
19.93
0.49
Open-MAGVIT2
262K
6.76
22.31
0.65
1.67
22.70
0.64
IBQ
262K
6.79
22.28
0.65
1.53
22.69
0.64
Table 3: Image reconstruction on MSCOCO 2017 and ImageNet-1K. CB denotes codebook size. † indicates CLIP-pretrained initialization; ‡ indicates an ImageNet-1K-pretrained tokenizer.
Tokenizer
rFID ↓
Generator
Type
#Params.
gFID ↓
IS ↑
SD-VAE [ 48 ]
0.61
DiT [ 51 ]
Diffusion-based
675M
9.62
121.5
SiT [ 52 ]
Diffusion-based
675M
8.61
131.7
Taming-VQGAN † [ 12 ]
2.19
LlamaGen ‡ [ 15 ]
Transformer-based
1.4B
14.65
86.3
RQ-VAE [ 14 ]
3.20
RQ-Transformer [ 14 ]
Transformer-based
3.8B
7.55
134.0
ViT-VQGAN [ 13 ]
1.28
VIM-Large [ 13 ]
Transformer-based
1.7B
4.17
–
MAGE [ 53 ]
–
MAGE-ViT [ 53 ]
Transformer-based
230M
6.93
195.8
Table 4: Visual generation on ImageNet-1K without classifier-free guidance. † VQGAN tokenizer from LlamaGen [ 15 ] . ‡ Generated at 384×384 and resized to 256×256 . ⋆ Visual encoder initialized with pretrained InternViT-300M weights; generated at 448×448 and resized to 256×256 [ 5 ] .
Method
Res.
Data
Image to Text
Text To Image
Flickr30K
MSCOCO
Flickr30K
MSCOCO
R@1
R@5
R@10
R@1
R@5
R@10
R@1
R@5
R@10
R@1
R@5
R@10
EVA02-B/16
224
Merged-2B
87.9
97.8
99.2
60.0
82.7
89.1
73.9
91.1
94.7
42.2
67.5
77.1
CLIP-L/14
224
WIT400M
86.4
97.3
99.4
57.1
80.1
87.2
67.9
88.9
93.3
35.4
60.4
71.0
QLIP†
256
DC-1B
80.4
94.0
97.0
50.6
74.1
82.2
61.8
84.5
89.9
32.9
57.2
67.6
UniTok
256
DC-1B
79.5
95.6
97.3
52.4
76.4
84.4
60.8
84.4
90.3
34.8
59.6
69.9
Table 5: Zero-Shot Retrieval on Flickr30K and MSCOCO 2014. † indicates initialization with pretrained CLIP weights. ∗ denotes our reproduction. Results show that randomly initialized PrimiTok outperforms UniTok and is even comparable to CLIP-initialized QLIP.
Figure 4: Content-Adaptive Primitive Allocation. Fixed-1 assigns one primitive per token chunk, whereas PrimiTok tends to allocate more primitives to regions containing fine details and salient image content. Brighter colors indicate larger primitive counts.
Setting
Accuracy
rFID ↓
PSNR ↑
SSIM ↑
LPIPS ↓
Warm-Up Training Strategy
w/o Warm-up
63.8
0.34
24.45
0.72
0.1206
w/ Warm-up
66.5
0.37
23.93
0.71
0.1410
Primitive Allocation
Fixed-1
65.8
0.41
23.57
0.69
0.1440
Fixed-60
63.9
0.39
23.61
0.68
0.1420
Table 6: Ablation Studies on the ImageNet-1K Validation Set. Bold denotes the default configuration.
Building a unified visual tokenizer is essential for bridging the gap between visual understanding and generation. Yet existing approaches struggle with the inherent conflict between these tasks, as a single token space is forced to support both high-level semantic abstraction and low-level pixel reconstruction. We propose WinTok, a concise hybrid tokenizer that achieves a win-win performance by explicitly decoupling the two objectives. WinTok supplements pixel tokens with a set of learnable semantic tokens, effectively mitigating cross-task interference without incurring the computational overhead of dual tokenizers. To further enhance understanding capability, we introduce an asymmetric token distillation mechanism: the semantic tokens are guided by pretrained semantic embeddings from any visual foundation model, enabling them to inherit strong discriminative power while maintaining flexibility. Across 10 challenging benchmarks, WinTok delivers consistent improvements in reconstruction, understanding, and generation. Trained on only 50M open-source data, WinTok surpasses the strong baseline UniTok by 11.2% in classification accuracy and achieves a competitive reconstruction rFID of 0.41, despite using substantially less training data. Code is released at https://github.com/markywg/WinTok.
Yiwei Guo, Shaobin Zhuang, Zhipeng Huang +4
Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences · WeChat Vision, Tencent Inc. · Shanghai Jiao Tong University
Efficient visual tokenization requires balancing representation compactness with the preservation of fine-grained image content. Conventional grid-based tokenizers allocate tokens uniformly across spatial locations despite non-uniform visual complexity, whereas compact 1D tokenizers aggregate global information but can struggle to preserve local details. We introduce MixTok, a hybrid visual tokenizer that combines a compact 1D global representation with sparse 2D tokens for local refinement. A content-adaptive router ranks candidate locations by refinement priority and determines the number of 2D tokens for each image under a target average token budget. At the highest-scoring locations, 2D token features replace the spatial features recovered from the 1D representation, and a shared decoder reconstructs the image from the resulting mixed features. On ImageNet 256 x 256, MixTok achieves highly competitive reconstruction and generation performance, with an rFID of 1.195 and a gFID of 1.95 at respective average budgets of approximately 128 and 131 content tokens per image.
Chenge Li, Yefei He, Xinyu Liu +3
Zhejiang University · The Hong Kong University of Science and Technology · University of Adelaide
Modern visual tokenizers aim to preserve fine-grained visual details while learning high-level semantic representations for downstream generation and understanding. Query-based 1D visual tokenizers encode images into flexible latent sequences, yet how individual learnable queries gather and encode image information remains poorly understood. We reveal that these queries spontaneously develop complementary roles under semantic supervision: a small set of Content queries captures high-level semantic information, while a larger set of Detail queries preserves fine-grained visual details for reconstruction. To adapt token processing to these heterogeneous roles, we introduce MoETok, a 1D visual tokenizer that routes tokens through sparsely activated experts. Jointly optimized with reconstruction and semantic objectives, the router learns role-specialized processing paths adapted to each token's representation. Across model scales and token budgets, MoETok consistently improves reconstruction, semantic representation, and autoregressive generation over dense tokenizers under matched supervision and active computation. On ImageNet, it combines strong reconstruction and semantic representation with state-of-the-art class-conditional generation within the 1D tokenizer family. We further validate MoETok at scale in a unified autoregressive model jointly trained for understanding and generation with a next-token cross-entropy objective. The resulting model combines competitive visual understanding with state-of-the-art generation among unified discrete models, matching or surpassing diffusion-based models such as BAGEL and Qwen-Image on benchmarks including DPG-Bench (87.61), GenEval2 (40.04 GM), and WISE (0.49).
Jiahao Guo, Bao Tang, Haoxiang Cao +6
Huazhong University of Science and Technology · South China Normal University · KlingAI Research