Generative large model reasoning result verification method and verification system

By acquiring and reproducing the evidence link of a large language model, verifying its inference process and results, and storing data on a trusted platform, the problem of lack of inference process verification and privacy protection in the existing technology is solved, and the results of large-model inference are realized accuracy and data integrity.

CN118964913APending Publication Date: 2024-11-15SHANGHAI TONGSHI INFORMATION TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411016266.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-27
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The prior art lacks verification of the inference process of large language models, especially in domain-specific knowledge models, and fails to effectively protect privacy and data integrity.

Method used

By obtaining the evidence link of the inference process of large language model, reproducing the inference process and comparing the intermediate result data, verifying the accuracy of the inference results, and storing the root node of the Merkel Patricia tree on a trusted platform to ensure the completeness of the data , protect privacy with a trusted execution environment or zero-knowledge proof.

Benefits of technology

It realizes effective verification of the inference process and results of generative large-scale models, ensures data integrity and privacy protection, and ensures the accuracy and credibility of inference results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964913A_ABST
    Figure CN118964913A_ABST
Patent Text Reader

Abstract

The invention provides a verification method and verification system for a generative large model reasoning result, and the method comprises the steps: obtaining an evidence chain of a large language model reasoning process, and reproducing the large language model reasoning process according to the evidence chain and target model data, and comparing the intermediate result data obtained in each step with the corresponding intermediate result data in the evidence chain when the reasoning process of the large-scale language model is reproduced to obtain a comparison result, and reproducing the next step of the reasoning process of the large-scale language model after the comparison result is judged to meet a verification condition. The verification of the reasoning process of the generative large model can be completed, and after all steps of the reasoning process of the large language model are reproduced, the reasoning result obtained when the reasoning process of the large language model is reproduced is compared with the reasoning result in the evidence chain so as to complete the verification of the reasoning result in the evidence chain. And verification of the generation type large model inference 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 artificial intelligence technology, and in particular to a verification method and a verification system for generative large model reasoning results. Background Art

[0002] Large Language Model (LLM) has made significant progress in the field of Natural Language Processing (NLP) in recent years. However, there are several models in a large language model, and verifying whether the reasoning process of the large language model is carried out in the expected model, especially in the model of specific domain knowledge, is an urgent problem to be solved.

[0003] Currently, existing technologies usually focus on the accuracy of reasoning results, lack verification of the reasoning process itself, and lack protection of privacy and data integrity.

[0004] Therefore, it is necessary to provide a new verification method and verification system for generative large model reasoning results to solve some of the above-mentioned problems existing in the prior art. Summary of the invention

[0005] The purpose of the present invention is to provide a verification method and verification system for generative large model reasoning results, so as to realize the verification of generative large model reasoning process and reasoning results.

[0006] To achieve the above object, the verification method of the generative large model reasoning result of the present invention comprises the following steps:

[0007] S1: Obtaining the evidence chain of the large language model reasoning process, the evidence chain includes input data, some intermediate result data, some weight data, some algorithm random selection numbers and reasoning results;

[0008] S2: Reproducing the reasoning process of the large language model according to the evidence chain and the target model data, and comparing the intermediate result data obtained in each step with the corresponding intermediate result data in the evidence chain when reproducing the reasoning process of the large language model to obtain a comparison result, and after judging that the comparison result meets the verification condition, reproducing the next step of the reasoning process of the large language model;

[0009] S3: After reproducing all the steps of the reasoning process of the large language model, the reasoning result obtained when reproducing the reasoning process of the large language model is compared with the reasoning result in the chain of evidence to complete the verification of the reasoning result in the chain of evidence.

[0010] The beneficial effect of the verification method of the generative large model reasoning result is: obtaining the evidence chain of the large language model reasoning process, reproducing the reasoning process of the large language model according to the evidence chain and the target model data, and comparing the intermediate result data obtained in each step with the corresponding intermediate result data in the evidence chain when reproducing the reasoning process of the large language model to obtain a comparison result, and after judging that the comparison result meets the verification condition, reproducing the next step of the reasoning process of the large language model, so as to complete the verification of the generative large model reasoning process, and after reproducing all the steps of the reasoning process of the large language model, comparing the reasoning result obtained when reproducing the reasoning process of the large language model with the reasoning result in the evidence chain to complete the verification of the reasoning result in the evidence chain, so as to ensure the verification of the reasoning result of the generative large model.

