Abstract
IBM Research has released the Granite Embedding R2 family, a set of open-source (Apache 2.0) encoder-based models designed specifically for enterprise-grade retrieval-augmented generation (RAG). These models offer a 16x expansion in context length (up to 8,192 tokens) and a significant speed advantage—processing documents 19-44% faster than leading competitors—while setting new performance benchmarks across text, code, and tabular data.
Introduction
In production RAG environments, developers frequently encounter a "trilemma" involving context length, inference speed, and licensing. Many existing embedding models are constrained by a 512-token context window, limiting their utility for long-document search. Conversely, models supporting longer contexts often suffer from prohibitive inference latency or restrictive non-commercial licenses. Furthermore, standard models often struggle with "non-standard" enterprise data, such as complex tables or multi-turn conversational histories. The Granite R2 models address these challenges by providing a high-speed, long-context, and commercially permissive solution explicitly trained for diverse corporate data types.
Methodology and Architecture
The Granite R2 models are built upon the ModernBERT architecture, an encoder-only transformer utilizing Flash Attention and alternating global/local attention layers. The training pipeline consists of four distinct stages:
- Retrieval-Oriented Pre-training: Employs a RetroMAE (Masked Auto-Encoder) approach for robust representation learning.
- Novel Tabular Pre-training: A modified RetroMAE objective forces the encoder to align table structures with natural language by reconstructing masked table tokens from contextual embeddings and summaries.
- Contrastive Fine-tuning: Standard query-passage pair training using an improved contrastive loss.
- Contrastive Distillation: A final polishing stage where models learn to mimic the similarity score distribution of a larger teacher model (Mistral-7B-Instruct).
The release includes two bi-encoders (149M and 47M parameters) and a 149M parameter cross-encoder reranker utilizing a list-wise ranking objective (PListMLE) to refine search results.
Evaluation and Datasets
Training was conducted on a massive 2-trillion-token corpus, including GneissWeb, CodePile, and curated internal technical documents. Evaluation spanned a comprehensive battery of benchmarks:
- MTEB-v2 & BEIR: General English text retrieval.
- COIR: Code-to-code and text-to-code retrieval.
- MLDR & LongEmbed: Long-context document search.
- Table-IR: Structured data retrieval (e.g., OpenWikiTables, AIT-QA).
- MT-RAG: Multi-turn conversational retrieval.
Key Results and Insights
The Granite R2 models demonstrate superior performance and efficiency across all tested domains. The base model (149M) is approximately 20% faster than comparable models like BGE-base, while the small model (47M) offers a 44% speed advantage.
Key insights from the development process include:
- Efficiency via Architecture: ModernBERT and Flash Attention allow the R2 models to maintain the speed of their predecessors despite increased parameter counts.
- Optimizing RoPE: A Rotary Positional Embedding (RoPE) theta value of 80k was identified as the optimal configuration for the 8k context window, balancing long-context capability with short-task performance.
- Tabular Alignment: Treating tables as first-class citizens during pre-training significantly boosted structured data retrieval.
Conclusion and Future Work
While the Granite R2 models set a new standard for English-language enterprise RAG, future work will focus on expanding language support and closing the zero-shot gap on specific long-context benchmarks through targeted fine-tuning. Scaling to even larger context windows and multilingual capabilities remains a priority for supporting global enterprise use cases.
Summary updated