通过元数据增强的RAG流水线和直接偏好优化增强法律LLM
Enhancing Legal LLMs through Metadata-Enriched RAG Pipelines and Direct Preference Optimization
AI总结:
本文提出元数据增强的RAG和直接偏好优化,解决法律领域长文本检索和生成中的精度问题,提升模型的可靠性与安全性。
摘要:
大型语言模型(LLMs)在短上下文中表现良好,但在处理长法律文档时性能下降,常产生错误的条款或先例等幻觉。在法律领域,精确性至关重要,此类错误会损害模型的可靠性与信任度。检索增强生成(RAG)有助于使输出更具体,但在法律环境中仍存在局限,特别是当需要本地部署的小型模型以满足数据隐私要求时。我们识别出两种失败模式:由于法律语料库中词汇冗余导致的检索错误,以及在上下文不足时模型仍生成答案的解码错误。为此,我们提出了元数据增强的混合RAG以提高文档级检索能力,并应用直接偏好优化(DPO)以在上下文不足时强制安全拒绝。这些方法共同提升了法律语言模型的 groundedness、可靠性与安全性。
英文摘要:
Large Language Models (LLMs) perform well in short contexts but degrade on long legal documents, often producing hallucinations such as incorrect clauses or precedents. In the legal domain, where precision is critical, such errors undermine reliability and trust. Retrieval Augmented Generation (RAG) helps ground outputs but remains limited in legal settings, especially with small, locally deployed models required for data privacy. We identify two failure modes: retrieval errors due to lexical redundancy in legal corpora, and decoding errors where models generate answers despite insufficient context. To address this, we propose Metadata Enriched Hybrid RAG to improve document level retrieval, and apply Direct Preference Optimization (DPO) to enforce safe refusal when context is inadequate. Together, these methods improve grounding, reliability, and safety in legal language models.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。