RAG & Retrieval·Question 58 of 100Advanced

Teams increasingly rerank with an LLM rather than a cross-encoder. How do pointwise, pairwise and listwise LLM reranking work, and when is the cost justified?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

An LLM reranker asks a generative model to judge relevance, and it wins on queries that need reasoning or instruction-following, such as "clauses that conflict with our standard indemnity" or "only guidance that applies to EU customers". It typically costs an order of magnitude or more per query than a cross-encoder, so it earns its place on a narrow, hard slice of traffic or as a teacher for a cheaper model, rarely as the default.

Full worked answer

An LLM reranker asks a generative model to judge relevance, and it wins on queries that need reasoning or instruction-following, such as "clauses that conflict with our standard indemnity" or "only guidance that applies to EU customers". It typically costs an order of magnitude or more per query than a cross-encoder, so it earns its place on a narrow, hard slice of traffic or as a teacher for a cheaper model, rarely as the default.

Three formulations:

  • Pointwise: score each query-passage pair independently, ideally from the probability of a "yes" token rather than a generated number, which drifts between calls. Parallel and easy to threshold. Several open-weight rerankers are now small decoder models fine-tuned to do exactly this, which blurs the line with cross-encoders.
  • Pairwise: ask which of two passages is more relevant. Accurate per decision, but the comparison count grows fast with list length, so it is rarely affordable online.
  • Listwise: put the query and ~20 candidates in one prompt and ask for a ranking, the RankGPT pattern. The model sees candidates side by side, so it can judge relative quality and spot duplicates. The costs: long lists need sliding windows, outputs can be malformed or truncated permutations, generating the ranking adds latency, and results shift with input order.

How I would deploy it:

  1. Keep the cross-encoder stage and apply the LLM only to its top ~20, never to first-stage output.
  2. Gate by query class. Instruction-heavy and ambiguous queries go to the LLM, plain lookups go straight through.
  3. Control position bias. Shuffle input order, or aggregate over two orderings for high-stakes queries, so the bias does not just reproduce the first-stage ranking.
  4. Distil. Run the LLM reranker offline to label query-passage pairs, then fine-tune the cross-encoder on those labels. This usually recovers much of the gain at cross-encoder latency, and it is the answer interviewers are listening for.
  5. Prove it per slice: nDCG@10 and p95 latency on the golden set, and remove it if the gain only shows in the aggregate.

In an agentic loop the agent already reranks what it reads, so stacking a second LLM reranker needs its own evidence.

What a good answer covers

  • An LLM reranker asks a generative model to judge relevance, and it wins on queries that need reasoning…
  • It typically costs an order of magnitude or more per query than a cross-encoder, so it earns its place…
  • Pointwise: score each query-passage pair independently, ideally from the probability of a "yes" token…
  • Pairwise: ask which of two passages is more relevant
  • Keep the cross-encoder stage and apply the LLM only to its top ~20, never to first-stage output

Key terms: Pointwise · Pairwise · Listwise

Interviewer follow-ups to expect

  1. How would you measure position bias in a listwise reranker on your own data?

  2. How many labelled pairs do you need to distil an LLM reranker into a cross-encoder, and how do you check the student did not simply inherit the teacher's biases?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep