Abstract
We propose V2Flow, a novel tokenizer that produces discrete visual tokens capable of high-fidelity reconstruction, while ensuring structural and latent distribution alignment with the vocabulary space of large language models (LLMs). Leveraging this tight visual-vocabulary coupling, V2Flow enables autoregressive visual generation on top of existing LLMs. Our approach formulates visual tokenization as a flow-matching problem, aiming to learn a mapping from a standard normal prior to the continuous image distribution, conditioned on token sequences embedded within the LLMs vocabulary space. The effectiveness of V2Flow stems from two core designs. First, we propose a Visual Vocabulary resampler, which compresses visual data into compact token sequences, with each represented as a soft categorical distribution over LLM's vocabulary. This allows seamless integration of visual tokens into existing LLMs for autoregressive visual generation. Second, we present a masked autoregressive Rectified-Flow decoder, employing a masked transformer encoder-decoder to refine visual tokens into contextually enriched embeddings. These embeddings then condition a dedicated velocity field for precise reconstruction. Additionally, an autoregressive rectified-flow sampling strategy is incorporated, ensuring flexible sequence lengths while preserving competitive reconstruction quality. Extensive experiments show that V2Flow outperforms mainstream VQ-based tokenizers and facilitates autoregressive visual generation on top of existing LLMs.
Introduction
Large Language Models (LLMs) excel at processing one-dimensional textual sequences, yet adapting them for high-fidelity image generation has traditionally faced significant hurdles. Most current methods utilize Vector Quantization (VQ) to convert images into discrete tokens. However, two major disparities often hinder performance: a distribution mismatch between visual and textual latent spaces, leading to "modality competition," and a structural mismatch where 2D image grids are forced into inefficient 1D raster scans.
V2Flow addresses these issues by asking: Can we design a tokenizer that produces tokens that "look" like text to an LLM, while still allowing for high-fidelity image reconstruction?
The V2Flow Architecture
The V2Flow framework introduces a unified latent space where visual tokens inhabit the same neighborhood as textual tokens. This is achieved through two primary architectural innovations: the Visual Vocabulary Resampler and the Masked Autoregressive Rectified-Flow Decoder.
Visual Vocabulary Resampler
Instead of creating a separate codebook for images, this module compresses visual data into a 1D sequence where each "visual token" is represented as a soft categorical distribution over the actual LLM vocabulary (e.g., the LLaMA tokenizer). By using the Gumbel-softmax trick, the model maintains differentiability while mapping visual features directly into the embedding space used for language. This reduces the representational gap that typically plagues multimodal models.
Masked Autoregressive Rectified-Flow Decoder
To reconstruct high-quality pixels, V2Flow moves away from standard VQ-decoders in favor of a transformer encoder-decoder architecture paired with Rectified Flow (a type of flow-matching). The decoder treats image reconstruction as a "filling in the blanks" task, progressively refining patches from noise to clear pixels. This approach allows V2Flow to achieve higher reconstruction quality at lower token counts than previous 1D tokenizers.
Experimental Results
The researchers evaluated V2Flow using ImageNet-1K for reconstruction and a combination of JourneyDB and LAION-HD (approx. 6 million pairs) for text-to-image generation, utilizing a LLaMA2-7B backbone.
- Superior Reconstruction: On ImageNet (256x256), V2Flow achieved a PSNR of 22.37, significantly outperforming the previous state-of-the-art 1D tokenizer, TiTok (21.44).
- Compression Efficiency: V2Flow's reconstruction using only 128 tokens was superior to TiTok's performance using 256 tokens, representing a 2x improvement in efficiency.
- Qualitative Edge: Visual comparisons demonstrate that V2Flow preserves fine-grained details, such as textures and facial features, that other models often distort.
- Seamless Integration: When integrated with LLaMA2-7B, the system successfully generated complex images from text prompts, demonstrating strong semantic alignment by treating image generation as a standard "next-token prediction" task.
Conclusion and Future Work
V2Flow demonstrates that unifying visual and textual vocabularies can significantly enhance the efficiency and quality of autoregressive image generation. While the model currently uses some visual-specific token initialization, future work aims for a truly "zero-extra-token" approach and scaling the training data to billions of image-text pairs to compete with large-scale diffusion models.
Summary updated