In this article
Before you start
This page builds on retrieval-augmented generation, and it assumes you have met vector search.
Why interviewers ask this
A question about a named reranker tests whether you understand the second half of retrieval, not only the vector index. Interviewers who probe a RAG design often move from "how do you find passages" to "how do you order them", and a candidate who can only say "I use a better embedding model" has skipped the stage that fixes ordering.
A weak answer says the reranker "makes search more accurate." A strong answer says what goes in (a query and one passage), what comes out (one score, not a vector), why it is applied only to a short list, and what its score does and does not mean. A Staff-level answer adds cost: one forward pass per candidate, so the length of the list is a latency and cost decision, which the page on where RAG latency and cost go breaks down stage by stage.
bge-reranker-v2-m3 from first principles
- Reranker
- A reranker is a model that takes a query and one candidate passage as a single input and returns one relevance score, so a list of candidates can be sorted from most to least relevant after a cheaper search has produced it.
- Logit
- A logit is the raw, unbounded number a model outputs before any squashing function is applied; it can be negative or large, and only its order and size relative to other logits carry meaning.
In plain words
Imagine a hiring manager with a pile of 100 résumés from a keyword search. The search matched words, so it is fast but crude. The manager reads each résumé next to the job description and writes a score on it. Reading the two together catches things a keyword match misses. The analogy breaks in one place: the manager can explain a score, but the reranker's number has no fixed meaning across queries.
In one precise sentence, bge-reranker-v2-m3 maps a (query, passage) pair to one number, and a higher number means the passage answers the query better. The model card says it is built on bge-m3, is multilingual, and is released under the Apache-2.0 license.
Step 1: A first-stage retriever returns candidates
A first-stage retriever is a fast search step, usually vector search over precomputed embeddings, that returns a few dozen or hundred candidate passages for a query. It works because a bi-encoder is a model that embeds the query and each passage separately, so passage vectors are computed once and reused for every query.
Input: the user's query. Output: a candidate list in the retriever's order. That order is only as good as one vector comparison can make it. The reranker never searches the corpus. It sees only what this step hands over, so a passage the retriever missed is lost; the guide to chunking strategies for RAG covers one common cause of such misses.
Step 2: The reranker reads the query and passage together
A cross-encoder is a model that feeds the query and a passage into one network as a single input, so every word of the query can interact with every word of the passage. bge-reranker-v2-m3 works this way. The model card states that, unlike an embedding model, a reranker takes the question and the document as input and directly outputs a similarity instead of an embedding.
Input: one (query, passage) pair. Output: one number. The pair is scored separately from every other pair, so scoring 100 candidates means 100 forward passes. The card's transformers example tokenizes with max_length=512 (model card), and the card states no maximum input length for the reranker. Its base model, bge-m3, processes inputs of up to 8,192 tokens (bge-m3 card), but that is the base model's figure, not a stated limit of the reranker. Set max_length yourself and measure ranking quality on your own long chunks. You now know why the reranker is accurate and why it is slow: both come from reading the pair jointly.
Step 3: The score is a logit, and sigmoid maps it to a probability-like value
The raw output of bge-reranker-v2-m3 is a logit, so it can be negative. On the model card, the panda query gives raw scores of -8.1875 for an unrelated "hi" passage and 5.26171875 for the panda definition (model card). The sigmoid is a function, 1 divided by (1 plus e to the power of minus z), that maps any number into the range between zero and one.
The card says that setting normalize=True applies the sigmoid, and it shows 0.000278 and 0.9948 for those two passages (model card). The sigmoid is strictly increasing, so it never changes the order of the candidates. It only changes the scale. A common mistake is to treat the result as a calibrated probability; the card does not claim that, and a threshold such as "keep above 0.5" should be tested on your own data.
Step 4: Sort by score and keep the top few
The last step sorts the candidates by score, highest first, and keeps the first few for the language model. Because sorting depends only on order, you can sort on raw logits and skip the sigmoid unless you need a bounded number for a threshold or a display. Usually only a handful of passages go on to the language model, and that count is a context-budget choice: every extra passage uses prompt space and adds cost.
Input: scored pairs. Output: a short, re-ordered context list. A passage the retriever ranked fourth can move to first. The page on evaluating a RAG system shows how to measure whether this reordering helped answers, for example by comparing retrieval metrics before and after on the same queries.
Step-by-step description
- The retriever returns candidates.
- Each query and passage pair is read together.
- The raw score maps between zero and one.
- Candidates are sorted by score.
- A first-stage retriever returns candidates.
- The reranker scores each query and passage pair together.
- The sigmoid maps the raw score between zero and one.
- Sorting by score keeps the best passages.
Knowing it is half the job. Saying it is the other half.
Interview Clozo is an AI interview copilot for real interview rounds: it hears the question and puts a strong answer on your screen, and you say it in your own words. See the features or how it works.
Start Free Trial →Worked example
Start with the two numbers on the model card. The raw scores are -8.1875 and 5.26171875, and the sigmoid maps them to 0.000278 and 0.9948, which the script reproduces.1 The card also shows a raw -5.65234375 that maps to 0.003497 for a dummy pair, and the script gives the same value.1 A raw score of zero would map to 0.5.1
Text description of the diagram
- The raw scores for the panda query are -8.1875 and 5.26171875.
- The sigmoid maps them to 0.000278 and 0.9948.
- The sigmoid never changes the order of the candidates.
The facts below are the ones the model card states, in one place.
| Fact | What the model card says |
|---|---|
| Base model | bge-m3 |
| Licence | Apache-2.0 |
| Languages | multilingual |
| Output | one score per (query, passage) pair, no embedding |
| Raw score range | unbounded logit (card example -8.1875 to 5.26) |
| Bounded score | sigmoid via normalize=True |
| Example truncation | max_length=512 in the transformers example |
| Card's pick for best performance | bge-reranker-v2-gemma, bge-reranker-v2-minicpm-layerwise |
Every row is from the model card, read 2026-10-26.
Now a re-sort. Five candidates come back from a retriever in the order A, B, C, D, E. The reranker logits below are illustrative, not measured from the model.
| Candidate | Retriever rank (illustrative) | Reranker logit (illustrative) | After sigmoid | Reranked position |
|---|---|---|---|---|
| A | 1 | -3.2 | 0.0392 | 4 |
| B | 2 | 1.4 | 0.8022 | 2 |
| C | 3 | -0.5 | 0.3775 | 3 |
| D | 4 | 4.1 | 0.9837 | 1 |
| E | 5 | -6.0 | 0.0025 | 5 |
The sigmoid column is computed from the illustrative logits.1
Cost is the reason for the two-stage design. Take an illustrative corpus of 1,000,000 passages. Reranking the top 100 candidates takes 100 forward passes per query. Scoring the whole corpus with the reranker would take 1,000,000 passes per query, which is 10,000 times more.1 If the passes run in batches of 16 (illustrative), 100 candidates need 7 batches.1
Text description of the diagram
- A bi-encoder embeds the query and each passage separately.
- A reranker reads the query and passage together and outputs one score.
- A reranker needs one forward pass per candidate.
Trade-offs and edge cases
bge-reranker-v2-m3 trades extra latency for better ordering. Each candidate costs one forward pass, so a longer list raises both cost and delay. Pick the list length by measuring answer quality against latency on your own queries, as the page on where RAG latency and cost go describes.
It is also not the largest option in its family. The model card describes it as lightweight, multilingual and fast, and recommends it for efficiency and multilingual use. For better performance, the card points to the gemma-based and minicpm-layerwise variants (model card). Its older siblings, bge-reranker-base and bge-reranker-large, are listed for Chinese and English.
Edge cases:
- Recall ceiling. A reranker cannot recover a passage the first stage never returned.
- Score scale. Raw logits from different queries are not directly comparable, so tune any cut-off on held-out queries.
- Long passages. The card's examples truncate at 512 tokens and state no limit; set
max_lengthexplicitly and test long chunks, as Step 2 describes. - Sensitive data. Sending passages to a hosted scoring service moves data outside your boundary; see securing a RAG system.
- Graph-shaped questions. Multi-hop questions may need structure beyond reordering; the GraphRAG page covers that.
How do you call bge-reranker-v2-m3 in code?
The model card shows a call through the FlagEmbedding library, reproduced here in shortened form from the model card (read 2026-10-26).
from FlagEmbedding import FlagReranker
reranker = FlagReranker('BAAI/bge-reranker-v2-m3', use_fp16=True)
pairs = [['what is panda?', 'hi'],
['what is panda?', 'The giant panda is a bear species endemic to China.']] # shortened
print(reranker.compute_score(pairs)) # card: [-8.1875, 5.26171875]
print(reranker.compute_score(pairs, normalize=True)) # card: [0.000278, 0.9948]The printed scores are the card's, not re-run here. The first call loads the model; use_fp16=True speeds up computation at a slight cost in quality, as the card says. pairs holds one query and passage per item, and compute_score returns one raw logit for each. With normalize=True it applies the sigmoid, so each value falls between zero and one.
How to answer it in an interview
What does bge-reranker-v2-m3 do in a RAG pipeline?
It is a reranker. My first-stage retriever returns, say, a hundred candidates cheaply from precomputed embeddings. The reranker then reads the query and each passage together and outputs one score per pair, so it orders them more carefully than vector similarity can. It produces no embeddings, so nothing is precomputed, and cost grows with the number of candidates. The raw score is a logit; I only sort on it, or apply a sigmoid if I need a threshold, and I tune that threshold on held-out queries.
The spoken structure: say where it sits, say what goes in and out, say the cost, then say what the score means.
Common mistakes
- "The reranker gives me embeddings I can store." (wrong) It scores a pair at query time and returns no embedding. (right) "Passage embeddings come from the retriever; the reranker only scores pairs."
- "The score is a probability." (wrong) See Step 3: it is a logit. (right) "I sort on the raw score and use the sigmoid only for a bounded value."
- "bge-reranker-v2-m3 is the same as bge-m3." (wrong) bge-m3 is its base model; they do different jobs. (right) "bge-m3 embeds text; the reranker is built on it to score pairs."
- "I rerank the whole corpus for best quality." (wrong) That needs one pass per passage per query. (right) "I rerank a short list the retriever produced."
- "It is the most accurate bge reranker." (wrong) The card recommends other variants for best performance. (right) "It is the lightweight, multilingual option."
Follow-up questions
Does bge-reranker-v2-m3 output embeddings?
No. The card says a reranker takes a question and a document as input and outputs a similarity directly, not an embedding. Nothing from it can be stored in a vector index.
Is the reranker score a probability?
Not by default; Step 3 explains the logit and the optional sigmoid. Validate any threshold on your own data.
Why not score the whole corpus with the reranker?
Each pair needs its own forward pass, so cost grows with corpus size for every query. In the illustrative corpus above that is 10,000 times more passes than reranking 100 candidates.
Which bge reranker should you pick?
Per the model card, choose v2-m3 for efficiency and multilingual use, and the gemma or minicpm-layerwise variants when you want better performance and can pay for it. Compare them on your own queries.
How do you know the reranker helped?
Compare retrieval and answer quality with and without it on the same labeled queries, as in how to evaluate a RAG system. More practice questions are in the RAG interview questions.
- bge-reranker-v2-m3 scores a query and a passage together and returns one number, not an embedding.
- It reorders a short list from a first-stage retriever; it cannot find passages the retriever missed.
- The raw score is a logit; the optional sigmoid maps it between zero and one without changing the order.
- Cost grows with the number of candidates, one forward pass each.
- It is the lightweight multilingual option; larger variants are recommended for best performance.
Sources
- BAAI/bge-reranker-v2-m3 model card — Hugging Face (model publisher: BAAI); repository created 2024-03-15, read 2026-10-26, 15 Mar 2024
- BGE M3-Embedding: Multi-Lingual, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation (arXiv 2402.03216) — arXiv (Chen et al.); listed on the model card, 5 Feb 2024
- BAAI/bge-m3 model card — Hugging Face (model publisher: BAAI), 26 Oct 2026