AB
AiBoss
project

LaWGPT - A Chinese Legal Language Model Developed by Nanjing University

LaWGPT is a large-scale Chinese legal language model developed by Nanjing University. It is based on the LLaMA model and undergoes secondary pre-training, incorporating a large amount of Chinese legal knowledge. Focusing on the legal field, it can understand and generate legal-related texts and is applicable to...

What is LaWGPT?

LaWGPT is a Chinese legal language model developed by Nanjing University. Based on the LLaMA model and pre-trained, it incorporates a wealth of Chinese legal knowledge. Focusing on the legal field, it can understand and generate law-related texts, making it suitable for various scenarios such as legal consultation, case analysis, and legal document generation. LaWGPT has multiple versions, including LaWGPT-7B-alpha and LaWGPT-7B-beta1.0. The model has been trained on massive amounts of Chinese legal texts and possesses a rich reserve of legal knowledge.

LaWGPT's main functions

  • Legal ConsultationUsers can consult LaWGPT on various legal issues, such as contract disputes, labor law issues, and intellectual property protection. Based on the user's questions, LaWGPT will provide corresponding legal interpretations and suggestions.
  • Legal document generationBased on text generation capabilities, it can assist lawyers and legal professionals in quickly generating legal documents such as contracts and complaints, thereby improving work efficiency.
  • Legal exam assistanceIt can be used to assist in preparing for the Chinese Judicial Examination by providing simulated exam questions and explanations to help candidates better understand and master legal knowledge.
  • Legal education and trainingIt can be used as a legal education tool to help students and teachers better understand legal knowledge and improve teaching effectiveness.
  • Intelligent Customer ServiceIt is applied in the field of intelligent customer service, automatically answering users' legal questions and improving customer service efficiency.

LaWGPT Technical Principles

  • InfrastructureLaWGPT is an extension and optimization based on general Chinese base models (such as Chinese-LLaMA, ChatGLM, etc.). It provides LaWGPT with powerful language generation and understanding capabilities.
  • Legal Terminology ExpansionTo better address legal issues, LaWGPT expands upon the specialized lexicon of the legal domain. The model can more accurately identify and understand legal terms and their contextual relationships, demonstrating a higher level of semantic understanding in legal texts.
  • Large-scale legal corpus pre-trainingLaWGPT was pre-trained using a large-scale Chinese legal corpus. The corpus includes legal documents, codes, and judicial cases, covering a wide range of content from the Constitution to local regulations. Through pre-training, the model learned the grammar, semantics, and context of legal language, enhancing its basic semantic understanding capabilities in the legal field.
  • Command fine-tuningBased on pre-training, LaWGPT underwent fine-tuning. The development team constructed a legal domain dialogue question-answering dataset and a Chinese judicial examination dataset, using these datasets to fine-tune the model, further improving its ability to understand and answer legal questions.
  • Knowledge-Guided Data Generation Framework (KGDG)LaWGPT employs a Knowledge-Guided Data Generation (KGDG) framework, which includes the following key components:
    • KGGENLegal documents are introduced as a knowledge base, and content containing questions and reasoning paths is generated through a knowledge-aware sampler and a knowledge-guided writer.
    • KGFIX and DAVERUsed to fix errors in inference paths and references, and to verify the quality of generated data.
    • MITRAGenerate standard question-answer pairs and question-answer pairs with clear reasoning paths to provide richer training data for the model.

LaWGPT project address

Application scenarios of LaWGPT

  • Legal ResearchLaWGPT helps researchers quickly find relevant laws, regulations, cases, and literature, accelerating the research process. It can help researchers quickly understand relevant laws and regulations, speeding up policy analysis.
  • Case AnalysisLaWGPT helps lawyers quickly understand complex case details and generate preliminary analysis reports. In judicial practice, lawyers and judges can refer to LaWGPT's accurate interpretation of relevant legal provisions and reasonable judgment suggestions generated based on extensive case analysis to quickly clarify case thinking and make fair and efficient judgments.
  • Policy ResearchLaWGPT can help researchers quickly find and understand relevant laws and regulations, accelerating policy analysis.