Abstract
UniCode introduces a unified codebook for Multimodal Large Language Models (MLLMs), allowing a single vocabulary to represent both text and images. By employing a "language-driven iterative training" paradigm and a novel in-context image decompression task, the model achieves high-quality image generation and multimodal understanding with significantly fewer parameters and less training data than previous heavyweights.
Introduction
Most current MLLMs, such as LLaVA, are primarily "text-out" models. While they excel at understanding images by projecting visual features into a text space, they lack the capability to generate images. Existing models that attempt both usually follow one of two suboptimal paths: adding a massive separate visual codebook, which increases complexity and risks "codebook collapse," or mapping images into a frozen LLM's text space, often resulting in blurry, low-quality reconstructions.
The fundamental challenge lies in the "modality gap" between dense, continuous visual signals and discrete, symbolic text. Bridging these without compromising the LLM’s linguistic intelligence or ballooning model size is a critical goal in multimodal research.
Methodology
UniCode treats visual tokens as "first-class citizens" within the LLM's existing vocabulary. This is achieved through several key innovations:
Language-driven Iterative Training
Instead of forcing the LLM to learn a new visual language from scratch, UniCode uses an Exponential Moving Average (EMA) approach. It periodically synchronizes the visual tokenizer’s codebook with the LLM’s embeddings. This "smooth" update ensures the LLM's language capabilities remain intact while the tokenizer learns to map visual patches to specific text tokens.
In-context Image Decompression
To bridge the gap between compressed visual features and discrete codes, the authors introduced a pre-training task where the model receives compressed embeddings and must autoregressively predict the sequence of discrete visual codes.
Stacked Quantization (HQ-VAE)
To manage sequence lengths within finite context windows, UniCode employs a hierarchical approach. Images are compressed into a multi-layer "pyramid" of codes, enabling high-fidelity reconstruction without requiring an excessive number of tokens per image.
Experimental Results
The model was evaluated across generation, understanding, and reconstruction tasks using datasets like LCS-558K, CC3M, VQA-v2, and ImageNet.
Image Generation and Reconstruction
UniCode achieved a Frechet Inception Distance (FID) of 6.72 on ImageNet, outperforming other LLM-based generators like RQ-Transformer (7.55). Furthermore, its reconstruction ability (rFID of 2.83 on ImageNet) is nearly on par with specialized, non-LLM visual tokenizers, demonstrating that the unified codebook preserves fine visual detail.
Multimodal Understanding
On VQA benchmarks, the enhanced UniCode+ achieved a score of 56.2 on ScienceQA and 77.6 on POPE. These results outperform the multimodal generation model Emu and remain competitive with understanding-focused models like LLaVA-1.5.
Discussion and Limitations
While UniCode demonstrates high efficiency—achieving comparable results with a 104M parameter visual encoder versus the 1B+ parameters used in larger models—it still faces challenges. It lags behind LLaVA-1.5 on the POPE benchmark for object hallucination, likely due to the smaller training set for the visual tokenizer. Additionally, high-resolution images still result in long sequences that strain context windows. Future work will focus on scaling the visual encoder and training data to further bridge these gaps.
Summary updated