ld.← ALL FIELD NOTESTHE RELATED CASE STUDY ↗
FIELD NOTES / 04RERANKING   ·   RETRIEVAL & RAG

Finding candidates is only the first step.

Getting the top results from search does not necessarily mean the best results are at the top.

A closer look at relevance

After dense and sparse retrieval and RRF, we have a set of candidates. The next question is which of them are actually most relevant to the query.

We use a cross-encoder to rerank them. Instead of independently embedding the query and result and comparing those representations, it evaluates each query–candidate pair together and gives it a relevance score.

Different stages, different jobs

Retrieval helps find promising candidates. Reranking helps decide which of those candidates should come first. The distinction makes it easier to reason about what each stage contributes to the system.

THE RETRIEVAL PIPELINE
QueryDense + sparseRRFRerankLLM

Every stage has a cost

A cross-encoder adds compute and latency, so adding a stage is not a free improvement. The benefit needs to justify its cost in the context of the whole system.

That trade-off felt familiar: building AI systems involves the same kind of engineering judgment as any other backend system.

Continue the conversation

KEEP READING / 03How do you combine two different rankings?

Another note from the notebook.