用大模型生成法律数据,让开源模型也能达到商用水平。
LawGPT: Knowledge-Guided Data Generation and Its Application to Legal LLM
- 用法律知识引导生成,提升数据多样性与质量。
- 生成5万条高质量法律推理数据,训练出性能媲美闭源模型的LawGPT。
- 适合法律AI研究者、想低成本提升模型能力的开发者。
大型语言模型在自然语言处理任务中表现优异,但在法律推理任务中仍受限。闭源模型存在数据隐私和高推理成本问题,开源模型则因缺乏法律领域训练数据而表现不佳。为此,我们研究法律推理的数据生成方法,利用闭源模型辅助提升开源模型的法律推理能力。该过程面临闭源模型法律知识不足及生成数据难以验证的挑战。为此提出KgDG框架,通过法律知识引导增强生成多样性,并引入精炼与验证流程保障数据质量。进一步扩展生成数据集,提升模型推理能力。基于KgDG构建了包含5万条高质量样本的合成法律推理数据集,训练得到的LawGPT模型超越现有法律专用LLM,性能接近闭源模型,验证了KgDG与LawGPT的有效性。代码与资源已公开于https://github.com/LAMDASZ-ML/Knowledge-Guide-Data-Generation。
原文摘要 · Abstract (English)
Large language models (LLMs), both proprietary and open-source, have demonstrated remarkable capabilities across various natural language processing tasks. However, they face significant limitations in legal reasoning tasks. Proprietary models introduce data privacy risks and high inference costs, while open-source models underperform due to insufficient legal domain training data. To address these limitations, we study data generation for legal reasoning to improve the legal reasoning performance of open-source LLMs with the help of proprietary LLMs. This is challenging due to the lack of legal knowledge in proprietary LLMs and the difficulty in verifying the generated data. We propose KgDG, a knowledge-guided data generation framework for legal reasoning. Our framework enables leveraging legal knowledge to enhance generation diversity and introduces a refinement and verification process to ensure the quality of generated data. Moreover, we expand the generated dataset to further enhance the LLM reasoning capabilities. Using KgDG, we create a synthetic legal reasoning dataset containing 50K high-quality examples. Our trained model LawGPT outperforms existing legal-specific LLMs and achieves performance comparable to proprietary LLMs, demonstrating the effectiveness of KgDG and LawGPT. Our code and resources is publicly available at https://github.com/LAMDASZ-ML/Knowledge-Guide-Data-Generation .
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。