Method for intelligent agent simulation court trial based on large language model and debate judgment mode

By constructing a legal document library, a factual evidence library and an argument summary library, it provides legal basis and factual analysis for agents, and adopts a collaborative confrontation framework and a debate-based judgment model to solve the structural hallucinations, sparse information and bias problems that LLM exist in the mock court, achieving more accurate debate and fair judgment.

CN120297313APending Publication Date: 2025-07-11SOUTHEAST UNIV
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202510227450.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

The Big Language Model (LLM) has structural hallucinations in mock courts, generates unreal content, cannot accurately cite articles and strictly argue legal reasoning, and in many rounds of debates, information perception is sparse and role drifting, affecting the accuracy and fairness of the debate.

Method used

Build a legal document library, a factual evidence library and an argument summary library to provide legal basis and factual analysis for agents; use a framework of collaborative confrontation to enhance debate ability; eliminate bias through a debate-style judgment model to ensure the fairness of the judgment results.

Benefits of technology

It improves the accuracy and impartiality of debate in mock courts, enhances the debate ability of the agent, and ensures the fairness and rationality of the final judgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120297313A_ABST
    Figure CN120297313A_ABST
Patent Text Reader

Abstract

The invention discloses an agent simulation court trial method based on a large language model and a debate judgment mode, and the method comprises the steps: firstly, setting a simulation court process based on a real world court trial link, then dividing roles in a court into three groups, i.e., a judge, a plaintiff and a defendant, constructing a collaborative confrontation framework, and carrying out the cooperative confrontation of the court; the method comprises the following steps of: firstly, defining function details of each role, then constructing a legal provision library, a fact evidence library and an argument abstract library in two links of court investigation and court debate, providing a law basis and fact analysis for dialectical lawyers, and finally, requiring two dialectical judges to debate a judgment result according to a previous court record based on a debate judgment mode so as to obtain a judgment result of the dialectical lawyers. And biases are eliminated by integrating viewpoints of all parties, and a final judgment result is obtained. Experiments show that the method has high overall performance on the task of simulating a court by using the intelligent agent, the debate ability of the intelligent agent can be effectively enhanced, and the fairness of a trial result is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular, to a method for intelligent agent mock court trial based on large language models and adversarial judgment models. Background Art

[0002] Competitive debate is an adversarial activity centered around ideological collision and logical deduction, playing a crucial role in fields such as education, law, and politics. As a structured intellectual activity, competitive debate is of great significance for cultivating abilities such as critical thinking, logical reasoning, argument analysis, and refutation skills, and thus is widely applied in educational teaching scenarios. With the development of computer technologies such as artificial intelligence, people have begun to strive to transform complex human argumentation processes into computable forms to achieve automatic argumentation, thereby assisting in decision-making in fields such as legal reasoning and public policies. Among them, the mock court, as a classic scenario of competitive debate, has gradually attracted the attention of researchers. Analyzing and demonstrating each court procedure through artificial intelligence agents helps improve the efficiency of legal practice. However, since agents must collect and analyze information from vague, long-term, and multi-round debate texts, and most existing research on legal scenarios focuses on short texts, such as charge prediction and legal consultation, it is still challenging to use AI agents to simulate the entire court process.

[0003] Large language models (LLMs) such as ChatGPT have been proven to demonstrate excellent performance in a wide range of natural language understanding tasks. Due to their excellent reading comprehension and text generation capabilities, many researchers have begun to apply them to interactively simulate human behavior. Research shows that LLMs can deeply explore complex human behavior patterns and their interactions with the environment, and exhibit certain psychological traits, including confrontation, trust, disguise, etc. In addition, LLMs can also achieve self-evolution through means such as experience acquisition and memory update, reflecting the ability of agents to acquire and improve skills and knowledge like humans. These advancements make LLMs agents show promising application prospects in simulating human interactive behavior.

[0004] Nonetheless, moot court remains a challenging scenario for LLMs. First, LLMs generate some untrue and fictional content. Researchers have found that LLMs have a structural hallucination problem. However, in the process of mock trials, the use of precise legal language is required, which not only involves the accurate citation of articles, but also needs to consider the specific circumstances of the case and strict legal reasoning. Second, multi-round debates require the model to not only have rich legal expertise, but also deeply understand the inference logic of both sides' lawyers in order to organize arguments. However, the limited context length of LLMs restricts the amount of information that can be conveyed in a single instance. As the number of debate rounds increases, the perception of historical information by LLMs becomes sparser and may even exhibit role drift, that is, confusing the role it plays and thus changing its own position, leading to chaos in the debate. Therefore, how to enable the agent to effectively present persuasive debate views and consistently maintain its own position is a major challenge for the agent to achieve a moot court. In addition, due to the wide range of training data sources for LLMs and the inevitable inclusion of human social biases, LLMs may exhibit certain biases in the moot court, which in turn affects the fairness of the trial results. There is a lack of attention to this aspect in existing work.

[0005] To address the above challenges, the present invention proposes a method for intelligent agent moot court trials based on large language models and a debate-based judgment mode. This method establishes a legal provision library, a factual evidence library, and an argument summary library. By retrieving information to query the most relevant legal provisions, the agent's statements are based on the law, alleviating the problem of knowledge hallucination. The present invention constructs a framework that combines cooperation and confrontation to enhance the agent's debate ability. In this framework, three agents are respectively configured for the plaintiff team and the defendant team. Each agent within the team has a clear division of labor and cooperates with each other to generate an overall debate view by combining information from different dimensions. At the same time, confrontation is emphasized between the plaintiff and the defendant, requiring them to express their arguments in a "tit-for-tat" state, which enhances the agent's in-depth thinking ability. In addition, the present invention designs a debate-based judgment mode, requiring two agents to debate the judgment result based on the previous court records, eliminating biases by integrating various viewpoints, and obtaining the final judgment result. This mode maximally eliminates the internal biases existing in the model and ensures the fairness of the final judgment result. Summary of the Invention

