insideout Get Pro

04 · Reranking

Pro

Search and Retrieval, lesson 4

Reranking

A slower model rescores the top results for precision.

"Vector search" and "Combining keyword and vector search": fast first passes that end in one ranked list. This lesson adds a second, slower pass over the top of that list.

Part 1. The first pass is fast but blurry

Question: "Can enterprise customers get a refund after 45 days?" The embedding search returns three passages with very close scores. Say they come out like this:

0.85 "Annual plans can get a refund within 30 days." 0.84 "Enterprise plans get a refund within 60 days, pro-rated." 0.81 "Enterprise customers get a dedicated account manager."

All three are about enterprise or refunds, so all three sit near the question. Only the second answers it. The embedding of each passage was made before anyone asked anything, so it can't know that "45 days" is the part that matters.

Bi-encoder

An embedding model used for search. It encodes the question and each passage separately, then compares the two vectors. Fast, because passages are encoded once, ahead of time.

Your turn

Why can't a bi-encoder tell the 30-day passage from the 60-day one for this question?

A passage's vector has to serve every possible question. Whether "within 60 days" covers "after 45 days" depends on this exact question, and the bi-encoder never looks at both together.

Part 2. Read the question and the passage together

Keep going with Pro

You've done the first part. Pro opens the rest of this lesson, and every other one.

Still to come
  1. Read the question and the passage together
  2. Retrieve wide, rerank narrow
  3. Choosing how many to rerank

Search and Retrieval overviewSpotted a mistake? Tell us.