{
  "id": 22574634,
  "title": "Is a cross-encoder reranker worth the latency? Measured on 2,908 FastAPI doc chunks",
  "url": "https://urgent.news/2026/11/29/is-a-cross-encoder-reranker-worth-the-latency-measured-on-2-908",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-29T12:16:21.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/recallrundev/is-a-cross-encoder-reranker-worth-the-latency-measured-on-2908-fastapi-doc-chunks-57f2"
  },
  "original_language": null,
  "account": "Testing a cross-encoder reranker on FastAPI English documentation revealed mixed results based on query type and candidate depth. On heading queries, reranking the top 20 candidates improved Mean Reciprocal Rank (MRR) from 0.710 to 0.889 (+0.179), while top 10 and top 50 candidates showed even more significant gains in hit@1 and hit@5 metrics. However, reranking did not benefit exact code identifiers, as their hit@5 dropped from 0.835 to 0.780 when using top-50 candidates. Paraphrases were inconclusive, with mixed gains and losses in hit@k metrics depending on candidate depth. Latency increased proportionally with candidate depth, costing a median of 1,706 ms per query at 20 candidates on a single CPU thread. The model, ms-marco-MiniLM-L-6-v2, achieved NDCG@10 of 74.30 on TREC DL 2019 and about 1,800 docs/sec on a V100 GPU. While reranking can improve results for natural-language queries like headings, identifiers, and paraphrases may not see significant benefits. The bottom line is that reranking the top 20 candidates is recommended over larger depths, with recall@N being a key metric to check before further optimization.",
  "summary": "Tested on: FastAPI English docs (154 Markdown files, 2,908 heading-aware chunks), sentence-transformers 6.3.0, transformers 5.24.1, torch 2.15.0 CPU (1 torch thread, 2-core GitHub runner), cross-encoder/ms-marco-MiniLM-L-6-v2 reranker, all-MiniLM-L6-v2 embeddings. Query sets: 200 random heading queries, 200 random exact-identifier queries (seed 0), 30 hand-written paraphrases. Single run, no GPU.…",
  "summary_source": "publisher",
  "key_points": [
    "Reranking top 20 candidates improves MRR from 0.710 to 0.889 on FastAPI doc chunks",
    "Latency increases proportionally with candidate depth, costing 1,706 ms per query at 20 candidates",
    "Reranking benefits natural-language queries but may not improve identifiers and paraphrases"
  ],
  "editors_take": null,
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}