Large language model-based discipline inspection and supervision case trial AI auxiliary method and system
Through an AI-assisted system based on a large language model, combined with dynamic knowledge graphs and blockchain technology, automation and intelligent decision-making in case trials are achieved, solving the problems of low efficiency and lack of accuracy in existing technologies and improving the accuracy and security of case trials.
Patent Information
- Application Number
- CN202511278102.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-09
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-09-09
AI Technical Summary
Case examiners need to manually review a large number of legal provisions when determining the nature of cases and making judgments, which is inefficient and biased. The existing legal retrieval system cannot be updated dynamically, making it difficult to reason about complex cases. There is a lack of an intelligent case database, making it difficult to match similar cases.
An AI-assisted system based on a large language model is used to match case element vectors through a dynamic knowledge graph, generate legal clauses and historical case vectors, use a three-channel encoding layer to extract structural features and contextual features, combine the attention mechanism to calculate the applicability probability of legal clauses, and generate an encrypted report stored in the blockchain.
It has achieved automation and intelligence in case review, improved decision-making accuracy, shortened processing time, and enhanced security and efficiency. The qualitative accuracy rate reached 92.7%, the processing time was shortened from 8 hours to 3 minutes, and the cracking cost exceeded 10^20 operations.
Smart Images

Figure CN120804342A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of artificial intelligence, in particular to a case handling AI assistance method and system for discipline inspection and supervision based on a large language model. BACKGROUND
[0002] When a case handler qualitatively and determines a case of discipline inspection and supervision, a large number of legal provisions need to be manually consulted, which is inefficient and may lead to deviation. The existing legal retrieval system usually only supports keyword matching and cannot dynamically update the revised legal provisions. When the input keyword is inconsistent with the legal retrieval system, the case handler often cannot find the applicable legal provisions. In particular, the reasoning of complex cases is difficult and tests the case handling experience of the case handler. When querying similar cases in combination with the case library, the existing technology lacks an intelligent case library, and the matching of similar cases is difficult. SUMMARY
[0003] Therefore, the present application provides a case handling AI assistance method and system for discipline inspection and supervision based on a large language model, which can solve the above technical problems.
[0004] In order to solve the above technical problems, the present application is implemented as follows.
[0005] A case handling AI assistance method for discipline inspection and supervision based on a large language model, comprising: Step S1: determining a case element vector of a case to be handled by the case handling AI assistance system for discipline inspection and supervision; matching the case element vector with a dynamic knowledge graph to determine a plurality of candidate legal provisions and historical cases; the dynamic knowledge graph is a knowledge graph that is updated in real time according to current laws and regulations and integrates historical cases; generating a legal provision vector and a historical case vector based on the plurality of matched candidate legal provisions and historical cases; embedding the legal provision vector, the case element vector and the historical case vector into a first output vector; Step S2: inputting the first output vector into a large language model that has been trained; the three-channel encoding layer of the large language model extracts the dynamic knowledge graph structure features corresponding to the legal provision vector through the legal channel, obtains the context features corresponding to the case element vector through the case element channel, and performs attention pooling operation on the historical case vector through the case channel to generate semantic features; the cross-channel attention layer calculates the attention weights between the dynamic knowledge graph structure features, the context features and the semantic features respectively; inputting the weighted vector superimposed with the attention weights into the full connection layer to determine the legal provision application probability corresponding to the weighted vector; the output layer determines a second output vector representing the applicable legal provisions based on the legal provision application probability.
[0006] Preferably, the method further comprises step S3: generating applicable legal terms corresponding to the second output vector, generating an encrypted report, and storing the encrypted report as encrypted data in the blockchain.
[0007] Preferably, the step S1, determining the case element vector of the AI-assisted system for the disciplinary inspection and supervision case trial, includes: Step S11: BERT-encode the case text corresponding to the case to be processed by the AI-assisted system for disciplinary inspection and supervision cases to generate a text vector, and use the text vector as the input vector; Step S12: The graph neural network aggregates the neighborhood node information of the input vector to generate a case element vector corresponding to the input vector. The aggregation formula is:
[0008] in, l is the number of training times, u is the neighbor node of node v, v is the node in the graph neural network, is the neighbor node set composed of the neighbor nodes of node v, For the l The training parameters for the training time, For node u in l The hidden state during training, For node v in l +1 hidden state during training, is a non-linear activation function.
[0009] Preferably, the step S1, generating a legal clause vector and a historical case vector based on the matched candidate legal clauses and historical cases, respectively, includes: Step S13: Use the TranSR model to map the candidate legal clause text to the relational space to generate a legal clause vector. The mapping formula is:
[0010] in, is the initial term feature vector, is the relational projection matrix, is the bias term, is the legal terms vector; Step S14: Use SiameseNetwork to generate historical case vectors corresponding to historical cases. The loss function of SiameseNetwork is:
[0011] in, is the loss function of SiameseNetwork, margin is the preset interval threshold, , respectively the i-th historical case vector, the j-th historical case vector. Preferably, the step S1 of generating the legal clause vector and the historical case vector respectively based on the matched several candidate legal clauses and historical cases comprises: Step S13: using the TranSR model to map the candidate legal clause text to the relationship space to generate the legal clause vector, and the mapping formula is:
[0012] wherein, is the initial clause feature vector, is the relationship projection matrix, is the bias term, is the legal clause vector; Step S14: using the SiameseNetwork to generate the historical case vector corresponding to the historical case, and the loss function of the SiameseNetwork is:
[0013] wherein, is the loss function of the SiameseNetwork, and the margin is a preset interval threshold, , respectively the i-th historical case vector, the j-th historical case vector.
[0014] An AI auxiliary system for handling disciplinary inspection cases based on a large language model, comprising: An initialization module configured to determine a case element vector of the AI auxiliary system for handling disciplinary inspection cases; match the case element vector with a dynamic knowledge graph to determine several candidate legal clauses and historical cases; the dynamic knowledge graph is a knowledge graph that is updated in real time according to current laws and regulations and integrates historical cases; generate a legal clause vector and a historical case vector respectively based on the matched several candidate legal clauses and historical cases; and embed the legal clause vector, the case element vector and the historical case vector into a first output vector; Matching module: configured to input the first output vector into the trained large language model. The three-channel encoding layer of the large language model extracts the dynamic knowledge graph structural features corresponding to the legal clause vector through the legal channel, obtains the contextual features corresponding to the case element vector through the case element channel, and performs attention pooling operation on the historical case vector through the case channel to generate semantic features; the cross-channel attention layer calculates the attention weights between the dynamic knowledge graph structural features, contextual features and semantic features respectively; the weighted vector with superimposed attention weights is input into the fully connected layer to determine the applicability probability of the legal clause corresponding to the weighted vector; the output layer determines the second output vector representing the applicable legal clause based on the applicability probability of the legal clause.
[0015] The present invention provides a computer-readable storage medium, wherein a plurality of instructions are stored in the storage medium; the plurality of instructions are used for a processor to load and execute the method described above.
[0016] The present invention provides an electronic device, characterized in that the electronic device includes: A processor, which is used to execute multiple instructions; A memory for storing a plurality of instructions; The plurality of instructions are used to be stored by the memory and loaded and executed by the processor to implement the method as described above.
[0017] Beneficial effects: (1) This invention is an AI-assisted system method for intelligent disciplinary inspection and supervision case trials based on a large language model (LLM). Through natural language processing (NLP), knowledge graph (KG) and deep learning technology, it achieves automated legal matching, historical case comparison and decision support for cases.
[0018] (2) The present invention constructs a dynamic knowledge graph and a multi-dimensional analysis model, fully combining the characteristics of text matching to make the decision-making support conclusions more accurate.
[0019] (3) The present invention uses hardware-level confidentiality technology to improve security. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 This is a flow chart of the AI-assisted system method for disciplinary inspection and supervision case trials based on a large language model of the present invention; Figure 2 This is a schematic diagram of the structure of the AI-assisted system for disciplinary inspection and supervision case trials based on a large language model of the present invention. DETAILED DESCRIPTION
[0021] The present invention is described in detail below with reference to the accompanying drawings and embodiments.
[0022] like Figure 1As shown, the application proposes a disciplinary inspection case trial AI auxiliary system method based on a large language model, which comprises the following steps: Step S1: determining the case element vector of the case of the disciplinary inspection case trial AI auxiliary system; matching the case element vector with the dynamic knowledge graph to determine a plurality of candidate legal provisions and historical cases; the dynamic knowledge graph is a knowledge graph that is updated in real time according to the current laws and regulations and integrates historical cases; generating a legal provision vector and a historical case vector based on the matched plurality of candidate legal provisions and historical cases; embedding the legal provision vector, the case element vector and the historical case vector into a first output vector; Step S2: inputting the first output vector into the trained large language model; the three-channel encoding layer of the large language model extracts the dynamic knowledge graph structure features corresponding to the legal provision vector through the legal channel, obtains the context features corresponding to the case element vector through the case element channel, and performs attention pooling operation on the historical case vector through the case channel to generate semantic features; the cross-channel attention layer calculates the attention weights between the dynamic knowledge graph structure features, the context features and the semantic features; inputting the weighted vector superimposed with the attention weights into the full connection layer to determine the legal provision application probability corresponding to the weighted vector; the output layer determines the second output vector representing the applicable legal provision based on the legal provision application probability.
[0023] Further, the method further comprises step S3: generating the applicable legal provision corresponding to the second output vector, generating an encrypted report, and storing the encrypted report as encrypted data into the blockchain. The large language model comprises an input layer, a three-channel encoding layer, a cross-channel attention layer, a full connection layer and an output layer connected in sequence.
[0024] The application realizes the disciplinary inspection case trial AI auxiliary system through three stages, first acquires legal provisions, constructs a dynamic knowledge graph with time limit labels, the time limit labels are used to represent the effective time of the legal provisions, and updates the dynamic knowledge graph according to the update of the legal provisions; based on the dynamic knowledge graph and the case element vector of the disciplinary inspection case trial AI auxiliary system, the first output vector is determined; then the trained large language model is used to associate the case of the disciplinary inspection case trial AI auxiliary system with the applicable legal provision by combining the attention mechanism; finally, the encrypted report is generated according to the applicable legal provision, the encrypted report is stored as encrypted data into the blockchain, and the whole chain is realized.
[0025] In this application, the case text corresponding to the case of the disciplinary inspection case trial AI auxiliary system is generated into a 768-dimensional text vector through BERT encoding.
[0026] The step S1 of determining the case element vector of the disciplinary inspection case trial AI auxiliary system comprises: Step S11: BERT-encode the case text corresponding to the case to be processed by the AI-assisted system for disciplinary inspection and supervision cases to generate a text vector, and use the text vector as the input vector; Step S12: The graph neural network aggregates the neighborhood node information of the input vector to generate a case element vector corresponding to the input vector. The aggregation formula is:
[0027] in, l is the number of training times, u is the neighbor node of node v, v is the node in the graph neural network, is the neighbor node set composed of the neighbor nodes of node v, For the l The training parameters for the training time, For node u in l The hidden state during training, For node v in l +1 hidden state during training, is a non-linear activation function.
[0028] In the present invention, the case element vector of the case to be tried in the AI-assisted system for disciplinary inspection and supervision is generated by fusing Word2Vec with the graph neural network. The case element vector can represent the correlation between the subject, behavior, and consequence.
[0029] The step S1 generates a legal clause vector and a historical case vector based on the matched candidate legal clauses and historical cases, including: Step S13: Use the TranSR model to map the candidate legal clause text to the relational space to generate a legal clause vector. The mapping formula is:
[0030] in, is the initial term feature vector, is the relational projection matrix, is the bias term, is the legal terms vector; Step S14: Use SiameseNetwork to generate historical case vectors corresponding to historical cases. The loss function of SiameseNetwork is:
[0031] in, is the loss function of SiameseNetwork, margin is the preset interval threshold, , The i-th historical case vector and the j-th historical case vector, respectively.
[0032] In the application, the TransR model is used to retain the semantic and relationship characteristics of the candidate legal provisions, and the Siamese Network is used to calculate the case similarity, and the historical case vector is a semantic matching vector.
[0033] In the application, the dynamic knowledge graph is a knowledge graph that is updated in real time according to current laws and regulations and has a time limit label, for example, current laws and regulations are obtained at a fixed time every day, and revised provisions and newly added provisions are detected. Based on SimHash, the text fingerprint is calculated, and if the difference between the legal regulation text stored in the local database exceeds the threshold, the process of updating the dynamic knowledge graph is triggered, so as to reconstruct the dynamic knowledge graph. When a new node and edge are added to the dynamic knowledge graph, transactional writing is used to ensure data consistency; for invalid provisions, they are marked as “abolished” and no longer participate in matching.
[0034] The step S2, wherein: The legal channel extracts the dynamic knowledge graph structure features corresponding to the legal provision vector through the graph attention network; the fact channel encodes the case element vector through BERT-wwm to generate the context features corresponding to the case element vector; and the case channel performs attention pooling operation on the historical case vector to generate semantic features, and the attention pooling formula is C'=∑ αi C i , wherein, αi is the attention weight of the i-th historical case vector.
[0035] The cross-channel attention layer calculates the attention weights between the dynamic knowledge graph structure features, the context features and the semantic features respectively.
[0036] , wherein, is the attention weight between the two features to be calculated in the dynamic knowledge graph structure features, the context features and the semantic features, Softmax is a softmax function, is the vector dimension of the two features to be calculated, , is one of the two features to be calculated.
[0037] The weighted vector calculation formula is , wherein, is , The weighted vector superimposed with the attention weight.
[0038] The loss function of the large language model is:
[0039] wherein, , , , are weights, is a cross-entropy loss function, is a legal logic loss function, is a semantic loss function, is a time limit loss function;
[0040] wherein, is a cross-entropy loss function in the art, KL is a divergence function, is a prediction probability distribution of the large model on the applicability of the legal provisions vector, is a difference operation, is an ideal distribution about the applicability of legal provisions generated according to expert knowledge, F is a context feature corresponding to the case element vector, C is a historical case vector, is a cosine similarity between F and C; ReLu is a ReLu function, is the effective time of the legal provisions, is the time of the case of the AI auxiliary system for the trial of the case to be disciplined and supervised.
[0041] In the present application, the alignment of the context feature corresponding to the case element vector and the historical case vector is constrained by the cosine similarity, and the alignment of the context feature corresponding to the case element vector and the historical case vector is constrained by the KL divergence approximation , so as to avoid generating conclusions that violate legal rules.
[0042] In step S1, when determining the case element vector of the AI auxiliary system for the trial of the case to be disciplined and supervised, by means of synonym replacement, sentence reorganization and the like on the description of the case to be disciplined and supervised, the extracted case element vector can be more accurate, and the generalization can be improved. Adversarial samples can also be generated for training to enhance the robustness of the large model. The present application adopts distributed training, and the initial value of the learning rate is 3e5. The cosine annealing strategy is used to adjust the learning rate.
[0043] The application adopts the mode of encrypted storage, divides the case data of the to-be-disciplined and monitored case trial AI auxiliary system into 128KB fragments, encrypts each fragment using an SM4 algorithm, generates a key by a secure chip, attaches an HMACSHA256 signature to each encrypted fragment of data to prevent tampering, periodically rotates the key and destroys the old key. A hardware isolation mode is constructed, the memory is divided into a secure area and a non-secure area, the inference process of the large model and the report generation are configured in the non-secure area, and various data are stored in the secure area. The operation log is stored in the blockchain in real time. A user is authenticated in a manner supporting fingerprint and digital main book two-factor authentication, a trusted computing firmware is loaded when the user starts the operation, and the security and confidentiality are ensured. For example, the ArmTrustZone technology is used to divide the secure area and the non-secure area, and the key calling is only performed in the secure area. The operation log information such as the timestamp, the user ID and the operation type is calculated for a log hash value through the SHA3 algorithm, and then an intelligent contract is called to write in the blockchain.
[0044] Further, the application outputs a weighting vector to visually show the association path of the legal clause and the case of the to-be-disciplined and monitored case trial AI auxiliary system.
[0045] The test results of the application are as follows.
[0046] Accuracy: In 1000 test cases, the qualitative accuracy rate is 92.7%; Efficiency: The average processing time is shortened from 8 hours to 3 minutes; Security: The cracking cost of encrypted storage is more than 10^20 operations.
[0047] As shown in Figure 2 The application also provides a to-be-disciplined and monitored case trial AI auxiliary system device based on a large language model, which comprises: An initialization module configured to determine a case element vector of the to-be-disciplined and monitored case trial AI auxiliary system, match the case element vector with a dynamic knowledge graph to determine a plurality of candidate legal clauses and historical cases, the dynamic knowledge graph is a knowledge graph integrated with historical cases and updated in real time according to current laws and regulations, generate a legal clause vector and a historical case vector based on the plurality of matched candidate legal clauses and historical cases respectively, and embed the legal clause vector, the case element vector and the historical case vector into a first output vector; The matching module is configured to input the first output vector into the trained large language model, the three-channel encoding layer of the large language model extracts dynamic knowledge graph structure features corresponding to the legal clause vector through the legal channel, obtains context features corresponding to the case element vector through the case element channel, and performs attention pooling operation on the historical case vector through the case channel to generate semantic features; the cross-channel attention layer calculates the attention weights between the dynamic knowledge graph structure features, the context features and the semantic features two by two respectively; the weighted vector superimposed with the attention weights is input into the full connection layer to determine the legal clause application probability corresponding to the weighted vector; and the output layer determines the second output vector representing the applied legal clause based on the legal clause application probability.
[0048] The foregoing specific embodiments only describe the design principles of the present application, and the shapes and names of the components in the description can be different and are not limited. Therefore, those skilled in the art of the present application can modify or equivalently replace the technical solutions described in the foregoing embodiments; and these modifications and replacements do not deviate from the purpose and technical solutions of the present application, and should all belong to the protection scope of the present application.
Claims
1. An AI-assisted method for disciplinary inspection and supervision case trials based on a large language model, characterized by: include: Step S1: Determine the case element vector for the disciplinary inspection and supervision case to be heard; match the case element vector with the dynamic knowledge graph to determine several candidate legal clauses and historical cases; the dynamic knowledge graph is a knowledge graph that is updated in real time according to current laws and regulations and integrates historical cases; generate a legal clause vector and a historical case vector based on the matched candidate legal clauses and historical cases; embed the legal clause vector, case element vector, and historical case vector into the first output vector; Step S2: The first output vector is input into the trained large language model. The three-channel encoding layer of the large language model extracts the dynamic knowledge graph structural features corresponding to the legal clause vector through the legal channel, obtains the contextual features corresponding to the case element vector through the case element channel, and performs an attention pooling operation on the historical case vector through the case channel to generate semantic features. The cross-channel attention layer calculates the attention weights between the structural features, contextual features and semantic features of the dynamic knowledge graph respectively; the weighted vector with the superimposed attention weights is input into the fully connected layer to determine the applicability probability of the legal clause corresponding to the weighted vector; the output layer determines the second output vector representing the applicable legal clause based on the applicability probability of the legal clause.
2. The method according to claim 1, wherein The method further includes step S3: generating applicable legal terms corresponding to the second output vector, generating an encrypted report, and storing the encrypted report as encrypted data in the blockchain.
3. The method according to any one of claims 1 to 2, wherein The step S1, determining the case element vector of the AI-assisted system for the disciplinary inspection and supervision case trial, includes: Step S11: BERT-encode the case text corresponding to the case to be processed by the AI-assisted system for disciplinary inspection and supervision cases to generate a text vector, and use the text vector as the input vector; Step S12: The graph neural network aggregates the neighborhood node information of the input vector to generate a case element vector corresponding to the input vector. The aggregation formula is: in, l is the number of training times, u is the neighbor node of node v, v is the node in the graph neural network, is the neighbor node set composed of the neighbor nodes of node v, For the l The training parameters for the training time, For node u in l The hidden state during training, For node v in l +1 hidden state during training, is a non-linear activation function.
4. The method according to claim 3, wherein The step S1 generates a legal clause vector and a historical case vector based on the matched candidate legal clauses and historical cases, including: Step S13: Use the TranSR model to map the candidate legal clause text to the relational space to generate a legal clause vector. The mapping formula is: in, is the initial term feature vector, is the relational projection matrix, is the bias term, is the legal terms vector; Step S14: Use SiameseNetwork to generate historical case vectors corresponding to historical cases. The loss function of SiameseNetwork is: in, is the loss function of SiameseNetwork, margin is the preset interval threshold, , are the i-th historical case vector and the j-th historical case vector respectively.
5. The method according to claim 4, wherein The loss function of the large language model is: in, 、 、 、 are weights, is the cross entropy loss function, is the legal logic loss function, is the semantic loss function, is the time loss function; Among them, KL is the divergence function, is the predicted probability distribution of the applicability of the large model to the legal clause vector, is the difference operation, is the ideal distribution of the applicability of legal provisions generated based on expert knowledge, F is the contextual feature corresponding to the case element vector, C is the historical case vector, is the cosine similarity between F and C; ReLu is the ReLu function, The effective date of the legal provisions. This is the time for AI-assisted systems to be used in disciplinary inspection and supervision cases.
6. An AI-assisted system for disciplinary inspection and supervision case trials based on a large language model, characterized by: include: Initialization module: configured to determine the case element vector for the AI-assisted system for disciplinary inspection and supervision case trials; match the case element vector with the dynamic knowledge graph to determine several candidate legal clauses and historical cases; the dynamic knowledge graph is updated in real time based on current laws and regulations and integrates historical case knowledge graphs; generate legal clause vectors and historical case vectors based on the matched candidate legal clauses and historical cases; and embed the legal clause vector, case element vector, and historical case vector into the first output vector; Matching module: This module is configured to input the first output vector into the trained large language model. The three-channel encoding layer of the large language model extracts the dynamic knowledge graph structural features corresponding to the legal clause vector through the legal channel, obtains the contextual features corresponding to the case element vector through the case element channel, and performs an attention pooling operation on the historical case vector through the case channel to generate semantic features. The cross-channel attention layer calculates the attention weights between the structural features, contextual features and semantic features of the dynamic knowledge graph respectively; the weighted vector with the superimposed attention weights is input into the fully connected layer to determine the applicability probability of the legal clause corresponding to the weighted vector; the output layer determines the second output vector representing the applicable legal clause based on the applicability probability of the legal clause.
7. A computer-readable storage medium, characterized in that The storage medium stores a plurality of instructions; the plurality of instructions are used by a processor to load and execute the method according to any one of claims 1 to 5.
8. An electronic device, characterized in that: The electronic device comprises: A processor, which is used to execute multiple instructions; A memory for storing a plurality of instructions; The plurality of instructions are used to be stored in the memory and loaded and executed by the processor according to any one of claims 1 to 5.
Citation Information
Patent Citations
Legal provision recommendation method and device and storage medium
CN110569350A
Method and system for recommending criminal legal instrument related laws
CN111460817A
Method and device for recommending applicable law articles of legal cases
CN116304078A
Legal element analysis method and system based on large language model and knowledge graph
CN119046476A
Knowledge graph-based case retrieval method, device and equipment, and storage medium
US20220121695A1