ContentsRAG from Scratch to TRECAdisak Sukul · Iowa State University

Start here

Part 1 · Foundations

Part 2 · Finding the evidence

Part 3 · Writing the answer

Part 4 · Judging RAG

Part 5 · TREC and the 2026 tracks

Part 6 · Case studies: our submissions

Part 7 · Beyond text: video

Part 8 · Streams and advanced RAG

Back matter

Part 2 · Finding the evidence · Chapter 9

Reranking

In one sentence: a fast search finds a few hundred candidates, and a slower, more careful model reads each candidate together with the question and sorts them again.

Why you should care

The best models for judging “does this document answer this question?” are far too slow to run over a whole collection. So search is done in two stages. The first stage is cheap and must not miss. The second stage is costly and must sort well. Most of the quality gains in modern search come from the second stage. So do some of its strangest failures, as our own results show.

Words you need

First stage
The fast search over the whole collection: BM25, dense retrieval, or both fused.
Candidates
The documents the first stage hands to the reranker.
Reranker
A model that gives each candidate a new score and re-sorts the list.
Cross-encoder
A model that reads the query and one document together and outputs one relevance score.
Pointwise
Scoring one document at a time.
Listwise
Showing a model several documents at once and asking for their order.
Sliding window
A way to sort a long list with a listwise model: sort a few documents, move along, sort the next few.
Truncation
Cutting a document to the length the model can read.

Core The idea

Two ways to compare a question and a document

A bi-encoder (Chapter 6) reads the question alone and the document alone, and compares two vectors. It never sees the two texts side by side. A cross-encoder reads them together, as one input, so it can notice that the document mentions the right bridge and the wrong year.

Bi-encoderCross-encoder
ReadsQuestion and document separatelyQuestion and document together
Work at question timeEmbed one question, look up neighboursRun the model once for every candidate
Can coverThe whole collectionA few hundred to a few thousand candidates
AccuracyGoodBetter

The two-stage pipeline

  1. Retrieve. The first stage returns its top candidates, say 100 or 1,000.
  2. Score. The reranker scores each pair of question and candidate.
  3. Sort and cut. Sort by the new score and keep the top of the list.

Two limits follow from this design, and both matter later in the chapter.

  • A reranker cannot find what the first stage missed. If the right document is not among the candidates, no reranker will bring it back. The recall of the first stage is a ceiling.
  • A reranker sees only what fits. Many cross-encoders read about 512 tokens. A long document is cut, and the reranker judges only the beginning.

Three kinds of reranker

KindHow it worksExample we used
Cross-encoderA mid-sized model trained to output a relevance score for one pairbge-reranker-v2-m3
Language model, pointwiseA large language model is asked “does this document meet the query, yes or no?” The score is how likely it is to say yes.Qwen3-Reranker-8B
Language model, listwiseA language model sees ten documents and returns them in order. A sliding window covers longer lists.gpt-4.1-mini

Watch and read

For the two videos we confirmed that the link opens and the title and channel match. We have not watched them through.

How we did it at TREC 2026

Our eight RAG retrieval runs form a ladder. Each step adds one thing to the step below it.

RunCandidatesRerankerOur own dev nDCG at 10
isu-bm25-rrf7Fused top 100None0.723
isu-rrf-qwen3The same 100Qwen3-Reranker-8B0.774
isu-rrf-ceThe same 100bge-reranker-v2-m30.797
isu-rrf-ce-deepDeep pool, about 4,500 documents per narrativebge-reranker-v2-m3, top 100 keptsee the note
isu-rrf-ce-deep-lwfThe top 50 of the run aboveListwise order fused with the cross-encoder order by RRF0.815
isu-rrf-ce-deep-lwThe top 50 of the same runListwise order alone0.829

Dev numbers are ours: our own development topics, judged by our own panel of language-model judges, before any official result. They are not track scores. The deep run was compared on a different judged set, where it gained 0.063 nDCG at 10 over the depth-100 pool; in the listwise comparison its cross-encoder order scored 0.797. The two remaining runs, isu-rrf-ce-tau and isu-rrf-ce-pool, are about how many documents to return (Chapter 10).

  • The cross-encoder. It read each narrative with the first 2,000 characters of each document, up to 512 tokens.
  • The listwise pass. A window of 10 documents moved up the list 5 at a time, from the bottom to the top, three times. The prompt asked the model to prefer documents that cover several parts of the narrative. We followed a recipe reported by a TREC RAG 2025 team.
  • A rule set in advance. We wrote down, before looking, that the listwise-fused run would become our first-priority run only if it gained at least 0.015 on dev. It gained 0.018, so it did.
  • Hardware. The Qwen3 reranker has 8 billion parameters. We ran it on the university's GPU cluster. The cross-encoder is small enough for one desktop graphics card.

