Introduction
Information Retrieval (IR) systems rely heavily on document ranking to order candidates by relevance to a user query. While Large Language Models (LLMs) have demonstrated remarkable zero-shot ranking capabilities, existing prompting strategies face a "trilemma" of trade-offs between accuracy and efficiency. Pointwise methods are fast but lack context; pairwise methods are highly accurate but computationally expensive; and listwise methods are efficient but sensitive to input order and context window limits. This paper introduces Setwise Prompting, a novel approach that achieves the accuracy of pairwise ranking while significantly reducing computational overhead.
Methodology
The core innovation is the transition from binary comparisons to set-based selection. Instead of comparing two documents at a time, the LLM is prompted to identify the most relevant document from a set of $k$ candidates.
Setwise Sorting Algorithms
To leverage this approach for full-list ranking, the authors adapt classic sorting algorithms. In Setwise Heapsort, the "heapify" operation is modified: rather than comparing a parent to two children individually, the LLM compares the parent and multiple children simultaneously in a single prompt. Similarly, Setwise Bubblesort compares a sliding window of documents. These adaptations drastically reduce the number of required LLM inference passes.
Listwise Likelihoods
For listwise ranking, the method avoids slow text generation. Instead, it utilizes the model's output logits to calculate the likelihood of each document label (e.g., "Passage A", "Passage B") being the most relevant. This approach is more robust against formatting errors and hallucinations compared to standard text generation.
Experimental Evaluation
The effectiveness of Setwise prompting was evaluated on the TREC Deep Learning (2019 & 2020) benchmarks and the BEIR benchmark (8 diverse datasets). Experiments utilized a range of LLMs, including Flan-T5 (up to 11B), Llama-2-7b, Vicuna-13b, and GPT-3.5-turbo.
Key Results and Insights
- Efficiency Gains: Setwise Heapsort reduced computational costs by approximately 62% compared to Pairwise Heapsort, with a negligible impact on ranking effectiveness (NDCG@10 decreased by only 0.8%).
- Superior Performance: Setwise approaches consistently outperformed pointwise and listwise baselines. Notably, while pointwise performance often plateaued or declined with model size, Setwise prompting scaled effectively with larger models.
- Reduced Latency: For a 100-document re-ranking task using Flan-T5-xl, Setwise Heapsort achieved a query latency of ~3 seconds, compared to ~20 seconds for Pairwise Heapsort.
- Robustness: Setwise Bubblesort demonstrated significantly higher resilience to the initial order of documents compared to traditional listwise methods, which are often biased toward documents appearing earlier in the prompt.
Limitations and Future Work
The primary constraint of Setwise prompting is the LLM's context window. As the set size $k$ increases, document content must be truncated more aggressively to fit the prompt. Furthermore, the logit-based optimization requires access to internal model probabilities, which is currently limited to open-source models or specific APIs. Future research will explore the impact of larger context windows (e.g., Gemini, GPT-4) and automated prompt optimization to further enhance the Setwise paradigm.
Summary updated