Is ChatGPT Good at Search? Investigating Large Language Models as Re-Ranking Agents

Weiwei Sun, Lingyong Yan, Xinyu Ma, Shuaiqiang Wang, Pengjie Ren, Zhumin Chen, Dawei Yin, Zhaochun Ren

TL;DR

Researchers have demonstrated that Large Language Models (LLMs) like GPT-4 can act as highly effective search re-rankers, outperforming state-of-the-art supervised models in a zero-shot setting. By using a novel "permutation generation" approach and distilling these capabilities into smaller models, they achieved superior performance with a 440M parameter model compared to a 3B parameter supervised baseline.

What Problem Does This Paper Address?

Modern search engines typically use a two-stage pipeline: a fast retriever (like BM25) pulls a few hundred candidates, and a complex re-ranker sorts them by relevance. Traditionally, these re-rankers are supervised models trained on massive datasets like MS MARCO. However, these models often struggle to generalize to new domains and require expensive human labeling.

While LLMs have shown promise in zero-shot tasks, applying them to ranking is tricky. Previous methods either asked the model to score passages one-by-one (pointwise) or relied on internal model probabilities that are often hidden behind APIs. The authors tackle two main hurdles: how to make LLMs rank passages effectively without needing internal probabilities, and how to make this process efficient enough for real-world use.

Methods

The authors introduce three key innovations:

  1. Instructional Permutation Generation (PG): Instead of asking "Is this passage relevant?" (pointwise), they provide a list of passages and ask the LLM to output a ranked permutation (e.g., [2] > [3] > [1]). This allows the LLM to perform a "listwise" comparison, looking at all candidates simultaneously to discern subtle differences in relevance.
  2. Sliding Window Strategy: To overcome the context window limits of LLMs, the authors use a sliding window that moves from the end of the initial retrieved list toward the top. This iteratively refines the ranking, ensuring the most relevant documents "bubble up" to the first positions. Sliding Window Illustration
  3. Permutation Distillation: To address the high cost and latency of calling GPT-4, they use ChatGPT as a "teacher." They rank 10,000 queries using ChatGPT and use those rankings as labels to train smaller, specialized student models (like DeBERTa-Large and LLaMA-7B) using a pairwise RankNet loss.
Figure 3: Illustration of re-ranking 8 passages using sliding windows with a window size of 4 and a step size of 2. The blue color represents the first two windows, while the yellow color represents the last window. The sliding windows are applied in back-to-first order, mean- ing that the first 2 passages in the previous window will participate in re-ranking the next window.

Datasets

The study evaluates models across several standard benchmarks and one new one:

  • TREC-DL (2019 & 2020): Standard ad-hoc search benchmarks.
  • BEIR: A suite of 8 diverse retrieval tasks (e.g., Bio-medical, News, Twitter).
  • Mr.TyDi: A multilingual benchmark covering 10 low-resource languages.
  • NovelEval: A newly introduced test set containing 21 questions about events that occurred after the training cutoff for GPT-4 (e.g., the 2023 Cannes Film Festival). This ensures the model is actually reasoning about relevance rather than just recalling memorized facts.

Key Insights and Ideas

  • Listwise > Pointwise: The "aha moment" is that LLMs are much better at ranking when they can compare passages directly. The permutation generation approach significantly outperforms query generation or simple relevance scoring.
  • Stability is the Bottleneck: While ChatGPT is powerful, it is "unstable"—it sometimes repeats or misses passage identifiers in its output. GPT-4 is much more reliable in following these complex formatting instructions.
  • Specialization Beats Scale: Surprisingly, the distilled 440M DeBERTa model often outperformed its teacher (ChatGPT). This is likely because the specialized model is more stable and doesn't suffer from the generation hallucinations (like missing IDs) that plague general-purpose LLMs during ranking tasks.
  • Data Contamination is Real but Manageable: The success on NovelEval proves that GPT-4’s ranking ability isn't just a result of seeing the test questions during pre-training; it possesses a genuine capability to deduce relevance for unknown information.

Key Results

The quantitative gains are substantial across the board:

  • Zero-Shot Superiority: GPT-4 outperformed the previous SOTA supervised model, monoT5-3B, by an average nDCG@10 improvement of 2.7 on TREC and 2.3 on BEIR. Comparison of GPT models vs SOTA
  • Distillation Success: A distilled DeBERTa-Large (435M) model achieved an nDCG of 53.03 on BEIR, beating the monoT5 (3B) supervised baseline (51.36).
  • Multilingual Performance: GPT-4 showed strong results on Mr.TyDi, though it struggled slightly with very low-resource languages like Bengali and Telugu, likely due to tokenization inefficiencies.
Figure 1: Average results of ChatGPT and GPT-4 (zero-shot) on passage re-ranking benchmarks (TREC, BEIR, and Mr.TyDi), compared with BM25 and previous best-supervised systems (SOTA sup., e.g., monoT5 (Nogueira et al., 2020)).

Limitations and Future Work

  • Proprietary Dependency: The best results currently rely on closed-source models (GPT-4). Open-source models like Vicuna-13B still show a significant performance gap in generating complex permutations.
  • Recall Bottleneck: A re-ranker can only sort what the retriever finds. If the initial BM25 step misses the relevant document, the LLM cannot fix it. The authors suggest future work should look at using LLMs to improve the first-stage retrieval.
  • Initial Order Sensitivity: The model's performance is sensitive to the order in which passages are presented in the prompt. Finding ways to make LLM ranking more robust to input ordering remains an open challenge.

Summary updated

BibTeX
@inproceedings{sun2023is,
  author = {Weiwei Sun and Lingyong Yan and Xinyu Ma and Shuaiqiang Wang and Pengjie Ren and Zhumin Chen and Dawei Yin and Zhaochun Ren},
  title = {{Is ChatGPT Good at Search? Investigating Large Language Models as Re-Ranking Agents}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.emnlp-main.923},
}
Figure