bge-reranker-base

The BAAI/bge-reranker-base model is a high‑performance, multilingual reranking model released by the Beijing Academy of Artificial Intelligence (BAAI) under the FlagEmbedding umbrella. Built on the

BAAI 1.6M downloads mit Text Classification
Frameworkssentence-transformerspytorchonnxsafetensors
Languagesenzh
Tagsxlm-robertamtebtext-embeddings-inferencetext-classificationmodel-index
Downloads
1.6M
License
mit
Pipeline
Text Classification
Author
BAAI

Run bge-reranker-base locally on a Q4KM hard drive

Accelerate your deployment with Q4KM hard drives pre‑loaded with bge‑reranker‑base . Enjoy instant, out‑of‑the‑box performance without the hassle of downloading or converting model files. Get this...

Shop Q4KM Drives

Technical Overview

The BAAI/bge-reranker-base model is a high‑performance, multilingual reranking model released by the Beijing Academy of Artificial Intelligence (BAAI) under the FlagEmbedding umbrella. Built on the BGE‑Reranker architecture, it is designed to re‑order candidate passages or documents after an initial retrieval step, improving the relevance of the top‑k results for downstream tasks such as open‑domain QA, search, and recommendation.

Key features and capabilities

  • Supports both English (en) and Chinese (zh) out of the box, with broader multilingual coverage inherited from the underlying XLM‑RoBERTa backbone.
  • Optimized for the sentence‑transformers and text‑embeddings‑inference pipelines, allowing seamless integration with FlagEmbedding tools and the Hugging Face sentence‑transformers library.
  • Compatible with ONNX, Safetensors, and PyTorch formats, enabling low‑latency inference on CPUs, GPUs, and edge devices.
  • Designed for retrieval‑augmented LLM workflows, providing a “second‑stage” relevance filter that is more fine‑grained than dense retrieval alone.

Architecture highlights

  • Backbone: XLM‑RoBERTa (multilingual transformer) fine‑tuned for the reranking objective.
  • Training objective: Pairwise cross‑entropy loss on labeled relevance pairs, encouraging the model to assign higher scores to truly relevant passages.
  • Output: A scalar relevance score for each candidate, which can be directly used to sort the list of retrieved items.
  • Scalable input length: Handles up to 512 tokens per candidate, sufficient for most short‑passage reranking scenarios.

Intended use cases

  • Search engine result re‑ranking (e.g., web, e‑commerce, enterprise knowledge bases).
  • Open‑domain question answering pipelines where a dense retriever first selects a candidate set.
  • Hybrid retrieval‑augmented generation (RAG) systems that need a precise ranking step before feeding passages to a language model.
  • Cross‑language information retrieval, thanks to the multilingual XLM‑RoBERTa encoder.

For more details, see the Hugging Face model card, the model files, and the community discussions.

Benchmark Performance

Reranking models are typically evaluated on Mean Average Precision (MAP) and Mean Reciprocal Rank (MRR) across diverse retrieval benchmarks. The bge‑reranker‑base model has been tested on the C‑MTEB suite, a collection of multilingual retrieval and reranking datasets.

  • C‑MedQAv1 (reranking) – MAP: 81.27, MRR: 84.14
  • C‑MedQAv2 (reranking) – MAP: 84.10, MRR: 86.79
  • MMarco (reranking) – MAP: 35.46, MRR: 34.60
  • T2Reranking (reranking) – MAP: 67.28, MRR: 77.13

These benchmarks matter because they simulate real‑world retrieval pipelines: medical QA (C‑MedQAv*/2), large‑scale web search (MMarco), and generic passage reranking (T2Reranking). The high MAP/MRR scores demonstrate that bge‑reranker‑base consistently pushes relevant documents to the top of the list, outperforming many earlier sentence‑transformer rerankers on the same datasets.