[0006] Technical problem: The technical problem to be solved by the present invention is that the large language model (LLM) itself has a structural hallucination problem, which will generate some untrue and fictional content, affecting the accuracy of the simulated trial process, including the accurate citation of articles and the strict demonstration of legal reasoning; in the multi-round debates in court, the limited context length of the LLM limits the amount of information that can be conveyed in a single time. As the number of debate rounds increases, the LLM's perception of historical information becomes sparser and may even exhibit role drift, that is, confusing the role it plays and thus changing its own position, leading to chaotic debates and being unable to consistently maintain its own position; due to the wide range of sources of the LLM's training data and inevitably containing biases in human society, the LLM may show certain biases in the simulated court, thus affecting the fairness of the trial result. The present invention provides a method for intelligent agent simulated court trial based on large language model and debate-based judgment mode.

[0007] Technical solution: The technical solution adopted by the present invention to solve its technical problem is: a method for intelligent agent simulated court trial based on large language model and debate-based judgment mode. The method first sets up the simulated court process based on the trial process in the real world court. Then, the roles in the court are divided into three groups: judges, plaintiffs, and defendants, to construct a framework of cooperation and confrontation, and define the detailed functions of each role to accurately simulate and reproduce the litigation scenario and enhance the debate ability of the intelligent agent. At the same time, a finite state machine is adopted to control the simulated court trial process to ensure the strict consistency of the simulated process. Next, in the two links of court investigation and court debate, a legal article library, a factual evidence library, and an argument summary library are constructed to provide legal basis and factual analysis for defense lawyers. Finally, based on the debate-based judgment mode, two judge debaters are required to debate on the judgment result according to the previous court records, eliminate biases by integrating the views of all parties, and obtain the final judgment result.

[0008] The method for intelligent agent simulated court trial based on large language model and debate-based judgment mode of the present invention includes the following steps:

[0009] 1) Based on the trial process in the real world court, set up the simulated court process;

[0010] 2) Divide the roles in the court into three groups: judges, plaintiffs, and defendants, and construct a framework of cooperation and confrontation

[0011] to accurately simulate and reproduce the litigation scenario.

[0012] 3) For the court process set in step 1), adopt a finite state machine to control the simulated court trial process to ensure the strict consistency of the simulated process;

[0013] 4) During the two sessions of court investigation and court debate, a legal provision library, a factual evidence library, and an argument summary library are constructed to provide legal basis and factual analysis for defense lawyers.

[0014] 5) Based on the adversarial judgment model, two adversarial judges are required to debate the judgment result according to the previous court records, eliminate biases by integrating various viewpoints, and obtain the final judgment result.

[0015] As a further improvement of the present invention, in step 1), the present invention follows the trial process of the real-world court, and sets the simulated court process as four sessions: court investigation, proof presentation and cross-examination, court debate, and final statement. Each session is sequentially labeled as t j ∈T = t i , t e , t d , t s , and each session consists of multiple rounds of speeches. The set of agents is represented as One of the agents is represented as A, and r is used to represent the current round. Then the behavior of the agent in the r-th round of t j is represented as What an agent says to others is called a response, represented by m k , and what an agent hears from others is called an observation. In addition, the relevant information involved when the agent generates a response is called memory, which are represented as R, O, and M respectively. Let message = {response, observation, memory}. The process session and the state transition method are as follows:

[0016]

[0017] Among them, represents the power set of the message set, used to characterize the complete possibility space of messages in each session. N represents the number of rounds of the conversation. represents the information density mapping function, used to quantify the information density of each session, and ensure that the information inheritance I(t j+1 ) satisfies:

[0018]

[0019] Among them, Info(·) represents the information entropy measurement function, used to evaluate the amount of information in a single round of speech, that is, the Shannon entropy. α represents the information decay coefficient, used to control the retention ratio of cross-session information inheritance. λ represents the time decay factor, used to dynamically adjust the weight of historical round information. R j is the total number of conversation rounds.

[0020] As a further improvement of the present invention, in step 2), considering that in the real world, whether it is the plaintiff, the defendant or the judge, the decision-making usually reaches an agreement through private discussions. Therefore, in order to maintain the order of the court, among the three agents of the judge, the plaintiff and the defendant set by the present invention, only one agent responsible for speaking in each group of roles is completely transparent, that is, the speech of this agent is visible to all agents in the environment. Except for the agent responsible for speaking, the behaviors of the remaining agents are only visible within their own groups.

[0021] As a further improvement of the present invention, in step 2), in order to provide a legal basis for the defense lawyers of the plaintiff and the defendant, the present invention introduces an agent of legal regulations searcher. The legal regulations searcher queries the legal regulations library according to the case fact information f j

[0022] and analyzes the involved laws in combination with the law-related behaviors, and finally sorts out a case legal analysis material to provide to the defense lawyer to provide a legal basis for his speech, which is formally expressed as:

[0023]

[0024] Among them, represents the candidate relevant legal articles, search(·) represents the search function, and the BM25 (Best Matching 25) retrieval algorithm is used in this solution. BM25 is a ranking function in information retrieval, which is used to estimate the relevance between a document and a given search query.

[0025] As a further improvement of the present invention, in step 2), since the court debate session requires a deep understanding of the logical thinking of the opponent's debate, the viewpoints should firmly maintain one's own position around the focus of the dispute, and even sharply attack the loopholes in the opponent's argument to obtain the maximum benefit. Therefore, in order to provide auxiliary support for the defense lawyers of the plaintiff and the defendant in the court debate session, the present invention introduces an agent of strategy analyst, which is responsible for thinking and reasoning about the information in the fact evidence library and the argument summary library through a chain of thought, elaborating on the arguments, summarizing the evidence, and generating a debate strategy thinking material to guide the defense lawyer to make a debate speech, thereby enhancing the logic of the agent's debate.

