[论文解读] LawGPT: A Chinese Legal Knowledge-Enhanced Large Language Model
LawGPT 是首个开源的中文法律大模型,增强了以法律为导向的预训练语料和知识驱动的微调阶段,在主要法律任务上超越开源 LLaMA 7B。通过自我托管来保护数据隐私。
Large language models (LLMs), including both proprietary and open-source models, have showcased remarkable capabilities in addressing a wide range of downstream tasks. Nonetheless, when it comes to practical Chinese legal tasks, these models fail to meet the actual requirements. Proprietary models do not ensure data privacy for sensitive legal cases, while open-source models demonstrate unsatisfactory performance due to their lack of legal knowledge. To address this problem, we introduce LawGPT, the first open-source model specifically designed for Chinese legal applications. LawGPT comprises two key components: legal-oriented pre-training and legal supervised fine-tuning. Specifically, we employ large-scale Chinese legal documents for legal-oriented pre-training to incorporate legal domain knowledge. To further improve the model's performance on downstream legal tasks, we create a knowledge-driven instruction dataset for legal supervised fine-tuning. Our experimental results demonstrate that LawGPT outperforms the open-source LLaMA 7B model. Our code and resources are publicly available at https://github.com/pengxiao-song/LaWGPT and have received 5.7K stars on GitHub.
研究动机与目标
- 激发创建一个开源的中文法律大模型,以解决现有模型在数据隐私和知识方面的不足。
- 通过大规模的法律领域预训练来引入法律领域知识。
- 通过知识驱动的监督微调来提升下游法律任务的性能。
- 展示 LawGPT 相对于开源基线的有效性并讨论隐私优点。
提出的方法
- 使用 500K 法律文档语料开发一个法律导向的预训练(LPT)。
- 在 LPT 期间应用 LoRA 微调基础模型。
- 构建一个 30K 强的法律知识驱动指令数据集,用于法律监督微调(LFT)。
- 使用 Alpaca 风格模板对 LPT 模型在 D_LFT 上进行微调,得到 LawGPT(LFT)。
- 推理期间,用 Alpaca 模板包装指令并自回归生成回答。
- 在八项法律任务上进行零-shot 评估,并与 GPT-3.5 Turbo、GPT-4 与 LLaMA 7B 进行比较。
实验结果
研究问题
- RQ1法律导向的预训练如何影响 LLM 对中国法律的理解与推理?
- RQ2知识驱动的监督微调是否能提升开源 LLM 在法律任务上的性能?
- RQ3LawGPT 与专有模型及开源基线在零-shot 法律任务中的比较如何?
- RQ4将 LawGPT 作为开源自托管模型部署获得了哪些隐私优势?
主要发现
- LawGPT 在零-shot 设置下超过开源 LLaMA 7B 在主要法律任务上的表现。
- LawGPT 在总体表现上仍落后于专有模型 GPT-3.5 Turbo 与 GPT-4。
- LPT 与 LFT 的结合优于基础开源模型对法律任务的表现。
- LawGPT 实现了私有化、自托管部署并具备数据隐私优势。
- 本论文在 GitHub 上提供公开代码和资源(提到 5.7K 星标)。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。