Benchmarking Small Language Models for Legal Retrieval-Augmented Generation: Structural Validity, Citation Compliance, and Inference Efficiency(小型语言模型在法律检索增强生成中的基准测试:结构有效性、引用合规性和推理效率)于 2026-12-01 提交到 arXiv,作者 Bhavya Yajush Awasthi, Amit Khaparde。去 arXiv 读原文,或下载 PDF。
主要发现
- 在 FIRE 2019 AILA 的全部 50 个查询中,Qwen2.5-1.5B-Instruct 的结构可用率为 1.00,引用有检索依据的回答率为 0.16。
- 在五个本地运行的小型语言模型中,Phi-3 Mini Q4 的引用有检索依据的回答率最高,为 0.38,但这个指标不能说明引用是否支持相关法律主张。
- Llama-3.2-1B 的结构可用率为 0.92,并在报告的本地环境中取得最高的平均端到端吞吐量,为 6.21 tokens/s。
- 在报告所用的机器上,Phi-3 Mini Q4 的平均首个 token 等待时间最长,为 69.11 秒,平均端到端吞吐量最低,为 1.81 tokens/s。
- 在五个模型中,首个 token 等待时间约占平均生成时间的 75–83%,说明提示词处理占了测得延迟的很大一部分。
最重要的一点。 在这五个本地小型语言模型和 FIRE 2019 AILA 的全部 50 个查询中,结构可用性、已检索文档引用行为和推理效率各自变化。引用匹配只能作为初步诊断,不能证明法律正确性或主张层面的支持关系。
摘要
Retrieval-augmented generation (RAG) can condition language-model responses on external evidence, but its usefulness in legal settings depends on more than fluent text generation. This study benchmarks five small language models (SLMs) in a local legal RAG pipeline using BM25 retrieval over the FIRE 2019 Artificial Intelligence for Legal Assistance (AILA) corpus and inference through llama$.$cpp. For each query, the system retrieves prior case documents, constructs a constrained prompt, and evaluates the generated response for structural usability, citation behaviour, and inference efficiency. Citation-grounded response rate is defined as the proportion of queries for which a structurally usable response contains at least one citation to a retrieved document; citation precision separately measures the proportion of extracted citations that refer to retrieved documents. Neither measure verifies whether a cited case substantively supports a legal claim. Qwen2.5-1.5B achieved a structural usability rate of 1.00 but a citation-grounded response rate of 0.16. Llama-3.2-1B achieved a structural usability rate of 0.92 and the highest mean end-to-end throughput (6.21 tokens/s), while Phi-3 Mini Q4 had the highest citation-grounded response rate (0.38) but the greatest mean time to first token (69.11 s). These results show that structural usability, citation behaviour, and inference efficiency are distinct properties of local SLM-based legal RAG. The study provides a controlled comparison under a shared retrieval and generation protocol and highlights the need to evaluate citation behaviour separately from fluency and latency.
译文:检索增强生成(RAG)可以让语言模型根据外部证据生成回答,但它在法律场景中的用途不只取决于文字是否流畅。本研究在一个本地法律 RAG 流程中对五个小型语言模型(SLM)进行基准测试。该流程使用 BM25 从 FIRE 2019 人工智能法律援助(AILA)语料库中检索内容,并通过 llama.cpp 进行推理。对于每个查询,系统会检索既往案件文档,构建带有限制条件的提示词,并从结构可用性、引用行为和推理效率三个方面评估生成的回答。引用有检索依据的回答率,是指结构可用且至少引用了一份已检索文档的查询所占比例;引用精确率另行衡量抽取出的引用中有多少指向已检索文档。这两个指标都不验证被引用案件是否在实质上支持某项法律主张。Qwen2.5-1.5B 的结构可用率为 1.00,但引用有检索依据的回答率为 0.16。Llama-3.2-1B 的结构可用率为 0.92,平均端到端吞吐量最高,为 6.21 tokens/s;Phi-3 Mini Q4 的引用有检索依据的回答率最高,为 0.38,但平均首个 token 等待时间也最长,为 69.11 秒。这些结果表明,在本地小型语言模型法律 RAG 中,结构可用性、引用行为和推理效率是彼此不同的属性。本研究在统一的检索和生成流程下提供了受控比较,并说明引用行为需要与流畅度和延迟分开评估。
关键术语
- 引用有检索依据的回答率:在全部查询中,回答结构可用且至少引用一份该查询已检索文档的查询所占比例。
- 引用精确率:从回答中抽取出的引用里,指向已检索文档的引用所占比例。
- 结构可用性:生成的回答是否符合要求的输出结构,并达到论文评估所需的可用程度。
- BM25:一种词项检索排序方法,根据查询与文档共有的词及其频率特征为文档评分。
- 首个 token 等待时间:从提交提示词到收到第一个生成 token 之间经过的时间。
- GGUF 量化:一种模型存储和运行格式,可以用较低精度表示权重,以便在本地进行推理。
论文原文
这段话定义了两个引用指标,并说明它们没有检验什么。
Citation-grounded response rate is defined as the proportion of queries for which a structurally usable response contains at least one citation to a retrieved document; citation precision separately measures the proportion of extracted citations that refer to retrieved documents. Neither measure verifies whether a cited case substantively supports a legal claim.
译文:引用有检索依据的回答率,是指结构可用且至少引用了一份已检索文档的查询所占比例;引用精确率另行衡量抽取出的引用中有多少指向已检索文档。这两个指标都不验证被引用案件是否在实质上支持某项法律主张。
这段结果显示,三个受测模型分别在不同指标上表现较高。
Qwen2.5-1.5B achieved a structural usability rate of 1.00 but a citation-grounded response rate of 0.16. Llama-3.2-1B achieved a structural usability rate of 0.92 and the highest mean end-to-end throughput (6.21 tokens/s), while Phi-3 Mini Q4 had the highest citation-grounded response rate (0.38) but the greatest mean time to first token (69.11 s).
译文:Qwen2.5-1.5B 的结构可用率为 1.00,但引用有检索依据的回答率为 0.16。Llama-3.2-1B 的结构可用率为 0.92,平均端到端吞吐量最高,为 6.21 tokens/s;Phi-3 Mini Q4 的引用有检索依据的回答率最高,为 0.38,但平均首个 token 等待时间也最长,为 69.11 秒。
这段讨论说明,仅把引用匹配到已检索文档仍然无法确定回答质量。
A response may cite only retrieved cases while misinterpreting them, omitting a controlling precedent, or reaching an unsupported legal conclusion.
译文:一份回答可能只引用已检索到的案件,同时对这些案件作出错误解释、遗漏有约束力的先例,或得出缺少支持的法律结论。
这段限制说明,生成结果来自完整查询集实验。
All 50 AILA queries were included in the generation experiment, rather than using only the benchmark’s 40-query test split. The reported generation figures should therefore not be interpreted as official test-split results.
译文:生成实验使用了全部 50 个 AILA 查询,没有只使用基准中的 40 个测试查询。因此,报告的生成数据不应被理解为官方测试集结果。
论文里的图
可以比较五个小型语言模型的标准化指标,同时注意更高的首个 token 等待时间和输出上限触发率代表更不利的结果。

