---
title: The reranker, the second look — RAG, lesson 5
description: An embedding compares a question to 100,000 chunks in one pass but is coarse; a reranker reads the question with each of the top 50 and scores the pair.
url: https://instibrain.ai/guides/rag/the-reranker
updated: 2026-11-07
site: https://instibrain.ai/llms.txt
---

lesson 5 of 8 · rag

# The reranker.

An embedding is fast and coarse. A reranker is slow and exact: it reads the question with each of the top chunks and scores the pair. The best five go in.

## new words

**Reranker**
A model that reads a question and one chunk together and gives one score: does this chunk answer this question?

**Top-k**
How many chunks a search returns. 50 go to the reranker; 5 go to the prompt.

## the lesson

An embedding was computed once, for the chunk alone, before any question existed. So it cannot know what the question needs: it puts "the notice period" near every clause about notice, and the right one lands tenth or thirtieth. A reranker reads the pair, question and chunk, at question time, and that reading is exact.

It is also slow, so it reads only the top 50 the search returned, never the index. The count of what it reads is computable:

```
50 chunks × (500 tokens + a 20-token question) = 26,000 tokens a question
at Haiku 5.5's list price, $0.10 per million, if a chat model did the scoring:
26,000 × $0.10 / 1,000,000 = $0.0026, a quarter of a cent
```

| Step | Reads | Returns |
| Vector search | The question's one vector against 100,000 | The top 50, coarse |
| Reranker | 50 pairs, question and chunk, whole | The top 50, exact |
| The cut | Nothing | The best 5, into the prompt |

Where it helps: the right chunk exists and is ranked 30th. Where it does not: the right chunk is not in the top 50 at all, which is a retrieval problem, lesson 7's measure, not a ranking one.

From the index to the prompt. The counts are an example.

## try it

Type this and press Enter. You are the reranker:

```
Score each sentence 0 to 10 for whether it answers the question, and rank them. Question: When are invoices paid? 1 Invoices are paid within 30 days of the date we receive them. 2 A supplier bill is settled one month after it arrives. 3 Reset your password through the VPN portal, never by email. 4 Expense claims need a receipt and are paid with the next salary.
```

## you should see

- Sentence 1 first, sentence 2 second, with high scores; sentence 4 low, though it shares "paid"; sentence 3 at 0.
- Word counts gave sentence 2 a cosine of 0 in AI basics, lesson 5. A reader of pairs ranks it second. That is the reranker's gain.

---

instibrain is made by WebWork AI, Inc. Everyone uses the same models · the difference is what yours knows.
