Derek PapierskiAI & software engineer
Michigan

notes

← notes

what a reranker does

Oct 12, 2026

say you search some docs for “how do i undo a migration?” and the first result explains how to create one. it’s related. probably shares a lot of the same words. still doesn’t answer the question.

a reranker takes the results a search system already found and puts them in a new order. the hope is that the page about rolling a migration back moves above the introduction to migrations.

a common setup is to retrieve a batch of passages, then use a cross-encoder to score each passage together with the question. an embedding search compares vectors produced separately; the cross-encoder gets to look at the question and passage together. the Sentence Transformers example shows how those two steps fit together.

you might retrieve 50 passages and keep 5 after reranking. those numbers are just an example. running the more expensive model over a shortlist keeps the extra work manageable.

in a RAG system, the selected passages become context for the model writing the answer. so this is one place where an answer can go wrong before the model writes anything.

a high relevance score doesn’t tell you whether the documentation is correct or current. and a reranker can’t move a missing passage to the top. if retrieval never found the rollback instructions, reranking that batch won’t fix it.

when checking a bad answer, i’d want to see the passages before and after this step. whether the useful one made it into the first batch, where it ended up, and whether it was actually passed to the model. that gives me somewhere specific to look.