Research paper code for adaptive RAG via question complexity
Top 86.9% on sourcepulse
This repository provides the official code for Adaptive-RAG, a framework designed to dynamically select the most suitable retrieval strategy for Large Language Models (LLMs) based on query complexity. It aims to improve the efficiency and accuracy of Question-Answering (QA) systems by balancing single-step, iterative, and no-retrieval methods. The target audience includes researchers and practitioners working on retrieval-augmented LLMs.
How It Works
Adaptive-RAG employs a classifier, a smaller LM trained on automatically collected labels, to predict query complexity. This classifier then dynamically routes queries to the most appropriate retrieval strategy (single-step, iterative, or no-retrieval), optimizing resource usage and response quality across a spectrum of query difficulties. This adaptive approach avoids unnecessary overhead for simple queries and ensures complex queries are handled effectively.
Quick Start & Requirements
conda create -n adaptiverag python=3.8
), activate it, and install dependencies (pip install torch==1.13.1+cu117 --extra-index-url https://download.pytorch.org/whl/cu117
, pip install -r requirements.txt
).Highlighted Details
Maintenance & Community
The project is associated with NAACL 2024. Further community or maintenance details are not explicitly provided in the README.
Licensing & Compatibility
The repository does not explicitly state a license. The code is presented as the "Official Code Repository" for a research paper.
Limitations & Caveats
The setup process is complex, requiring the installation and configuration of multiple servers (Elasticsearch, LLM) and extensive data preparation. The reliance on specific versions of PyTorch (1.13.1+cu117) and Elasticsearch (7.10.2) may pose compatibility challenges.
1 year ago
Inactive