[0011] Optionally, the reasoning process of the large language model includes the following steps:

[0012] S11: converting the input data into digital code;

[0013] S12: converting the digital code into a digital code sequence recognized by the reasoning model;

[0014] S13: The inference model predicts a new digital code sequence based on the digital code sequence;

[0015] S14: Convert the new digital code sequence into the inference result according to the mapping table.

[0016] Optionally, both step S12 and step S13 include several sub-steps.

[0017] Optionally, in step S1, obtaining the evidence chain of the large language model reasoning process includes:

[0018] Obtaining the evidence chain of the large language model in step S12 and step S13 has the beneficial effect of effectively reducing the size and amount of calculation of the evidence chain without affecting the reproducing process of the large language model reasoning.

[0019] Optionally, the method for verifying the generative large model reasoning result further includes:

[0020] forming a Merkle-Patricia tree based on the chain of evidence;

[0021] The root node of the Merkle Patricia tree is transmitted to a trusted platform for storage.

[0022] Optionally, the method for verifying the generative large model reasoning result further includes:

[0023] Encrypting the root node of the Merkle Patricia tree to obtain an encrypted value, and then transmitting the encrypted value to a trusted platform for storage;

[0024] The encryption includes encrypting the root node by an encryption formula to obtain an encrypted value, wherein the encryption formula is c=g v ×h r , c is the encrypted value, g and h are the generators on the elliptic curve, and v is the root node.

[0025] Optionally, the method for verifying the generative large model reasoning result further includes:

[0026] When executing steps S1 to S3, a trusted execution environment or zero-knowledge proof is used to protect the privacy of the large language model and the target model data.

[0027] Optionally, the reasoning process of the large language model includes at least one of a multi-head attention mechanism algorithm and a multi-agent algorithm, and the results that are not discarded in the multi-head attention mechanism algorithm and the multi-agent algorithm are obtained to form the chain of evidence.

[0028] Optionally, comparing the inference result obtained when reproducing the inference process of the large language model with the inference result in the chain of evidence includes:

[0029] Determining whether an inference result obtained when reproducing the inference process of the large language model includes timestamp information;

[0030] If it is determined that the inference result obtained when reproducing the inference process of the large language model does not contain timestamp information, then calculating a hash value of the inference result obtained when reproducing the inference process of the large language model and a hash value of the inference result in the evidence chain;

[0031] The hash value of the inference result obtained when reproducing the reasoning process of the large language model is compared with the hash value of the inference result in the evidence chain. If the hash value of the inference result obtained when reproducing the reasoning process of the large language model is the same as the hash value of the inference result in the evidence chain, the verification passes.

[0032] The present invention also provides a verification system for generative large model reasoning results, including an acquisition unit, a reproduction unit and a comparison unit, wherein the acquisition unit is used to obtain an evidence chain of a large language model reasoning process, wherein the evidence chain includes input data, a plurality of intermediate result data, a plurality of weight data, a plurality of algorithm random selection numbers and a reasoning result; the reproduction unit is used to reproduce the reasoning process of the large language model according to the evidence chain and target model data, and when reproducing the reasoning process of the large language model, the intermediate result data obtained in each step is compared with the corresponding intermediate result data in the evidence chain to obtain a comparison result, and after judging that the comparison result meets the verification condition, the next step of the reasoning process of the large language model is reproduced; the comparison unit is used to compare the reasoning result obtained when reproducing the reasoning process of the large language model with the reasoning result in the evidence chain after the reproduction unit reproduces all steps of the reasoning process of the large language model, so as to complete the verification of the reasoning result in the evidence chain.

[0033] The beneficial effect of the verification system for the generative large model reasoning results is that: the acquisition unit is used to obtain the evidence chain of the large language model reasoning process, the reproduction unit is used to reproduce the reasoning process of the large language model according to the evidence chain and the target model data, and when reproducing the reasoning process of the large language model, the intermediate result data obtained in each step is compared with the corresponding intermediate result data in the evidence chain to obtain a comparison result, and after judging that the comparison result meets the verification condition, the next step of the reasoning process of the large language model is reproduced, so as to complete the verification of the generative large model reasoning process, and the comparison unit is used to compare the reasoning result obtained when reproducing the reasoning process of the large language model with the reasoning result in the evidence chain after the reproduction unit reproduces all the steps of the reasoning process of the large language model, so as to complete the verification of the reasoning result in the evidence chain, thereby ensuring the verification of the reasoning result of the generative large model. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 The present invention is a flowchart of a method for verifying the inference results of a generative large model in some embodiments of the present invention. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein should be understood by people with general skills in the field to which the present invention belongs. "Including" and similar words used in this article mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects.

[0036] In view of the problems existing in the prior art, an embodiment of the present invention provides a method for verifying the inference results of a generative large model. Figure 1 , the verification method of the generative large model reasoning result comprises the following steps:

[0037] S1: Obtaining the evidence chain of the large language model reasoning process, the evidence chain includes input data, some intermediate result data, some weight data, some algorithm random selection numbers and reasoning results;

[0038] S2: Reproducing the reasoning process of the large language model according to the evidence chain and the target model data, and comparing the intermediate result data obtained in each step with the corresponding intermediate result data in the evidence chain when reproducing the reasoning process of the large language model to obtain a comparison result, and after judging that the comparison result meets the verification condition, reproducing the next step of the reasoning process of the large language model;

[0039] S3: After reproducing all the steps of the reasoning process of the large language model, the reasoning result obtained when reproducing the reasoning process of the large language model is compared with the reasoning result in the chain of evidence to complete the verification of the reasoning result in the chain of evidence. Wherein, the target model data is the data of the target model in the reasoning process of the large language model. The reasoning process of the large language model is reproduced by the target model data. If the target model is not used in the reasoning process of the large language model, the intermediate result data in the reproduction process and the intermediate result data in the chain of evidence will be different.

[0040] In some embodiments, the inference process of the large language model includes the following steps:

[0041] S11: converting the input data into digital code;

[0042] S12: converting the digital code into a digital code sequence recognized by the reasoning model;

[0043] S13: The inference model predicts a new digital code sequence based on the digital code sequence;

[0044] S14: Convert the new digital code sequence into the inference result according to the mapping table.

[0045] In some embodiments, steps S11 to S14 are all prior art, which are the reasoning process of a large language model. Steps S12 and S13 both include several sub-steps, wherein the intermediate results and the weight data are matrices, and each matrix operation is a sub-step, which includes but is not limited to self-attention operation, multi-head attention operation, and residual operation. Preferably, in step S1, only the evidence chain of the large language model in steps S12 and S13 is obtained, and the input data of step S12 is used as the initial parameter of the evidence chain, and the data in steps S11 and S14 are abandoned, which can effectively reduce the size of the evidence chain and the amount of calculation.

[0046] In some embodiments, in step S2, if the intermediate result data obtained when reproducing the reasoning process of the large language model is the same as the corresponding intermediate result data in the evidence chain, a first comparison result is obtained, the first result satisfies the verification condition, and then the next step of the reasoning process of the large language model is reproduced. In step S3, if the reasoning result obtained when reproducing the reasoning process of the large language model is the same as the reasoning result in the evidence chain, the reasoning result in the evidence chain is accurate; if the reasoning result obtained when reproducing the reasoning process of the large language model is different from the reasoning result in the evidence chain, the reasoning result in the evidence chain is inaccurate.

[0047] In some embodiments, in step S2, if the intermediate result data obtained when reproducing the reasoning process of the large language model is different from the corresponding intermediate result data in the evidence chain, a second comparison result is obtained. If the second result does not meet the verification condition, it is judged that the reasoning process of the large language model is not carried out in the expected model.

[0048] In some other embodiments, in step S2, if the difference between the intermediate result data obtained when reproducing the reasoning process of the large language model and the corresponding intermediate result data in the evidence chain is within the threshold range, a first comparison result is obtained, and the first result satisfies the verification condition, and then the next step of the reasoning process of the large language model is reproduced, and the intermediate result data obtained when reproducing the reasoning process of the large language model is replaced with the corresponding intermediate result data in the evidence chain. In step S3, if the reasoning result obtained when reproducing the reasoning process of the large language model is the same as the reasoning result in the evidence chain, the reasoning result in the evidence chain is accurate; if the reasoning result obtained when reproducing the reasoning process of the large language model is different from the reasoning result in the evidence chain, the reasoning result in the evidence chain is inaccurate. Because the operation involves floating-point operations, the intermediate results may have slight differences when implemented using floating-point numbers of different hardware instruction sets. Replacing the intermediate result data obtained when reproducing the reasoning process of the large language model with the corresponding intermediate result data in the evidence chain can avoid further amplification of errors and greatly avoid the impact on subsequent verification results.

