RAG-Studio: Towards In-Domain Adaptation of Retrieval Augmented Generation Through Self-Alignment
Kelong Mao, Zheng Liu, Hongjin Qian, Fengran Mo, Chenlong Deng, Zhicheng Dou
Abstract
Retrieval-Augmented Generation (RAG) has been widely received as an effective paradigm to enhance the quality of text generation by integrating large language models (LLMs) with external knowledge.However, the off-the-shelf RAG systems, which rely on LLMs and retrievers trained from general-purpose datasets, often fall short in handling specialized domains.To address the above challenge, we introduce RAG-Studio, a novel self-aligned training framework which autonomously adapts general RAG systems to specific domains.In a nutshell, RAG-Studio accepts a specialized domain corpus, where it identifies useful domain knowledge and synthesizes training data on top of it.Then, it leverages the synthetic data for the joint fine-tuning of the RAG system, such that the retriever can bring in more precise information, and the LLM can become more proficient at utilizing the retrieved information.We perform extensive experiments across diversified domain-specific QA datasets, spanning the Biomedical, Finance, Law, Computation, and Wiki, whose results validate the substantial improvements over the generally trained RAG.