[0026] As a further improvement of the present invention, in step 2), the present invention constructs a framework that combines cooperation and confrontation. The plaintiff team and the defendant team are respectively configured with three agents, namely, the defense lawyer, the legal regulations searcher, and the strategy analyst. Each agent within the team has a clear division of labor and cooperates with each other to generate an overall debate viewpoint by combining information from different dimensions; at the same time, emphasis is placed on confrontation between the plaintiff and the defendant, and they are required to express their viewpoints in a "tit-for-tat" state to further enhance the in-depth thinking ability of the agents.

[0027] As a further improvement of the present invention, in step 3), in order to ensure the strict consistency of the simulation process, the present invention adopts a finite state machine to control the trial process of the mock court. The present invention defines a state set S = {s1, s2, s3, s4}, where each state corresponds to each link of the above court process in sequence. A prompt instruction corresponding to each link is written in each state, so as to guide the agent to speak in accordance with the court order norms. In order to guide the smooth handover of each link, the present invention defines an event set E for the end of the state, where E i represents the end event of state s i , and E = {E1, E2, E3, E4}. When each link ends, the presiding judge is required to read out the corresponding end prompt word for the link, and use rule matching to detect the end of the state. If the corresponding flag output appears in the response of the presiding judge, the state transition is executed and enters the next link. The formal description is as follows:

[0028]

[0029] Let the event monitoring function be M, which is used to detect whether the response of the presiding judge contains the corresponding end prompt word, and is defined as follows:

[0030] M: Response → {True, False}

[0031] If M(response) = True, the corresponding end event E i is triggered and the state transition T(s i , E i ) to s i+1 is executed.

[0032] As a further improvement of the present invention, in step 4), the present invention constructs a legal article library, and queries the most relevant legal articles through information retrieval so that the agent's speech is based on the law, and assists the legal searcher to generate case legal analysis materials as the subsequent overall legal basis information for one's own side. Specifically, first define the legal article library where each is a structured representation of a legal article. Use the Embedding model f embed : to map each to a d-dimensional vector space, obtain the article vector and store all the article vectors in the FAISS vector database. Then the present invention requires the legal searcher to raise three questions regarding the details of the case from one's own side to form a question set Q = {q1, q2, q3}, and each q in the question set jIt should focus on the details of the case, aiming to hit the points of its own interests and point out the faults of the other party as much as possible. Use the same Embedding model f embed Map the question set Q to the vector space to obtain a vector set q1, q2, q3, where q j = f embed (q j ). For each question vector q j , find the n most similar legal provision vectors s i in the FAISS database, that is, find the provisions that satisfy the following formula:

[0033]

[0034] Thus, obtain the n most relevant provisions for each question q j Finally, instruct the legal searcher to analyze the association between the case behavior and the retrieved legal provisions and output it to the defense lawyer of one's own side. This legal analysis material of the case will provide a legal basis for the defense lawyer's speech in the subsequent links.

[0035] As a further improvement of the present invention, in step 4), in order to solve the problem that as the number of rounds of debate increases in the court debate session, the model may have a role drift phenomenon, making its own argument unclear, the present invention constructs a factual evidence base and an argument summary base, and forms the Memory of the intelligent agent with them, which is used to provide long-term storage during the debate. Specifically, the factual evidence base stores the factual detail information between the court investigation and the cross-examination of evidence, and the argument summary base records the arguments and evidence of both sides of the debate, both of which are obtained by the strategy analyst analyzing and extracting the speeches of both sides. The strategy analyst can query and obtain content from the two bases at any time or add new content. In order to enhance the logical reasoning ability of the LLM in multi-round debates, the strategy analyst obtains information from the factual evidence base and the argument summary base to perform argument analysis, focusing on decomposing the content of the debate viewpoints, such as how the arguments influence each other and what evidence is introduced to corroborate, etc., and then gives targeted suggestions for the debate ideas in the current round.

[0036] ​As a further improvement of the present invention, in step 5), in order to eliminate the possible bias problem of the LLM in the mock court and ensure the fairness of the trial process, the present invention proposes a debate-based judgment. Two judge debaters J1 and J2 debate with each other to obtain the judgment result. When the plaintiff and the defendant complete their final statements in the final statement session, a debate scenario is set up. The topic of the debate is which party wins the lawsuit based on the previous court trial records. The two judge debaters stand on the positions of supporting the plaintiff's victory or the defendant's victory respectively, and separately put forward and jointly debate their responses and reasoning processes around each litigation request in the plaintiff's complaint in turn, in order to obtain a reasonable judgment result. By initiating a round of debate, the agent needs to incorporate the responses from other parties into the information window, re-examine and improve its own debate content, and promote the agent's in-depth analysis of legal principles, evidence, and facts. In order to improve the anti-bias ability of the system, this solution proposes a quantization method based on the degree of bias. Define the bias elimination factor δ:

[0037]

[0038] where Entropy is the joint entropy, used to quantify the decision-making uncertainty between judge agents J1 and J2, and C is the number of litigation request categories, corresponding to the number of independent claims in the plaintiff's lawsuit. The final trial confidence Conf can be calculated by the following formula:

[0039] Conf = σ(w1·δ + w2·Consistency + w3·CitationRate)

[0040] where CitationRate is the legal provision citation rate, that is, the proportion of legal provisions cited in the judgment. w i represents the trainable model parameters. σ represents the sigma function. Consistency represents the intra-link consistency score, and the text similarity between the speech content and the link topic is evaluated through a pre-trained model