[0049] In some other embodiments, in step S2, if the difference between the intermediate result data obtained when reproducing the reasoning process of the large language model and the corresponding intermediate result data in the evidence chain is outside the threshold range, a second comparison result is obtained, and the second result does not meet the verification condition, then it is judged that the reasoning process of the large language model is not carried out in the expected model.

[0050] In some embodiments, the method for verifying the generative large model reasoning result further includes:

[0051] Forming a Merkle Patricia Tree according to the chain of evidence;

[0052] The root node of the Merkle Patricia tree is transmitted to a trusted platform for storage, thereby ensuring the integrity and tamper-proofness of the root node.

[0053] In some embodiments, the verification method of the generative large model reasoning result further includes: encrypting the root node of the Merkle Patricia tree to obtain an encrypted value, and then transmitting the encrypted value to a trusted platform for storage; the encryption includes encrypting the root node by an encryption formula to obtain an encrypted value, and the encryption formula is c=g v ×h r, c is an encrypted value, g and h are generators on the elliptic curve, and v is a root node. The trusted platform is, for example, a blockchain. The root node is encrypted by the encryption formula, and when a composite intelligent task for the generative large model is performed, the composite intelligent task can be decomposed into different subtasks to be verified on different verification machines, or only some subtasks can be selected for verification.

[0054] In some embodiments, in step S2, when obtaining the evidence chain data, it is necessary to obtain it from the trusted platform. Send (v, r) to the trusted platform, and the trusted platform verifies whether c is equal to (g v h r )mod q, if c=(g v h r )mod q, then v can be obtained from the trusted platform, otherwise v cannot be obtained from the trusted platform.

[0055] In some embodiments, the verification method of the generative large model reasoning result also includes: when executing steps S1 to S3, using a trusted execution environment or zero-knowledge proof (Zero-Knowledge Proof) to protect the privacy of the large language model and the target model data.

[0056] In some embodiments, the reasoning process of the large language model includes at least one of a multi-head attention algorithm and a multi-agent algorithm. Obtaining the results that are not discarded in the multi-head attention algorithm and the multi-agent algorithm to form the chain of evidence can reduce the size and amount of computation of the chain of evidence and avoid the impact of redundant data.

[0057] In some embodiments, comparing the inference result obtained when reproducing the inference process of the large language model with the inference result in the chain of evidence includes:

[0058] Determining whether an inference result obtained when reproducing the inference process of the large language model includes timestamp information;

[0059] If it is determined that the inference result obtained when reproducing the inference process of the large language model does not contain timestamp information, then calculating a hash value of the inference result obtained when reproducing the inference process of the large language model and a hash value of the inference result in the evidence chain;

[0060] The hash value of the inference result obtained when reproducing the reasoning process of the large language model is compared with the hash value of the inference result in the evidence chain. If the hash value of the inference result obtained when reproducing the reasoning process of the large language model is the same as the hash value of the inference result in the evidence chain, the verification passes.

[0061] The present invention also provides a verification system for implementing a verification method for generative large model reasoning results, comprising an acquisition unit, a reproduction unit and a comparison unit, wherein the acquisition unit is used to obtain an evidence chain of a large language model reasoning process, wherein the evidence chain comprises input data, a plurality of intermediate result data, a plurality of weight data, a plurality of algorithm random selection numbers and a reasoning result; the reproduction unit is used to reproduce the reasoning process of the large language model according to the evidence chain and target model data, and when reproducing the reasoning process of the large language model, the intermediate result data obtained in each step is compared with the corresponding intermediate result data in the evidence chain to obtain a comparison result, and after judging that the comparison result meets the verification condition, the next step of the reasoning process of the large language model is reproduced; the comparison unit is used to compare the reasoning result obtained when reproducing the reasoning process of the large language model with the reasoning result in the evidence chain after the reproduction unit reproduces all steps of the reasoning process of the large language model, so as to complete the verification of the reasoning result in the evidence chain.

[0062] Although the embodiments of the present invention are described in detail above, it is obvious to those skilled in the art that various modifications and variations can be made to these embodiments. However, it should be understood that such modifications and variations are within the scope and spirit of the present invention as described in the claims. Moreover, the present invention described herein may have other embodiments and may be implemented or realized in a variety of ways.

Claims