图来自论文 arXiv:2612.01130,版权归作者。原图说明:Figure 2: Normalized comparison of the five evaluated SLMs across response-quality and inference metrics. Each metric is scaled relative to its maximum observed value. Higher values do not uniformly indicate better performance: higher TTFT indicates greater latency, while a higher output-limit rate indicates more frequent generation truncation.
作者自己说的含义
- 作者认为,法律 RAG 生成器需要从结构可靠性、引用行为、延迟、内存使用和长检索上下文下的稳定性等多个方面评估,因为这些属性可能各自变化。
- 作者把引用精确率和引用有检索依据的回答率视为依赖检索结果的诊断指标,并明确指出它们不能作为法律正确性或主张层面忠实性的证据。
- 作者指出,本地运行可以减少把法律文档和查询发送给外部模型服务的需要,但这不能解决生成内容是否可靠或整个应用是否存在数据外传路径的问题。
- 作者提出,后续研究需要单独评估检索质量,加入人工法律评估,并测试检索深度、提示词、上下文截断、输出长度和解码设置带来的变化。
可以怎么做
- 在相同 FIRE 2019 AILA 设置下审计这五个模型时,分别测量结构可用率和引用有检索依据的回答率。 依据:在 50 个查询中,Qwen2.5-1.5B-Instruct 的结构可用率为 1.00,引用有检索依据的回答率为 0.16。
- 完成基于案件标识符的引用匹配后,再检查所引案件的相关性、解释是否准确以及是否支持具体主张。 依据:Phi-3 Mini Q4 的引用有检索依据的回答率在五个模型中最高,为 0.38,但论文明确说明该指标不验证案件是否在实质上支持法律主张。
- 报告延迟结果时,同时列出受测硬件、软件、token 数量和量化格式。 依据:在报告所用的 Windows 10 机器上,Llama-3.2-1B 的平均端到端吞吐量为 6.21 tokens/s,Phi-3 Mini Q4 的平均首个 token 等待时间为 69.11 秒;作者说明这些测量结果与机器配置有关。
- 把这项实验的结果标为完整查询集结果,不要标为 FIRE 2019 AILA 官方测试集结果。 依据:生成实验使用了全部 50 个 AILA 查询,其中包括 10 个训练查询和 40 个测试查询。
- 复现五模型本地基准时,单独记录提示词处理阶段的延迟。 依据:在五个受测模型中,首个 token 等待时间约占平均生成时间的 75–83%。
注意。 实验使用了 FIRE 2019 AILA 的全部 50 个查询、固定的提示词和生成设置、160 个新 token 的输出上限,以及一台配备 16 GB 内存且未使用 GPU 的 Windows 10 机器。研究只检查引用标识符是否出现在已检索文档中,没有评估事实准确性、法律正确性、案件相关性、解释是否正确或实质支持关系。
一句话
在五个本地运行的小型语言模型和 FIRE 2019 AILA 的全部 50 个查询中,回答结构、已检索文档引用和速度没有同步变化。Qwen2.5-1.5B-Instruct 的结构可用率最高,Phi-3 Mini Q4 的引用有检索依据的回答率最高,Llama-3.2-1B 在报告设置下的平均端到端吞吐量最高。
这篇解读根据论文原文写成。引用的段落是原话,数字都是作者自己报告的。方法和完整结果请读论文。