Benchmarking 4 RAG Rerankers: Cohere Lifted the Answer from Rank 15 to 1
Affectionate_Slip654 · reddit · 2026-10-14
The author built a complete RAG reranking pipeline (retrieve Top 20 → rerank → Top 5 → LLM) and benchmarked four rerankers—local Cross-Encoder, LLM-based reranking, Cohere Rerank, and Jina Reranker—on 5 payment-industry PDFs (PCI DSS, central bank reports, 1,507 chunks), with full code and a video walkthrough.
Key findings:
- Similarity ≠ relevance: vector search finds chunks about the topic, not necessarily ones that answer the question
- A small cross-encoder can hurt: it rewards word matching and pushed both correct chunks out of the Top 5
- LLM reranking understood semantics (e.g., that "3.3" belongs to Requirement 3), placing both answer chunks 1st and 2nd
- Cohere lifted one answer chunk from 15th to 1st, turning a miss into a correct, cited answer
- Cohere and Jina offered the best accuracy/speed balance here, with trade-offs in per-call cost and sending docs to third parties
- Evaluate with before/after positions, Hit@5, and latency, always on the same Top 20 set
Stack: Python, Qdrant, gemini-embedding-2-preview (3,072-dim), ms-marco-MiniLM-L-6-v2, Cohere/Jina APIs. Code layout: retriever.py → rerankers.py → generate.py → compare.py.
More from coding & agent
- Dev ships throwaway Postgres for agents: pg19 via pglite on Cloudflare DO over raw TCP — ritakozlov · 2026-11-29
- Product idea: cloud Android VMs and home WiFi proxies to make agents look human — Darpinian · 2026-11-29
- 38 free agent skills distilled from shipping three live AI products — PawelHuryn · 2026-11-29
- Step 5: run evals on synthetic data pre-launch, watch real traces after — PawelHuryn · 2026-11-29
- Break your agent before attackers do: 6 tests mapped to OWASP LLM Top 10 — PawelHuryn · 2026-11-29
- PM shares playbook for shipping 4 customer-facing Claude agents into production — PawelHuryn · 2026-11-29