[Paper Review] Mix-of-Granularity: Optimize the Chunking Granularity for Retrieval-Augmented Generation
This paper proposes Mix-of-Granularity (MoG), a dynamic chunking strategy for Retrieval-Augmented Generation (RAG) that uses a router to select optimal document granularity based on input queries, improving retrieval relevance and reducing noise. It further introduces MoGG, which models knowledge as graphs to retrieve distantly located information, achieving state-of-the-art performance across multiple benchmarks with a novel soft-label loss for training.
Integrating information from various reference databases is a major challenge for Retrieval-Augmented Generation (RAG) systems because each knowledge source adopts a unique data structure and follows different conventions. Retrieving from multiple knowledge sources with one fixed strategy usually leads to under-exploitation of information. To mitigate this drawback, inspired by Mix-of-Expert, we introduce Mix-of-Granularity (MoG), a method that dynamically determines the optimal granularity of a knowledge source based on input queries using a router. The router is efficiently trained with a newly proposed loss function employing soft labels. We further extend MoG to MoG-Graph (MoGG), where reference documents are pre-processed as graphs, enabling the retrieval of distantly situated snippets. Experiments demonstrate that MoG and MoGG effectively predict optimal granularity levels, significantly enhancing the performance of the RAG system in downstream tasks. The code of both MoG and MoGG are released in https://github.com/ZGChung/Mix-of-Granularity.
Motivation & Objective
- Address the challenge of fixed chunking granularity in RAG systems, which limits retrieval effectiveness across diverse knowledge sources with varying structure and information density.
- Overcome the limitation of static chunking by dynamically selecting optimal granularity per query, adapting to fine-grained or coarse-grained information needs.
- Extend MoG to MoGG to retrieve semantically relevant but spatially distant information by modeling knowledge as graphs, improving coverage for complex queries.
- Develop a differentiable training mechanism for top-k retrieval via a soft-label guided loss function, enabling gradient backpropagation despite discrete selection.
- Enhance RAG performance across diverse domains—especially medical and scientific—by integrating multiple knowledge sources with adaptive granularity and graph-aware retrieval.
Proposed method
- Introduce a router module trained via a novel soft-label guided loss function to predict the optimal chunking granularity for each input query, enabling dynamic selection among pre-defined granularity levels.
- Pre-process reference documents into multiple granularity levels (e.g., sentence-level, paragraph-level, section-level) to provide diverse snippet options for the router to select from.
- Extend MoG to MoGG by transforming knowledge bases into graph structures where entities and relations are nodes and edges, enabling retrieval of semantically connected but spatially separated snippets.
- Use a graph retrieval mechanism that selects subgraphs with optimal hop range to retrieve relevant information, allowing cross-document and cross-knowledge-source retrieval.
- Apply a differentiable soft-label loss to approximate gradients through top-k selection, enabling end-to-end training of the router despite the non-differentiable nature of k-NN retrieval.
- Integrate the selected snippets (from MoG or MoGG) into the LLM’s context for generation, ensuring grounded and accurate outputs.
Experimental results
Research questions
- RQ1Can a learnable router dynamically select the optimal document chunking granularity based on query semantics to improve retrieval relevance in RAG systems?
- RQ2How does graph-based retrieval (MoGG) enhance the ability to retrieve distantly located but semantically relevant information compared to flat chunking?
- RQ3To what extent can a soft-label guided loss function enable effective training of the router despite the non-differentiable top-k retrieval operation?
- RQ4Does MoG and MoGG outperform fixed-chunking and existing RAG baselines across diverse downstream tasks, especially in medical and scientific domains?
- RQ5How does the performance of MoG and MoGG vary across different LLMs and knowledge sources with differing structural characteristics?
Key findings
- MoG achieves a 44.92% average accuracy on the MMLU benchmark with GLM3, outperforming MedRAG (42.69%) and the baseline CoT (39.08%), demonstrating improved retrieval quality through dynamic granularity selection.
- MoGG achieves a 61.68% average accuracy with GPT-3.5, surpassing MedRAG (52.50%) and CoT (65.71%), showing that graph-aware retrieval enhances performance on complex, cross-document queries.
- With InternLM, MoG achieves 58.04% average accuracy, outperforming MedRAG (42.23%) and CoT (59.14%), confirming the method's effectiveness across diverse LLMs.
- Llama3 with MoG achieves 62.21% average accuracy, exceeding MedRAG (51.27%) and CoT (63.86%), indicating robustness across different LLM architectures.
- Qwen1.5 with MoGG achieves 47.52% average accuracy, outperforming MedRAG (43.99%) and CoT (38.45%), validating the method’s generalization across models and domains.
- The soft-label loss enables effective training of the router despite top-k selection, allowing end-to-end optimization and consistent performance gains across all evaluated settings.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.