Large model-oriented compliance detection method, apparatus and device, and medium
By combining a dynamic rule engine and a retrieval-enhanced verification model, the problem of low efficiency and insufficient accuracy in existing compliance detection is solved, enabling real-time and accurate detection of the output content of large models and improving compliance detection capabilities in the fintech and healthcare fields.
Patent Information
- Application Number
- CN202610156662.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-03
- Publication Date
- 2026-05-19
AI Technical Summary
Existing compliance checks are inefficient and inaccurate in the fintech and healthcare sectors, unable to monitor the output of large models in real time and comprehensively, and struggling to identify complex and cryptic violations.
A dynamic rule engine is used for rapid initial screening, combined with a retrieval-enhanced verification model for in-depth verification, a collaborative arbitrator to generate compliance judgment results, and asymmetric encryption technology to generate verifiable evidence packages.
It enables real-time and accurate detection of the output content of large models, improves the efficiency and accuracy of compliance detection, and ensures the timeliness and traceability of supervision.
Smart Images

Figure CN122064570A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology and can be applied to the fields of fintech and healthcare. In particular, it relates to a compliance testing method, apparatus, equipment, and medium for large models. Background Technology
[0002] With the deep application of generative artificial intelligence in fintech and healthcare, the compliance risks of its output have become a regulatory focus. In fintech, AI models are widely used in core businesses such as customer service consultation, investment advice, and risk assessment; in healthcare, AI undertakes key tasks such as assisted diagnosis, treatment plan recommendation, and health consultation. Existing compliance control measures suffer from serious deficiencies in detection efficiency and accuracy. Inefficient compliance monitoring: Current compliance checks rely primarily on manual sampling or post-event batch analysis, failing to provide comprehensive monitoring of massive, real-time model outputs, resulting in significant delays in risk detection. In financial scenarios, AI models may generate thousands of outputs per second; similarly, AI-assisted diagnostic systems in the medical field face the challenge of massive real-time data streams. Traditional manual sampling methods struggle to handle such large volumes of data, leading to a significant amount of potential violations going undetected and accumulating regulatory risks.
[0003] Insufficient detection accuracy: Existing compliance detection relies solely on simple rules such as keyword matching, making it difficult to identify complex and subtle violations, resulting in low accuracy. For example, in the financial sector, this manifests as an inability to accurately identify misleading marketing and inappropriate risk warnings; in the medical field, it struggles to detect unethical advice or recommendations that exceed the scope of medical practice. Summary of the Invention
[0004] This invention provides a compliance testing method, apparatus, computer equipment, and medium for large models, to solve the technical problem that the efficiency and accuracy of existing compliance testing are both low.
[0005] Firstly, a compliance detection method for large models is provided, including: The output content of the large model is acquired in real time, and the dynamic rule engine is used to perform a first compliance check on the output content to obtain the detection result; The enhanced verification model performs a second compliance check on the output content that meets the preset conditions identified by the dynamic rule engine, generating an evidence support score. Based on the test results and the evidence support score, a compliance determination result and the confidence level of the compliance determination result are generated by a collaborative determination arbitrator.
[0006] Secondly, a compliance testing device for large models is provided, including: The first compliance detection unit is used to acquire the output content of the large model in real time and use the dynamic rule engine to perform a first compliance detection on the output content to obtain the detection result. The second compliance detection unit is used to perform a second compliance detection on the output content that meets the preset conditions identified by the dynamic rule engine through the retrieval enhancement verification model to generate an evidence support score. The first generation unit is used to generate a compliance determination result and the confidence level of the compliance determination result through a collaborative determination arbitrator based on the detection result and the evidence support score.
[0007] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described compliance detection method for large models.
[0008] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the aforementioned compliance detection method for large models.
[0009] The aforementioned scheme, implemented by the compliance detection method, apparatus, computer equipment, and storage medium for large models, can acquire the output content of the large model in real time and perform a first compliance detection on the output content using a dynamic rule engine to obtain the detection result; a second compliance detection is performed on the output content identified by the dynamic rule engine that meets preset conditions through a retrieval-enhanced verification model to generate an evidence support score; and a compliance judgment result and the confidence level of the compliance judgment result are generated through a collaborative judgment arbitrator based on the detection result and the evidence support score. In this invention, rapid initial screening is performed through a dynamic rule engine, and in-depth verification is performed through a retrieval-enhanced verification model, thereby achieving real-time and accurate detection of the output content of large models. This effectively solves the problems of low efficiency and high false positive and false negative rates of traditional single detection methods, thus improving the efficiency and accuracy of compliance detection. Attached Figure Description
[0010] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a flowchart illustrating a compliance detection method for large models in one embodiment of the present invention; Figure 2 yes Figure 1 A schematic diagram of a specific implementation of step S110; Figure 3 yes Figure 1 A schematic diagram of a specific implementation of step S120; Figure 4 This is a flowchart illustrating a compliance detection method for large models in another embodiment of the present invention; Figure 5 This is a schematic block diagram of a compliance detection device for large models in one embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention; Figure 7 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation
[0012] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0013] The compliance detection method for large models provided in this invention can be applied to either the client or server. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. Currently, in the fintech and healthcare fields, the efficiency and accuracy of existing compliance detection methods are relatively low. To address these issues, this invention proposes a compliance detection method for large models. This method uses a dynamic rule engine for rapid initial screening and a retrieval-enhanced verification model for in-depth verification, thereby achieving real-time and accurate detection of the output content of large models. This effectively solves the problems of low efficiency and high false positive / false negative rates of traditional single detection methods, thus improving the efficiency and accuracy of compliance detection. The invention will be described in detail below through specific embodiments.
[0014] Please see Figure 1 As shown, Figure 1 A flowchart of a compliance detection method for large models provided in an embodiment of the present invention includes the following steps: S110-S130.
[0015] S110. Obtain the output content of the large model in real time, and use the dynamic rule engine to perform a first compliance check on the output content to obtain the detection result.
[0016] Specifically, real-time acquisition of the output content of the large model refers to capturing the complete and original output content returned by the large model with a latency of milliseconds through the system interface or data stream monitoring mechanism after the large model completes the response to the user query, and automatically inputting the output content and its associated context information (such as input question, session identifier, timestamp, etc.) into the subsequent compliance detection and analysis process.
[0017] Among them, such as Figure 2 As shown, step S110 includes steps S111-S113: S111, The dynamic rule engine scans the output content based on a preset compliance rule library; S112. When the output content is found to meet a specific rule condition, the rule that meets the specific rule condition is triggered, and the triggered rule ID, the violating text fragment, and the location information of the violating text fragment are recorded. S113. Generate the detection result based on the triggered rule ID, the violating text fragment, and the location information of the violating text fragment, wherein the detection result includes compliance, suspected violation, and uncertainty.
[0018] Specifically, upon startup, the dynamic rule engine first loads and initializes a pre-defined compliance rule base. This compliance rule base stores specific compliance rules for the financial or healthcare industries and regulatory requirements. Each rule is defined in a structured "condition-action-evidence" triple, capable of describing various violation conditions, including keywords, semantic patterns, and logical combinations. The dynamic rule engine then employs an efficient pattern matching algorithm (e.g., based on Trie tree matching) to perform a comprehensive, character-by-character real-time scan of the output content, identifying potential locations in the text that may trigger violations.
[0019] During the scanning process, when the dynamic rule engine identifies a fragment in the output content that perfectly matches a condition defined in a rule, that rule is triggered. The triggering event immediately initiates a recording process to synchronously and structurally record the detailed chain of evidence for this violation, including: the unique identifier of the triggering rule, used to trace which compliance rule was violated; the matched original violating text fragment, serving as core evidence of the violation; and the fragment's position information within the output content. Specifically, the position information includes the start character offset and the end character offset, used to locate the violating statement within the context.
[0020] Finally, the dynamic rule engine synthesizes all triggered rule records and generates preliminary detection results based on preset judgment logic. This result is a classification label, typically including three categories: "Compliant," indicating no rules were triggered; "Suspected Violation," indicating one or more rules requiring further review were triggered; and "Uncertain," indicating rule matching conflicts or a confidence level below a predetermined threshold, making a definitive judgment impossible. This result provides clear input and decision-making basis for subsequent deep verification processes.
[0021] S120. The dynamic rule engine identifies the output content that meets the preset conditions through a retrieval enhancement verification model and performs a second compliance test to generate an evidence support score.
[0022] Specifically, such as Figure 3 As shown, step S120 includes steps S121-S122: S121, using the output content identified by the dynamic rule engine that meets preset conditions as a query vector, performing vector similarity retrieval in the preset knowledge base to obtain the most relevant legal clauses, wherein the preset conditions are the output content whose detection result is suspected violation or uncertain; S122, calculating the distance or similarity between the semantic embedding vector of the output content identified by the dynamic rule engine that meets the preset conditions and the most relevant legal clause to obtain the evidence support score. More specifically, after the dynamic rule engine completes the preliminary analysis and marks a certain output content of the large model as "suspected violation" or "uncertain," the retrieval enhancement verification model is immediately started to perform in-depth evidence verification: First, the output of the triggering rule is used as the core object to be verified. Through a pre-trained semantic embedding model (such as a deep learning model), the output of the triggering rule is transformed into a high-dimensional, numerical query vector, which mathematically represents the deep semantic features of the original text.
[0023] Subsequently, vector similarity retrieval is performed within a pre-defined knowledge base. This knowledge base has pre-converted massive amounts of unstructured text, such as regulatory documents, industry standards, and contract templates, into vectors using the same embedding model and indexed accordingly. The retrieval process is not a simple keyword matching; instead, it utilizes an approximate nearest neighbor algorithm to find, within milliseconds, several regulatory clause vectors that are semantically closest to the query vector in the vector space. It should be noted that in the fintech field, the pre-defined knowledge base can integrate regulatory provisions from the financial industry; in the healthcare field, it can integrate privacy regulations from the healthcare industry.
[0024] Finally, the cosine similarity between the query vector and the top-K most relevant regulatory clause vectors is calculated. Cosine similarity is a standard metric in natural language processing; it focuses on the consistency of vector direction, effectively capturing semantic connections without being affected by text length. The final generated evidence support score is a continuous numerical value. A higher score generally indicates a higher semantic consistency between the model output and authoritative regulations (i.e., a greater likelihood of compliance); a lower score indicates a significant semantic conflict (i.e., a higher risk of violation). This score, along with the judgment result from the dynamic rule engine, is input into the collaborative judgment arbitrator, providing quantifiable, key evidence based on external authoritative evidence for the final comprehensive compliance determination.
[0025] S130. Based on the detection results and the evidence support score, a compliance determination result and the confidence level of the compliance determination result are generated through a collaborative determination arbitrator.
[0026] Specifically, when the collaborative arbitrator generates the final compliance determination result, it comprehensively considers the detection results of the dynamic rule engine (compliant, suspected violation, uncertain) and the evidence support score (a continuous value between 0 and 1) provided by the retrieval enhancement verification model. The collaborative arbitrator has built-in multi-layer judgment logic: The first layer is hard rule triggering. When the detection result is "compliant" and the evidence support score is below 0.3, it is directly judged as compliant; when the detection result is "high-risk violation" and the evidence support score is above 0.8, it is directly judged as a violation. The second layer is confidence-weighted fusion. For the intermediate state of "suspected violation" or "uncertain", the confidence score is calculated using the formula: Confidence score = rule engine weight × rule confidence score + evidence support score weight × evidence score. The rule engine weight and evidence support score weight are dynamically adjusted based on historical verification accuracy. The third layer is threshold judgment. When the confidence score is above 0.7, it is judged as a violation; when it is below 0.3, it is judged as compliant. Intermediate values are marked as "suspected violation" and enter the manual review queue. In addition, a time decay factor has been introduced. For frequently triggered similar violation patterns, the confidence level gradually increases over time to address the identification of new violation methods. It should be noted that this confidence level is crucial for subsequent risk classification and handling, as well as audit follow-up.
[0027] Figure 4 This is a flowchart illustrating a compliance detection method for large models according to another embodiment of the present invention, as shown below. Figure 4 As shown, in this embodiment, the method includes steps S110-S140. That is, in this embodiment, the method further includes step S140 after step S130 in the above embodiment.
[0028] S140. Based on the compliance determination result, the context information associated with the output content, and the processing records of the dynamic rule engine and the retrieval enhancement verification model, a verifiable evidence package is generated.
[0029] Specifically, step S140 includes: encapsulating the compliance judgment result, the context information, and the processing record into a standard data packet; and digitally signing the standard data packet using asymmetric encryption technology to obtain the verifiable evidence packet. More specifically, firstly, the compliance judgment result (such as the final judgment label and confidence level), complete context information (including user query, original output of the large model, timestamp, and subject information), and detailed processing records (triggered rules, retrieved regulatory clauses, and judgment logic chain) are encapsulated into a structured standard data packet in JSON format. Subsequently, the standard data packet is digitally signed using a private key in asymmetric encryption technology. This signing process typically involves calculating a hash value for the data packet (such as using SHA-256 or the national cryptographic algorithm SM3), then encrypting the hash value with the private key to generate a unique digital signature, and attaching it to the data packet to ultimately form a complete and legally valid verifiable evidence packet.
[0030] In one embodiment, such as this embodiment, after step S140, the method further includes: calculating the hash value of the verifiable evidence package and storing the hash value in the blockchain; assigning a unique evidence storage index number to the verifiable evidence package and associating the evidence storage index number with the hash value stored in the blockchain. Specifically, a cryptographic hash algorithm (such as SHA-256 or the national cryptographic algorithm SM3) is used to calculate the digitally signed verifiable evidence package to generate a fixed-length and unique hash value. This hash value serves as an immutable "digital fingerprint" of the verifiable evidence package. Subsequently, this hash value is submitted through the transaction interface of the blockchain network. After confirmation by the consensus mechanism, it is permanently recorded in a specific block of the blockchain, and simultaneously a trusted timestamp issued by a timestamp server is recorded to ensure the credibility of the time point of the evidence's existence. During this process, a unique evidence storage index number is automatically assigned to each evidence package. The index number, along with the hash value of the verifiable evidence package, will be recorded in the off-chain database or the state of the on-chain smart contract, thereby establishing a fast-retrieval association mapping, so that the corresponding hash value on the blockchain can be located by using the evidence storage index number.
[0031] In one embodiment, such as this embodiment, after step S140, the method further includes: when the compliance determination result is a high-risk violation and the confidence level is higher than a first threshold, automatically intercepting the output content and replacing the output content with a predefined security response text, while simultaneously sending a real-time alarm notification to the compliance specialist; when the compliance determination result is a suspected violation or the confidence level is lower than a second threshold, returning the output content to the user, saving the complete record of this interaction and the verifiable evidence package to the manual review queue, and limiting the response frequency of the model instance that generated the output content for similar issues within a subsequent preset time. Specifically, when the compliance determination result is that a certain output content is a "high-risk violation" (e.g., involving illegal information, seriously misleading statements, or core data leakage), and the confidence level of the determination is higher than a preset first threshold, the highest level of emergency response will be immediately initiated. Specific measures include: First, automatically blocking high-risk output content to prevent it from reaching end users; second, seamlessly replacing the output content with pre-set secure response text, such as "Your inquiry involves a complex assessment, I have transferred you to a live customer service representative" or "To ensure the accuracy of the information, this issue needs further verification," to maintain service continuity; and simultaneously, sending real-time alerts containing complete context, judgment criteria, and evidence package indexes to designated compliance specialists so that they can quickly intervene and carry out follow-up processing.
[0032] For outputs with a compliance determination of "suspected violation" (i.e., a possibility of violation but insufficient evidence) or a determination confidence level below the preset second threshold (belonging to the low confidence level category), a relatively lenient but cautious strategy will be adopted. Such outputs will be allowed to be returned to the user to ensure that the service experience is not excessively interrupted. However, the complete record of this interaction, including the user query, the model's original output, details of the triggered rules, retrieval verification evidence, and the collaborative determination logic chain, will be automatically packaged into a verifiable evidence package and sent to a manual review queue for further review by compliance specialists. Furthermore, temporary restrictions will be imposed on the specific model instance that generated this output (identified by the model version ID and service instance ID). Within a preset period (e.g., 24 hours), when it receives a query for the same issue again, its response frequency will be limited or stricter detection rules will be triggered as a preventative risk control measure. Understandably, this dynamic handling mechanism based on risk level and confidence level combines the efficiency of automated response with the accuracy of human judgment, jointly constructing a compliance defense line that balances security and user experience.
[0033] To facilitate understanding, the compliance detection method for large models of this invention will be illustrated with one example each from the fields of fintech and healthcare: A multinational bank deployed an AI compliance detection system in its cross-border payment business. This system monitors transaction risk assessment reports generated by a large-scale model in real time. A dynamic rule engine is loaded with multiple financial regulatory rules. When the dynamic rule engine detects that a transaction involves a high-risk region and the amount exceeds a regulatory threshold, it triggers a "suspected violation" alert. The enhanced verification model then activates, vectorizing the output of the AI compliance detection system and performing a similarity search in a pre-set financial regulation knowledge base. It accurately locates the specific provisions regarding transactions in high-risk regions, calculating an evidence support score as high as 0.92. The system comprehensively determines that the transaction has a high-risk violation with a confidence level of 95%, automatically intercepts the output and replaces it with a safe response stating "This transaction requires manual review," while simultaneously sending a real-time alert notification to the compliance specialist. The entire process takes only 0.1 seconds, effectively preventing potential risks. Furthermore, all decision-making processes generate verifiable evidence packages and store them on the blockchain for evidence preservation, ensuring audit traceability.
[0034] A top-tier hospital integrated a compliance detection module into its AI-assisted diagnostic system to review treatment recommendations generated by a large-scale model. The dynamic rule engine incorporates multiple medical regulations. When the AI-assisted diagnostic system generates a recommendation for targeted therapy with a certain anticancer drug, the dynamic rule engine detects that the drug has not yet been approved for that indication, triggering a "suspected violation" alert. A retrieval-enhanced verification model converts the output from the AI-assisted diagnostic system into query vectors, performs vector similarity searches in a medical regulation knowledge base, and accurately matches prohibitions on off-label drug use, achieving an evidence support score of 0.89. The system determines the recommendation to be a high-risk violation with a 90% confidence level, automatically intercepts it, and replaces it with a safe response stating that "this treatment plan requires confirmation through multidisciplinary consultation," while simultaneously sending a real-time alert to the medical affairs department. All processing records, contextual information, and judgment criteria are encapsulated into verifiable evidence packages, digitally signed using asymmetric encryption technology, and the hash values are stored on a blockchain for evidence preservation, ensuring the compliance and traceability of medical decisions and effectively preventing the risk of medical disputes.
[0035] The compliance detection method for large models in this invention performs rapid initial screening through a dynamic rule engine and in-depth verification through a retrieval-enhanced validation model, thereby achieving real-time and accurate detection of the output content of large models. This effectively solves the problems of low efficiency and high false positive and false negative rates of traditional single detection methods, thus improving the efficiency and accuracy of compliance detection.
[0036] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0037] The software tools or components not belonging to our company that appear in the embodiments of this application are merely examples and do not represent actual use.
[0038] In one embodiment, a compliance testing device 200 for large models is provided, which corresponds one-to-one with the compliance testing methods for large models described in the above embodiments. For example... Figure 5 As shown, the compliance testing device 200 for large models includes a first compliance testing unit 201, a second compliance testing unit 202, and a first generation unit 203. Detailed descriptions of each functional module are as follows: The first compliance detection unit 201 is used to acquire the output content of the large model in real time and use the dynamic rule engine to perform a first compliance detection on the output content to obtain the detection result. The second compliance detection unit 202 is used to perform a second compliance detection on the output content that meets the preset conditions identified by the dynamic rule engine through the retrieval enhancement verification model to generate an evidence support score. The first generation unit 203 is used to generate a compliance determination result and the confidence level of the compliance determination result through a collaborative determination arbitrator based on the detection result and the evidence support score.
[0039] In one embodiment, the first compliance detection unit 201 is specifically used for: The dynamic rule engine scans the output content based on a preset compliance rule base; When the output content is found to meet specific rule conditions, the rule that meets the specific rule conditions is triggered, and the triggered rule ID, the violating text fragment, and the location information of the violating text fragment are recorded. The detection result is generated based on the triggered rule ID, the violating text fragment, and the location information of the violating text fragment, wherein the detection result includes compliance, suspected violation, and uncertainty.
[0040] In one embodiment, the second compliance detection unit 202 is specifically used for: The output content that meets the preset conditions identified by the dynamic rule engine is used as a query vector. Vector similarity retrieval is performed in the preset knowledge base to obtain the most relevant legal clauses. The preset conditions are that the output content whose detection result is suspected violation or uncertain. The distance or similarity between the output content that meets the preset conditions identified by the dynamic rule engine and the semantic embedding vector of the most relevant legal clause is calculated to obtain the evidence support score.
[0041] In one embodiment, the compliance testing device 200 for large models further includes: The second generation unit is used to generate a verifiable evidence package based on the compliance judgment result, context information associated with the output content, and the processing records of the dynamic rule engine and the retrieval enhancement verification model. A computing unit is used to calculate the hash value of the verifiable evidence package and store the hash value in the blockchain; An allocation unit is used to assign a unique evidence storage index number to the verifiable evidence package and associate the evidence storage index number with the hash value stored in the blockchain; The interception and replacement unit is used to automatically intercept the output content and replace the output content with a predefined security response text when the compliance judgment result is a high-risk violation and the confidence level is higher than the first threshold, and at the same time send a real-time alarm notification to the compliance specialist. The storage unit is used to return the output content to the user when the compliance judgment result is suspected violation or the confidence level is lower than the second threshold, and to save the complete record of this interaction and the verifiable evidence package to the manual review queue, and to limit the response frequency of the model instance that generates the output content to the same type of problem in the subsequent preset time.
[0042] In one embodiment, the second generating unit is specifically used for: The compliance determination result, the context information, and the processing record are encapsulated into a standard data packet; The verifiable evidence package is obtained by digitally signing a standard data packet using asymmetric encryption technology.
[0043] The compliance detection device for large models in this invention performs rapid initial screening through a dynamic rule engine and in-depth verification through retrieval enhancement verification models, thereby achieving real-time and accurate detection of the output content of large models. This effectively solves the problems of low efficiency and high false positive and false negative rates of traditional single detection methods, thus improving the efficiency and accuracy of compliance detection.
[0044] Specific limitations regarding compliance testing devices for large models can be found in the limitations of compliance testing methods for large models described above, and will not be repeated here. Each unit in the aforementioned compliance testing device for large models can be implemented entirely or partially through software, hardware, or a combination thereof. These units can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0045] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When executed by the processor, the computer program implements the functions or steps of a compliance detection method for large models on the server side.
[0046] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements client-side functions or steps of a compliance testing method for large-scale models.
[0047] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described compliance detection method for large models.
[0048] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described compliance detection method for large models.
[0049] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0050] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0051] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0052] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A compliance detection method for large models, characterized in that, include: The output content of the large model is acquired in real time, and the dynamic rule engine is used to perform a first compliance check on the output content to obtain the detection result; The enhanced verification model performs a second compliance check on the output content that meets the preset conditions identified by the dynamic rule engine, generating an evidence support score. Based on the test results and the evidence support score, a compliance determination result and the confidence level of the compliance determination result are generated by a collaborative determination arbitrator.
2. The compliance detection method for large models as described in claim 1, characterized in that, The step of using a dynamic rule engine to perform a first compliance check on the output content to obtain the detection result includes: The dynamic rule engine scans the output content based on a preset compliance rule base; When the output content is found to meet specific rule conditions, the rule that meets the specific rule conditions is triggered, and the triggered rule ID, the violating text fragment, and the location information of the violating text fragment are recorded. The detection result is generated based on the triggered rule ID, the violating text fragment, and the location information of the violating text fragment, wherein the detection result includes compliance, suspected violation, and uncertainty.
3. The compliance detection method for large models as described in claim 2, characterized in that, The step of generating an evidence support score by performing a second compliance check on the output content that meets preset conditions identified by the dynamic rule engine through a retrieval-enhanced verification model includes: The output content that meets the preset conditions identified by the dynamic rule engine is used as a query vector. Vector similarity retrieval is performed in the preset knowledge base to obtain the most relevant legal clauses. The preset conditions are that the output content whose detection result is suspected violation or uncertain. The distance or similarity between the output content that meets the preset conditions identified by the dynamic rule engine and the semantic embedding vector of the most relevant legal clause is calculated to obtain the evidence support score.
4. The compliance detection method for large models as described in claim 1, characterized in that, After the step of generating a compliance determination result and the confidence level of the compliance determination result through a collaborative arbitrator based on the detection result and the evidence support score, the method further includes: Based on the compliance determination result, the context information associated with the output content, and the processing records of the dynamic rule engine and the retrieval enhancement verification model, a verifiable evidence package is generated.
5. The compliance detection method for large models as described in claim 4, characterized in that, The step of generating a verifiable evidence package based on the compliance determination result, contextual information associated with the output content, and processing records of the dynamic rule engine and the retrieval enhancement verification model includes: The compliance determination result, the context information, and the processing record are encapsulated into a standard data packet; The verifiable evidence packet is obtained by digitally signing a standard data packet using asymmetric encryption technology.
6. The compliance detection method for large models as described in claim 4, characterized in that, After the step of generating a verifiable evidence package based on the compliance determination result, the context information associated with the output content, and the processing records of the dynamic rule engine and the retrieval enhancement verification model, the method further includes: Calculate the hash value of the verifiable evidence package and store the hash value in the blockchain; Assign a unique evidence storage index number to the verifiable evidence package and associate the evidence storage index number with the hash value stored in the blockchain.
7. The compliance detection method for large models as described in claim 4, characterized in that, After the step of generating a verifiable evidence package based on the compliance determination result, the context information associated with the output content, and the processing records of the dynamic rule engine and the retrieval enhancement verification model, the method further includes: When the compliance determination result is a high-risk violation and the confidence level is higher than the first threshold, the output content is automatically intercepted and replaced with a predefined security response text, while a real-time alarm notification is sent to the compliance specialist. When the compliance determination result is suspected violation or the confidence level is lower than the second threshold, the output content is returned to the user, and the complete record of this interaction and the verifiable evidence package are saved to the manual review queue. The response frequency of the model instance that generates the output content for similar issues is limited within a subsequent preset time.
8. A compliance testing device for large models, characterized in that, include: The first compliance detection unit is used to acquire the output content of the large model in real time and use the dynamic rule engine to perform a first compliance detection on the output content to obtain the detection result. The second compliance detection unit is used to perform a second compliance detection on the output content that meets the preset conditions identified by the dynamic rule engine through the retrieval enhancement verification model to generate an evidence support score. The first generation unit is used to generate a compliance determination result and the confidence level of the compliance determination result through a collaborative determination arbitrator based on the detection result and the evidence support score.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the compliance detection method for large models as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the compliance detection method for large models as described in any one of claims 1 to 7.