Mix-of-Granularity: Optimize the Chunking Granularity for Retrieval-Augmented Generation

Zijie Zhong, Hanwen Liu, Xiaoya Cui, Xiaofan Zhang, Zengchang Qin
6/1/2024
cs.LGcs.AIcs.CL

Official code: ZGChung/Mix-of-Granularity (11 stars, last commit 2025-01-26).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

[COLING 2025] Mix-of-Granularity paper

110Jinja, ShellJan 26, 20251 years agoNOASSERTION

Similar Papers

Cite this paper

@article{zhong2024mixofgranularity,
  title  = {Mix-of-Granularity: Optimize the Chunking Granularity for Retrieval-Augmented Generation},
  author = {Zijie Zhong and Hanwen Liu and Xiaoya Cui and Xiaofan Zhang and Zengchang Qin},
  year   = {2024},
  eprint = {2406.00456},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2406.00456v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.00456.svg)](https://codeofpaper.com/paper/2406.00456)

Discussion