[0041] Beneficial effects:

[0042] Compared with the prior art, the present invention has the following advantages: 1) The existing method of using LLM for mock trials has low accuracy because the LLM itself has a problem of structural hallucinations, generating some untrue and fictional content, and unable to accurately quote articles and strictly demonstrate the legal reasoning process. The present invention proposes to establish a legal article library, a factual evidence library, and an argument summary library, and query the most relevant legal articles through information retrieval to make the statements of the intelligent agent legally compliant, so as to alleviate the problem of knowledge hallucinations. 2) The existing methods have weak debate capabilities. As the debate rounds deepen, the LLM's perception of historical information becomes sparser and may even exhibit role drift, that is, confusing the role it plays and thus changing its own position, leading to chaotic debates and unable to consistently maintain its own position. The present invention constructs a framework that combines cooperation and confrontation to enhance the debate capabilities of the intelligent agent. In this framework, the plaintiff team and the defendant team are each configured with three intelligent agents. Each intelligent agent within the team has a clear division of labor and cooperates with each other to generate an overall debate view by combining information from different dimensions. At the same time, confrontation is emphasized between the plaintiff and the defendant, requiring them to express their arguments in a "tit-for-tat" state, which strengthens the in-depth thinking ability of the intelligent agent. 3) The existing method of using LLM for mock trials may affect the fairness of the trial result because the training data source of the LLM is extensive and inevitably contains biases in human society, which may be reflected in the mock trial to a certain extent. The present invention designs a debate-based judgment mode, requiring two intelligent agents to debate the judgment result based on the previous court records, eliminating biases by integrating various viewpoints, and obtaining the final judgment result. This mode maximally eliminates the internal biases existing in the model and ensures the fairness of the final judgment result.

[0043] Through experimental analysis, it is proved that the method of intelligent agent mock court trial based on large language models and adversarial judgment models proposed in this method has improved the mock court trial using large language models, significantly enhanced the model performance, effectively enhanced the debate ability of the intelligent agent, and ensured the fairness of the trial results. From the perspective of the multi-granularity memory management system, by dividing the three-level information units of response / observation / memory and constructing a structured factual evidence base and argument summary base, a long-term memory management paradigm for legal scenarios is formed. This system supports fine-grained information backtracking and retrieval. For example, in subsequent appeal simulations, the contradictions in the first-instance debate can be quickly located, laying a data architecture foundation for constructing a cross-instance legal reasoning system. In addition, this solution adopts a dynamically scalable trial process control mechanism. Through the combination of a finite state machine and a rule matching event monitoring function, modular control of the trial process is achieved. This design not only supports the precise scheduling of the existing four trial links but also can quickly adapt to the different court procedures of different countries or regions by expanding the state set S and event set E. The explicit control logic of the finite state machine reserves a technical interface for manual intervention. The state transition detection function of the presiding judge intelligent agent can be extended to access the manual confirmation mechanism, enabling the system to operate fully automatically and also supporting human expert review of key links (such as evidence acceptance), meeting the compliance requirements of the judicial assistance system for "human-in-the-loop". Brief Description of the Drawings

[0044] Figure 1 is a schematic diagram of the basic process of the present invention;

[0045] Figure 2 is a flow chart of the mock court trial of the present invention;

[0046] Figure 3 is a framework diagram of the model of the present invention. Detailed Embodiments

[0047] The present invention will be further described below in conjunction with the embodiments and the accompanying drawings of the specification.

[0048] Embodiment:

[0049] The method of intelligent agent mock court trial based on large language models and adversarial judgment models of the present invention includes the following steps:

[0050] 1) Based on the court trial links in the real world, set up the mock court process. In the real world, court trials usually consist of four links: court investigation, presentation and cross-examination of evidence, court debate, and final statement. As Figure 2 shown, the present invention also follows the real arrangement and sets the mock court process as these four links, and each link is sequentially labeled as t j ∈T = ti ,t e ,t d ,t s . Each session consists of multiple rounds of speeches. In the present invention, the intelligent agent is represented by A, and the current round is represented by r. Then, at time t j the behavior of the intelligent agent in the r-th round is expressed as What the intelligent agent says to others is called a response, denoted by m k . What the intelligent agent hears from others is called an observation. In addition, the relevant information involved in the intelligent agent generating a response is called memory, which are respectively represented by R, O, M. Let message = {response, observation, memory}. The process session and the state transition method are as follows:

[0051]

[0052] Among them, represents the power set of the message set, which is used to characterize the complete possibility space of messages in each session. N represents the number of rounds of the conversation. represents the information density mapping function, which is used to quantify the information density of each session to ensure that the information inheritance I(t j+1 ) satisfies:

[0053]

[0054] Among them, Info(·) represents the information entropy measurement function, which is used to evaluate the information volume of a single round of speech, that is, the Shannon entropy. α represents the information decay coefficient, which is used to control the retention ratio of cross-session information inheritance. λ represents the time decay factor, which is used to dynamically adjust the weight of historical round information. R j is the total number of conversation rounds.

[0055] 2) In order to accurately simulate and reproduce the litigation scenario, the present invention divides the roles in the court into three groups: the judge, the plaintiff, and the defendant, and defines the functional details of each role. Such as Figure 3As shown, the present invention constructs a framework that combines cooperation and confrontation. The judge, the plaintiff, and the defendant are divided into three groups of agents. The agents within each group cooperate with each other to complete tasks, while the agents between the plaintiff group and the defendant group are in direct opposition. Among them, the judge group of agents consists of a Chief Judge and two Judge Debaters. The plaintiff group and the defendant group of agents are both composed of an Advocate Orator, a Statute Searcher, and a Strategy Analyzer. For each role in the mock trial, the present invention implements a separate LLM-based agent through prompts.

