Abstract
Most multi-modal tasks can be formulated into problems of either generation or embedding. Existing models usually tackle these two types of problems by decoupling language modules into a text decoder for generation, and a text encoder for embedding. To explore the minimalism of multi-modal paradigms, we attempt to achieve only one model per modality in this work. We propose a Multi-Modal Generative Embedding Model (MM-GEM), whereby the generative and embedding objectives are encapsulated in one Large Language Model. We also propose a PoolAggregator to boost efficiency and enable the ability of fine-grained embedding and generation. A surprising finding is that these two objectives do not significantly conflict with each other. For example, MM-GEM instantiated from ViT-Large and TinyLlama shows competitive performance on benchmarks for multimodal embedding models such as cross-modal retrieval and zero-shot classification, while has good ability of image captioning. Additionally, MM-GEM can seamlessly execute region-level image caption generation and retrieval tasks. Besides, the advanced text model in MM-GEM brings over 5% improvement in Recall@1 for long text and image retrieval.
Addressing Modality Divergence
In the current multi-modal landscape, a "modality divergence" exists between two primary task types. Embedding models, like CLIP, typically utilize a dual-encoder structure to project images and text into a shared latent space for retrieval and classification. Conversely, generative models, such as LLaVA, employ auto-regressive decoders to interpret images and generate descriptive text.
These paradigms require fundamentally different textual treatments: embedding models require a global summary of a sentence, whereas generative models must predict text token-by-token. Previous attempts to unify these functions often resulted in complex "Frankenstein" architectures with separate encoders and decoders. MM-GEM addresses this by asking if a single Large Language Model (LLM) can perform both roles simultaneously without performance degradation.
Methodology: A Unified Framework
MM-GEM proposes a minimalist framework where a single LLM (specifically TinyLlama) serves as both the text encoder and the text decoder.
The model is trained using two simultaneous objectives:
- Embedding: The model aligns image features with the hidden state of a special
[EMB]token using an Info-NCE loss. - Generation: A standard cross-entropy loss is used to predict the next token following a
[CAP]prompt.
To move beyond collapsing images into a single global vector, MM-GEM utilizes a PoolAggregator. This component maintains a spatial feature map, allowing the model to flexibly aggregate visual information from specific regions. Training occurs in two stages: large-scale pre-training on 2.3 billion image-text pairs (Stage 1), followed by fine-tuning on dense caption data using RoIAlign to teach the model to associate specific image regions with text (Stage 2).
Key Insights and Spatial Awareness
A core finding of this research is the "No-Conflict" surprise: contrastive learning (embedding) and auto-regressive learning (generation) are compatible within a single LLM. Training them together does not degrade performance; rather, they appear to complement each other. Furthermore, using a full LLM like TinyLlama as a text encoder significantly improves performance on long, complex text retrieval tasks, yielding a 5% improvement in Recall@1 compared to smaller transformer encoders.
Because the model is trained to attend to specific regions during Stage 2, it gains exceptional spatial awareness. It can perform region-level captioning, describing specific objects within a crowded scene based on a bounding box, whereas standard models typically default to a global image description.
Performance Evaluation
MM-GEM demonstrates state-of-the-art performance across multiple benchmarks:
- Retrieval: Using a ViT-L/14, MM-GEM achieved a Recall@1 of 45.6 on COCO text-to-image retrieval, outperforming OpenAI CLIP (34.3) and matching OpenCLIP.
- Captioning: On the NoCaps benchmark, the model achieved a CIDEr score of 100.7, significantly outperforming larger models like Flamingo-9B (79.4).
- Zero-Shot Classification: The model maintained high accuracy across the ICinW benchmark, proving that generative training does not compromise its classification capabilities.
Conclusion and Future Directions
While MM-GEM successfully unifies generative and embedding tasks, limitations remain. The web-scale pre-training data is often noisy, which can affect initial caption quality. Future work will explore incorporating more text-only data to enhance linguistic reasoning and scaling the architecture to larger LLMs (e.g., 7B or 13B parameters) to further improve complex multi-modal reasoning.
Summary updated