Prompts Forms Resume Reports ★ Saved ★ Saved★ + Submit a tool
Techniques

Reranker Model BGE-Reranker

About 3934 characters Updated Nov 30, 2026 18 views AI wiki

BGE-Reranker is a family of reranking models released by the Beijing Academy of Artificial Intelligence (BAAI), designed for fine-grained scoring of recall results in the second stage of a retrieval-augmented generation (RAG) pipeline. It does not perform retrieval itself but steps in after coarse ranking, reordering candidate documents by relevance to the question, and is the most direct and most effective link in improving retrieval quality.

Core Principles

BGE-Reranker uses a cross-encoder architecture, that is, concatenating "question" and "document" into one sequence fed together into a Transformer, letting attention interact bidirectionally between them, and finally outputting a relevance score through a classification head. This differs fundamentally from a bi-encoder (i.e., an ordinary embedding model): an embedding model encodes question and document separately into vectors and then computes cosine distance, with neither aware of the other at encoding time and all interaction deferred to the final dot product; a cross-encoder runs a full forward pass separately for each pair, seeing fine-grained word-to-word matching relationships, so its accuracy is usually markedly higher than vector similarity.

Its training data consists mainly of large-scale Chinese-English pairs, obtained through contrastive learning on positive and negative samples. Family members include bge-reranker-base, bge-reranker-large, and the multilingual bge-reranker-v2-m3. Among them v2-m3 uses an XLM-RoBERTa backbone, covering more than one hundred languages and supporting longer input lengths, making it the most widely used version in current engineering. There are also lightweight versions distilled from large models, used in scenarios extremely sensitive to latency.

Key Points

A typical usage is "recall the top fifty to one hundred, then rerank and truncate to the top three to five": vector retrieval handles breadth and speed, the reranker handles precision, with a clear division of labor. Among parameters, pay close attention to max_length: the default five hundred and twelve tokens truncates long documents, and the truncation strategy directly affects scoring stability; whether to keep the head or split by paragraph and take the highest score makes a considerable difference.

Scores are usually raw logits; without sigmoid normalization the values can be positive or negative with no fixed range, so thresholds must be calibrated per model and domain. The cost lies in computation: reranking time is proportional to the number of candidates, completely unlike the one-time encoding of vector retrieval. One hundred candidates on a large backbone may bring hundreds of milliseconds of latency, so deployments often use cascaded pruning: coarse rank to thirty first, then fine rank. One can also batch inference on GPU, enable half precision, or switch to the base version to balance speed and quality. Batch size strongly affects throughput, and serial single-item calls are a common performance killer.

Also watch the input format: many versions require concatenating in the order "query first, document after", and reversing the order markedly lowers scores. In Chinese scenarios, confirm that the model and tokenizer match, and do not mix weights from different families. Engineering also commonly uses a hybrid strategy of "rule score plus model score": weighting signals such as title matches, time freshness and field importance with the reranking score often fits the business better than relying on semantic score alone. Before launch, measure NDCG on a batch of human-annotated relevance samples rather than judging subjectively whether the effect is good.

Common Misconceptions

First, using the reranker as a retriever, scoring the whole library directly, which is completely infeasible in engineering, since millions of documents mean millions of forward passes. Second, ignoring that scores are not comparable across models: change the model or the max_length and historical thresholds immediately fail, so re-annotation and validation are mandatory. Third, assuming reranking always brings improvement; if the recall stage never fetched the correct document, reranking cannot help, and the optimization order should be recall first, fine ranking second.

Application Scenarios

Retrieval-augmented generation, enterprise knowledge base question answering, search engine fine ranking, long-document retrieval in law and medicine, multilingual cross-lingual retrieval, customer service ticket matching, paper plagiarism checking and literature recommendation.