[0056] The present invention sets up three parties of agents for the judge, the plaintiff, and the defendant. Only one agent responsible for speaking in each group of roles is completely transparent, that is, the speech of this agent is visible to all agents in the environment. Except for the agent responsible for speaking, the behaviors of the remaining agents are only visible within their own groups. This is considered because in the real world, whether it is the plaintiff, the defendant, or the judge, the decision-making is usually reached through private discussions. Therefore, in order to maintain the order of the court, the present invention takes this operation, which is also a typical behavior in court trials. As Figure 3 shown, only the Advocate Orator in the plaintiff / defendant group is completely transparent, while the behaviors of the Statute Searcher and the Strategy Analyzer are only visible within their own groups. In the judge group, only the Chief Judge responsible for speaking is completely transparent, and the behaviors of the two Judge Debaters are only visible to the members within the judge group. The specific role descriptions and responsibility objectives of each agent in the present invention are as follows:

[0057] Plaintiff and defendant agents: Both the plaintiff side and the defendant side are composed of three agents, namely an Advocate Orator, a Statute Searcher, and a Strategy Analyzer. Among them, the goal of the Advocate Orator is to strive to safeguard the interests of the plaintiff and the defendant based on the actual situation and existing evidence in court, oppose the defendant / plaintiff, express the views of their own side in speech, and win this lawsuit under the condition of following legal compliance. The other two agents are designed as assistants to the Advocate Orator to provide information support. As Figure 2 shown in the "court investigation" link in Figure 2As shown in the "court debate" link, the strategy analyst is responsible for providing auxiliary support to the defense lawyer in the court debate link. In this link, it is necessary to deeply understand the logical thinking of the other party's debate. The viewpoint should firmly maintain one's own position around the focus of the dispute, and even clearly attack the loopholes in the other party's argument to obtain maximum benefits. Therefore, the present invention introduces a strategy analyst to think and reason about the information in the fact evidence library and the argument summary library through a thinking chain, explain the argument, summarize the evidence, and generate a debate strategy idea material to guide the defense lawyer to make a debate speech, thereby enhancing the logic of the intelligent agent's debate.

[0058] Judge agent: It consists of a presiding judge and two debate judges. The presiding judge is responsible for presiding over the order of the entire court and has the power of interrogation. He can question the plaintiff and the defendant and ask questions at the right time to ensure that the interrogated party exercises the right to express himself. In order to eliminate the internal bias of the model as much as possible and strive to maximize the fairness of the judgment result, the present invention introduces two debate judges to debate the judgment opinions based on the previous court historical speech records before reading the final trial result. The collision of opinions helps to reach a consensus on the judgment and eliminate bias. Finally, the debate results are transmitted to the presiding judge, who announces the final judgment result.

[0059] 3) For the court process set in step 1), a finite state machine is used to control the mock court trial process to ensure the strict consistency of the simulation process. The simulation process consists of four steps: court investigation, evidence presentation and cross-examination, court debate and final statement. However, the present invention has found through experiments that if the intelligent agent is only informed through the prompt instruction and then allowed to start free simulation, due to the certain randomness of the LLM generation process, even the same prompt may generate different outputs, resulting in the simulation not being carried out according to the preset steps and the simulation order being chaotic. In order to ensure the strict consistency of the simulation process, the present invention adopts a finite state machine to control the mock court trial process. Figure 3 As shown in the "Information Pool" module, the present invention sets four states according to the court's game logic, and defines a state set S = s1, s2, s3, s4, where each state corresponds to each link of the above-mentioned court process - court investigation, evidence presentation and cross-examination, court debate and final statement. In each state, a prompt instruction for the corresponding link is written to guide the agent to speak in accordance with the court order. In order to guide the smooth handover of each link, the present invention defines an event set E for the end of the state, where E i Indicates state s i The end event, and E = E1, E2, E3, E4. When each link ends, the chief judge is required to read the corresponding link end prompt word, and use rule matching to detect the end of the state. If the corresponding flag output appears in the chief judge's response, the state transfer is executed and enters the next link. The formal description is as follows:

[0060]

[0061] Let the event monitoring function be M, which is used to detect whether the response of the presiding judge contains the corresponding end prompt word, and is defined as follows:

[0062] M: Response → True,False

[0063] If M(response) = True, then the corresponding end event E is triggered i and the state transition T(s i ,E i ) to s i+1 .

[0064] In addition, the court trial adopts an interrogation system, where the presiding judge exercises the power of interrogation over the plaintiff / defendant. Each round of interrogation can only be directed at one party (the plaintiff or the defendant), and the agent is not allowed to speak when the judge does not request to speak. Therefore, in order to determine the speaking order of the agent, the present invention uses a language model to extract the text features of the judge's speech, performs binary classification of the interrogation object, and determines the next speaking object of the agent according to the classification result, further standardizing the court order.

[0065] 4) In the two links of court investigation and court debate, a legal article library, a factual evidence library, and an argument summary library are constructed to provide legal basis and factual analysis for defense lawyers. Good information support is the basis of debate, and the quality of arguments often depends on the accuracy and relevance of the data behind them. Therefore, the present invention constructs a legal article library, a factual evidence library, and an argument summary library respectively from the two aspects of court investigation and court debate, providing legal basis and factual analysis for defense lawyers.

[0066] First, at the beginning stage of court investigation, the regulation searcher needs to generate a legal analysis material of the case as the subsequent global legal basis information for his own side. Specifically, the present invention constructs a legal article library where each is a structured representation of a legal article. Using the Embedding model f embed : Each is mapped to a d-dimensional vector space to obtain the article vector and all article vectors are stored in the FAISS vector database. The present invention requires the regulation searcher to put forward three questions targeting the details of the case from his own side to form a question set Q = q1, q2, q3. Each q in the question set j should focus on the details of the case, aiming to hit the interest demands of his own side and point out the mistakes of the other side as much as possible. Using the same Embedding model f embedMap the question set Q to a vector space to obtain a set of vectors q1, q2, q3, where q j = f embed (q j ). For each question vector q j , find the n most similar legal provision vectors s i in the FAISS database, that is, find the provisions that satisfy the following formula:

