小型语言模型法律 RAG 基准评测:结构有效性、引用合规与推理效率
Benchmarking Small Language Models for Legal Retrieval-Augmented Generation: Structural Validity, Citation Compliance, and Inference Efficiency
AI 导读
一项研究在本地法律 RAG 管线中对五个小型语言模型(SLM)进行基准评测,使用 BM25 检索 FIRE 2019 AILA 语料并经 llama.cpp 推理。
正文 · 原文
Abstract: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.
| Comments: | 13 pages, 4 tables, 2 figures |
| Subjects: | Artificial Intelligence (cs.AI); Computation and Language (cs.CL); Information Retrieval (cs.IR); Machine Learning (cs.LG) |
| Cite as: | arXiv:2612.01130 [cs.AI] |
| (or arXiv:2612.01130v2 [cs.AI] for this version) | |
| https://doi.org/10.48550/arXiv.2612.01130 arXiv-issued DOI via DataCite |
Submission history
From: Bhavya Yajush Awasthi [view email]
[v1]
Tue, 1 Dec 2026 06:57:58 UTC (601 KB)
[v2]
Wed, 2 Dec 2026 13:54:53 UTC (601 KB)
来源:arXiv cs.AI · arxiv.org