Abstract
Large Language Models (LLMs) have demonstrated significant potential in zero-shot document reranking. However, their performance is often hampered by poor input quality—such as ambiguous user queries and noisy retrieved passages—and context window limitations. This paper introduces RankFlow, a multi-agent collaborative workflow that decomposes the reranking task into four specialized roles: a Query Rewriter, a Pseudo-Answerer, a Passage Summarizer, and a Reranker. By cleaning queries and distilling passages before the final ranking step, RankFlow achieves state-of-the-art performance, outperforming models like RankGPT-4 across various benchmarks, including the NovelEval-2306 dataset designed to test for data contamination. Our results demonstrate that task decomposition and noise reduction are critical for maximizing the utility of LLMs in information retrieval.
1. Introduction
In modern Information Retrieval (IR) systems, reranking serves as a critical second stage. While initial retrieval algorithms like BM25 are efficient at narrowing down millions of documents to a small candidate set, they often lack the semantic depth required for precise ordering. Large Language Models (LLMs) have emerged as powerful zero-shot rerankers, yet they face two primary challenges: input quality and context constraints. Real-world queries are frequently vague, and retrieved passages often contain redundant or irrelevant information that distracts the model. Furthermore, as the number of documents in a listwise ranking prompt increases, LLMs often suffer from the "lost in the middle" effect, where their instruction-following capabilities degrade.
To address these issues, we present RankFlow, a workflow that moves away from monolithic prompting toward a structured, multi-role Standard Operating Procedure (SOP).
2. The RankFlow Methodology
RankFlow decomposes the reranking process into a pipeline of four specialized agents, each designed to optimize a specific aspect of the information flow:
- Query Rewriter: This agent transforms short or ambiguous user inputs into formal, descriptive retrieval requests. By clarifying the user's intent, it provides a more stable target for the subsequent stages.
- Pseudo-Answerer: Leveraging the LLM’s internal knowledge, this agent generates a hypothetical "standard answer" to the rewritten query. This answer is concatenated with the query to provide a richer semantic context for matching against candidate documents.
- Passage Summarizer: To combat noise and context window limitations, this agent distills each candidate passage into a concise summary. This process removes grammatical errors and irrelevant filler, effectively compressing the information so the final Reranker can process more documents with higher focus.
- Reranker: The final agent performs listwise ranking using a sliding window approach. It utilizes a specialized prompt featuring a four-level relevance grading scale (from Perfectly Relevant to Irrelevant) and employs Chain-of-Thought (CoT) reasoning to justify its ranking decisions before outputting the final order.
3. Experimental Setup
We evaluated RankFlow against state-of-the-art baselines, including RankGPT-4 and supervised models like monoT5, across three major benchmark suites:
- TREC-DL (2019 & 2020): Standard benchmarks for deep learning in search.
- BEIR: A diverse collection of retrieval tasks covering domains such as bio-medicine (NFCorpus), COVID-19, and social media (Signal).
- NovelEval-2306: A specialized dataset containing queries and documents published after the training cutoff of major LLMs. This ensures that performance gains are due to reasoning capabilities rather than data contamination or memorization.
4. Key Insights and Results
4.1 Superior Accuracy and Robustness
RankFlow achieved an average nDCG@10 of 55.64 across the BEIR datasets, consistently outperforming RankGPT-4 (54.09). Notably, the performance gap widened on the NovelEval dataset, where RankFlow improved nDCG@10 by over 5 points compared to standard GPT-4 reranking. This suggests that the workflow's structured reasoning is highly robust even when encountering entirely novel topics.
4.2 The Power of Specialization
A key finding of our study is that specialization often trumps scale. By allowing the Summarizer to act as a noise filter, the Reranker's ability to judge relevance actually improved. Rather than losing vital information, the distillation process allowed the model to focus on core semantic matches. Additionally, we found that repeating the rewritten query multiple times (a "query weighting" technique) helped the model maintain focus on the user's original intent throughout long prompts.
4.3 Efficiency and Smaller Models
While GPT-4 serves as the strongest engine for RankFlow, the workflow also significantly boosts the performance of smaller open-source models like LLaMA-3-8B. These models typically struggle with long-context listwise ranking, but the summarized inputs provided by RankFlow make the task manageable. Furthermore, by caching summarized passages and rewritten queries ("RankFlow w. Local Passage"), the system can operate ~27% faster and ~30% cheaper than standard one-step GPT-4 reranking in production environments.
5. Limitations and Future Work
Despite its success, RankFlow introduces additional token overhead during the initial processing pass (rewriting and summarizing). While caching mitigates this in recurring environments, the first-turn latency remains higher than simple prompting. Future research will explore dynamic role alteration, where the workflow adapts its complexity based on the difficulty of the query or the specific domain of the documents, potentially skipping steps for simpler tasks to optimize for both cost and speed.
6. Conclusion
RankFlow demonstrates that the challenges of LLM-based reranking—noise, ambiguity, and context limits—can be effectively managed through a collaborative multi-agent workflow. By treating reranking as a structured process rather than a single prompt, RankFlow sets a new standard for zero-shot document ranking performance.
Summary updated