arXiv:2504.04945cs.LGcs.AI2025-04被引 3

小模型用1500题微调,逼近人类法律答题水平

A Llama walks into the 'Bar': Efficient Supervised Fine-Tuning for Legal Reasoning in the Multi-state Bar Exam

  • 用70B大模型生成结构化IRAC推理,指导小模型微调
  • 微调后模型在1514题上接近人类答题准确率
  • 适合资源有限但需高效法律问答的场景

法律推理对大语言模型提出独特挑战,因领域知识复杂且需严谨逻辑。本文研究在仅1,514道多州律师考试(MBE)题目的有限数据下,如何通过监督微调提升小型模型(Llama 2 7B 和 Llama 3 8B)的法律问答能力。评估基于JD Advising授权的2022年MBE数据集,涵盖7个法律领域,每类约200题。利用Llama 3(70B)将解释转化为结构化的IRAC格式(问题、规则、应用、结论),作为推理引导,对比有无该引导的微调效果。比较未微调与不同样本量微调后的模型表现,分析准确率和提示遵循度变化,并研究选项选择偏差及其缓解。同时考察多种变量组合:提示类型(少样本/零样本)、答案顺序(选项优先/解释优先)、输出格式(编号列表/Markdown/JSON)及解码温度。结果表明,特定领域的微调使部分模型配置达到接近人类基准的性能,即便计算资源有限且数据量较小。论文发布微调数据集及优化后的系列SFT适配器,为小模型实现有效法律问答提供实际资源下限参考。

原文摘要 · Abstract (English)

Legal reasoning tasks present unique challenges for large language models (LLMs) due to the complexity of domain-specific knowledge and reasoning processes. This paper investigates how effectively smaller language models (Llama 2 7B and Llama 3 8B) can be fine-tuned with a limited dataset of 1,514 Multi-state Bar Examination (MBE) questions to improve legal question answering accuracy. We evaluate these models on the 2022 MBE questions licensed from JD Advising, the same dataset used in the 'GPT-4 passes the Bar exam' study. Our methodology involves collecting approximately 200 questions per legal domain across 7 domains. We distill the dataset using Llama 3 (70B) to transform explanations into a structured IRAC (Issue, Rule, Application, Conclusion) format as a guided reasoning process to see if it results in better performance over the non-distilled dataset. We compare the non-fine-tuned models against their supervised fine-tuned (SFT) counterparts, trained for different sample sizes per domain, to study the effect on accuracy and prompt adherence. We also analyse option selection biases and their mitigation following SFT. In addition, we consolidate the performance across multiple variables: prompt type (few-shot vs zero-shot), answer ordering (chosen-option first vs generated-explanation first), response format (Numbered list vs Markdown vs JSON), and different decoding temperatures. Our findings show that domain-specific SFT helps some model configurations achieve close to human baseline performance, despite limited computational resources and a relatively small dataset. We release both the gathered SFT dataset and the family of Supervised Fine-tuned (SFT) adapters optimised for MBE performance. This establishes a practical lower bound on resources needed towards achieving effective legal question answering in smaller LLMs.

法律AI微调小模型推理生成

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。