TL;DR
This paper introduces Gemini Embedding, a new text embedding model built on Google's Gemini LLM. It achieves state-of-the-art performance across a wide range of multilingual, English, and code-based tasks, demonstrating remarkable generalization capabilities and outperforming previous models on the Massive Multilingual Text Embedding Benchmark (MMTEB).
What Problem Does This Paper Address?
Creating effective text embeddings that can generalize across diverse languages, domains, and tasks is a significant challenge. Traditional embedding models often struggle to perform well on a broad spectrum of downstream applications like classification, retrieval, and clustering. While large language models (LLMs) have shown promise in improving embedding quality, there's a need for a unified model that can leverage the full power of a state-of-the-art LLM like Gemini to produce highly generalizable and performant embeddings.
Methods
The core of Gemini Embedding is its initialization from Google's Gemini LLM, leveraging its inherent multilingual and code understanding capabilities. The model architecture involves a transformer encoder initialized from Gemini, followed by mean pooling of token embeddings and a linear projection to the target dimension.
The training process is a two-stage pipeline:
- Pre-finetuning: The model is trained on a large, potentially noisy dataset using a contrastive loss, but without hard negatives. This stage focuses on adapting the LLM's parameters for encoding tasks, benefiting from large batch sizes for gradient stability.
- Fine-tuning: The model is then fine-tuned on a diverse mixture of task-specific datasets containing query, positive, and hard negative target triples. This stage uses smaller batch sizes and often processes one dataset at a time to maximize signal.
To further enhance performance, the authors employ Model Soup, averaging parameters from multiple fine-tuned checkpoints. Gemini itself is also used to improve data quality through:
- Synthetic Data Generation: Creating realistic synthetic datasets for retrieval and classification tasks.
- Data Filtering: Identifying and removing low-quality examples from existing retrieval datasets.
- Hard Negative Mining: Strategically selecting semantically similar but irrelevant passages to improve retrieval performance.
Datasets
The training data mixture includes a billion-scale web corpus for pre-finetuning and a curated set of academic and synthetic datasets for fine-tuning. For evaluation, the authors extensively use:
- Massive Multilingual Text Embedding Benchmark (MMTEB): A comprehensive benchmark covering over 100 tasks and 250+ languages. This includes MTEB(Multilingual), MTEB(Eng, v2), and MTEB(Code).
- XOR-Retrieve: A cross-lingual retrieval benchmark.
- XTREME-UP: Another cross-lingual retrieval benchmark focusing on underrepresented Indo-European languages.
- MIRACL: A multilingual retrieval dataset used for data filtering experiments.
Key Insights and Ideas
- Leveraging Gemini's Power: Initializing embeddings directly from a powerful LLM like Gemini is a highly effective strategy for achieving strong generalization.
- Task Diversity Over Language Diversity: For fine-tuning, a diverse mix of tasks seems more crucial than simply including more languages, especially when the base model already has strong multilingual capabilities.
- Data Quality is Paramount: Using Gemini to generate synthetic data and filter existing datasets significantly boosts embedding performance, even outperforming models trained on original, unfiltered data.
- Hard Negatives are Useful, But Tricky: While hard negatives improve retrieval performance, excessive use can lead to overfitting.
- Unified Model for Multilingualism: A single embedding model can achieve state-of-the-art results across multilingual, English, and code tasks, demonstrating remarkable versatility.
Key Results
Gemini Embedding achieved state-of-the-art performance on the MTEB(Multilingual) leaderboard, significantly outperforming previous models. Specifically:
- MTEB(Multilingual): Achieved a Task Mean of 68.32 (a +5.09 improvement over the second-best model) and a Task Type Mean of 59.64 (+3.64 improvement).
- MTEB(Eng, v2): Achieved the highest Borda rank and excellent overall performance.
- MTEB(Code): Achieved the highest Borda rank and mean performance across evaluation tasks.
- Cross-lingual Retrieval (XOR-Retrieve and XTREME-UP): Demonstrated remarkable improvement, showcasing strong capabilities in understanding and retrieving information across different languages.
- Ablation Studies: Showed that pre-finetuning alone significantly improves performance, and fine-tuning with an English-only mixture still outperforms top models on multilingual tasks.
Limitations and Future Work
Limitations:
- The paper notes that excessive hard negatives can lead to overfitting in retrieval tasks, suggesting a need for better regularization or sampling strategies.
Future Work:
- Multimodal Embeddings: Extending Gemini Embedding to support other modalities like image, video, and audio, leveraging Gemini's multimodal capabilities to create a unified embedding space for diverse data types.
- Optimized Training Recipes: Exploring training recipes that balance performance across different uni-modal and multi-modal capabilities within a single model.
Summary updated