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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zhong, Zijie, Liu, Hanwen, Cui, Xiaoya, Zhang, Xiaofan, Qin, Zengchang
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913666180317184
author Zhong, Zijie
Liu, Hanwen
Cui, Xiaoya
Zhang, Xiaofan
Qin, Zengchang
author_facet Zhong, Zijie
Liu, Hanwen
Cui, Xiaoya
Zhang, Xiaofan
Qin, Zengchang
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2406_00456
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Mix-of-Granularity: Optimize the Chunking Granularity for Retrieval-Augmented Generation
Zhong, Zijie
Liu, Hanwen
Cui, Xiaoya
Zhang, Xiaofan
Qin, Zengchang
Machine Learning
Artificial Intelligence
Computation and Language
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.
title Mix-of-Granularity: Optimize the Chunking Granularity for Retrieval-Augmented Generation
topic Machine Learning
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2406.00456