[论文解读] LegalBench-RAG: A Benchmark for Retrieval-Augmented Generation in the Legal Domain
LegalBench-RAG 是第一个专注于评估法律领域 RAG 系统检索阶段的基准,使用精确的、以原始来源为锚点的片段级检索,并提供用于快速试验的迷你版本。
Retrieval-Augmented Generation (RAG) systems are showing promising potential, and are becoming increasingly relevant in AI-powered legal applications. Existing benchmarks, such as LegalBench, assess the generative capabilities of Large Language Models (LLMs) in the legal domain, but there is a critical gap in evaluating the retrieval component of RAG systems. To address this, we introduce LegalBench-RAG, the first benchmark specifically designed to evaluate the retrieval step of RAG pipelines within the legal space. LegalBench-RAG emphasizes precise retrieval by focusing on extracting minimal, highly relevant text segments from legal documents. These highly relevant snippets are preferred over retrieving document IDs, or large sequences of imprecise chunks, both of which can exceed context window limitations. Long context windows cost more to process, induce higher latency, and lead LLMs to forget or hallucinate information. Additionally, precise results allow LLMs to generate citations for the end user. The LegalBench-RAG benchmark is constructed by retracing the context used in LegalBench queries back to their original locations within the legal corpus, resulting in a dataset of 6,858 query-answer pairs over a corpus of over 79M characters, entirely human-annotated by legal experts. We also introduce LegalBench-RAG-mini, a lightweight version for rapid iteration and experimentation. By providing a dedicated benchmark for legal retrieval, LegalBench-RAG serves as a critical tool for companies and researchers focused on enhancing the accuracy and performance of RAG systems in the legal domain. The LegalBench-RAG dataset is publicly available at https://github.com/zeroentropy-cc/legalbenchrag.
研究动机与目标
- 通过在大型法律语料库中定位准确、最小的文本片段来评估法律 RAG 流水线的检索精度。
- 提供公开可得的、专家标注的数据集,以在法律场景中比较检索算法。
- 通过避免大且不精确的块来保持上下文窗口的效率,并实现精确引文。
提出的方法
- 通过追溯到四个法律数据集(PrivacyQA、CUAD、MAUD、ContractNLI)中的原始位置来构建 LegalBench-RAG。
- 将查询创建为文档描述与问句的组合,以产生地面真实区间(起始/结束字符索引)。
- 用 (filename, index range) 的数组来标注 QA 对,以便精确回答每个查询。
- 使用分块策略评估检索(固定大小 500-char 的分块 与 Recursive Text Character Splitter)及后处理(无 reranker 与 Cohere reranker)。
- 使用 OpenAI text-embedding-3-large 进行嵌入,SQLite Vec 进行存储,在选定配置中使用 Cohere reranker 以进行实验。

实验结果
研究问题
- RQ1法律检索系统在大型语料库中多大程度上能够定位回答法律查询的准确、最小文本片段?
- RQ2哪些分块和重新排序策略在法律文本中能获得最佳的检索精确度与召回率?
- RQ3LegalBench-RAG 内的不同数据集在检索难度和性能上有何差异?
- RQ4通用重新排序器在专业法律文本上的局限性是什么?
主要发现
- 在没有 reranker 的情况下,RTCS(Recursive Text Character Splitter)在所有数据集上实现了最佳的整体检索性能。
- Cohere 的 reranker 相较于无 reranker 在本法律检索基准上表现不足。
- PrivacyQA 被认为是最容易的数据集,而 MAUD 是检索中最具挑战性的。
- 在 PrivacyQA 上,在 RTCS 且无 reranker 的条件下,Precision@1 达到 14.38%,Recall@64 达到 84.19%。
- MAUD 显示出较低的性能,Precision@1 约为 2.65%,Recall@64 约为 28.28%。
- LegalBench-RAG-mini 提供一个轻量级的 776 查询子集(跨 4 个数据集),用于快速试验。

更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。