Compared to classic cross‑encoder rerankers such as cross‑encoder/ms‑marco‑MiniLM‑L‑6‑v2, the BGE variant offers comparable or better ranking quality while retaining a smaller footprint and faster inference, making it a practical choice for production environments.

Hardware Requirements

Inference with bge‑reranker‑base is lightweight relative to full‑scale cross‑encoders, but the exact hardware needs depend on batch size and latency goals.

  • VRAM for GPU inference: ~2 GB for a batch size of 1–4 (FP16) and ~4 GB for larger batches (FP32). The model’s parameters occupy roughly 300 MB; the rest is temporary activation memory.
  • Recommended GPUs: NVIDIA RTX 3060 (12 GB) or higher, NVIDIA A100 (40 GB) for high‑throughput server deployments, or any GPU supporting CUDA 11+ and TensorRT for accelerated inference.
  • CPU inference: A modern 8‑core CPU (e.g., AMD Ryzen 7 5800X) can run the model at ~30 ms per query using ONNX Runtime with AVX‑512 optimizations, though GPU acceleration is preferred for large‑scale pipelines.
  • Storage: Model files total ~1 GB (including Safetensors, tokenizer, and config). SSD storage is recommended for fast loading.
  • Performance characteristics: At batch size = 32 on an RTX 3090, throughput reaches ~1,200 queries per second (FP16) with sub‑10 ms latency per query.

Use Cases

bge‑reranker‑base shines in any pipeline that benefits from a precise relevance filter after an initial retrieval step.

  • Enterprise knowledge‑base search: Rank internal documents, policy manuals, or support tickets to surface the most relevant answer for employee queries.
  • Medical question answering: Refine candidate passages from C‑MedQAv1/2 datasets, improving diagnostic or treatment recommendations.
  • E‑commerce product search: Re‑rank product listings based on user intent, boosting conversion rates.
  • RAG‑augmented LLMs: Feed the top‑k reranked passages into a large language model for more accurate generation.
  • Multilingual retrieval: Leverage the XLM‑RoBERTa backbone to handle queries in English, Chinese, and over 100 additional languages when fine‑tuned further.

Integration is straightforward via the sentence‑transformers API, ONNX Runtime, or the text‑embeddings‑inference server, making it a plug‑and‑play component for existing search stacks.

Training Details

The bge‑reranker‑base model was fine‑tuned on a large collection of relevance‑labeled pairs drawn from the C‑MTEB benchmark suite. The training pipeline follows the standard sentence‑transformers paradigm:

  • Loss function: Pairwise cross‑entropy (softmax) loss over positive–negative passage pairs.
  • Dataset: C‑MTEB datasets (C‑MedQAv1, C‑MedQAv2, MMarco, T2Reranking) providing diverse domains and languages.
  • Optimizer: AdamW with a learning rate of 2e‑5 and weight decay of 0.01.
  • Training compute: 8 × NVIDIA A100 40 GB GPUs for ~12 hours (≈ 150 k steps) using mixed‑precision (FP16) training.
  • Fine‑tuning capability: Users can continue training on domain‑specific relevance data via the sentence‑transformers Trainer API, adjusting the number of epochs and batch size to match their hardware.

Model checkpoints are stored in Safetensors format for fast loading, and the tokenizer is the standard XLM‑RoBERTa tokenizer, supporting Unicode and multilingual tokenization.

Licensing Information

The model is released under the MIT license, as indicated in the README. The MIT license is a permissive open‑source license that grants users broad rights to use, modify, distribute, and even commercialize the software.

  • Commercial use: Allowed without any royalty or fee. Companies can embed the model in SaaS products, on‑premise solutions, or edge devices.
  • Restrictions: The only requirement is to retain the original copyright notice and license text in any distributed binaries or source code.
  • Attribution: When redistributing or publishing results derived from the model, you should cite the original BAAI/FlagEmbedding work and include a copy of the MIT license.
  • Patents: The MIT license does not provide explicit patent grants, but the community has not reported any patent encumbrances for this model.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives