arXiv:2504.02590cs.CL2025-04EMNLP被引 15

让大模型依法做数学题,避免漏步骤、出错算。

Legal Mathematical Reasoning with LLMs: Procedural Alignment through Two-Stage Reinforcement Learning

  • 分两阶段强化学习,用教师模型分难易数据,学生模型轻量训练。
  • 在中文法律数学题集上,准确率和流程合规性显著提升。
  • 适合法律AI、司法辅助系统研发者参考,尤其关注程序合规性。

法律数学推理对高风险法律场景中的大语言模型至关重要,输出必须兼具数学准确性与程序合规性。现有法律大模型缺乏结构化数值推理能力,而通用模型虽能计算却常忽略法定步骤。为此,我们提出首个中文法律数学推理基准LexNum,涵盖三类典型场景,每例均体现合法程序流程。进一步提出两阶段强化学习框架LexPam:第一阶段利用更强教师模型进行课程学习,划分基础与挑战样本;第二阶段采用轻量1.5B学生模型,通过组相对策略优化(Group Relative Policy Optimization)训练,无需昂贵价值网络,支持稀疏的终局奖励下稳定训练。第一阶段提升准确率与格式规范,第二阶段引入新奖励机制,通过任务特有法律要素引导程序对齐。实验表明,现有模型在LexNum上表现不佳,而LexPam显著提升数学准确率与法律一致性,并在跨任务、跨领域中具有良好泛化能力。

原文摘要 · Abstract (English)

Legal mathematical reasoning is essential for applying large language models (LLMs) in high-stakes legal contexts, where outputs must be both mathematically accurate and procedurally compliant. However, existing legal LLMs lack structured numerical reasoning, and open-domain models, though capable of calculations, often overlook mandatory legal steps. To address this, we present LexNum, the first Chinese legal mathematical reasoning benchmark, covering three representative scenarios where each instance reflects legally grounded procedural flows. We further propose LexPam, a two-stage reinforcement learning framework for efficient legal reasoning training. Leveraging curriculum learning, we use a stronger teacher model to partition data into basic and challenging subsets. A lightweight 1.5B student model is then fine-tuned with Group Relative Policy Optimization, which avoids costly value networks and enables stable training from sparse, end-of-sequence rewards. The first stage improves accuracy and format; the second introduces a novel reward to guide procedural alignment via task-specific legal elements. Experiments show that existing models perform poorly on LexNum, while LexPam enhances both mathematical accuracy and legal coherence, and generalizes effectively across tasks and domains.

法律AI强化学习数学推理程序合规

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