Blockchain-based verifiable large model privacy inference method, device and medium
By storing the local coordinate encoding and polynomial commitments of sparse matrices on the blockchain, the problems of high computational resource consumption for online verification of structured sparse matrices and difficulty in offline structural proof are solved, achieving improved security and efficiency for end-to-end zero-knowledge attributes and asynchronous auditing.
Patent Information
- Application Number
- CN202611335873.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-11-24
AI Technical Summary
Existing zero-knowledge proof schemes fail to effectively decouple the position verification and linear computation verification of structured sparse matrices, resulting in excessive computational resource consumption during the online inference phase and difficulties in formalizing the correctness proof of offline structures.
By employing a blockchain-based approach, the local coordinates of a sparse matrix are encoded into kernel functions to generate polynomial commitments. These commitments are then packaged into offline model certificates and stored on the blockchain through Boolean proofs and offline structural consistency proofs, thus achieving end-to-end zero-knowledge attribute guarantees.
It achieves the unforgeability of offline structures, eliminates engineering assumptions, provides mathematically provable security guarantees for model authentication on the blockchain, supports asynchronous auditing, and improves verification efficiency.
Smart Images

Figure CN123159535A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the intersection of zero-knowledge proof systems, verifiable machine learning, and blockchain smart contract technologies. Specifically, it relates to a blockchain-based verifiable large-model privacy inference method, device, and medium. In particular, it relates to an algebraic index routing proof system for authenticating the location metadata of structured sparse matrices, including Boolean proof, routing consistency proof, structure binding security theorem, as well as an algebraic reasoning unforgeability theorem and end-to-end zero-knowledge attribute guarantee during the online reasoning phase. Background Technology
[0002] Verifiable reasoning for large language models is a cutting-edge topic at the intersection of cryptography and machine learning. In the Model-as-a-Service deployment paradigm, cloud providers host large, closed-source models, and users submit queries to retrieve the reasoning results. Users face significant verifiability challenges: providers may secretly replace these models with cheaper, smaller ones to reduce costs, or simplify the computational path to incomplete ones, leaving users unable to audit the correctness of the reasoning.
[0003] To address this trust problem without exposing model weights, academia has proposed verifiable machine learning based on zero-knowledge proofs. Current mainstream solutions are based on Thaler's matrix multiplication optimization protocol, which transforms matrix multiplication relations into low-order polynomial identities through multilinear extensions and summation verification protocols, reducing the prover's complexity to... However, when the matrix dimension exceeds ten thousand, even... The computational load also becomes unacceptable.
[0004] To accelerate reasoning, the hardware industry widely adopts structured sparsity techniques to improve the throughput of matrix multiplication. However, existing zero-knowledge proof schemes fail to effectively utilize this structured sparsity—they either treat sparse matrices as dense matrices, employ opportunistic zero-hop strategies to skip computations only when the input is exactly zero, or require dynamic parsing and verification of the global coordinates of non-zero elements during the online phase.
[0005] The essence of the above problem lies in the fact that existing solutions do not decouple position verification from linear computation verification. Cryptographic verification of the position coordinates of the structured sparse matrix continuously consumes computational resources on the online critical path. Although offline preprocessing can precompile position information into an indexless form, how to formally prove the correctness of the offline structure using cryptographic means remains an unsolved problem in existing technologies. Summary of the Invention
[0006] The purpose of this invention is to address the shortcomings of existing technologies by providing a blockchain-based verifiable large-model privacy inference method, device, and medium. This provides complete cryptographic security for offline structure authentication and online inference verification under structured sparse model conditions, and achieves end-to-end zero-knowledge attributes at the complete protocol level.
[0007] To achieve the above objectives, the present invention adopts the following technical solution: This invention provides a blockchain-based verifiable large-model privacy inference method, comprising the following steps: S1: For the structured sparse weight matrix of a large language model, the local coordinates of each retained value in the weight matrix are... The encoding is a kernel function, which is used to transform the weight values and local coordinates into an algebraic relationship of the weight table, and a polynomial commitment scheme is used to generate polynomial commitments for the weight table. S2: Prove the strict Boolean property of coordinate variables, and obtain the proof of the Boolean property of coordinate variables; S3: Multilinear expansion of the weight table Multilinear expansion of weight values and multilinear extension of local coordinates Perform offline structural consistency proof to obtain proof of offline structural consistency; S4: Package the Boolean proof and offline consistency proof into an offline model certificate, and submit it to the blockchain contract together with the polynomial commitment to complete the one-time model structure authentication; S5: When a user submits a large language model inference query, the prover performs a zero-knowledge proof on the multiplication relationship between the weight matrix of the large language model and the input vector corresponding to the user query. Both parties perform a summation test to verify the polynomial identity of the multiplication relationship, and finally output the verifiable large model inference result with zero-knowledge proof to the user.
[0008] Further, in step S1, the local coordinates The kernel function is specifically: in, Indicates the bit length of the local coordinates. As an auxiliary variable, and They represent and The One binary bit; Furthermore, in step S1, the algebraic relationship of the weight table is specifically as follows: Where u is the block index of the matrix, and k is the index of the non-zero element within the block. As a dimension variable, It is a multilinear extension.
[0009] Furthermore, in step S2, proving the strict Boolean property of the coordinate variables specifically involves: Let the domain variable be ,in The indicator function is ; Multilinear extension of local coordinates after random linear aggregation The verification method samples random evaluation points. and random aggregation coefficients The proof verifies the strict Boolean property of all coordinate variables by verifying, through a summation test protocol, that the summation of the polynomial at all Boolean input points is always zero; that is, it proves the following identity: Finally, we obtain the Boolean proof of the coordinate variables, that is, the cryptographic proof that all local coordinates strictly take the value of 0 or 1.
[0010] Furthermore, in step S3, the offline structural consistency proof specifically involves: setting the domain variable... Multilinear expansion of the weight table Multilinear expansion of weight values and multilinear extension of local coordinates The verification method samples random evaluation points. and random aggregation coefficients ; Leveraging the homomorphic property of multinomial commitment schemes, the verifier locally uses publicly available... Polynomial commitment of linear combination weight table Get aggregate commitment and in The request is to open to retrieve the aggregate value on the left. The proof party passed Round-trip summation tests prove that the value of the weight table at any random point is equal to the weight value and the value obtained by recalculating the local coordinates using a kernel function, and that the random terminal point generated after the protocol ends... The proof is open. and all The verifier evaluates the routing expression locally. The proof is then completed by comparing it with the summation test terminal assertion, thus obtaining a proof of offline structural consistency.
[0011] Furthermore, in step S4, the offline model certificate and the polynomial commitment are permanently stored on the blockchain. Any verifier can retrieve and perform asynchronous audits at any time during the online inference phase without needing to engage in additional offline interaction with the prover.
[0012] Further, in step S5, The multiplication operation relationship is specifically as follows: ; The zero-knowledge proof specifically involves: for the multiplication operation relationship, the verifier samples a row of random challenge points. And using multilinear equation indicator functions Output vector Compressed into a single-point evaluation scalar Define row aggregation table The multiplication relationship is transformed into an inner product equation. The prover and the verifier are working on the target polynomial. Perform the summation test protocol.
[0013] Furthermore, after After the round-robin check protocol interaction, the random challenge sequence from the verifiers constitutes a continuous non-Boolean terminal. ; Summation check protocol output terminal assertion: The verifier utilizes the homomorphic combinatorial property of polynomial commitments to directly synthesize terminal commitments from the polynomial commitments; the verifier calculates locally: Let the terminal polynomial Based on algebraic identities The prover only needs to generate a batch polynomial commitment to open the proof, opening three values: the initial output declaration. Terminal input data and the model values of homomorphic synthesis Verification party verifies the terminal equation. If true, output the verifiable large model reasoning result with accompanying zero-knowledge proof, confirming that the prover correctly performed the large model matrix multiplication, without needing to verify sparse coordinates in the critical path throughout the process.
[0014] Compared with the prior art, the beneficial effects of the present invention are mainly reflected in the following aspects: Offline security: Offline structure authentication provides unforgeability, eliminates engineering assumptions, and provides mathematically provable security for model authentication on the blockchain; End-to-end zero-knowledge assurance: Supports the protection of model intellectual property rights in real-world deployments; Blockchain compatibility: Offline certificates and commitments are stored on-chain, allowing verifiers to query them at any time without real-time interaction with the proviser, supporting asynchronous auditing scenarios. Attached Figure Description
[0015] Figure 1 This is a flowchart of the blockchain-based verifiable large-model privacy inference method provided by the present invention; Figure 2 This is a structural diagram of the electronic device provided by the present invention. Detailed Implementation
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments 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.
[0017] like Figure 1 As shown, the blockchain-based verifiable large-model privacy inference method provided by this invention includes the following steps: S1: Offline Structure Construction For a structured sparse weight matrix in a large language model, the weight matrix consists of several non-zero weight values and their corresponding local coordinates. Local coordinates of each retained value Encode as a kernel function: in, Indicates the bit length of the coordinate. As an auxiliary variable, and They represent and The One binary digit.
[0018] This kernel function transforms the weight values and local coordinates in the weight matrix into an algebraic relationship in the weight table, enabling the verification of sparse structures in large models to be performed completely independently of online computation.
[0019] Specifically, let u be the block index of the matrix, and k be the index of the non-zero element within the block. As a dimension variable, For multilinear expansion, the algebraic relation of the weight table is obtained as follows: This formula transforms a process that requires dynamic lookup into a pure polynomial equation, thus allowing the process to be included in the verification scope of the standard summation test protocol.
[0020] The weight matrix needs to be committed, and a multinomial commitment scheme is used to calculate and generate multinomial commitments for the weight table. .
[0021] S2: Boolean proof If an attacker maliciously submits non-Boolean local coordinates, the correctness of the kernel function cannot be guaranteed. Therefore, offline structure construction must first prove the strict Boolean nature of the coordinate variables.
[0022] Domain variable ,in The indicator function is .
[0023] Multilinear extension of local coordinates after random linear aggregation The verification method samples random evaluation points. and random aggregation coefficients The proof verifies the strict Boolean property of all coordinate variables by verifying, through a summation test protocol, that the summation of the polynomial at all Boolean input points is always zero. This is equivalent to proving the following identity: This step ultimately outputs a Boolean proof of the local coordinate variables, that is, a cryptographic proof that all local coordinates strictly take the value of 0 or 1. This proof will serve as a prerequisite for subsequent kernel function construction and as part of the offline model certificate.
[0024] S3: Offline structural consistency proof The purpose of offline structural consistency proof is to implement multinomial commitments. and Cryptographic binding ensures that the promised data is indeed generated according to the regulations.
[0025] Domain variable Multilinear expansion of the weight table Multilinear expansion of weight values and multilinear extension of local coordinates The verification method samples random evaluation points. and random aggregation coefficients Utilizing the homomorphic property of multinomial commitment schemes, the verifier locally uses publicly available... Polynomial commitment of linear combination weight table Obtain the aggregation commitment: And in The request is to open to obtain the aggregated values on the left: Proof of the case The round-sum test protocol proves that the value of the aggregated weight table at any random point is equal to the weight value and the value recalculated using a kernel function based on the local coordinates, thus cryptographically binding the commitment of the weight table to the underlying weight values. Random terminal points are generated after the protocol ends. The proof is open. and all The verifier evaluates the routing expression locally. The proof is then completed by comparing the result with the terminal assertion of the summation test.
[0026] This step ultimately outputs a proof of offline structural consistency, which will serve as a prerequisite for subsequent kernel function construction and an offline model certificate.
[0027] S4: Offline model certificate on-chain The proofs from steps S2 and S3 are packaged into an offline model certificate and submitted to the blockchain contract together with the polynomial commitment to complete the one-time model structure certification. This step ultimately outputs an offline model certificate and a multinomial commitment stored on the blockchain. This certificate and multinomial commitment are permanently stored on the blockchain and can be retrieved and asynchronously audited at any time during the online inference phase, without requiring additional offline interaction with the proving party.
[0028] S5: Online Reasoning Proof After a user submits a large language model inference query, the prover needs to determine the multiplication relationship between the weight matrix of the large language model and the input vector corresponding to the user query. Perform online zero-knowledge proofs.
[0029] For the aforementioned multiplication operation relationship, the verifier samples a row of random challenge points. Using multilinear equation indicator functions The verifier and the proviser will output a high-dimensional vector. Compressed into a single-point evaluated scalar: Define row aggregation table Therefore, matrix-vector multiplication is rigorously transformed into a one-dimensional inner product relation along the column dimension: .
[0030] The prover and verifier transform the above inner product relation into a summation test of a multilinear extended form. The objective polynomial is set as follows: .go through After the round-robin check protocol interaction, the random challenge sequence from the verifiers constitutes a continuous non-Boolean terminal. At this point, the summation check protocol output terminal asserts: The key to the agreement is that the verifying party must verify... However, row aggregation table This involves online querying of relevant dynamic variables. To this end, the verifier utilizes the homomorphic combinatorial property of polynomial commitments (PCS) to directly extract the polynomial commitments solidified on the blockchain in steps S3 and S4. The terminal in the middle of the synthesis process commits to this. The verifier performs the calculation locally: Let the terminal polynomial Based on algebraic identities The prover only needs to generate a batch polynomial commitment to open the proof, opening three values: the initial output declaration. Terminal input data and the model values of homomorphic synthesis Finally, the verifier verifies the terminal equation. Is it true? If it is true, then it is certain that the proof correctly performed the large model matrix multiplication, and there is no need to verify sparse coordinates in the critical path throughout the process.
[0031] Example 1: Complete Authentication Process for Structured Sparse Large Model Inference 1.1 Scene Setting The 4096-dimensional weight matrix of the large language model query projection layer is selected as the authentication object, and a 2:4 structured sparsity is adopted.
[0032] 1.2 Offline Structure Local coordinates Kernel function: Only when When the output is 1, it satisfies the indicative function.
[0033] 1.3 Boolean Proof Execution Round-robin summation test. Verification sampling: , Summation test polynomial: If all If all values in the domain are Boolean, then In each This holds true, and each expansion is a zero polynomial. The proof is open. The verifier first checks for Boolean property, then verifies the terminal assertion value. It is consistent with the polynomial value at the terminal point.
[0034] 1.4 Execution of Route Consistency Proof Round-robin summation test. Verification sampling: , Aggregate commitment: Through the homomorphic property of PCS, exist The place is open The proof is demonstrated through 22 rounds of summation: Proof of opening and The verifier locally evaluates the right-hand routing expression and compares the summation to verify the terminal assertion.
[0035] 1.5 Online Reasoning Proof Execution After a user initiates an online large language model query, the output vector is... and input vector All dimensions are 4096. The validator samples random row challenge points. This compresses the output vector into a single-point evaluation. .
[0036] Regarding the inner product relation, the prover and the verifier perform... The round-summation verification protocol. The random challenge sequence of the verifiers constitutes a random terminal. Sum and check the output terminal assertion value. For the four local coordinates The verification team first calculates the multilinear interpolation weights. Subsequently, the verifier uses four static weight tables to commit, and locally synthesizes terminal commitments using the PCS additive homomorphic property: The prover generates a batch of open proofs and opens the input vector to the verifier. value at and the commitment to terminal aggregation in Homomorphic evaluation value at Verification by the verifier Due to the commitment of synthetic terminals The evaluation directly replaces the opening of the 4096-dimensional dense matrix, and the online proof completely avoids processing... The coordinate lookup cost, and the open domain size on the model side from Strictly reduced to This greatly improves verification efficiency.
[0037] like Figure 2 As shown, this application provides an electronic device including a memory 101 for storing one or more programs and a processor 102. When the one or more programs are executed by the processor 102, they implement the method as described in any of the first aspects above.
[0038] The system also includes a communication interface 103. The memory 101, processor 102, and communication interface 103 are electrically connected directly or indirectly to each other to enable data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses or signal lines. The memory 101 can be used to store software programs and modules, and the processor 102 executes various functional applications and data processing by executing the software programs and modules stored in the memory 101. The communication interface 103 can be used for signaling or data communication with other node devices.
[0039] The memory 101 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0040] The processor 102 can be an integrated circuit chip with signal processing capabilities. The processor 102 can be a general-purpose processor 102, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0041] In the embodiments provided in this application, it should be understood that the disclosed methods and systems can also be implemented in other ways. The method and system embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0042] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0043] On the other hand, embodiments of this application provide a computer-readable storage medium storing a computer program thereon. When executed by processor 102, the computer program implements the methods described in any of the first aspects above. If the functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
Claims
1. A verifiable large-model privacy inference method based on blockchain, characterized in that, Includes the following steps: S1: For the structured sparse weight matrix of a large language model, the local coordinates of each retained value in the weight matrix are... The encoding is a kernel function, which is used to transform the weight values and local coordinates into an algebraic relationship of the weight table, and a polynomial commitment scheme is used to generate polynomial commitments for the weight table. S2: Prove the strict Boolean property of coordinate variables, and obtain the proof of the Boolean property of coordinate variables; S3: Multilinear expansion of the weight table Multilinear expansion of weight values and multilinear extension of local coordinates Perform offline structural consistency proof to obtain proof of offline structural consistency; S4: Package the Boolean proof and offline consistency proof into an offline model certificate, and submit it to the blockchain contract together with the polynomial commitment to complete the one-time model structure authentication; S5: When a user submits a large language model inference query, the prover performs a zero-knowledge proof on the multiplication relationship between the weight matrix of the large language model and the input vector corresponding to the user query. Both parties perform a summation test to verify the polynomial identity of the multiplication relationship, and finally output the verifiable large model inference result with zero-knowledge proof to the user.
2. The method according to claim 1, characterized in that, In step S1, the local coordinates The kernel function is specifically: ;in, Indicates the bit length of the local coordinates. As an auxiliary variable, and They represent and The One binary digit.
3. The method according to claim 1, characterized in that, In step S1, the algebraic relationship of the weight table is specifically as follows: Where u is the block index of the matrix, and k is the index of the non-zero element within the block. As a dimension variable, It is a multilinear extension.
4. The method according to claim 1, characterized in that, In step S2, proving the strict Boolean property of the coordinate variables specifically involves: Let the domain variable be ,in The indicator function is ; Multilinear extension of local coordinates after random linear aggregation The verification method samples random evaluation points. and random aggregation coefficients The proof verifies the strict Boolean property of all coordinate variables by verifying, through a summation test protocol, that the summation of the polynomial at all Boolean input points is always zero; that is, it proves the following identity: Finally, we obtain the Boolean proof of the coordinate variables, that is, the cryptographic proof that all local coordinates strictly take the value of 0 or 1.
5. The method according to claim 1, characterized in that, In step S3, the offline structural consistency proof specifically involves: setting domain variables Multilinear expansion of the weight table Multilinear expansion of weight values and multilinear extension of local coordinates The verification method samples random evaluation points. and random aggregation coefficients ; Leveraging the homomorphic property of multinomial commitment schemes, the verifier locally uses publicly available... Polynomial commitment of linear combination weight table Get aggregate commitment and in The request is to open to retrieve the aggregate value on the left. The proof is passed Round-trip summation tests prove that the value of the weight table at any random point is equal to the weight value and the value obtained by recalculating the local coordinates using a kernel function, and this is also true for the random terminal points generated after the protocol ends. The proof is open. and all The verifier evaluates the routing expression locally. The proof is then completed by comparing it with the summation test terminal assertion, thus obtaining a proof of offline structural consistency.
6. The method according to claim 1, characterized in that, In step S4, the offline model certificate and polynomial commitment are permanently stored on the blockchain. Any verifier can retrieve and audit them asynchronously at any time during the online inference phase without needing additional offline interaction with the prover.
7. The method according to claim 1, characterized in that, In step S5, The multiplication operation relationship is specifically as follows: ; The zero-knowledge proof specifically involves: for the multiplication operation relationship, the verifier samples a row of random challenge points. And using multilinear equation indicator functions Output vector Compressed into a single-point evaluation scalar Define row aggregation table The multiplication relationship is transformed into an inner product equation. The prover and the verifier are working on the target polynomial. Perform the summation test protocol.
8. The method according to claim 7, characterized in that, go through After the round-robin check protocol interaction, the random challenge sequence of the verifiers constitutes a continuous non-Boolean terminal. ; Summation check protocol output terminal assertion: The verifier utilizes the homomorphic combinatorial property of polynomial commitments to directly synthesize terminal commitments from the polynomial commitments; the verifier calculates locally: Let the terminal polynomial Based on algebraic identities The prover only needs to generate a batch polynomial commitment to open the proof, opening three values: the initial output declaration. Terminal input data and the model values of homomorphic synthesis Verification party verifies the terminal equation. If true, output the verifiable large model reasoning result with accompanying zero-knowledge proof, confirming that the prover correctly performed the large model matrix multiplication, without needing to verify sparse coordinates in the critical path throughout the process.
9. An electronic device comprising a memory and a processor, characterized in that, The memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the blockchain-based verifiable large-model privacy inference method according to any one of claims 1-8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the blockchain-based verifiable large-model privacy inference method as described in any one of claims 1-8.
