Urgent.News

What's breaking now, across thousands of outlets.

Tech

Reranking Models: The Cheapest RAG Quality Upgrade

Last year I took over a support chatbot for a client with about 40,000 help center and internal wiki chunks in a vector database. Retrieval was pure dense vector search. The model answered confidently from the wrong chunk about a third of the time. We did not re-embed anything, did not switch databases, and did not fine-tune a model. We added a reranker between retrieval and generation in one…

Last year, the author revamped a support chatbot handling 40,000 help center and internal wiki chunks in a vector database. Retrieval used pure dense vector search, but answers were correct only about one-third of the time. Adding a reranker between retrieval and generation increased accuracy from 61% to 84%, with costs under $40 that month.

Many teams assume poor RAG answers indicate a need for better embedding models, larger LLMs, or new vector databases. However, often a cheap second pass over retrieved chunks is sufficient. This article explains reranking, its cost, how to measure the improvement, and when to skip it. Most Retrieval Augmented Generation (RAG) systems use bi-encoders, compressing queries and document chunks into single vectors and returning the closest candidates.

While fast, bi-encoders are better at recall, not precision. Negation, qualifiers, part numbers, and differences in phrasing like "refund policy for annual plans" vs. "refund policy for monthly plans" produce nearly identical vectors, leading to wrong chunks being ranked first. To address this, reranking splits retrieval into two stages: recall and precision.

Stage one uses fast bi-encoder search to pull top 50 to 100 candidates, while stage two scores each candidate with a reranker, a cross-encoder that reads the query and candidate together to produce a relevance score. Self-hosted rerankers cost only fractions of a GPU hour and add minimal latency. The author recommends hybrid retrieval, combining BM25 keyword search with dense vector search to better handle exact string matches. Implementing reranking adds latency but improves answer accuracy at a relatively low cost.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Why Your Telemetry Code Fails During Live Production Incidents

Most telemetry code gets written when you're calm, happy, and have zero idea how your system is actually going to fail. The result is predictable.

  • Telemetry code often fails to capture internal queue state during production incidents.
  • Effective telemetry requires emitting state vectors for observability systems.
  • Structured metadata logging enables querying patterns based on actual data.

More from Tuesday 27 October →