Is ChatGPT Good at Search? Investigating Large Language Models as Re-Ranking Agents
Read first: Reranker map: pointwise, pairwise, setwise, listwise and reasoning rerankers · Document Ranking with a Pretrained Sequence-to-Sequence Model
TL;DR. RankGPT asks a chat LLM to read a query and 20 numbered passages and output an ordering such as [2] > [3] > [1]. To rerank 100 candidates it slides a window of 20 (step 10) from the bottom of the list to the top. Zero-shot GPT-4 beat supervised rerankers on TREC DL and an 8-dataset BEIR subset. Distilling ChatGPT’s orderings for 10k MS MARCO queries into a 435M DeBERTa cross-encoder produced a student that beat its teacher.
Why it matters now. RankGPT is the anchor for listwise LLM reranking. RankZephyr distils it, and Rank1 and Rank-R1 position themselves against it. It also set the pattern later deep-research systems reuse: let an LLM compare candidates in context, then distil the behaviour into something cheaper.
Key idea
Section titled “Key idea”Three ways to use an LLM as a reranker. Query generation scores a passage by the likelihood of the query given the passage. Relevance generation asks a yes/no question per passage. Permutation generation (PG), RankGPT’s proposal, puts several passages in one prompt and asks for an ordering of their identifiers. PG needs no log-probabilities and no calibration across calls, because every judgement is relative within the prompt.
Sliding window. The context cannot hold 100 passages, so RankGPT uses windows of moved by , starting from the bottom of the BM25 list. Each call reorders its window, and the top 10 survivors join the next window up. A strong passage can therefore climb from rank 100 to rank 1 in one pass. A passage that falls to position 11 or lower in its window is never seen again. The paper reports 10 calls and about 20k tokens per query for gpt-3.5.
Permutation distillation. ChatGPT ranked 20 BM25 passages for each of 10k MS MARCO training queries, at a cost the paper puts at about USD 40. A student that gives one score per passage is trained with RankNet over all pairs, where is the teacher’s rank of passage :
Each pair the teacher orders contributes a logistic loss on the score difference. At inference the student is pointwise again: one forward pass per passage, with no windows.
Key results
Section titled “Key results”All numbers are paper-reported nDCG@10, reranking BM25’s top 100.
- TREC and BEIR (Table 1). On DL19 / DL20 / BEIR-8 average, BM25 scores 50.58 / 47.96 / 43.42 and monoT5-3B 71.83 / 68.89 / 51.36. gpt-3.5-turbo scores 65.80 / 62.91 / 49.37 and gpt-4 75.59 / 70.56 / 53.68. On BEIR, gpt-4 reranks only the top 30 of the gpt-3.5 output. Cohere rerank-v2 averages 49.45 on BEIR.
- Mr.TyDi. GPT-4 averages 62.93 against 60.28 for the multilingual MiniLM cross-encoder (mmarcoCE). It is worse on Bengali, Telugu and Thai, which the authors attribute to weaker language ability and to low-resource text using more tokens, so passages get cropped.
- NovelEval. To limit contamination, the authors wrote 21 questions about recent events and judged 420 passages. GPT-4 reaches 90.45 against 84.62 for monoT5-3B.
- Cost (Table 11). Per query, gpt-3.5 costs USD 0.040 and gpt-4 USD 0.596. Reranking the top 30 with GPT-4 adds USD 0.098. Calls took about 1.1 s (gpt-3.5) and 3.2 s (gpt-4), so 10 chained calls take about 11 s and 32 s per query.
- Window size (Table 12). On DL19, window/step 20/10 reaches 67.05; 40/20, 60/30 and 80/40 reach 65.51, 65.03 and 65.57.
Limitations & open questions
Section titled “Limitations & open questions”- Order dependence and a single pass mean the reranker inherits first-stage errors. Extra passes help nDCG@10 slightly but cost nDCG@1.
- Contamination and reproducibility. Results rest on closed API models whose training data and versions change. NovelEval is too small to settle the contamination question.
- No scores. A permutation does not say whether anything in the window is relevant, so it cannot drive thresholds or abstention.
- Open: how far listwise prompting holds up for passages much longer than MS MARCO’s, and whether the student-beats-teacher result survives outside MS MARCO-like data.
Connections
Section titled “Connections”- Before: monoT5, the supervised pointwise baseline. Reranker map compares the families.
- After: RankZephyr distils RankGPT3.5 and RankGPT4 into an open 7B listwise model. Rank-R1 compares its setwise reasoning reranker with RankGPT4.
- Distillation more broadly: knowledge distillation.
- Judging instead of ranking: UMBRELA uses an LLM to produce relevance labels for evaluation. It shares the calibration problem that pushed RankGPT toward relative judgements.
Questions to think through
These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.
- Derive / compute
Permutation distillation trains a student with RankNet on the teacher's ordering. For three passages the student scores are s1 = 2, s2 = 1, s3 = 0 and the teacher outputs [3] > [1] > [2]. Compute the loss, then the gradient with respect to each score, and say which way one gradient-descent step moves each score.
What a strong answer covers
- Pairs where the teacher puts i above j: (3, 1), (3, 2), (1, 2). Terms log(1 + exp(sj − si)): log(1 + e²) ≈ 2.127, log(1 + e¹) ≈ 1.313, log(1 + e⁻¹) ≈ 0.313. Total ≈ 3.753.
- d/ds3 = −σ(2) − σ(1) ≈ −0.881 − 0.731 = −1.612, so s3 goes up the most.
- d/ds1 = σ(2) − σ(−1) ≈ 0.881 − 0.269 = +0.612, so s1 goes down; d/ds2 = σ(1) + σ(−1) = 0.731 + 0.269 = +1.0, so s2 goes down. The gradients sum to zero, because only score differences matter.
- The badly ordered pair (3 above 1, currently reversed by 2 points) dominates; already-correct pairs contribute little. The student is a pointwise scorer at inference even though it learned from a list.
- Derive / compute
Per query on TREC, RankGPT reports USD 0.040 for gpt-3.5 over the top 100, USD 0.596 for gpt-4 over the top 100, and USD 0.098 of gpt-4 cost to rerank only the top 30 of the gpt-3.5 output. DL19 nDCG@10 is 65.80, 75.59 and 73.64 respectively. For 1,000 queries, compute the cost of each pipeline and the marginal cost per nDCG point of each upgrade. What does this say about where an expensive model should sit in a cascade?
What a strong answer covers
- Totals per 1,000 queries: gpt-3.5 = USD 40; hybrid = 40 + 98 = USD 138; full gpt-4 = USD 596.
- gpt-3.5 → hybrid: 98 / 7.84 ≈ USD 12.5 per point. gpt-3.5 → full gpt-4: 556 / 9.79 ≈ USD 57 per point. Hybrid → full gpt-4: 458 / 1.95 ≈ USD 235 per point.
- Most of the gain comes from letting the strong model re-order the top 30; the bottom 70 add little to nDCG@10, which only looks at the top.
- Put the expensive model last, on a short list. Cost grows with the number of windows, while nDCG@10 only rewards the head of the ranking. Latency follows the same logic: 10 chained calls took about 11 s per query for gpt-3.5 and 32 s for gpt-4.
- Mechanism
On DL19 with text-davinci-003, relevance generation (one yes/no judgement per passage) scores 50.58 nDCG@10, query generation (likelihood of the query given the passage) 45.37, and permutation generation 61.50. Explain, in terms of what the model sees and what score it must produce, why the listwise instruction wins, and what it gives up in return.
What a strong answer covers
- Permutation generation shows the model 20 passages at once, so it makes relative judgements; it never has to put scores on a common absolute scale across separate calls.
- Relevance generation needs the yes/no probability to be calibrated across independent prompts, which a prompted LLM was not trained for; query generation scores by the model's prior over query wording, which is only loosely tied to relevance.
- Generating identifiers matches what instruction-tuned chat models are good at (following a format and comparing items in context).
- Costs: no per-document score or threshold; output can be malformed (missing or repeated identifiers); the context window caps the list, which forces the sliding window and its order dependence.
- What if…
RankGPT's ablations on DL19 vary the initial order (BM25, reversed BM25, random), the number of sliding-window passes (1, 2 or 3), and the window size with step = window/2 (20, 40, 60, 80). Predict each effect from how the back-to-first window works, then check against the reported numbers.
What a strong answer covers
- Initial order: a single pass carries only each window's top 10 forward, so the start order matters. Reported nDCG@10 falls from 65.80 (BM25) to 32.77 (reversed BM25) and 25.17 (random).
- More passes: a second pass fixes documents left behind, giving 66.62 (2 passes) and 66.97 (3 passes) nDCG@10, but nDCG@1 drops by 3.88. Extra passes reshuffle the head and do not only improve it.
- Window size: 20/10 is best on nDCG@10 (67.05) against 65.51, 65.03 and 65.57 for 40, 60 and 80. Larger windows see more candidates per call but must order more items in a longer context.
- Takeaway: listwise prompting depends on a decent first stage, and its hyperparameters trade the reach of each call against the model's ability to order long lists.
- Critique
RankGPT's headline is that zero-shot GPT-4 beats supervised rerankers. Identify the two weakest points in that evidence — one about test-set contamination and one about output reliability — and design an experiment that would show whether the advantage is real.
What a strong answer covers
- Contamination: TREC DL and BEIR were public before the GPT models were trained. NovelEval (21 questions, 420 passages, GPT-4 90.45 vs monoT5-3B 84.62 nDCG@10) addresses this but is tiny, so its confidence interval is wide.
- Reliability (Table 10, 97 TREC queries): gpt-3.5 produced 14 repeated identifiers, 153 missing identifiers and 7 refusals; missing passages are appended in the original order, which quietly mixes the BM25 ranking back in.
- API models change over time, so the exact runs cannot be reproduced later.
- Experiment: a fresh, post-cutoff test collection with pooled judgements from all compared systems, several runs per configuration to measure variance, and a count of malformed outputs per run alongside nDCG.
- Design
GPT-4 underperformed a multilingual MiniLM cross-encoder on Bengali, Telugu and Thai in Mr.TyDi, which the authors attribute to weaker language ability and to low-resource text using more tokens, so passages get cropped. You need a Telugu reranker with USD 500 of API budget and one 24 GB GPU. Design the pipeline.
What a strong answer covers
- Token arithmetic first: if Telugu needs several times more tokens per word, a 20-passage window either crops passages or overflows the context, so use smaller windows or truncate by characters rather than tokens, and measure how much evidence is cut.
- Spend the budget on teacher permutations for distillation (RankGPT distilled 10k queries × 20 passages for about USD 40 with gpt-3.5) rather than on inference, then train a small multilingual student with RankNet.
- Student choice: a multilingual encoder cross-encoder fits a 24 GB GPU and scores pointwise, so it avoids window and order problems at inference.
- Validate against the multilingual cross-encoder baseline on held-out Telugu queries, and check teacher quality on a small human-judged sample first, since a weak teacher in Telugu caps the student.