Peking University officially released ChatLaw, a large Chinese legal model, and made it open source

According to the "Kechuangban Daily" report, the Peking University team recently released a Chinese legal model called ChatLaw, which aims to provide popular legal services to the public. This model supports receiving documents and voice input, and is capable of generating legal documents, providing legal advice, and recommending appropriate legal aid services to the user.

 

In order to develop this project, the Tuzhan Intelligence AIGC Joint Laboratory of Peking University Shenzhen Graduate School is based on a general-purpose ultra-large-scale model, using a large amount of structured text data in the legal field for training.

It is worth mentioning that the team also open sourced three models: ChatLaw-13B, ChatLaw-33B and ChatLaw-TextVec.

The launch of the ChatLaw project has received widespread attention and recognition. At present, the project has more than a thousand stars on GitHub, showing its popularity and potential influence in the legal technology field.

Of course, Peking University has also open sourced a large legal model, lawyer-llama, through training in large-scale legal corpus, and systematically learning China's legal knowledge system so that the model can master Chinese legal knowledge and apply it to Chinese legal practice.

 

Compared with the BELLE (Be Everyone's Large Language model Engine) model on the left side of the picture above, if you ask "China's legal age for marriage", you can see that Lawyer LLaMA gave a correct answer, which is more like Lawyer's answer. Moreover, even if the necessary legal provisions are provided, such as question B in the above picture, BELLE cannot give a correct answer, while Lawyer LLaMA answered this question well and professionally with reasons.

In fact, it can also be seen from BELLE's answer that many problems often arise when such a large model is directly placed in the professional vertical field. The author team believes that in order to make the large model well adapted to the special requirements of the legal field, it must The following three conditions must be met, namely:

1. Accurate expression, avoiding ambiguity: In the legal field, it is often the case that just changing a word will lead to a diametrically opposite result in the construction of legal relations. For example, there is only one word difference between deposit and deposit in Chinese, but its meaning is the same as legal Effect is quite different in the law of contract;

2. Understanding and distinguishing legal terms: In law, there are many unique and specific terms, many terms only appear in the legal field, such as the concept of legal person, and there are many more terms that may have different meanings in the legal field and the daily life field. With the same meaning, the model also needs to be distinguished;

3. Be able to understand the actual situation: In addition to having a basic understanding and systematic grasp of legal terms and legal analysis, the model should also have the ability to accurately understand real-life problems, that is, the model needs to have an ability to apply legal theory to solve specific problems core competence.

Based on the above theories, the author's team expects to solve the application of large models in the legal field through the following steps based on the open source LLaMA model:

1. Law-related knowledge injection: By collecting a large number of original texts in the legal field, such as legal provisions, judicial interpretations and national legal documents, the original model is continuously trained using new data;

2. Field-specific skill acquisition: A good legal large model should be able to solve common problems in the legal field, such as concept interpretation, case analysis and legal consultation, so the author collected a set of actual task cases and used ChatGPT to generate corresponding answers. Perform supervised fine-tuning so that the model has the ability to solve specific tasks in the legal domain;

3. Information retrieval alleviates hallucinations: In order to alleviate the problem of machine hallucinations in large models, the author also introduces an information retrieval module. Before generating each reply, it first uses the user's query and context to retrieve relevant legal provisions, and then based on these legal provisions to generate a corresponding response.

 

The author team successfully completed the construction of Lawyer LLaMA, and the overall operation process of Lawyer LLaMA is shown in the figure

 

 

Let's directly look at the effects given in the paper. For equal comparison, lawyer-llama is indeed much better from different angles.

The detailed code and installation steps are in the comment area, please pick it up yourself, please support us a lot.

Guess you like

Origin blog.csdn.net/xyk2000114/article/details/131551522