{"id":13440522,"url":"https://github.com/PKU-YuanGroup/ChatLaw","last_synced_at":"2025-03-20T10:31:24.320Z","repository":{"id":176874695,"uuid":"650600874","full_name":"PKU-YuanGroup/ChatLaw","owner":"PKU-YuanGroup","description":"ChatLaw：A Powerful LLM Tailored for Chinese Legal. 中文法律大模型","archived":false,"fork":false,"pushed_at":"2025-01-04T15:29:26.000Z","size":11499,"stargazers_count":7086,"open_issues_count":61,"forks_count":555,"subscribers_count":39,"default_branch":"main","last_synced_at":"2025-02-01T09:15:43.450Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://chatlaw.cloud/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PKU-YuanGroup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-07T12:12:18.000Z","updated_at":"2025-02-01T08:42:05.000Z","dependencies_parsed_at":"2023-07-01T13:00:57.776Z","dependency_job_id":"f905bb60-f2a7-4ae6-9395-551b75e11c5d","html_url":"https://github.com/PKU-YuanGroup/ChatLaw","commit_stats":{"total_commits":66,"total_committers":7,"mean_commits":9.428571428571429,"dds":"0.40909090909090906","last_synced_commit":"fbb88bc80120609b936b2fdc75dded6ee1b3f450"},"previous_names":["pku-yuangroup/chatlaw"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PKU-YuanGroup%2FChatLaw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PKU-YuanGroup%2FChatLaw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PKU-YuanGroup%2FChatLaw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PKU-YuanGroup%2FChatLaw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PKU-YuanGroup","download_url":"https://codeload.github.com/PKU-YuanGroup/ChatLaw/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244594971,"owners_count":20478382,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:01:23.536Z","updated_at":"2025-03-20T10:31:24.314Z","avatar_url":"https://github.com/PKU-YuanGroup.png","language":null,"funding_links":[],"categories":["Others","🤖 模型","A01_文本生成_文本对话","Legal AI Models \u0026 Embeddings","大语言模型LLMs","Applications","Repos","大模型列表"],"sub_categories":["🧩 领域模型","大语言对话模型及数据","Large Language Models (LLMs)","提示语（魔法）"],"readme":"# Chatlaw: A Large Language Model-based Multi-Agent Legal Assistant Enhanced by Knowledge Graph and Mixture-of-Experts. \n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/PKU-YuanGroup/ChatLaw\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/PKU-YuanGroup/ChatLaw/main/images/logo.png\" width=\"50%\"\u003e\n  \u003c/a\u003e\n  \u003cp align=\"center\"\u003e\n      \u003ca href=\"https://arxiv.org/pdf/2306.16092.pdf\"\u003e\u003cstrong\u003earXiv\u003c/strong\u003e\u003c/a\u003e\n        ·\n      \u003ca href=\"https://huggingface.co/PandaVT/ChatLaw2-Moe\"\u003e\u003cstrong\u003eHuggingFace\u003c/strong\u003e\u003c/a\u003e\n    \u003c/p\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n# ChatLaw Models\n\n## ChatLaw2-MoE\n\n- **Latest Version**: Based on the InternLM architecture with a 4x7B Mixture of Experts (MoE) design.\n\n- **Specialization**: Tailored for Chinese legal language processing、\n\n## ChatLaw-13B\n\n- **Demo Version**: Built on the Ziya-LLaMA-13B-v1 model.\n- **Performance**: Excels in general Chinese tasks but requires a larger model for complex legal QA.\n\n## ChatLaw-33B\n\n- **Demo Version**: Utilizes the Anima-33B model.\n- **Enhancements**: Improved logical reasoning over the 13B version.\n- **Challenge**: Occasionally defaults to English responses due to limited Chinese training data in Anima.\n\n## ChatLaw-Text2Vec\n\n- **Function**: A text similarity model trained on 93,000 court case decisions.\n- **Capability**: Matches user queries to pertinent legal statutes, offering contextual relevance.\n- **Example**: Connects questions about loan repayment to the appropriate sections of contract law.\n\n\n## Introduction\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/PKU-YuanGroup/ChatLaw/chatlaw2/assert/main.jpg\" style=\"width=40%;\"/\u003e\u003c/div\u003e\n\nAI legal assistants, powered by Large Language Models (LLMs), offer accessible legal consulting. However, the risk of hallucination in AI responses is a concern. This paper introduces ChatLaw, an innovative assistant that employs a Mixture-of-Experts (MoE) model and a multi-agent system to enhance reliability and accuracy in AI legal services. By integrating knowledge graphs and artificial screening, we've created a high-quality legal dataset for training the MoE model. This model leverages various experts to address a range of legal issues, optimizing legal response accuracy. Standardized Operating Procedures (SOPs), inspired by law firm workflows, significantly minimize errors and hallucinations.\n\nOur MoE model outperforms GPT-4 in the Lawbench and Unified Qualification Exam for Legal Professionals, achieving a 7.73% higher accuracy and an 11-point lead, respectively. It also surpasses other models in real-case consultations across multiple dimensions, showcasing robust legal consultation capabilities.\n\n---\n\n### Multi-Agents Collaboration Process and Legal Consultation Report\n\nThe diagram below illustrates the collaborative process of multiple agents in providing legal consultation services, exemplified by a divorce consultation. The process involves gathering information, legal research, comprehensive advice, and culminates in a detailed Legal Consultation Report.\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/PKU-YuanGroup/ChatLaw/chatlaw2/assert/fig3.jpg\" style=\"width=40%;\"/\u003e\u003c/div\u003e\n\n# Dataset\n\n## Data Visualization and Performance Comparison\n\n(a) Our legal dataset covers a diverse range of tasks, from case classification to public opinion analysis.\n\n(b) ChatLaw demonstrates superior performance across multiple legal categories compared to other models.\n\n(c) ChatLaw consistently outperforms other models in legal cognitive tasks, as shown in the Lawbench comparison.\n\n(d) ChatLaw maintains high performance across five years on the Unified Qualification Exam for Legal Professionals.\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/PKU-YuanGroup/ChatLaw/chatlaw2/assert/fig1.jpg\" style=\"width=40%;\"/\u003e\u003c/div\u003e\n\n# Experiments\n\n## Evaluation of Legal Consultation Quality and Model Performance\n\n(a) Legal consultation quality is assessed based on Completeness, Logic, Correctness, Language Quality, Guidance, and Authority.\n\n(b) ChatLaw achieves the highest scores across all criteria, particularly excelling in Completeness, Guidance, and Authority.\n\n(c) ChatLaw shows a higher win rate compared to other models, indicating superior capability in providing high-quality legal consultations.\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/PKU-YuanGroup/ChatLaw/chatlaw2/assert/fig2.jpg\" style=\"width=40%;\"/\u003e\u003c/div\u003e\n\n## Truthful QA Evaluation\n\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/PKU-YuanGroup/ChatLaw/chatlaw2/assert/truthfulqa.jpg\" style=\"width=40%;\"/\u003e\u003c/div\u003e\n\n##  Usage\n\nFind the model at: [ChatLaw2-MoE](https://huggingface.co/PandaVT/ChatLaw2-MoE)\n\n\n```\n@misc{cui2024chatlaw,\n      title={Chatlaw: A Multi-Agent Collaborative Legal Assistant with Knowledge Graph Enhanced Mixture-of-Experts Large Language Model}, \n      author={Jiaxi Cui and Munan Ning and Zongjian Li and Bohua Chen and Yang Yan and Hao Li and Bin Ling and Yonghong Tian and Li Yuan},\n      year={2024},\n      eprint={2306.16092},\n      archivePrefix={arXiv},\n      primaryClass={cs.CL}\n}\n@misc{ChatLaw,\n  author={Jiaxi Cui and Zongjian Li and Yang Yan and Bohua Chen and Li Yuan},\n  title={ChatLaw},\n  year={2023},\n  publisher={GitHub},\n  journal={GitHub repository},\n  howpublished={\\url{https://github.com/PKU-YuanGroup/ChatLaw}},\n}\n```\n\n\n\n\n\n## Star History\n\n[![Star History](https://api.star-history.com/svg?repos=PKU-YuanGroup/ChatLaw\u0026type=Date)](https://star-history.com/#PKU-YuanGroup/ChatLaw\u0026Date)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPKU-YuanGroup%2FChatLaw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPKU-YuanGroup%2FChatLaw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPKU-YuanGroup%2FChatLaw/lists"}