作者: Bhavya Yajush Awasthi, Amit KhapardearXiv 2612.01130

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 个查询中,结构可用性、已检索文档引用行为和推理效率各自变化。引用匹配只能作为初步诊断,不能证明法律正确性或主张层面的支持关系。

摘要

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 中,结构可用性、引用行为和推理效率是彼此不同的属性。本研究在统一的检索和生成流程下提供了受控比较,并说明引用行为需要与流畅度和延迟分开评估。

关键术语

论文原文

这段话定义了两个引用指标,并说明它们没有检验什么。

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 等待时间和输出上限触发率代表更不利的结果。

Figure 2: Normalized comparison of the five evaluated SLMs across response-quality and inference metrics. Each metric is

图来自论文 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.

作者自己说的含义

可以怎么做

  1. 在相同 FIRE 2019 AILA 设置下审计这五个模型时,分别测量结构可用率和引用有检索依据的回答率。 依据:在 50 个查询中,Qwen2.5-1.5B-Instruct 的结构可用率为 1.00,引用有检索依据的回答率为 0.16。
  2. 完成基于案件标识符的引用匹配后,再检查所引案件的相关性、解释是否准确以及是否支持具体主张。 依据:Phi-3 Mini Q4 的引用有检索依据的回答率在五个模型中最高,为 0.38,但论文明确说明该指标不验证案件是否在实质上支持法律主张。
  3. 报告延迟结果时,同时列出受测硬件、软件、token 数量和量化格式。 依据:在报告所用的 Windows 10 机器上,Llama-3.2-1B 的平均端到端吞吐量为 6.21 tokens/s,Phi-3 Mini Q4 的平均首个 token 等待时间为 69.11 秒;作者说明这些测量结果与机器配置有关。
  4. 把这项实验的结果标为完整查询集结果,不要标为 FIRE 2019 AILA 官方测试集结果。 依据:生成实验使用了全部 50 个 AILA 查询,其中包括 10 个训练查询和 40 个测试查询。
  5. 复现五模型本地基准时,单独记录提示词处理阶段的延迟。 依据:在五个受测模型中,首个 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 在报告设置下的平均端到端吞吐量最高。

去 arXiv 读论文 →

这篇解读根据论文原文写成。引用的段落是原话,数字都是作者自己报告的。方法和完整结果请读论文。