[0067]

[0068] Thus, obtain the n most relevant provisions for each question q j

[0069] Finally, instruct the legal searcher to analyze the association between the case behavior and the retrieved legal provisions and output them to the defense lawyer on one's own side. This case legal analysis material will provide a legal basis for the defense lawyer's subsequent statements. Specifically, the legal searcher queries the legal and regulatory database j according to the case fact information f and combines the involved laws with the law-related behaviors for analysis, and finally sorts out a case legal analysis material to provide to the defense lawyer to provide a legal basis for his statement. The formal expression is:

[0070]

[0071] Among them, represents the candidate relevant legal provisions, search(·) represents the search function, and the BM25 (Best Matching 25) retrieval algorithm is used in this solution. BM25 is a ranking function in information retrieval, which is used to estimate the relevance between a document and a given search query.

[0072] ​Secondly, as the core part of court trial, in this invention, a strategy analyst is introduced to assist defense lawyers in decision-making during court debates. Since the context window of LLM is limited, as the context length increases, the model may forget previous historical information, which is important for decision-making. In addition, as the number of debate rounds increases, the model may exhibit role drift, making its own arguments unclear. To address the above pain points, this invention sets up a fact evidence base and an argument summary base to form the Memory of the intelligent agent, which is used to provide long-term storage during the debate. Specifically, the fact evidence base stores factual detail information between court investigations and the cross-examination of evidence, and the argument summary base records the arguments and evidence of both sides of the debate, both of which are analyzed and extracted by the strategy analyst from the statements of both sides. The strategy analyst can query and obtain content from the two bases at any time or add new content. To enhance the logical reasoning ability of LLM in multi-round debates, the strategy analyst obtains information from the fact evidence base and the argument summary base to perform argument analysis, with a focus on decomposing the content of debate viewpoints, such as how arguments influence each other and which evidence is introduced for corroboration, etc., and then gives targeted suggestions for the debate ideas in the current round. In addition, by providing guidance on the debate ideas for defense lawyers, the problem of role drift is effectively overcome, ensuring that the intelligent agent can remember previous interaction information and also enhancing the logic of debate statements.

[0073] 5) Based on the adversarial judgment model, two adversarial judges are required to debate the judgment result based on the previous court records, integrating various viewpoints to eliminate biases and obtain the final judgment result. Since the training data sources of LLM are extensive and inevitably contain biases of human society, LLM may exhibit certain biases in a mock court. Such biases may affect the fairness of the trial process. This problem is particularly prominent in court trials because fairness is one of the core values of the law, and any form of bias will undermine the fairness of the law. To solve this problem, this invention proposes an adversarial judgment, where two adversarial judges J1 and J2 debate with each other to obtain the judgment result. In the final statement session, when the plaintiff and the defendant complete their final statements, a debate scenario is set up, with the topic being which party wins the lawsuit based on the previous court trial records. The two adversarial judges respectively stand on the viewpoints of supporting the plaintiff or the defendant to win, and separately propose and jointly debate their responses and reasoning processes for each lawsuit request in the plaintiff's complaint in turn to obtain a reasonable judgment result. By initiating a round of debate, the intelligent agent needs to incorporate the responses from other parties into the information window and re-examine them to improve its own debate content, promoting the intelligent agent's in-depth analysis of legal principles, evidence, and facts. To enhance the anti-bias ability of the system, this solution proposes a quantization method based on the degree of bias. Define the bias elimination factor δ:

[0074]

[0075] Among them, Entropy is the joint entropy, which is used to quantify the decision-making uncertainty between the judge agents J1 and J2. C is the number of lawsuit request categories, corresponding to the number of independent requests in the plaintiff's lawsuit. The final trial confidence Conf can be calculated by the following formula:

[0076] Conf = σ(w1·δ + w2·Consistency + w3·CitationRate)

[0077] Among them, CitationRate is the legal provision citation rate, that is, the proportion of legal provisions cited in the judgment. w i represents the trainable model parameters. σ represents the sigma function. Consistency represents the within-link consistency score, which evaluates the text similarity between the speech content and the link theme through a pre-trained model.

[0078] As Figure 2 shown in the "Final Statement" module in

[0079] However, given multiple rounds of debate, how does the present invention ensure that the debater-judges will converge to a final consensus judgment result? Through empirical practice, the present invention has found that after multiple rounds of debate, the intelligent agents will reach a consensus and converge to a single judgment result, even if they are instructed to stand on different positions at the beginning of the debate. Therefore, after the debate reaches the predetermined number of rounds, the present invention feeds back the debate result to the presiding judge who announces the judgment result. If the debater-judges still fail to reach a consensus after the debate reaches the specified number of rounds, the presiding judge makes a final decision by combining the viewpoints of both parties. Compared with the approach of having a single intelligent agent make the adjudication, this not only allows for consulting and considering multiple different sources, expanding the information scope of thinking, but also can reduce the influence of bias on the final judgment to a certain extent. For litigation requests on which there is agreement in the judgment, it can also enhance the confidence of the intelligent agent's judgment. This debate-based judgment mechanism introduces multiple perspectives, allows the collision of viewpoints from different positions, makes the judgment process more transparent and comprehensive, and provides a new path for solving the bias problem in intelligent judicial judgment.

[0080] The above embodiments are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and equivalent replacements can be made. The technical solutions obtained by improving and equivalently replacing the claims of the present invention all fall within the protection scope of the present invention.

