TL;DR
This paper introduces X-Fusion, a novel framework that enables large language models (LLMs) to understand and generate images without compromising their existing language capabilities. By freezing the LLM's core and introducing a separate, trainable vision tower, X-Fusion achieves state-of-the-art performance on multimodal tasks while being more computationally efficient than training from scratch.
What Problem Does This Paper Address?
Large Language Models (LLMs) have demonstrated remarkable abilities in processing and generating text. However, human communication is inherently multimodal, often involving visual elements. Integrating vision capabilities into LLMs is crucial for creating more versatile and human-like AI systems. Existing approaches often struggle with either:
- Catastrophic forgetting: Fine-tuning LLMs for vision tasks can degrade their original language understanding and generation abilities.
- Computational cost: Training large multimodal models from scratch requires immense computational resources and extensive datasets.
- Limited scope: Some methods focus solely on image understanding or generation, not both simultaneously.
This paper addresses the challenge of extending LLMs to handle visual information efficiently and effectively, while preserving their core language expertise.
Methods
X-Fusion employs a Dual Tower architecture to achieve its goals. The core idea is to keep the pre-trained LLM's language layers frozen (the "text tower") and introduce a new, trainable "vision tower" with separate weights.
Here's a breakdown of the key components:
- Frozen LLM Backbone: The original LLM's parameters are preserved, ensuring its language capabilities remain intact.
- Vision Tower: This tower is responsible for processing visual information. It's designed to be modality-specific and can be trained independently.
- Interleaved Input: Text inputs are tokenized as usual, while images are processed by a pre-trained visual encoder (e.g., VAE from Stable Diffusion) to extract latent representations. These representations are then converted into "image tokens." The combined text and image tokens are fed into the model.
- Dual Tower Operation: Within each layer of the model, there's a frozen text transformer block and a trainable vision transformer block. Both operate on the combined input embeddings. The outputs are then selectively combined to form the final output of the block, with text tokens processed by the text tower and image tokens by the vision tower.
- X-Fuse Layer (Optional): This layer merges features from both towers, trading increased computational cost for potentially improved performance.
- Training Objective: The model is trained using a combined objective that includes the standard autoregressive loss for language modeling and a diffusion loss for image modeling.
Datasets
The paper mentions using a large, in-house licensed dataset for training. For evaluation, they utilize:
- MS-COCO: Used for both text-to-image generation (evaluating image quality with FID) and image captioning (evaluating image understanding with BLIP2-ITM).
- InternVL-2.0: Used to generate image-caption pairs for training.
Key Insights and Ideas
- Freezing LLMs is Key: Preserving the LLM's original weights is crucial for maintaining its language capabilities, a common pitfall in other multimodal approaches.
- Dual Tower Flexibility: The ability to have non-identical designs for the text and vision towers offers significant flexibility for future extensions and optimizations.
- Data Synergy: Incorporating image understanding data (I2T) significantly boosts image generation performance (T2I), suggesting a strong cross-task benefit.
- Noise Matters: While diffusion models benefit from noisy data for generation, excessive noise in image-to-text samples can degrade image understanding. Using cleaner images for understanding tasks improves both understanding and generation.
- Asymmetric Data Benefits: Image understanding data helps generation, but generation data doesn't significantly help understanding. This suggests a strategic approach to data balancing is important.
Key Results
- State-of-the-Art Performance: X-Fusion's Dual Tower architecture outperforms other baseline architectures (Single Tower, Gated Tower, Dual Projection) in both image generation (lower FID) and image understanding tasks.
- Competitive Efficiency: The Dual Tower approach achieves competitive performance without requiring full LLM retraining, making it more practical.
- Preserved Language Ability: Unlike some fine-tuning methods, X-Fusion maintains the LLM's general knowledge, as evidenced by its performance on the MMLU benchmark.
- Data Ratio Impact: A training ratio of approximately 66% text-to-image and 33% image-to-text (2:1) is recommended for optimal performance.
- Noise Reduction Benefits: Using clean images for image-to-text samples consistently leads to better image understanding and also boosts image generation.
Limitations and Future Work
- X-Fuse FLOPs Trade-off: The optional X-Fuse layer improves performance but at the cost of increased FLOPs.
- Transferring Diffusion Models: While X-Fusion can be initialized with a pretrained diffusion model (X-Fusion(Pretrained DiT)), this is presented as an extension rather than the core method. The paper suggests further exploring this for stronger generation capabilities.
- Task-Specific Modeling: The paper notes that the optimal modeling approach for new modalities might be case-specific and could be an area for future research.
- Exploring Other Modalities: The Dual Tower design is inherently flexible and can be extended to incorporate other modalities like audio by adding dedicated towers.
Summary updated