Downloads · 30 days
24
24% of all-time downloads
sfczaa/bge-reranker-base-nq-ft
bge-reranker-base-nq-ft is a text classification model from sfczaa. Use it when you need a label for a piece of text. The card lists the license as mit.
A cross-encoder reranker for RAG retrieval: BAAI/bge-reranker-base fine-tuned on hard-negative groups mined from the Natural Questions train split. It was produced as Stage 8 of a controlled ablation study of RAG chun…
Downloads · 30 days
24
24% of all-time downloads
All-time downloads
101
Public
Parameters
278M
1.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.1 GB · 98%
From the Hugging Face model README
A cross-encoder reranker for RAG retrieval: BAAI/bge-reranker-base fine-tuned
on hard-negative groups mined from the Natural Questions train split. It was
produced as Stage 8 of a controlled ablation study of RAG chunking, where the
diagnosis was explicit - at the best chunk size the answer was already inside the
BGE top-20 pool for ~96% of questions while Recall@1 sat at ~0.63, so the
bottleneck was ranking within the pool.
| Base model | BAAI/bge-reranker-base |
| Data | 2034 groups (1 positive + 7 hard negatives) mined from 2161 NQ train questions |
| Mining | deployment-matched chunking (fixed 15 sentences / overlap 0), BGE top-20 pool (BAAI/bge-base-en-v1.5) |
| Objective | listwise softmax cross-entropy over each group |
| Schedule | 2 epochs, lr 2e-5, warmup 10%, weight decay 0.01, 4 groups/step, fp16, seed 42 |
| Hardware | single T4 |
| Loss | 0.904 -> 0.513 |
Every evaluation below uses the NQ validation split, disjoint from training.
In-domain (NQ, 1000 docs / 1032 questions). delta vs the off-the-shelf reranker, with all arms reranking one identical BGE top-20 pool (2 SE = 0.030):
| chunking config | dense R@1 | off-the-shelf R@1 | this model R@1 | delta vs off-the-shelf |
|---|---|---|---|---|
| fixed 6/0 | 0.509 | 0.545 | 0.650 | +0.106 |
| fixed 15/0 | 0.628 | 0.629 | 0.736 | +0.107 |
| fixed 15/1 | 0.626 | 0.627 | 0.720 | +0.093 |
| bilstm 15/0 | 0.630 | 0.627 | 0.714 | +0.087 |
| transformer 15/0 | 0.637 | 0.625 | 0.732 | +0.107 |
At fixed 15/0 this closes about a third of the gap between dense R@1 (0.628) and the pool ceiling (0.964). R@3 and R@5 rise too; no metric trades down.
Cross-dataset (TriviaQA rc.wikipedia, 472 docs / 300 questions, 2 SE = 0.054). Cross-dataset limitations:
| delta vs off-the-shelf R@1 | delta vs no reranking (dense) | |
|---|---|---|
| in-domain (NQ), fixed 15/0 | +0.107 | +0.107 |
| cross-dataset (TriviaQA), fixed 15/0 | +0.057 | +0.003 |
On the tested TriviaQA bench, the off-the-shelf reranker lowered R@1 by 0.03...0.07 relative to dense retrieval. This model returned to approximately the dense baseline. Its difference from the off-the-shelf reranker was positive at 5/5 configs and above the approximate 2 SE band at 4/5 configs, but the cross-dataset result remained approximately equal to dense retrieval.
The reported improvement is specific to NQ. The TriviaQA result does not establish expected behavior on other datasets.
from sentence_transformers import CrossEncoder
model = CrossEncoder("sfczaa/bge-reranker-base-nq-ft", max_length=512)
scores = model.predict([(question, passage) for passage in candidates])
ranked = [c for _, c in sorted(zip(scores, candidates), reverse=True)]
Drop-in replacement for BAAI/bge-reranker-base - same architecture, tokenizer
and 512-token truncation. Reranking costs ~0.56 s/question at depth 20 on a T4,
unchanged by fine-tuning.
MIT, matching the BAAI/bge-reranker-base base model.