ChunkRAG: Novel LLM-Chunk Filtering Method for RAG Systems

Ishneet Sukhvinder Singh, Ritvik Aggarwal, Ibrahim Allahverdiyev, Muhammad Taha, Aslihan Akalin, Kevin Zhu, Sean O'BrienarXiv 2024

Abstract

Retrieval-Augmented Generation (RAG) systems using large language models (LLMs) often generate inaccurate responses due to the retrieval of irrelevant or loosely related information. Existing methods, which operate at the document level, fail to effectively filter out such content. We propose LLM-driven chunk filtering, ChunkRAG, a framework that enhances RAG systems by evaluating and filtering retrieved information at the chunk level. Our approach employs semantic chunking to divide documents into coherent sections and utilizes LLM-based relevance scoring to assess each chunk's alignment with the user's query. By filtering out less pertinent chunks before the generation phase, we significantly reduce hallucinations and improve factual accuracy. Experiments show that our method outperforms existing RAG models, achieving higher accuracy on tasks requiring precise information retrieval. This advancement enhances the reliability of RAG systems, making them particularly beneficial for applications like fact-checking and multi-hop reasoning.

Introduction: Addressing the Granularity Gap

Standard Retrieval-Augmented Generation (RAG) systems often suffer from a "granularity gap." When a system retrieves information to answer a query, it typically pulls in large document segments or fixed-length blocks. While these blocks might contain the answer, they also frequently contain extraneous or weakly relevant "fluff."

Conceptual comparison between standard retrieval and the proposed LLM-driven chunk filtering.

Large Language Models (LLMs) are notoriously sensitive to this noise; if a retrieved context contains a high percentage of irrelevant data, the model is prone to "hallucinating" or incorporating that noise into its response. Existing advanced RAG methods like CRAG or Self-RAG attempt to fix this at the document level, but they often fail to evaluate the internal quality of the text chunks themselves. ChunkRAG aims to provide a "scalpel" to precisely excise irrelevant content before it ever reaches the final generation stage.

The ChunkRAG Framework

The authors propose a two-stage approach: Semantic Chunking and Advanced Filtering.

The ChunkRAG architecture, featuring semantic chunking and a multi-stage filtration pipeline.

Semantic Chunking and Query Rewriting

Instead of cutting text at arbitrary intervals, ChunkRAG tokenizes documents into sentences and groups them based on cosine similarity. If the similarity between consecutive sentences drops below a threshold ($\theta = 0.8$), a new chunk is started. This ensures chunks are semantically coherent. Additionally, the system uses GPT-4o to transform user queries into forms that better match the stored chunk embeddings.

Multi-Stage Filtration Pipeline

The core innovation is a multi-stage evaluation process for each retrieved chunk:

  1. Redundancy Removal: Uses TF-IDF and cosine similarity to deduplicate near-identical sections, preventing the model from being cluttered by repetitive information.
  2. LLM-Based Scoring: Chunks undergo a three-step evaluation: initial scoring, self-reflection (where the model adjusts for misalignments), and a final check by a critic model applying domain-specific heuristics (like temporal consistency).
  3. Dynamic Thresholding: Rather than using a fixed cutoff, ChunkRAG calculates a threshold based on the distribution of scores for that specific query (using mean and standard deviation), ensuring only the "cream of the crop" chunks are kept.

Key Results and Insights

ChunkRAG was evaluated on three distinct benchmarks: PopQA (long-tail knowledge), PubHealth (fact-checking), and Biography (long-form generation). The framework consistently outperformed state-of-the-art baselines like Self-RAG and CRAG:

  • Accuracy Boost: In PubHealth, ChunkRAG reached 77.3% accuracy, a significant jump over standard RAG (39.0%) and Self-RAG (72.4%).
  • Factual Consistency: It attained an 86.4 FactScore in the Biography task, indicating high factual consistency in long-form text.
  • Relevance Improvement: Comparative analysis showed that ChunkRAG’s average relevance score was 0.467, compared to just 0.180 for a naive retriever.

The paper argues that document-level relevance is a poor proxy for chunk-level utility. Dynamic thresholding and self-reflection were found to be crucial; allowing the LLM to "double-check" its own scoring significantly decreased retrieval errors, acting as a built-in quality control mechanism.

Conclusion

ChunkRAG demonstrates that granular, chunk-level filtering is essential for reliable RAG systems, particularly in fact-intensive tasks. While the multi-stage scoring process increases computational cost and latency, the reduction in hallucinations and improvement in factual accuracy make it a powerful tool for applications like multi-hop reasoning and fact-checking. Future work will focus on improving efficiency through model distillation and exploring domain-specific thresholds for specialized fields like law or medicine.

Summary updated

BibTeX
@misc{singh2024chunkrag,
  author = {Ishneet Sukhvinder Singh and Ritvik Aggarwal and Ibrahim Allahverdiyev and Muhammad Taha and Aslihan Akalin and Kevin Zhu and Sean O'Brien},
  title = {{ChunkRAG: Novel LLM-Chunk Filtering Method for RAG Systems}},
  year = {2024},
  eprint = {2410.19572},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.19572},
}
Figure