Project Overview: LongRAG
The LongRAG project focuses on enhancing the Retrieval-Augmented Generation (RAG) framework by utilizing long-context Language Model Models (LLMs) to improve efficiency and performance in text retrieval operations. This project introduces novel strategies to optimize the retrieval and reading processes involved in generating answers from large data corpuses.
Introduction to LongRAG
Traditional RAG frameworks rely heavily on short retrieval units, which often require extensive searching over large datasets to locate relevant information. This leads to a heavily-loaded retriever and a relatively lightweight reading process, often resulting in less optimal performance. LongRAG seeks to address this imbalance by implementing "long retrievers" and "long readers." By using retrieval units consisting of 4K tokens, which are 30 times longer than standard sizes, the project aims to streamline the retrieval process, making it more efficient and potentially more accurate, thereby offering valuable insights for future RAG applications with long-context LLMs.
Getting Started with LongRAG
To use LongRAG, users must first clone the repository and install necessary packages. This is done through a few simple steps in the command line:
git clone https://github.com/TIGER-AI-Lab/LongRAG.git
cd LongRAG
pip install -r requirements.txt
Quick Start
Quickly get started with the "Long Reader" section. This process guides users through obtaining predictions for 100 examples, with results akin to sample files in the provided exp/
directory.
Corpus Preparation
While optional, users have the choice to prepare their corpus or use the pre-processed versions available on Hugging Face for datasets like NQ and HotpotQA. The option to delve into how the corpus is crafted encourages further customization and understanding.
Enhancements with Long Retriever
LongRAG employs advanced dense retrieval techniques utilizing tools like Tevatron and a base embedding model (bge-large-en-v1.5) to enhance retrieval experiments. By grouping related documents into long retrieval units, the framework reduces corpus size and simplifies retrieval tasks while improving information completeness.
Deploying the Long Reader
LongRAG uses robust models such as Gemini-1.5-Pro and GPT-4o to manage long-context input effectively. The setup involves concatenating long retrieval units, with entire datasets available in the Hugging Face repository. Support for additional models continues to grow, ensuring adaptability and expanded capabilities.
Licensing Information
Usage of datasets within LongRAG abides by their respective licenses: Apache License 2.0 for NQ and the CC BY-SA 4.0 License for HotpotQA.
Citation
For academic and research usage, kindly cite the LongRAG paper in any related publications:
@article{jiang2024longrag,
title={LongRAG: Enhancing Retrieval-Augmented Generation with Long-context LLMs},
author={Ziyan Jiang, Xueguang Ma, Wenhu Chen},
journal={arXiv preprint arXiv:2406.15319},
year={2024},
url={https://arxiv.org/abs/2406.15319}
}
By redefining the interaction between retrieval and reading processes, LongRAG enhances performance, influences future research directions, and provides a formidable tool for tasks requiring sophisticated handling of large-scale textual data.