ChatGPT/GPT‑4 can directly rank search passages with simple prompts; distilled small models inherit that power.

April 19, 20237 min

Overview

Production Readiness

0.65

Novelty Score

0.55

Cost Impact Score

0.6

Citation Count

23

Authors

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

Links

Abstract / PDF

Why It Matters For Business

LLMs can directly re-rank search results zero‑shot and produce supervisory labels to train small, cheaper re‑rankers; this can cut inference cost and maintenance versus training large supervised re‑rankers on noisy labels.

Summary TLDR

The authors show that instructing LLMs (permutation generation) to output ranked lists produces strong zero-shot passage re-ranking. GPT‑4 often beats supervised re‑rankers on standard benchmarks and on a newly created "NovelEval" set that checks for data contamination. They introduce a sliding‑window prompt to handle context limits and a permutation distillation procedure to train small, fast cross‑encoders from LLM rankings; a 435M DeBERTa distilled model outperforms a 3B supervised model on BEIR while cutting inference cost.

Problem Statement

Pretrained LLMs are not trained to output ranked lists, yet search pipelines depend on accurate re‑ranking. Can chat LLMs be prompted to rank passages directly, and can their ranking ability be transferred into cheap specialized models for production?

Main Contribution

Introduce permutation generation prompts that ask LLMs to output a ranked permutation of passages.

Propose a sliding‑window re‑ranking strategy to handle token limits when ranking many passages.

Collect NovelEval, a 21‑question test set with recent content to detect LLM training data contamination.

Propose permutation distillation (RankNet-based) to train small cross‑encoders from LLM-ranked permutations.

Key Findings

GPT‑4 outperforms strong supervised re‑rankers on standard benchmarks when using permutation prompts.

NumbersnDCG@10: GPT‑4 53.68 vs monoT5 (3B) 51.36 on BEIR (avg), delta +2.32

GPT‑4 handles unseen, recent knowledge better than supervised baselines on the NovelEval test set.

NumbersNovelEval nDCG@10: GPT‑4 90.45 vs monoT5 (3B) 84.62, delta +5.83

Permutation distillation produces small specialized models that beat large supervised models on BEIR.

NumbersDeBERTa‑Large distilled (435M) BEIR avg nDCG@10 53.03 vs monoT5 (3B) 51.36, delta +1.67

Prompting and sliding windows have measurable API cost and latency.

NumbersGPT‑4 perm. gen cost $0.596/query (top100); re‑rank top30 cost $0.098/query; latency ~32s/query (gpt‑4)

LLM permutation outputs are sometimes unstable (duplicates/missing) and sensitive to initial passage order.

NumbersChatGPT: 14 repetitions, 153 missing ids; GPT‑4: 1 missing id; ranking sensitive to BM25 initial order (ablation)

Results

BEIR avg nDCG@10

Valuegpt-4: 53.68

BaselinemonoT5 (3B): 51.36

NovelEval nDCG@10

Valuegpt-4: 90.45

BaselinemonoT5 (3B): 84.62

BEIR avg nDCG@10 (distilled student)

ValueDeBERTa-large (435M) distilled: 53.03

BaselinemonoT5 (3B): 51.36

API cost per query (permutation generation)

Valuegpt-4: $0.596/query (top100)

Baselinegpt-4 re-rank top30: $0.098/query

Who Should Care

What To Try In 7 Days

Run permutation prompts (PG) with gpt-3.5-turbo on a held-out set to compare with your current re‑ranker.

Use sliding‑window PG to re‑rank top100 candidates and measure latency/cost; try GPT‑4 only on top30 to reduce cost.

Collect 5–10K queries, generate permutations with an LLM, and train a small cross‑encoder with RankNet to get a fast distilled re‑rank model.

Optimization Features

Token Efficiency

  • sliding-window reduces per-call tokens

Model Optimization

  • model specialization via distillation

System Optimization

  • use GPT-3.5 for bulk, GPT-4 for top30

Training Optimization

  • permutation distillation
  • RankNet-based pairwise loss
  • listwise/LambdaLoss options

Inference Optimization

  • two-stage: cheap first stage + LLM top30
  • sliding-window to limit context per call

Reproducibility

Code Available

Data Available

Open Source Status

  • partial

Risks & Boundaries

Limitations

  • Main experiments use closed‑source OpenAI models; open‑source LLMs lag behind.
  • Re-ranking effectiveness depends heavily on initial retrieval (BM25) and initial passage order.
  • Permutation outputs can be unstable (missing/duplicate ids, occasional rejections).
  • Direct LLM re‑ranking has high API cost and latency for top100 candidates.

When Not To Use

  • Ranking for high‑stakes social decisions (hiring, lending, moderation) due to bias/hallucination risks.
  • Production pipelines that cannot tolerate multi‑second latency or recurring API costs without distillation.
  • Low‑resource language settings until language modeling and tokenization are validated.

Failure Modes

  • Malformed permutations (duplicates/missing ids) causing wrong order or crashes.
  • Model rejection or subjective refusals for some queries.
  • Performance drop if first‑stage retrieval yields poor initial ordering.
  • High cost/latency if using GPT‑4 across many queries.

Core Entities

Models

  • gpt-4
  • gpt-3.5-turbo
  • ChatGPT
  • monoT5 (3B)
  • monoT5 (220M)
  • monoBERT (340M)
  • DeBERTa-v3-large (435M)
  • LLaMA-7B
  • Cohere Rerank

Metrics

  • nDCG@1
  • nDCG@5
  • nDCG@10
  • RBO (rank biased overlap)

Datasets

  • TREC-DL19
  • TREC-DL20
  • BEIR (8 tasks subset)
  • Mr.TyDi
  • MS MARCO (train sample)
  • NovelEval-2306

Benchmarks

  • nDCG@1
  • nDCG@5
  • nDCG@10