Establishment method and application of large-scale language model in legal field
The legal domain-specific large language model training method addresses the limitations of existing models by using data preprocessing and GRPO tuning, reducing costs and enhancing legal reasoning and accuracy for professional legal responses.
Patent Information
- Application Number
- CN202510347098.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-22
- Publication Date
- 2025-07-15
Smart Images

Figure CN120316211A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of large language models, and specifically to a method for establishing and applying a large language model in the legal field. Background Art
[0002] At present, the main way for domestic legal consultors to obtain legal consultation services is for the consultors to go to legal service institutions to inquire. Moreover, different consultors have a real-time understanding need for different legal issues, consultation directions, legal knowledge, and answers to legal questions that they are concerned about. In addition, with the development and progress of society, legal contents and regulations are also updated in real time, and legal workers also have the need to continuously learn new laws, regulations, and case precedents. Whether it is legal consultors or legal workers, the need for legal contents at any time and anywhere often cannot be met due to the strong professionalism of the law and the limited number of legal service personnel. In addition, the needs and discussions of relevant staff in the political and legal systems, such as lawyers, judges, prosecutors, police officers, and staff of the judicial bureau, etc., for the content, direction, and depth of Chinese laws are also different. Generally, the needs of different groups for legal knowledge are realized and learned by retrieving and querying relevant contents on the Internet. Especially in recent years, with the development and update of retrieval work and AI big data technology, retrieval tools and different types of databases have attracted more and more attention. However, the existing big data is generally of the general large language model type, which can provide general answers. In particular, it lacks training in professional legal content. Therefore, for legal questions raised by consultors in different legal environments and at different legal levels, there are often various situations where the retrieval results are unprofessional, unreliable, or even off-topic.
[0003] In the existing large-scale language model technology, although there has been a significant and rapid development in the processing of natural language, through in-depth exploration of the application of existing general large language models in the legal professional field, it is not difficult to find that first of all, these general large language models have not been particularly fully trained in the legal field, especially they have not learned the logic of legal language, the logic of the procuratorial organ's examination and prosecution, the trial logic of the court, and lack professional legal knowledge. Therefore, it is difficult to provide content that meets the professional and in-depth needs of the inquirers. Secondly, although there are some large language models related to law now, the existing models lack the training and presentation of the thinking logic process for the training method of legal large language models. As a result, although the existing models have legal knowledge, they cannot present the relevant legal thinking logic, and the answers provided cannot meet the requirements related to legal logic. At the same time, the lack of the thinking and argumentation process also makes the final conclusion difficult to convince legal inquirers, and it is also difficult for inquirers to test whether the answers of the large language model are accurate, whether further argumentation is needed, and when further argumentation is needed. Finally, for the legal professional workers related to the political and legal system, such as prosecutors, judges, etc., for the questions they want to understand deeply, the large language models trained by the existing legal large language model training technology can only answer from the perspective of ordinary inquirers or lawyers, and it is very difficult to output explanations that meet the needs of these professional groups. In addition, the existing large-scale language model technology requires a large amount of legal texts and computing power for the legal professional training of large language models, and the cost required is very high. Summary of the Invention
[0004] The purpose of the present invention is to overcome the defects of the existing technology and provide a new large-scale language model in the legal field.
[0005] The purpose of the present invention is also to provide a large-scale language model in the legal field, which solves the problems of too high training cost and lack of legal logic in the application of existing large language models in the legal field, and effectively solves the problems existing in the existing large-scale language models.
[0006] The purpose of the present invention is also to provide a fine-tuning training method and a method for preprocessing training data and an application of a large language model for multi-task and multi-angle learning.
[0007] To achieve the above purpose or one of the purposes, the technical solution of the present invention is as follows:
[0008] 1. A method for establishing a large language model in the legal field, and the establishment method includes the following steps:
[0009] S1. Preprocess the data in the legal field, and establish a legal large language model by training the preprocessed legal data;
[0010] S2. Pre-train the large language model for the legal field obtained in S1 so that the large language model generates a set of multiple answers to the input legal questions, including correct answers, wrong answers, correct answers with incorrect legal reasoning processes, and correct answers with correct legal reasoning processes. The answers of the model are tested by the output items with both correct legal reasoning processes and correct legal results. Scores are given based on whether the answers of the model are correct and whether they have correct legal reasoning processes. The scores of the answers are improved through multiple iterative trainings until the model meets the corresponding requirements.
[0011] S3. Fine-tune and train the large language model using the GRPO method to obtain a professional large language model for the legal field;
[0012] Furthermore, the process of preprocessing the legal field data includes the following steps:
[0013] S1. Obtain corresponding legal text data including laws, regulations, cases, etc. from sources such as the website of the National People's Congress of China, government websites at all levels, the Supreme People's Court, the Supreme People's Procuratorate, and the Judgments Online.
[0014] S2. Mark the obtained data and clarify the value of the data for various legal professional groups.
[0015] S3. Use legal professional knowledge to extract the behaviors and legal facts therein as input items for training, and classify the legal consequences and legal reasoning as output items for training so that the large language model can better receive and digest the data.
[0016] S4. Use legal professional knowledge and the general large language model to reduce the number of tokens of the input items to be less than a fixed value while retaining the important information content of the input items and streamlining other irrelevant information.
[0017] Furthermore, the process of fine-tuning and training the large language model using the GRPO method includes the following steps:
[0018] S1. Obtain the base model;
[0019] S2. Put the legal questions as input items, the legal reasoning processes and legal consequences as output items into the model for training to obtain a pre-trained large language model for the legal field;
[0020] S3. Examine the output of the model, and score each answer output by the model based on whether the output of the model conforms to the correct legal consequences, whether it has correct legal reasoning, and whether it conforms to the thinking of the professional group marked by the legal text;
[0021] S4. Repeat steps S2 and S3 to improve the overall score of the model answers until the score of the model answers meets the requirements. After that, a large language model for the legal field is obtained after the training is completed.
[0022] S5. Deploy the trained large language model in the legal field for application to support the legal tasks of customers and multiple professional groups.
[0023] Furthermore, the GRPO fine-tuning normalizes the scoring of the model's answers at the legal professionalism level using the following formula:
[0024]
[0025] Among them, r represents the score of the answer, mean(r) represents the group average score, and r i represents the score of the specific i-th answer;
[0026] At the same time, the following formula is used to improve the score of the model's answers and reduce the loss of model training:
[0027]
[0028] Among them, G represents the number of answers, β is the proportionality factor, and π θ is the existing strategy, and π ref is the reference strategy, and D is calculated according to the following formula KL [π θ ||π ref , which refers to the corresponding KL divergence:
[0029]
[0030] 2. An application of a large language model in the legal field, which applies the trained large language model in the legal field to specific legal issues and generates answers that meet the professional and vocational requirements, including the following steps:
[0031] S1. Input the prompt words and the case situation;
[0032] S2. Set the maximum number of tokens for the model input according to the character lengths of the input prompt words and the case situation;
[0033] S3. Run the large language model. According to the different prompt words, the large language model will output answers based on the positions of different legal professional groups.
[0034] In summary, due to the adoption of this technical solution, the beneficial effects of the present invention are as follows:
[0035] First, through the preprocessing process of big data in the legal field, the large language model trained with the data can use a more efficient group relative optimal algorithm (GRPO) to fine-tune and train the large language model in the subsequent processing. At the same time, through the preprocessing process of the training data, the resource occupation for subsequent model training is also reduced, and the video memory only needs to occupy about 50% of the existing technical methods. This not only facilitates more data training subsequently, but also improves the accuracy and professionalism of the model's answers. In addition, through the preprocessing process of the data, the accurate needs of each professional group for legal content can be distinguished in subsequent data training, making it more conducive for the legal large language model for subsequent data training to accurately output different retrieval results according to the needs of different legal professional groups.
[0036] Second, the present invention uses the preprocessed legal text data and then fine-tunes and trains it with GRPO. Compared with the general large language model, the question answers of the fine-tuned legal large language model are more professional at the legal level, more in line with legal logic, and present a more professional legal thinking process. Compared with the traditional LoRA fine-tuning technology, the GRPO fine-tuning technology reduces the training memory and computational burden required by the legal large language model by another 50%. That is, under the same data resource conditions, compared with the traditional LoRA fine-tuning technology that introduces a new database to test the model, the GRPO fine-tuning technology will double the number of model training times, and the accuracy and professionalism of the output content will also increase accordingly.
[0037] Third, the present invention makes the final question answers more in line with legal logic and more reasonable at the legal level by introducing a reward mechanism for the presentation of correct legal reasoning. The output result also has the display of the logical process, further meeting the customer's needs for the logical reasoning process. Customers can also check the model's answers from the legal logic level and can correct the content of the model's answers. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a schematic flow chart of data preprocessing in the present invention
[0039] Figure 2 It is a schematic diagram of using the GRPO fine-tuning technology to adjust the large language model in the legal field in the present invention DETAILED DESCRIPTION OF THE INVENTION
[0040] In order to clearly and completely describe the objectives, technical solutions of the present invention and make the advantages more clearly understood, the following further details the embodiments of the present invention with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are part of the embodiments of the present invention, rather than all of the embodiments, and are only used to explain the embodiments of the present invention, not to limit the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0041] Embodiment 1
[0042] A preprocessing method for training data of a legal large language model includes: obtaining corresponding legal text data including laws, regulations, cases, etc.; marking the obtained data to clarify the value of the data for various legal professional groups, extracting the behaviors, legal facts, legal consequences therein, and the legal reasoning that links the behavior facts with the legal consequences, using the behavior as the input item for training, and the legal consequences and legal reasoning as the output items for training; using legal professional knowledge and a general large language model to retain the important information of the input item (i.e., some behaviors and facts related to legal results in jurisprudence), streamline other irrelevant information, make the token number of the input item less than a certain value, and reduce the resources and time cost occupied by training.
[0043] As Figure 1 shown, when implementing this method, its main steps are as follows:
[0044] S1. Obtain the corresponding legal texts from sources such as the website of the National People's Congress of China, government websites at all levels, the Supreme People's Court, the Supreme People's Procuratorate, and the Judgments Online.
[0045] S2. Mark the value of the data for each legal professional group (such as lawyers, judges, prosecutors).
[0046] S3. Use professional knowledge to extract the input items and output items to be learned in the legal text and classify them so that the model can better receive and digest the data.
[0047] S4. Use professional knowledge and a general large language model to reduce the token number of the input item to a certain value while retaining the important information of the input item, reduce the resources and time occupied by model training (the occupied resources can be reduced by half), and improve the effect of model training in the same time.
[0048] The core technology of the above method lies in preprocessing the legal text data to be trained and learned through professional knowledge and general large language models, so that the data can be applicable to the GRPO fine-tuning technology for processing large language models in the legal field. At the same time, while retaining key information, the size of the input item data is reduced, thereby reducing the resources and time occupied by subsequent training, enabling the model to be trained more times within the same time, and thus improving the accuracy and professionalism of the answers of the trained model. In addition, by pre-labeling the data, the model learns the positions and thinking patterns of different legal professional groups.
[0049] Combined with Figure 1 the schematic diagram, the main steps of the method will be introduced in detail in this embodiment.
[0050] Step S1 of this embodiment is to obtain the corresponding legal text from relevant websites.
[0051] Step S2 of this embodiment is to mark the value of the data for each legal professional group according to the data source and the characteristics of the data itself. For example, for the guiding cases of the Supreme People's Procuratorate, according to its source from the Supreme People's Procuratorate and its characteristics (a large amount of space in the data is used to guide prosecutors, and the legal reasoning presented in the data is also from the perspective of prosecutors), mark its high value for prosecutors.
[0052] Step S3 of this embodiment is further data processing to adapt to fine-tuning the model through GRPO technology. Considering that questions and answers are required for fine-tuning the model, the GRPO technology needs to use answers and thinking processes to verify the output of the model. Here, first, the part of the legal document that can be used as a question needs to be extracted, which appears as assumptions and behavior patterns in legal articles and as case facts in judicial cases; second, the part of the legal document that answers needs to be extracted, which appears as legal consequences in legal articles and as the judgment results of the court in judicial cases. If the part that can be used as the thinking process needs to be extracted, it appears as the judge's reasoning in judicial cases.
[0053] Step S4 of this embodiment is to streamline the questions to reduce the training cost and training time. To achieve the purpose of saving time and labor costs, the publicly available general large language model (such as Deepseek V3) can be used to streamline the question items. By adjusting the prompt words, the general large language model retains important legal data while streamlining redundant and useless content, reducing the token number of the question items for subsequent fine-tuning training.
[0054] Embodiment 2
[0055] Based on Embodiment 1, Embodiment 2 provides a more efficient fine-tuning training method for a large language model for legal task learning for multiple professional groups, and this method needs to be completed using the data preprocessed in Embodiment 1.
[0056] As Figure 2 shown, when implementing this method, its main steps are as follows:
[0057] S1. After obtaining the base model, put the legal issues as input items, the legal reasoning process and legal consequences as output items into the model for training to obtain a pre-trained large language model for law;
[0058] S2. Examine the output of the model: Score each answer of the model output based on whether the output of the large language model conforms to the correct legal consequences, whether it has the correct legal reasoning, and whether it conforms to the thinking of the professional group marked by the legal text;
[0059] S3. Repeat S1 and S2 to improve the overall score of the model's answers until the score of the model's answers meets the requirements. After training is completed, a large language model for law is obtained;
[0060] S4. Deploy the trained large language model for law for application. The large language model can then support the legal tasks of customers and multiple professional groups.
[0061] The relevant literature on the existing GRPO algorithm only mentions its application in the mathematical field and does not show its application in fine-tuning large language models in the legal field. The core content of the method described in the present invention is to apply the GRPO algorithm in the process of fine-tuning the large language model for law, thereby reducing the cost of training the large language model for law, improving the accuracy and professionalism of the answers of the trained large language model for law, and at the same time presenting the legal reasoning process in the question answering.
[0062] The method described in the present invention reduces the resource occupation of the fine-tuned model by 90% through the GRPO algorithm, thereby making it possible to fine-tune and train the model only with a personal computer, and at the same time increasing the accuracy of the fine-tuned model by 30%.
[0063] Combined with Figure 2 the schematic, this embodiment will introduce each step of the method flow in detail.
[0064] In step S1 of this embodiment, the base model is trained using the data preprocessed in Embodiment 1. Here, the base model uses an existing public model (Qwen) to obtain a pre-trained large language model for law.
[0065] In step S2 of this embodiment, the answer items in the data, that is, the legal consequences and the court's judgment results and the legal reasoning thinking process, are used to examine a group of multiple answers of the pre-trained model and score them.
[0066] The scoring items include whether the answer is correct, whether it contains correct legal reasoning, whether it contains some pre-determined legal jargon, and whether it meets the requirements of legal professionalism. Each group of data is scored and normalized according to the following formula:
[0067] In this formula, r represents the score of the answer, mean(r) represents the group average score, and r i represents the score of the specific i-th answer.
[0068] In step S3 of this embodiment, the legal large language model is iteratively trained, and the answers of the trained model are continuously examined and scored using the answer items and the thinking process. By iterative training (for example, iterating 1000 times), the score of the model's answer is improved, enabling the score of the model's answer to meet the requirements of professionalism and accuracy, while also having a correct thinking process.
[0069] The following algorithm formula is used here to improve the score of the model's answer and reduce the loss (Loss) of model training.
[0070]
[0071] In this formula, G represents the number of answers, and β is the proportionality factor. π θ is the existing strategy, and π ref is the reference strategy. D KL [π θ ||π ref refers to the corresponding KL divergence, which is calculated according to the following formula:
[0072]
[0073] In step S4 of this embodiment, according to the actual business requirements, corresponding components can also be added to the trained legal large language model to enable it to complete tasks more professionally. The added components can include a database and RAG. RAG stands for Retrieval-Augmented Generation, aiming to enhance the generation ability of the large language model in this legal field by retrieving legal-related information from external knowledge sources.
[0074] In summary, the present invention not only overcomes the key challenges existing in the prior art, such as high training and adaptation costs, inefficient task role adaptation, etc., but also extends the more efficient GRPO algorithm, which is only publicly applied in the mathematical field, to the legal field, opening up a new path to more intelligent, personalized, low-cost and high-efficiency legal services. This method has wide applicability and important practical value, and shows great potential in promoting the development of legal technology.
[0075] Embodiment 3
[0076] This embodiment is a demonstration of the use of a large language model in the legal field. For example, "A judgment is made based on the following case: Defendant A, male, was an adult when he committed the crime and was detained on suspicion of kidnapping. Defendant A had the intention of kidnapping children and extorting money from parents due to financial constraints, and he scouted and searched for the kidnapped person many times. One afternoon, A saw a girl named B passing by alone with a schoolbag on her back, so he tricked B into getting on the bus on the pretext that "the teacher is looking for you" and then put her in a plastic bathtub. That night, after A tricked B into giving him her father's mobile phone number and home phone number, he killed B by covering her mouth and nose and then buried her. Afterwards, A fled the scene of the crime by train, called B's home, and said that he had kidnapped B and asked B's father to bring 6 children to the car before 6 pm five days later. 00,000 yuan ransom to the agreed place to exchange his daughter. Afterwards, A took a train to another place to make extortion calls. Because he lost the note recording the phone calls, he remembered the wrong phone number of the victim's family. After the call was connected, he heard that the person who answered the phone had an accent different from that of the victim B's father. Therefore, A suspected that the public security personnel had intervened and stopped the extortion. Later, A was arrested by the public security organs. A confessed the kidnapping and murder process and led the public security personnel to identify the burial site. The public security organs seized a corpse and extracted two hairs of B from his car (forensic DNA testing confirmed that they were the corpse and hair of the victim B). The public security organs seized from the defendant A a mobile phone that he used to make extortion calls.
[0077] The content in the above quotation marks is input into the legal language model established by the present invention for query, and the result obtained is as follows:
[0078] According to the case description provided, the defendant A's behavior constitutes serious criminal offenses, including kidnapping and intentional homicide. The following is an analysis of the case and possible legal judgment:
[0079] 1. Criminal conduct:
[0080] A intended to make a profit by kidnapping children and extorting money from their parents, and he planned to scout the area and look for the people to be kidnapped.
[0081] He lured B into his car under the pretext of "the teacher is looking for you", illegally detained him and took him to several locations, eventually leading to B's death.
[0082] In order to extort a ransom, A called B's family several times, staged a kidnapping incident, and demanded a huge ransom.
[0083] 2. **Nature of crime**:
[0084] According to the case, A's behavior not only included illegally detaining others, but also caused the death of the victim. The nature of his crime was serious and the impact was bad.
[0085] His actions constituted the crimes of kidnapping (for illegally detaining others) and intentional homicide (for causing the death of the victim).
[0086] 3. **Legal ruling**:
[0087] According to Article 238 (kidnapping) and Article 232 (intentional homicide) of China's Criminal Law, A's behavior should be severely punished according to law.
[0088] According to relevant legal provisions, the judgment should take into account the severity and consequences of the criminal act, as well as the subjective malice of the defendant and other factors. Normally, for such cases involving child kidnapping and resulting in death, the law will impose the most severe punishment, including the possibility of the death penalty. In summary, according to the description of the case, A's behavior is extremely bad and should be severely punished according to law. The specific judgment shall be made by the People's Court after trial in accordance with the law, and may be sentenced to death and deprived of political rights for life. This reflects the law's crackdown on such serious crimes, and also warns the society of the potential harm of similar crimes. This is the answer of the initially trained model.
[0089] The answer after inputting the content in the above quotation marks into the general large language model for retrieval is:
[0090] Qwen 2.57B:
[0091] According to the description of the case, the defendant A's behavior constitutes the crime of intentional homicide and kidnapping. Combined with the specific circumstances of the case, the following judgment can be made:
[0092] A intentionally and illegally deprived another person of his life, resulting in the death of one person, and should bear the responsibility for intentional homicide;
[0093] If A kidnaps another person in order to extort money or property, he should also bear the responsibility for the crime of kidnapping.
[0094] According to the relevant provisions of my country's Criminal Law, for intentional homicide, if the means of committing the crime are extremely cruel and the circumstances are serious, the death penalty can be imposed. For kidnapping, a fixed-term imprisonment is generally imposed, and a fine or confiscation of property may be imposed. Taking into account the criminal circumstances of defendant A in this case (including but not limited to the motive, means, and consequences of the crime, etc.), as well as his performance after being arrested (confessing truthfully, having a good attitude towards confession, etc.), the court may make the following judgment:
[0095] Defendant A was convicted of intentional homicide and sentenced to death with deprivation of political rights for life; convicted of kidnapping and sentenced to 15 years in prison with confiscation of all personal property. The two crimes were combined and the decision was made to execute the death penalty, deprive him of political rights for life, and confiscate all personal property.
[0096] At the same time, the court will confiscate a mobile phone used as a tool of crime seized from the defendant in accordance with the law.
[0097] It should be noted that the final judgment still needs to be determined by the court after legal trial, and the above content is for reference only.
[0098] As can be seen from Example 3, in the answer results of the legal large language model established by using the present invention, there is a thinking process and specific legal provisions are cited and analyzed, which is essentially different from the retrieval content output by the general large language model.
[0099] Therefore, the present invention makes the answered questions more in line with legal logic and more reasonable at the legal level by introducing a reward mechanism for the presentation of correct legal reasoning. Moreover, the output result also has a display of the thinking logic process, further meeting the customer's need for the logical reasoning process. The customer can also check whether the logical reasoning process of the model is correct from the legal logic level and can correct the answer content of the model.
Claims
1. A method for establishing a large language model in the legal field, characterized in that, The method for establishing a large language model in the legal field includes the following steps: S1. Preprocess the legal field data and establish a legal large language model by training the preprocessed legal data; S2. Pre-train the legal field large language model obtained in S1 so that the large language model generates a set of multiple answers to the input legal questions, including correct answers, wrong answers, correct answers with incorrect legal reasoning processes, and correct answers with correct legal reasoning processes. Examine the model's answers through the output items with correct legal reasoning processes and correct legal results. Score the model's answers based on whether the answers are correct and whether they have correct legal reasoning processes. Improve the score of the answers through multiple iterative trainings until the model meets the corresponding requirements; S3. Fine-tune and train the large language model using the GRPO method to obtain a professional legal field large language model.
2. The method for establishing a large language model in the legal field according to claim 1, characterized in that The process of preprocessing the legal field data includes the following steps: S1. Obtain corresponding legal text data including laws, regulations, cases, etc. from sources such as the website of the National People's Congress of China, government websites at all levels, the Supreme People's Court, the Supreme People's Procuratorate, and the Judgments Online; S2. Mark the obtained data and clarify the value of the data for various legal professional groups; S3. Use legal professional knowledge to extract the behaviors and legal facts therein as input items for training, and classify the legal consequences and legal reasoning as output items for training so that the large language model can better receive and digest the data; S4. Use legal professional knowledge and a general large language model to reduce the number of tokens of the input items to less than a fixed value while retaining the important information content of the input items and streamlining other irrelevant information.
3. The method for establishing a large language model in the legal field according to claim 1, characterized in that, The process of fine-tuning and training the large language model using the GRPO method includes the following steps: S1. Obtain the base model; S2. Put the legal questions as input items, the legal reasoning processes and legal consequences as output items into the model for training to obtain a pre-trained legal field large language model; S3. Examine the output of the model and score each answer output by the model based on whether the output of the model conforms to the correct legal consequences, whether it has correct legal reasoning, and whether it conforms to the thinking of the professional group marked by the legal text; S4. Repeat steps S2 and S3 to improve the overall score of the model's answers until the score of the model's answers meets the requirements. After that, a legal field large language model is obtained after training is completed; S5. Deploy the trained legal field large language model for application to support the legal tasks of customers and multiple professional groups.
4. The steps of fine-tuning and training a large language model according to claim 3, characterized in that, The GRPO fine-tuning normalizes the scoring of the model's answers at the legal professionalism level using the following formula: where r represents the score of an answer, mean(r) represents the group average score, and r i represents the score of the specific i-th answer; At the same time, use the following formula to improve the score of the model's answers and reduce the loss of model training: where G represents the number of answers, β is the scaling factor, and π θ is the existing policy, and π ref is the reference policy. D is calculated according to the following formula KL [π θ ||π ref , which refers to the corresponding KL divergence:
5. An application of a large language model in the legal field, characterized in that, Apply the trained legal field large language model to specific legal questions to generate answers that meet the professional and vocational requirements, including the following steps: S1. Input the prompt words and the case situation; S2. Set the maximum number of tokens for model input according to the character lengths of the input prompt words and the case situation; S3. Run the large language model. Depending on the different prompt words, the large language model will output answers from the perspectives of different legal professional groups.