RankCoT: Refining Knowledge for Retrieval-Augmented Generation through Ranking Chain-of-Thoughts

Mingyan Wu, Zhenghao Liu, Yukun Yan, Xinze Li, Shi Yu, Zheni Zeng, Yu Gu, Ge Yu

Abstract

Retrieval-Augmented Generation (RAG) enhances the performance of Large Language Models (LLMs) by incorporating external knowledge. However, LLMs still encounter challenges in effectively utilizing the knowledge from retrieved documents, often being misled by irrelevant or noisy information. To address this issue, we introduce RankCoT, a knowledge refinement method that incorporates reranking signals in generating CoT-based summarization for knowledge refinement based on given query and all retrieval documents. During training, RankCoT prompts the LLM to generate Chain-of-Thought (CoT) candidates based on the query and individual documents. It then fine-tunes the LLM to directly reproduce the best CoT from these candidate outputs based on all retrieved documents, which requires LLM to filter out irrelevant documents during generating CoT-style summarization. Additionally, RankCoT incorporates a self-reflection mechanism that further refines the CoT outputs, resulting in higher-quality training data. Our experiments demonstrate the effectiveness of RankCoT, showing its superior performance over other knowledge refinement models. Further analysis reveals that RankCoT can provide shorter but effective refinement results, enabling the generator to produce more accurate answers.

Introduction

Retrieval-Augmented Generation (RAG) has become the industry standard for grounding Large Language Models (LLMs) in external facts. By retrieving relevant documents, RAG systems aim to mitigate hallucinations and provide up-to-date information. However, a significant bottleneck remains: retrievers often return a mixture of "gold" documents and irrelevant noise. This leads to a "knowledge conflict," where the LLM struggles to distinguish between its internal parametric memory and the potentially noisy external context.

Existing solutions typically handle this through either reranking (scoring documents) or summarization (compressing text). Reranking often leaves irrelevant "fluff" within even the best documents, while summarization can be "distracted" by noise, inadvertently including irrelevant details in the final output. RankCoT addresses these issues by merging reranking and reasoning into a single, optimized knowledge refinement step.

Overview of the RankCoT framework for knowledge refinement

Methodology

RankCoT treats knowledge refinement as a preference-learning task, training the model to simultaneously filter and summarize information through a "Ranking Chain-of-Thought."

1. Implicit Reranking via CoT

Instead of merely scoring documents, RankCoT prompts the model to generate a Chain-of-Thought (CoT) summary for each retrieved passage. This process forces the model to evaluate the relevance of each document in the context of the query. By requiring the model to generate a CoT that leads to the correct answer, it implicitly learns which documents to prioritize and which to ignore.

2. Direct Preference Optimization (DPO)

The training process utilizes Direct Preference Optimization (DPO). The authors construct pairs of "chosen" (positive) and "rejected" (negative) CoTs. A positive CoT is derived from a document containing the ground-truth answer, while a negative CoT is derived from irrelevant documents. The model is fine-tuned to assign higher probability to these gold-standard reasoning paths, effectively learning to filter noise at the reasoning level.

3. Self-Reflection Mechanism

To improve data quality and prevent the model from adopting repetitive or "lazy" linguistic patterns, RankCoT employs a self-reflection step. The model critiques its initial CoT outputs to extract only the most query-relevant semantics. This ensures the training data is concise, informative, and focused on the core answer.

The RankCoT training process involving CoT ranking, self-reflection, and DPO

Experimental Setup

The robustness of RankCoT was evaluated across a diverse set of benchmarks and model architectures:

  • Training Data: A collection of 10 datasets, including Commonsense QA, Math QA, Wiki QA, and MARCO QA.
  • Evaluation Benchmarks: Six datasets covering various reasoning tasks: NQ (Natural Questions), HotpotQA (multi-hop reasoning), TriviaQA, PopQA, ASQA (ambiguous questions), and MARCO QA.
  • Backbone Models: Experiments were conducted using Llama3-8B-Instruct, MiniCPM3-4B, and Qwen2.5-14B-Instruct.

Results and Discussion

RankCoT demonstrates significant improvements in both accuracy and efficiency compared to standard RAG and standalone refinement methods.

  • Superior Accuracy: The method achieved a 2.5% average improvement over vanilla RAG across all tasks. Notably, it provided a massive 7.6% boost to the MiniCPM3-4B model, suggesting high effectiveness for smaller-scale models.
  • Efficiency Gains: By generating concise summaries rather than processing full documents twice, RankCoT reduces inference latency. On the NQ dataset, the refinement step took 82 seconds, compared to 212 seconds for a standard reranking approach.
  • Alleviating Knowledge Conflict: In "Internal Knowledge" tests (where the model must rely on its own memory), RankCoT maintained a high accuracy of 91.3%. This indicates it is less likely to be "confused" by the presence of external documents than traditional refinement methods, effectively balancing internal and external evidence.

Conclusion

RankCoT introduces a novel approach to knowledge refinement by integrating reranking signals directly into the reasoning process. By leveraging DPO and self-reflection, it trains LLMs to produce concise, accurate summaries that filter out retrieval noise. While the method's effectiveness depends on the quality of initial DPO pairs and the base reasoning capabilities of the LLM, it represents a significant step forward in building more reliable and efficient RAG systems. Future work will explore more complex preference pair generation and applying this logic to sophisticated multi-step retrieval pipelines.

Summary updated

BibTeX
@inproceedings{wu2025rankcot,
  author = {Mingyan Wu and Zhenghao Liu and Yukun Yan and Xinze Li and Shi Yu and Zheni Zeng and Yu Gu and Ge Yu},
  title = {{RankCoT: Refining Knowledge for Retrieval-Augmented Generation through Ranking Chain-of-Thoughts}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
  url = {https://openreview.net/forum?id=OjmDtejzXv},
}
Figure