UniTok: A Unified Tokenizer
for Visual Generation and Understanding
[**Chuofan Ma**](https://machuofan.github.io/)
1,2 · [**Yi Jiang**](https://enjoyyi.github.io/)
2† · [**Junfeng Wu**](https://wjf5203.github.io/)
2,3 · [**Jihan Yang**](https://jihanyang.github.io/)
1
[**Xin Yu**](https://xinyu-andy.github.io/)
1 · [**Zehuan Yuan**](https://shallowyuan.github.io/)
2* · [**Bingyue Peng**](https://openreview.net/profile?id=~BINGYUE_PENG1)
2 · [**Xiaojuan Qi**](https://xjqi.github.io/)
1†*
1HKU
2ByteDance
3HUST
†project lead *corresponding author
This repository implements UniTok, a unified visual tokenizer well-suited for both generation and understanding tasks.
It is compatible with autoregressive generative models (e.g. LlamaGen),
multimodal understanding models (e.g. LLaVA), and unified MLLMs (e.g. Chameleon and Liquid).

Built upon UniTok, we construct an MLLM capable of both multimodal generation and understanding
with the [Liquid](https://github.com/FoundationVision/Liquid/) framework,
which sets a new state-of-the-art among unified autoregressive MLLMs.

## Abstract
Visual generative and understanding models typically rely on distinct tokenizers to process images, presenting a key challenge for unifying them within a single framework. Recent studies attempt to address this by connecting the training of VQVAE (for autoregressive generation) and CLIP (for understanding) to build a unified tokenizer. However, directly combining these training objectives has been observed to cause severe loss conflicts. In this paper, we show that reconstruction and semantic supervision do not inherently conflict. Instead, the underlying bottleneck stems from limited representational capacity of discrete token space. Building on these insights, we introduce UniTok, a unified tokenizer featuring a novel multi-codebook quantization mechanism that effectively scales up the vocabulary size and bottleneck dimension. In terms of final performance, UniTok sets a new record of 0.38 rFID and 78.6% zero-shot accuracy on ImageNet. Besides, UniTok can be seamlessly integrated into MLLMs to unlock native visual generation capability, without compromising the understanding performance. Additionally, we show that UniTok favors cfg-free generation, reducing gFID from 14.6 to 2.5 on ImageNet 256$\times$256 benchmark. GitHub: this https URL .
## News
**2025-09-18:** UniTok is accepted at NeurIPS 2025 as a spotlight.
**2025-05-19:** We find UniTok favors generation **without classifier-free-guidance** --
it reduces gFID (without cfg) from 14.6 to 2.51 on ImageNet 256x256 using LlamaGen-XXL as the generator.
Please refer to the updated [EVAL.md](https://github.com/FoundationVision/UniTok/blob/main/eval/EVAL.md) for more details.
**2025-04-15:** The [gradio demo](https://huggingface.co/spaces/FoundationVision/UniTok) of UniTok MLLM is available on Huggingface now!
**2025-04-02:** A new [checkpoint](https://huggingface.co/FoundationVision/unitok_tokenizer/tree/main)
of UniTok is released, which has better downstream task performance
by replacing the causal attention projection layer with full attention.
The [model weights](https://huggingface.co/FoundationVision/unitok_mllm)
of our unified MLLM are also available on Huggingface now!
**2025-02-28:** Paper, code, model, and [project page](https://foundationvision.github.io/UniTok/) for UniTok are all released.
## Performance