Skip to content

PrimiTok: Learning to Diversify and Allocate Primitives for Visual Tokenization

Yizhu Chen, Chen Ju, Donghao Zhou, Ziyu Guo, Shuai Xiao, Jinsong Lan, Xiaoyong Zhu, Ying Chen, Haodong Li

cs.CV

Abstract

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.

Create a lesson