Retrieval-Augmented Generation (RAG) has emerged as a powerful approach for enhancing large language models' question-answering capabilities through the integration of external knowledge. However, when adapting RAG systems to specialized domains, challenges arise from distribution shifts, resulting in suboptimal generalization performance. In this work, we propose TTARAG, a test-time adaptation method that dynamically updates the language model's parameters during inference to improve RAG system performance in specialized domains. Our method introduces a simple yet effective approach where the model learns to predict retrieved content, enabling automatic parameter adjustment to the target domain. Through extensive experiments across six specialized domains, we demonstrate that TTARAG achieves substantial performance improvements over baseline RAG systems. Code available at https://github.com/sunxin000/TTARAG.
翻译:检索增强生成(RAG)已成为通过整合外部知识来增强大语言模型问答能力的重要方法。然而,当将RAG系统应用于特定领域时,分布偏移带来的挑战会导致泛化性能欠佳。本研究提出TTARAG,一种在推理过程中动态更新语言模型参数的测试时自适应方法,以提升RAG系统在专业领域的性能。我们的方法引入了一种简洁而有效的策略:模型通过学习预测检索内容,从而实现对目标领域的自动参数调整。通过在六个专业领域的广泛实验,我们证明TTARAG相较于基线RAG系统取得了显著的性能提升。代码发布于 https://github.com/sunxin000/TTARAG。