Abstract
This report explores the enhancement of text retrieval performance using advanced data refinement techniques. We develop Linq-Embed-Mistral (https://huggingface.co/Linq-AI-Research/Linq-Embed-Mistral) by building on the E5-mistral and Mistral-7B-v0.1 models, focusing on sophisticated data crafting, data filtering, and negative mining methods, which are highly tailored to each task, applied to both existing benchmark dataset and highly tailored synthetic dataset generated via large language models (LLMs). Linq-Embed-Mistral excels in the MTEB benchmarks (as of May 29, 2024), achieving an average score of 68.2 across 56 datasets, and ranks 1st among all models for retrieval tasks on the MTEB leaderboard with a performance score of 60.2. This performance underscores its superior capability in enhancing search precision and reliability. Our contributions include advanced data refinement methods that significantly improve model performance on benchmark and synthetic datasets, techniques for homogeneous task ordering and mixed task fine-tuning to enhance model generalization and stability, and a streamlined evaluation process using 4-bit precision and a light retrieval evaluation set, which accelerates validation without sacrificing accuracy.
1. Introduction
In the era of Retrieval-Augmented Generation (RAG), the retrieval component often serves as the primary performance bottleneck. While Large Language Models (LLMs) have revolutionized text processing, their effectiveness is contingent upon embedding models' ability to locate relevant information within vast corpora. Recent trends have shifted toward utilizing LLMs to generate synthetic training data for these embedding models. However, this approach is susceptible to the "garbage in, garbage out" principle. LLM-generated data frequently suffers from hallucinated positives, false negatives, and a lack of stylistic diversity. This report addresses how rigorous refinement of both synthetic and benchmark data can push the boundaries of retrieval performance.
2. Methodology
Linq-Embed-Mistral is built upon the E5-Mistral and Mistral-7B-v0.1 architectures. The core innovation lies in a multi-stage data refinement pipeline and specialized training strategies.
2.1 Advanced Data Refinement
The team implemented several filtering and mining techniques to ensure high-quality training triplets:
- Positive Answer Filtering: For retrieval tasks, passages were only retained if they explicitly contained the target answer.
- Teacher-Model Filtering: A teacher model was employed to rank passages. Positive examples were kept only if they appeared in the top-n results.
- Hard Negative Mining: Negatives were specifically mined from the 30th to 100th rank of the teacher model's output. These "hard" negatives are semantically similar enough to provide a meaningful challenge during training without being actually relevant.
2.2 Synthetic Data Crafting
Rather than relying on generic LLM outputs, the authors used extensive prompt engineering to address specific task-related issues. This included controlling word-length consistency, improving negation handling, and ensuring topic diversity across six task categories: short-long retrieval, classification, matching, STS, and bitext translation.
2.3 Training Stability and Efficiency
To ensure model generalization and stability, two key training techniques were used:
- Homogeneous Task Ordering: Training was organized into blocks where task order remained identical across epochs, allowing for better tracking of performance fluctuations.
- Mixed Task Fine-tuning: Different tasks were mixed within the same training batches to prevent catastrophic forgetting.
Furthermore, the evaluation process was streamlined using 4-bit precision and a "Light Retrieval Evaluation Set" (sampling 20% of queries), reducing evaluation time from over 100 hours to just 5 hours with negligible loss in accuracy.
3. Results and Discussion
Linq-Embed-Mistral achieved the #1 position on the MTEB retrieval leaderboard with a score of 60.2, outperforming established models like SFR-Embedding-Mistral (59.0) and GritLM-7B (57.4). Across the full suite of 56 MTEB datasets, it achieved an average score of 68.2, ranking 1st among publicly accessible models.
Key insights from the development process include:
- Negative Sampling Impact: Choosing the right "wrong" answers (mining from the top 30-100 results) impacts performance more significantly than simply increasing training batch sizes.
- Synthetic Data Fragility: Without refinement, GPT-4-generated data often includes artifacts like self-explanations that act as "cheats," preventing the model from learning genuine semantic relationships.
- Task Mixing: Mixing tasks within fine-tuning steps was critical for achieving stable model generalization.
4. Conclusion
Linq-Embed-Mistral demonstrates that focusing on data quality over sheer quantity can yield state-of-the-art results in text embeddings. Future work will explore "label-utilizing" strategies—incorporating labels from evaluation tasks directly into training—and improving multilingual data refinement to address the higher frequency of false positives and negatives in non-English synthetic data.
Summary updated