arXiv:2502.08356cs.CL2025-02NAACL被引 14

通过多样化数据增强提升领域知识注入,让大模型在检索失败时仍能准确回答。

Systematic Knowledge Injection into Large Language Models via Diverse Augmentation for Domain-Specific RAG

  • 用不同相关性的检索内容生成多训练样本,教会模型何时该信检索结果
  • 对同一问题生成多种答案,帮助模型更好内化专业领域知识
  • 适合需要高可靠性的医疗、法律等专业领域RAG应用

检索增强生成(RAG)已成为将领域知识注入大语言模型(LLM)的重要方法。尽管RAG通过引入检索到的领域知识提升了回复相关性,但检索错误仍可能导致幻觉和错误回答。为应对检索失败,现有方法通过微调使模型在检索失败时也能生成正确答案。然而我们发现,若缺乏系统性知识增强,微调后的模型可能仅记忆新信息,却无法有效提取相关领域知识,导致性能不佳。本文提出一种新框架,通过两种方式增强训练数据:上下文增强与知识改写。上下文增强通过对给定问答对生成多个样本,改变检索内容的相关性,训练模型判断何时应忽略或依赖检索结果;知识改写则使用同一问题的多个答案进行微调,使模型更深入内化专业知识。为缓解微调带来的灾难性遗忘,我们在问题中加入领域标识符,并使用包含通用问答对的重放缓冲区。实验表明,本方法相比现有技术,在令牌级召回率上最高提升10%相对增益,同时保持了LLM的泛化能力。

原文摘要 · Abstract (English)

Retrieval-Augmented Generation (RAG) has emerged as a prominent method for incorporating domain knowledge into Large Language Models (LLMs). While RAG enhances response relevance by incorporating retrieved domain knowledge in the context, retrieval errors can still lead to hallucinations and incorrect answers. To recover from retriever failures, domain knowledge is injected by fine-tuning the model to generate the correct response, even in the case of retrieval errors. However, we observe that without systematic knowledge augmentation, fine-tuned LLMs may memorize new information but still fail to extract relevant domain knowledge, leading to poor performance. In this work, we present a novel framework that significantly enhances the fine-tuning process by augmenting the training data in two ways -- context augmentation and knowledge paraphrasing. In context augmentation, we create multiple training samples for a given QA pair by varying the relevance of the retrieved information, teaching the model when to ignore and when to rely on retrieved content. In knowledge paraphrasing, we fine-tune with multiple answers to the same question, enabling LLMs to better internalize specialized knowledge. To mitigate catastrophic forgetting due to fine-tuning, we add a domain-specific identifier to a question and also utilize a replay buffer containing general QA pairs. Experimental results demonstrate the efficacy of our method over existing techniques, achieving up to 10\% relative gain in token-level recall while preserving the LLM's generalization capabilities.

RAG知识注入微调领域适应

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。