Rerank a shortlist with a supplied score

Read identifiers and quoted passages in short groups. · 191 words

Retrieval is the first stage of a grounded assistant: it collects a shortlist of possible sources. A reranker then examines that shortlist and assigns a relevance score, usually from 0 to 1, where a larger score means a better match. The scores are supplied, so the checking task is simple: sort the items by score, not by the order in which retrieval returned them. For example, a query about rainy-day activities at a science museum returns "indoor workshops" (0.91), "summer garden trail" (0.28), and "planetarium program" (0.76). The reranked order is indoor workshops, planetarium program, then summer garden trail.

Here is another shortlist for "free books for children": "library book sale" (0.64), "used bookstore donations" (0.83), and "children's reading hour" (0.40). Descending order puts used bookstore donations first, then the library book sale, then reading hour. Notice that the top item need not be the best source for every later question. Its score only measures fit to this query. In a grounded answer, the assistant should cite the reranked evidence it actually uses and should not claim that a low-scoring item says something merely because it appeared in the original shortlist.

Check your recall

In the free-books example, which source is ranked first, and why?

Check your answer

The used bookstore donations source is ranked first because its supplied score, 0.83, is the largest of 0.64, 0.83, and 0.40.

Sources and credits

Original KeyTouch lesson. Background reading · Lewis et al. · Retrieval-Augmented Generation.