[0081] The following indicators are used for evaluation in this embodiment:

[0082] To evaluate the performance of the agent in a mock court, the present invention uses the reliability of legal analysis, the rigor of debate logic, and the quality of the final judgment for evaluation. (1) Reliability of legal analysis: Whether the legal provisions, legal interpretations, and relevant case precedents cited by the agent during the mock court process are true and reliable and closely related to the facts and background of the case. This standard requires the agent to be able to argue based on accurate legal provisions rather than relying on incorrect or fabricated laws by the agent. Its core is to ensure that the agent can cite true and relevant legal provisions in case analysis, examine whether the agent's understanding of the legal provisions is accurate, and how to organically combine the legal provisions with the case facts. (2) Rigor of debate logic: Whether the argumentation process of the agent in the mock court follows a strict logical structure, especially whether the common syllogistic reasoning in law (e.g., major premise - minor premise - conclusion) is properly applied. Syllogistic reasoning is a classic legal reasoning method that requires the argument to start from facts, be deduced through appropriate legal provisions, and finally draw a logical conclusion. The agent should be able to clearly express its arguments, and there should be clear logical connections between each link. In addition, the agent should be able to identify and effectively respond to rebuttals in the debate rather than simply repeating the arguments mechanically. This requires the agent to not only have a certain legal foundation but also be able to handle complex logical relationships. (3) Fairness of the final judgment: Whether the judgment of the agent in the mock court is fair and reasonable. This standard requires the agent to comprehensively consider the case facts, relevant evidence, and applicable legal provisions when making a judgment to ensure that the judgment result conforms to the principles of social justice and legal justice. The fairness of the judgment is not only reflected in the compliance of the ruling but also includes whether the agent can balance the interests of all parties, avoid bias, and ensure the transparency and fairness of the judgment process.

[0083] It should be noted that the above embodiments are not used to limit the protection scope of the present invention. Any equivalent transformation or substitution made on the basis of the above technical solutions falls within the protection scope of the claims of the present invention.

Claims

1. A method for intelligent agent mock court trials based on large language models and a debate-style judgment model, characterized in that, The method includes the following steps: 1) Based on the trial process in the real world court, set up the process of the mock court; 2) Divide the roles in the court into three groups: the judge, the plaintiff, and the defendant. Build a framework of cooperation and confrontation, and define the detailed functions of each role to accurately simulate and reproduce the litigation scenario. 3) For the court process set in step 1), adopt a finite state machine to control the trial process of the mock court to ensure the strict consistency of the simulation process; 4) In the two links of court investigation and court debate, build a legal article library, a factual evidence library, and an argument summary library to provide legal basis and factual analysis for defense lawyers; 5) Finally, based on the adversarial judgment mode, require two arguing judges to debate the judgment result according to the previous court records, eliminate biases by integrating the views of all parties, and obtain the final judgment result.

2. The method for intelligent agent mock court trial based on large language model and adversarial judgment mode according to claim 1, characterized in that, In step 1), following the trial process in the real-world court, the mock court process is set to four links: court investigation, cross-examination of evidence, court debate, and final statement. Each link is sequentially labeled as t j ∈T = t i , t e , t d , t s , and each link consists of multiple rounds of speeches. The set of agents is represented as One of the agents is represented as A. Let r represent the current round. Then the behavior of the agent in the r-th round of t j is represented as What an agent says to others is called a response, represented by m k The words an agent hears from others are called observations. In addition, the relevant information involved in an agent generating a response is called memory, which are represented as R, O, and M respectively. Let message = {response, observation, memory}. The process link and state transition method are as follows: Among them, represents the power set of the message set, which is used to characterize the complete possibility space of messages in each link. N represents the number of turns of the conversation. represents the information density mapping function, which is used to quantify the information density of each link to ensure that the information inheritance I(t j+1 ) satisfies: Among them, Info(·) represents the information entropy metric function, which is used to evaluate the amount of information in a single-round speech, that is, Shannon entropy. α represents the information decay coefficient, which is used to control the retention ratio of cross-link information inheritance. λ represents the time decay factor, which is used to dynamically adjust the weight of historical round information. R j is the total number of dialogue rounds.

3. The method for intelligent agent mock court trial based on large language model and adversarial judgment mode according to claim 1, characterized in that, In step 2), among the three intelligent agents of the judge, the plaintiff, and the defendant set, only one intelligent agent responsible for speaking in each group of roles is completely transparent, that is, the speech of this intelligent agent is visible to all intelligent agents in the environment. Except for the intelligent agent responsible for speaking, the behaviors of the remaining intelligent agents are only visible within their own groups.

4. The method for intelligent agent mock court trial based on large language model and adversarial judgment mode according to claim 1, characterized in that, In step 2), an intelligent agent, the regulatory inspector, is introduced. The regulatory inspector queries the law and regulation database according to the case fact information f j and combines the involved laws l with the law-related acts for analysis. Finally, a legal analysis material of the case is compiled and provided to the defense lawyer to provide a legal basis for his speech. The formal expression is: i ​ Among them, represents the candidate relevant legal articles, search(·) represents the search function, and the BM25 (Best Matching 25) retrieval algorithm is used. BM25 is a ranking function in information retrieval, which is used to estimate the relevance between a document and a given search query.

5. The method for intelligent agent mock court trial based on large language model and adversarial judgment mode according to claim 1, characterized in that, In step 2), introduce an intelligent agent, the strategy analyst, who is responsible for thinking and reasoning about the information in the factual evidence library and the argument summary library through the chain of thought, expounding arguments, summarizing evidence, and generating a material of debate strategy ideas to guide the defense lawyer to make a debate speech, so as to enhance the logic of the intelligent agent's debate.

