Making Text Embedders Few-Shot Learners
About
Large language models (LLMs) with decoder-only architectures demonstrate remarkable in-context learning (ICL) capabilities. This feature enables them to effectively handle both familiar and novel tasks by utilizing examples provided within their input context. Recognizing the potential of this capability, we propose leveraging the ICL feature in LLMs to enhance the process of text embedding generation. To this end, we introduce a novel model bge-en-icl, which employs few-shot examples to produce high-quality text embeddings. Our approach integrates task-related examples directly into the query side, resulting in significant improvements across various tasks. Additionally, we have investigated how to effectively utilize LLMs as embedding models, including various attention mechanisms, pooling methods, etc. Our findings suggest that retaining the original framework often yields the best results, underscoring that simplicity is best. Experimental results on the MTEB and AIR-Bench benchmarks demonstrate that our approach sets new state-of-the-art (SOTA) performance. Our model, code and dataset are freely available at https://github.com/FlagOpen/FlagEmbedding .
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Information Retrieval | BEIR | -- | 59 | |
| Text Embedding | MTEB English v2 | Mean Score69.36 | 50 | |
| Sentence Embedding Evaluation | MTEB (test) | Re-Rank Score59.66 | 48 | |
| Text Embedding | MTEB | MTEB Score66.08 | 45 | |
| Retrieval | AIR-Bench English 24.04 | Wiki Score64.61 | 10 | |
| Text Embedding | MTEB Code v1 | Average Performance70 | 6 | |
| Text Embedding | RTEB (beta) | Average Performance63.03 | 6 | |
| Audio+Text2Audio+Text | Custom mixed modality dataset (test) | R@12.51 | 6 | |
| Speech2Speech | SLUE-SQA 5 (test) | R@10.3312 | 5 | |
| Speech2Text | HotpotQA (test) | Recall@10.4533 | 4 |