What the official scores say

Document setRunsSet precisionSet recallNugget gain
Track median0.34990.10020.6268
Fused top 100, in any orderisu-bm25-rrf7, isu-rrf-qwen3, isu-rrf-ce0.20040.08400.7139
Deep pool, reranked top 100, in any orderisu-rrf-ce-deep and the two listwise runs0.31300.13320.6291

Official scores, 114 runs from 27 teams. Precision and recall on 82 narratives, nugget gain (AutoNuggetizer nuggets) on 25. Source: the RAG tab of our results dashboard.

What surprised us

Three surprises, in rising order of importance.
  1. The official measures could not see our rerankers. Three runs hold the same 100 documents in three different orders, and so do three others. The track scored sets, not order, so each group of three got identical scores. Our whole reranker ladder is invisible in the official table (Chapter 4).
  2. Reranking a deep pool does not polish the list. It replaces it. When the cross-encoder chose its top 100 from the deep pool, it kept on average only 12.7 of the 100 documents that BM25 and RRF had put on top. The top 10 documents of the plain fused list sit at a median rank of 383.5 in the reranker's order. The two stages disagree deeply about what is relevant.
  3. More relevant documents, fewer key facts. The reranked set has higher precision, 0.3130 against 0.2004, and higher recall. But it covers fewer nuggets: 0.6291 against 0.7139, lower on 18 of 25 narratives and higher on 4. We do not know why. One idea is that the reranker picks many documents that say the same central thing, while the fused list is more varied. We have not tested this, and the data needed to test it has not been released.

Try it

  1. Take the BM25 results from the Chapter 5 lab. Rerank the top 20 with a small cross-encoder from the sentence-transformers package. How many of the top 5 changed?
  2. Find a case where the reranker moved a wrong document up. Read the document. Why did the model like it?
  3. Cut every document to its first 200 characters and rerank again. What changed?
  4. Time both stages. How many documents per second can each one handle?

Check yourself

  1. Why not run a cross-encoder over the whole collection?
  2. The right document is at first-stage rank 5,000 and you rerank the top 1,000. Where does it end up?
  3. What is the difference between pointwise and listwise reranking?
  4. Why did three of our runs get identical official scores?
  5. Our reranked set has higher precision and lower nugget gain. What does each measure reward, so that both can be true?
Answers
  1. It must run once for every pair of question and document, which is far too slow for millions of documents.
  2. Nowhere. It was never a candidate.
  3. Pointwise scores one document at a time. Listwise shows several documents and asks for their order.
  4. They contain the same documents in different orders, and the track's measures ignore order.
  5. Precision rewards each relevant document. Nugget gain rewards each key fact once. Many relevant documents that repeat the same facts raise precision and not nugget gain.

Go deeper

  • Depth of reranking. Reranking deeper raises the ceiling and gives the reranker more chances to promote a wrong document. The best depth depends on the reranker and should be tuned on held-out topics.
  • Long documents. Options are to score the first passage only, as we did, to score every passage and take the best score, or to use a reranker with a longer input.
  • Fusing rerankers. Language-model rerankers improve many topics and harm some. Fusing the new order with the old one limits the harm. This is why we built isu-rrf-ce-deep-lwf next to the pure listwise run.
  • Diversity. A reranker scores each document alone. It cannot know that the list already holds five documents saying the same thing. Methods such as maximal marginal relevance trade relevance against novelty. Given our third surprise, this is the first thing we would try next.
  • Scores are not probabilities. The raw score of a cross-encoder has no fixed scale, and it changes when the input is cut differently. Chapter 10 shows what that did to us.
  • Project idea. On a collection with nugget judgments, compare a reranked top 100 with a diversified top 100. Does diversity recover nugget coverage, and what does it cost in precision?