NV-Embed: Improved Techniques for Training LLMs as Generalist Embedding Models (NVIDIA, May 2024)
- Paper: https://arxiv.org/abs/2405.17428
- Authors: Chankyu Lee, Rajarshi Roy, Mengyao Xu, Jonathan Raiman, Mohammad Shoeybi, Bryan Catanzaro, et al. (NVIDIA)
- Category: Embedding models
- Goal: Train large language models as generalist embedding models that excel not only at retrieval but also at clustering, reranking, classification, and other semantic tasks.
- Architectural innovations:
- Replaces causal attention in the LLM with bidirectional attention to obtain better token representations for embedding.
- Adds a latent attention pooling layer to produce the final sentence/document embedding, avoiding simplistic pooling strategies.
- Training recipe:
- Two-stage contrastive learning with instruction tuning: a first stage mixes retrieval and non-retrieval instruction data, followed by a second stage with curated retrieval data and hard negative mining to sharpen retrieval accuracy without sacrificing generality.
- Results:
- At release (May 2024), NV-Embed achieved state-of-the-art performance on MTEB, ranking first on the Massive Text Embedding Benchmark.
- Strong results on retrieval benchmarks (e.g., BEIR-style datasets) while remaining competitive on non-retrieval tasks.
- Significance: Demonstrates that LLMs, with the right architectural and training modifications, can serve as unified embedding backbones across heterogeneous tasks, rather than requiring specialized BERT-scale encoders.
- BGE M3-Embedding (arXiv:2402.03216): multi-lingual, multi-functionality, multi-granularity embeddings.
- Arctic-Embed 2.0 (arXiv:2412.04506): multilingual retrieval without compromise.
- BGE-en-ICL / BGE-ICL (arXiv:2409.15700): few-shot learning for text embedders via in-context learning.
- Scandinavian Embedding Benchmarks: multilingual evaluation of embedding models.
Key points
Context in the embedding landscape
NV-Embed is best read alongside related efforts: