BGE reranker for the 2026-2 RAG assignment

This cross-encoder scores an English question against a Wikipedia title and its original passage. Use the single relevance logit to rerank candidate passages.

Training

  • Base checkpoint: BAAI/bge-reranker-base.
  • Dataset: NLPlab-skku/RAG-assignment, using train questions and train qrels.
  • One epoch over 20,000 sampled questions, with 20,000 gold pairs and 59,969 hard-negative pairs. Sampling excludes negatives that map to known gold or weak-positive passages.
  • Binary cross-entropy with logits, AdamW at 2e-5, seed 42, batch size 96, maximum sequence length 256. Training used BF16 autocast on Apple MPS.

The search system retrieves 100 BM25 candidates, keeps 50 ranked by MiniLM, and blends the BGE and initial BM25 scores to select 5 passages. The accompanying Colab notebook evaluates the complete system on dev. Training details and the evidence fingerprint are in training_summary.json.

Scoring a question and passage

import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer

repo = "EllaNAM/rag-assignment-bge-reranker"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForSequenceClassification.from_pretrained(repo).eval()
features = tokenizer(
    "What is the capital of France?",
    "Paris\nParis is the capital of France.",
    max_length=256, truncation=True, return_tensors="pt",
)
with torch.inference_mode():
    logit = model(**features).logits.item()
Downloads last month
7
Safetensors
Model size
0.3B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for EllaNAM/rag-assignment-bge-reranker

Finetuned
(34)
this model

Dataset used to train EllaNAM/rag-assignment-bge-reranker