1. A method for verifying the inference results of a generative large model, characterized in that: The following steps are involved: S1: Obtaining the evidence chain of the large language model reasoning process, the evidence chain includes input data, some intermediate result data, some weight data, some algorithm random selection numbers and reasoning results; S2: Reproducing the reasoning process of the large language model according to the evidence chain and the target model data, and comparing the intermediate result data obtained in each step with the corresponding intermediate result data in the evidence chain when reproducing the reasoning process of the large language model to obtain a comparison result, and after judging that the comparison result meets the verification condition, reproducing the next step of the reasoning process of the large language model; S3: After reproducing all the steps of the reasoning process of the large language model, the reasoning result obtained when reproducing the reasoning process of the large language model is compared with the reasoning result in the chain of evidence to complete the verification of the reasoning result in the chain of evidence.

2. The method for verifying the generative large model reasoning result according to claim 1, characterized in that: The reasoning process of the large language model includes the following steps: S11: converting the input data into digital code; S12: converting the digital code into a digital code sequence recognized by the reasoning model; S13: The inference model predicts a new digital code sequence based on the digital code sequence; S14: Convert the new digital code sequence into the inference result according to the mapping table.

3. The verification method for generative large model reasoning results according to claim 2, characterized in that: Both step S12 and step S13 include several sub-steps.

4. The method for verifying the generative large model reasoning result according to claim 3 is characterized in that: In step S1, the evidence chain of the large language model reasoning process is obtained, including: Obtain the evidence chain of the large language model in step S12 and step S13.

5. The method for verifying the generative large model reasoning result according to claim 1, characterized in that: Also includes: forming a Merkle-Patricia tree based on the chain of evidence; The root node of the Merkle Patricia tree is transmitted to a trusted platform for storage.

6. The method for verifying the generative large model reasoning result according to claim 5, characterized in that: Also includes: Encrypting the root node of the Merkle Patricia tree to obtain an encrypted value, and then transmitting the encrypted value to a trusted platform for storage; The encryption includes encrypting the root node by an encryption formula to obtain an encrypted value, wherein the encryption formula is c=g v ×h r , c is the encrypted value, g and h are the generators on the elliptic curve, and v is the root node.

7. The method for verifying the generative large model reasoning result according to claim 1, characterized in that: Also includes: When executing steps S1 to S3, a trusted execution environment or zero-knowledge proof is used to protect the privacy of the large language model and the target model data.

8. The method for verifying the generative large model reasoning result according to claim 1, characterized in that: The reasoning process of the large language model includes at least one of a multi-head attention mechanism algorithm and a multi-agent algorithm, and the results that are not discarded in the multi-head attention mechanism algorithm and the multi-agent algorithm are obtained to form the chain of evidence.

9. The method for verifying the generative large model reasoning result according to claim 1, characterized in that: Comparing the inference result obtained when reproducing the inference process of the large language model with the inference result in the chain of evidence, including: Determining whether an inference result obtained when reproducing the inference process of the large language model includes timestamp information; If it is determined that the inference result obtained when reproducing the inference process of the large language model does not contain timestamp information, then calculating a hash value of the inference result obtained when reproducing the inference process of the large language model and a hash value of the inference result in the evidence chain; The hash value of the inference result obtained when reproducing the reasoning process of the large language model is compared with the hash value of the inference result in the evidence chain. If the hash value of the inference result obtained when reproducing the reasoning process of the large language model is the same as the hash value of the inference result in the evidence chain, the verification passes.

10. A verification system for generative large model reasoning results, characterized in that: The system comprises an acquisition unit, a reproduction unit and a comparison unit, wherein the acquisition unit is used to acquire an evidence chain of a large language model reasoning process, wherein the evidence chain comprises input data, a plurality of intermediate result data, a plurality of weight data, a plurality of algorithm random selection numbers and a reasoning result; the reproduction unit is used to reproduce the reasoning process of the large language model according to the evidence chain and target model data, and when reproducing the reasoning process of the large language model, the intermediate result data obtained in each step is compared with the corresponding intermediate result data in the evidence chain to obtain a comparison result, and after judging that the comparison result meets the verification condition, the next step of the reasoning process of the large language model is reproduced; The comparison unit is used to compare the inference result obtained when reproducing the inference process of the large language model with the inference result in the chain of evidence after the reproduction unit reproduces all steps of the inference process of the large language model, so as to complete the verification of the inference result in the chain of evidence.

Citation Information

Cited By

  • Large model deployment method and device, equipment, medium and product

    CN120218137A

  • LLM output result verification method and device, storage medium and equipment

    CN120542580A