6. The method for intelligent agent mock court trial based on large language model and adversarial adjudication mode according to claim 1, characterized in that, In step 2), a framework of cooperation and confrontation is built. The plaintiff team and the defendant team are respectively configured with three intelligent agents, namely the defense lawyer, the law searcher, and the strategy analyst. Each intelligent agent within the team has a clear division of labor and cooperates with each other to generate an overall debate view by combining information from different dimensions; at the same time, emphasis is placed on confrontation between the plaintiff and the defendant, and they are required to express their arguments in a "tit-for-tat" state to further enhance the in-depth thinking ability of the intelligent agent.

7. The method for intelligent agent mock court trial based on large language model and adversarial judgment mode according to claim 1, characterized in that, In step 3), in order to ensure strict consistency in the simulation process, a finite state machine is adopted to control the process of the mock court trial. The state set S = {s1, s2, s3, s4} is defined, where each state corresponds to each link of the above court process in turn - court investigation, presentation of evidence and cross-examination, court debate, and final statement. Prompt instructions for the corresponding link are written in each state to guide the agent to speak in accordance with the court order norms. In order to guide the smooth transition of each link, the event set E for the end of the state is defined, where E i represents the end event of state s i , and E = {E1, E2, E3, E4}. When each link ends, the presiding judge is required to read out the corresponding end prompt word for the link, and rule matching is used to detect the end of the state. If the corresponding flag output appears in the response of the presiding judge, state transition is executed to enter the next link. The formal description is as follows: Let the event monitoring function be M, which is used to detect whether the response of the presiding judge contains the corresponding end prompt word, and is defined as follows: M: Response → True, False If M(response) = True, then trigger the corresponding end event E i and perform the state transition T(s i ,E i ) to s i+1 .

8. The method for intelligent agent mock court trial based on large language model and adversarial judgment mode according to claim 1, characterized in that, In step 4), a legal article library is constructed. Through information retrieval, the most relevant legal articles are queried to make the agent's speech legally based, and to assist the legal investigator in generating case legal analysis materials as the subsequent global legal basis information of the party. The details are as follows: First, define the legal article library Each of the l i It is a structured representation of legal texts, using the Embedding model Each l i Mapped to the d-dimensional vector space, we get the clause vector l i =f embed (l i ), and store all the article vectors in the FAISS vector database, and then ask the regulatory investigator to ask three questions about the case details from his own perspective to form a question set Q = q1, q2, q3. j We should focus on the details of the case, aiming to hit the interests of our side and point out the other party's faults as much as possible, using the same Embedding model f embed Map the problem set Q to the vector space and obtain the vector set q1, q2, q3, where q j =f embed (q j ), for each problem vector q j , find the closest n legal text vectors s in the FAISS database i , that is, find the clause that satisfies the following formula: Thus, the n articles j most relevant to each question q Finally, it instructs the legal searcher to analyze the association between the case behavior and the retrieved legal articles and output to the defense lawyer on one's own side. This case legal analysis material will provide a legal basis for the defense lawyer's speech in the subsequent session.

9. The method for intelligent agent mock court trial based on large language model and adversarial judgment mode according to claim 1, wherein, In step 4), a factual evidence library and an argument summary library are built and composed into the Memory of the intelligent agent for providing long-term storage during the debate process. Specifically, the factual evidence library stores the factual detail information between the court investigation and the cross-examination of evidence, and the argument summary library records the arguments and evidence of both sides of the debate, which are all analyzed and extracted from the speeches of both sides by the strategy analyst. The strategy analyst can query and obtain content from the two libraries at any time or add new content. In order to enhance the logical reasoning ability of the LLM in multi-round debates, the strategy analyst obtains information from the factual evidence library and the argument summary library to execute argument analysis, with the focus on decomposing the content of the debate view, and then giving targeted suggestions for the debate idea of the current round.

10. The method for intelligent agent mock court trial based on large language model and adversarial judgment mode according to claim 1, characterized in that, In step 5), a debate-based judgment is proposed. Two arguing judges, J1 and J2, debate with each other to obtain the judgment result. When the plaintiff and the defendant complete their final statements in the final statement session, a debate scenario is set up. The topic of the debate is which party wins the lawsuit based on the previous court trial records. The two arguing judges respectively stand on the viewpoints of supporting the plaintiff's victory or the defendant's victory, and separately propose and jointly debate their responses and reasoning processes for each lawsuit claim in the plaintiff's complaint in turn to obtain a reasonable judgment result. By initiating a round of debate, the agent needs to incorporate the responses from other parties into the information window, re-examine and improve its own debate content, promoting the agent's in-depth analysis of legal principles, evidence, and facts. To enhance the anti-bias ability of the system, a quantification method based on the degree of bias is proposed, and a bias elimination factor δ is defined: where Entropy is the joint entropy, used to quantify the decision-making uncertainty between the judge agents J1 and J2, C is the number of lawsuit claim categories, corresponding to the number of independent claims in the plaintiff's lawsuit, and the final trial confidence Conf is calculated through the following formula: Conf = σ(w1·δ + w2·Consistency + w3·CitationRate) Among them, CitationRate is the legal provision citation rate, that is, the proportion of legal provisions cited in the judgment, w i represents the trainable model parameters, σ represents the sigma function, Consistency represents the within-link consistency score, and the text similarity between the speech content and the link theme is evaluated through the pre-trained model.

Citation Information

Cited By

  • Large-scale dynamic social simulation method and system

    CN120542468A

  • Phishing website detection method, system and equipment based on multi-role agent debate

    CN121125303A

  • Method for measuring model value reasoning reliability

    CN121144067A

  • Simulated court dialectical care scene prediction method and system

    CN121353030A

  • Dynamic granularity timeline abstract generation method based on multi-agent collaboration and application thereof

    CN121743490A