Reformulating Domain Adaptation of Large Language Models as Adapt-Retrieve-Revise: A Case Study on Chinese Legal Domain
作者: Zhen wan, Yating Zhang, Yexiang Wang, Fei Cheng, Sadao Kurohashi
分类: cs.CL
发布日期: 2023-10-05 (更新: 2024-08-26)
备注: Accepted by ACL 2024 Findings
💡 一句话要点
提出适应-检索-修订框架以解决中文法律领域的LLM适应问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 领域适应 大型语言模型 中文法律 检索机制 生成模型 证据评估 机器学习
📋 核心要点
- 现有大型语言模型在特定领域(如中文法律)中生成内容时常出现幻觉现象,限制了其实际应用。
- 本文提出了一种适应-检索-修订的框架,通过适应小型模型并结合GPT-4的证据评估能力,来提高生成内容的准确性。
- 在四个中文法律任务的实验中,提出的方法在零-shot 设置下准确率提升了33.3%,显著优于现有方法。
📝 摘要(中文)
尽管大型语言模型(LLMs)如GPT-4在通用领域任务中展现了惊人的零-shot 能力,但在特定领域(如中文法律)中生成的内容常常存在幻觉现象,限制了其应用。这主要是由于缺乏涵盖特定领域的训练数据,导致GPT-4无法获取领域内知识。本文提出了一种简单有效的领域适应框架,通过将生成过程重新定义为适应-检索-修订(adapt-retrieve-revise)过程,来解决这一问题。该方法在四个中文法律任务的零-shot 设置中,准确率提高了33.3%,并且在与两个更强的基于检索的基线比较时,分别提升了15.4%和23.9%。
🔬 方法详解
问题定义:本文旨在解决大型语言模型在特定领域(如中文法律)生成内容时的幻觉问题。现有方法由于缺乏领域内训练数据,导致模型无法有效获取相关知识,影响生成结果的准确性。
核心思路:论文提出的适应-检索-修订框架通过将生成过程分为三个步骤,首先适应一个小型模型,然后利用该模型生成初步答案,最后通过检索外部知识库的证据来修订答案,从而提高生成内容的准确性和可靠性。
技术框架:整体流程包括三个主要模块:首先,适应一个7B的语言模型以学习领域内数据;其次,利用适应后的模型生成初步答案;最后,检索支持证据并与初步答案结合,交由GPT-4进行修订。
关键创新:最重要的创新点在于将大型语言模型的生成过程重新定义为适应-检索-修订,结合了小型模型的高效性与大型模型的证据评估能力,有效减少了幻觉现象的产生。
关键设计:在模型适应阶段,采用了领域内数据进行继续学习,确保模型能够捕捉到特定领域的知识;在检索阶段,设计了高效的知识库查询机制,以便快速获取相关证据;修订阶段则利用GPT-4的强大能力对初步答案进行评估和修正。
🖼️ 关键图片
📊 实验亮点
实验结果显示,提出的方法在四个中文法律任务的零-shot 设置下,准确率提高了33.3%,显著优于直接使用GPT-4生成的结果。此外,与两个更强的基于检索的基线相比,分别提升了15.4%和23.9%,验证了方法的有效性和优越性。
🎯 应用场景
该研究的潜在应用领域包括法律文本生成、法律咨询服务和智能问答系统等。通过提高大型语言模型在特定领域的适应能力,能够为法律从业者提供更准确的支持,提升法律服务的效率和质量。未来,该框架也可扩展至其他专业领域的知识应用。
📄 摘要(原文)
While large language models (LLMs) like GPT-4 have recently demonstrated astonishing zero-shot capabilities in general domain tasks, they often generate content with hallucinations in specific domains such as Chinese law, hindering their application in these areas. This is typically due to the absence of training data that encompasses such a specific domain, preventing GPT-4 from acquiring in-domain knowledge. A pressing challenge is that it's not plausible to continue training LLMs of such scale on in-domain data. This paper introduces a simple and effective domain adaptation framework for GPT-4 by reformulating generation as an \textbf{adapt-retrieve-revise} process. The initial step is to \textbf{adapt} an affordable 7B LLM to the target domain by continuing learning on in-domain data. When solving a task, we leverage the adapted LLM to generate a draft answer given a task query. Then, the draft answer will be used to \textbf{retrieve} supporting evidence candidates from an external in-domain knowledge base. Finally, the draft answer and retrieved evidence are concatenated into a whole prompt to let GPT-4 assess the evidence and \textbf{revise} the draft answer to generate the final answer. Our proposal combines the advantages of the efficiency of adapting a smaller 7B model with the evidence-assessing capability of GPT-4 and effectively prevents GPT-4 from generating hallucinatory content. In the zero-shot setting of four Chinese legal tasks, our method improves accuracy by 33.3\% compared to the direct generation by GPT-4. When compared to two stronger retrieval-based baselines, our method outperforms them by 15.4\% and 23.9\%. Our code will be released