ALoFTRAG: Automatic Local Fine Tuning for Retrieval Augmented Generation
Peter Devine
TL;DR
The paper tackles domain-specific accuracy in Retrieval Augmented Generation (RAG) by introducing ALoFTRAG, a framework that auto-generates and filters training data from local, unlabeled text and then LoRA-fine-tunes a base LLM to improve RAG performance without external models. It employs a five-step pipeline (text filtering, Q&A generation, Q&A filtering, hard-negative mining, and RAG fine-tuning) using a single base LLM and a multilingual IR model, enabling data-secure, cost-efficient domain adaptation. Evaluated on 20 datasets across 26 languages, ALoFTRAG yields consistent gains in citation and answer accuracy, illustrating practical benefits for sensitive domains like healthcare and finance. The approach democratizes access to higher-quality RAG systems by requiring modest hardware and maintaining local data privacy, with future work exploring IR training and multimodal extensions.
Abstract
Retrieval Augmented Generation (RAG) systems have been shown to improve the accuracy of Large Language Model (LLM) outputs. However, these models can often achieve low accuracy when applied to new data domains. We introduce the Automatic Local Fine Tuning of Retrieval Augmented Generation models (ALoFTRAG) framework, designed to improve the accuracy of RAG systems on a given domain by training LLMs without manually labeled data or using larger teacher models. By generating and filtering synthetic training data and performing LoRA fine-tuning, ALoFTRAG improves citation and answer accuracy across 20 datasets in 26 languages by, on average, 8.3% and 3.0% respectively. Our results demonstrate that ALoFTRAG offers a practical, cost-effective, and data-secure solution for improving RAG accuracy, making it particularly applicable to sensitive domains such as healthcare and finance.
