Generative model block chain reasoning deployment method and system based on quality proof
Through the new inference paradigm based on quality proof, the quality of inference results of the generative AI model is directly evaluated, and combined with the incentive mechanism and the two-stage consensus mechanism, the high cost and latency problems of the generative AI model in the deployment of decentralized networks are solved, achieving low latency, high performance and credible inference effects.
Patent Information
- Application Number
- CN202411618362.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-13
AI Technical Summary
The deployment of generative AI models in decentralized networks faces high costs and unnegligible latency issues, and existing technologies such as ZKML and OPML have significant limitations in scalability and floating-point number processing.
A new reasoning paradigm based on quality proof is proposed. By directly evaluating the quality of model inference results, the credibility of output is ensured, and combined with incentive mechanisms and two-stage consensus mechanisms, the calculation overhead is reduced and processing efficiency is improved.
It realizes low latency, high performance and trusted inference for deploying any large-scale generative models on the blockchain architecture, systematically ensures the integrity of generative model services and reduces computing overhead.
Smart Images

Figure CN119622827A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence technology, and specifically relates to a generative model blockchain reasoning deployment method and system based on quality proof. Background Art
[0002] In recent years, deep learning has brought about revolutionary changes in the field of artificial intelligence, and has made unprecedented progress in many fields such as natural language processing (NLP), image recognition, and audio processing. Generative AI models, such as the GPT series, DALL·E, and Stable Diffusion, have achieved highly innovative tasks by generating text, images, and audio. These models have shown outstanding application potential in many fields such as text generation, dialogue systems, content creation, personalized recommendations, artistic creation, programming assistance, and education, and have become an important tool for improving productivity and efficiency in key areas such as healthcare, financial forecasting, and legal assistance.
[0003] At the same time, blockchain technology, as a decentralized and secure ledger system, provides strong support for data integrity and transparency. Its combination with artificial intelligence not only enhances the security and credibility of AI-used data, but also mitigates the risk of data leakage and fraud. The transparent auditing capabilities of blockchain can enhance the credibility of AI systems and make decisions more robust and responsible. Decentralized AI models can also avoid technology monopoly and promote fairer distribution of technology benefits.
[0004] However, despite the huge potential of combining artificial intelligence with blockchain, the deployment of generative AI models in decentralized networks faces severe challenges. In particular, generative model reasoning usually requires a lot of computing resources, while traditional blockchain consensus mechanisms require repeated calculations on multiple nodes, which leads to high costs and non-negligible delays.
[0005] To address these issues, researchers are exploring advanced cryptographic techniques such as zero-knowledge proofs. However, existing technologies have significant limitations in scalability and handling floating-point numbers, making them unsuitable for real-world generative AI models. Among them, ZKML (Zero-Knowledge Machine Learning) technology attempts to convert deep neural networks into circuits and generate proofs of reasoning operations, but it is only applicable to small models with simple structures and fewer layers. Its technical shortcomings include limited scalability, floating-point processing difficulties, and high computational overhead.
[0006] Another solution is OPML (Optimistic Machine Learning), which is based on the idea of optimistic verification and aims to improve the efficiency of on-chain reasoning by reducing repeated calculations. However, OPML also has technical defects, such as high verification delay, fragility of optimistic assumptions, and high computational cost. Especially when dealing with complex generative models (such as multi-layer Transformer models), OPML still faces similar floating-point arithmetic problems and limited scalability as ZKML.
[0007] In summary, although the combination of generative AI models and blockchain technology has great potential and application value, it still faces many technical challenges. In order to promote further development in this field, it is necessary to continuously explore new technologies and methods to overcome the limitations of existing technologies and achieve low-latency, high-performance and reliable generative model reasoning. This is not only a hot spot and difficulty in current research, but also an important direction for the future development of artificial intelligence and blockchain technology. Summary of the invention
[0008] In view of the above, the purpose of the present invention is to provide a generative model blockchain reasoning deployment method and system based on quality proof, and propose a new reasoning paradigm called quality proof, which ensures the credibility of the output and reduces the computational overhead by directly evaluating the quality of the model reasoning results. The robustness of the quality proof is ensured by combining the incentive mechanism and the two-stage consensus mechanism to support the deployment of any large generative model on the blockchain architecture.
[0009] In order to achieve the above-mentioned invention object, the technical solution provided by the present invention is as follows:
[0010] An embodiment of the present invention provides a generative model blockchain reasoning deployment method based on quality proof, comprising the following steps:
[0011] Input the query to the generative model and output the response to obtain a query-response pair;
[0012] Run the cross-encoder model separately through multiple quality assessors in the blockchain, evaluate the quality of the response based on the query-response pair, and output multiple quality assessment scores encrypted with a private key;
[0013] The quality assessment scores higher than the predetermined threshold are encrypted with the public key and written into the shared file, all the quality assessment scores in the shared file are restored, and the average value of all the quality assessment scores in the shared file is calculated as the final quality assessment score of the response;
[0014] The generative model is further optimized based on the final quality assessment score and the model is deployed.
[0015] Preferably, it also includes:
[0016] Manual quality assessment is performed based on query-response pairs to obtain label quality assessment scores, which are then compared with quality assessment scores generated by multiple quality assessors. Different reward values are given to each quality assessor based on the comparison results, and each quality assessor is optimized.
[0017] Preferably, the quality assessor employs a large language model.
[0018] Preferably, the cross encoder model adopts the BERT model.
[0019] Preferably, the quality assessor performs quality assessment of the responses based on consistency between the responses and the query.
[0020] Preferably, the cross-encoder model supports efficient running on CPU or GPU.
[0021] In the second aspect, in order to achieve the above-mentioned purpose of the invention, an embodiment of the present invention further provides a generative model blockchain reasoning deployment system based on quality proof, which is implemented by the above-mentioned generative model blockchain reasoning deployment method based on quality proof, including: a reasoning module, an evaluation module, a consensus module and an optimization deployment module;
[0022] The reasoning module is used to input a query into a generative model and output a response to obtain a query-response pair;
[0023] The evaluation module is used to respectively run the cross-encoder model through multiple quality assessors in the blockchain, perform quality evaluation on the response based on the query-response pair, and output multiple quality evaluation scores encrypted by a private key;
[0024] The consensus module is used to encrypt the quality assessment score higher than the predetermined threshold value with the public key and write it into the shared file, restore all the quality assessment scores in the shared file, and calculate the average value of all the quality assessment scores in the shared file as the final quality assessment score of the response;
[0025] The optimization deployment module is used to further optimize the generative model based on the final quality assessment score to complete the model deployment.
[0026] Preferably, it also includes: an incentive module;
[0027] The incentive module is used to obtain a label quality assessment score by manually performing quality assessment based on query-response pairs, compare the label quality assessment score with the quality assessment scores generated by multiple quality assessors, assign different reward values to each quality assessor according to the comparison results, and optimize each quality assessor.
[0028] On the third aspect, in order to achieve the above-mentioned purpose of the invention, an embodiment of the present invention also provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to implement the above-mentioned generative model blockchain reasoning deployment method based on quality proof when executing the computer program.
[0029] In the fourth aspect, in order to achieve the above-mentioned purpose of the invention, an embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a computer, the above-mentioned generative model blockchain reasoning deployment method based on quality proof is implemented.
[0030] Compared with the prior art, the present invention has the following beneficial effects:
[0031] (1) Systematically ensuring the integrity of generative model services in a decentralized environment: Unlike the centralized deployment protocol of traditional models, in a fully decentralized environment, especially on a trustless blockchain, it is both important and difficult to systematically ensure the integrity of AI model services. This paper proposes a Proof of Quality (PoQ) approach to ensure the integrity of generative model outputs through an innovative reasoning framework, rather than verifying the entire reasoning process. Traditional verification methods, such as ZKML and OPML, focus on the process of each step of reasoning, while PoQ directly evaluates the quality of the generative model reasoning results to ensure the credibility of the output.
[0032] (2) Verifying the output quality of the generative model without increasing computational overhead: Lightweight quality assessment model is the key to PoQ’s solution to the computational overhead problem. The PoQ proposed in this paper uses a BERT-based cross-encoder model to evaluate the quality of input and output. These evaluation models are much lighter than large generative models, and can therefore significantly reduce computational overhead and improve processing efficiency.
[0033] (3) Maintaining the robustness of the protocol in the face of lazy or malicious participants: The present invention adopts an incentive mechanism and a two-stage consensus mechanism to motivate participants to follow the protocol, prevent lazy or malicious behavior, and ensure the robustness of PoQ. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0035] Figure 1It is a flowchart of a generative model blockchain reasoning deployment method based on quality proof provided by an embodiment of the present invention;
[0036] Figure 2 is a schematic diagram of a PoQ reasoning framework provided by an embodiment of the present invention;
[0037] Figure 3 is a schematic diagram of the evaluation process in the PoQ reasoning framework provided by an embodiment of the present invention;
[0038] Figure 4 It is a structural diagram of a generative model blockchain reasoning deployment system based on quality proof provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0039] To make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific implementation methods described herein are only used to explain the present invention and do not limit the scope of protection of the present invention.
[0040] The inventive concept of the present invention is: in view of the problems of high verification delay, high computational complexity and insufficient robustness in the combination of generative models and blockchains in the prior art, the embodiments of the present invention provide a generative model blockchain reasoning deployment method and system based on quality proof, and propose a new paradigm called Proof of Quality (PoQ), which focuses on verifying the quality of the generative model reasoning output rather than the reasoning process itself, thereby ensuring the credibility of the output; a lightweight cross-encoder model is used for quality assessment, which can reduce computing overhead and improve processing efficiency; the robustness of PoQ can be ensured through an incentive mechanism and a two-stage consensus mechanism, thereby achieving optimized deployment of any large generative model on the blockchain architecture.
[0041] Figure 1 Schematic diagram of the process of deploying a generative model blockchain reasoning method based on quality proof provided by an embodiment of the present invention. Figure 1 As shown, the embodiment provides a generative model blockchain reasoning deployment method based on quality proof, including the following steps:
[0042] S1, inputs the query into the generative model and outputs the response to obtain a query-response pair.
[0043] In generative AI services, the quality of the output is far more important than the inference process. First, users are willing to pay for the service only when the generated response is satisfactory. Second, the quality of the model output is not necessarily proportional to the computational workload of the model. Although scaling laws generally indicate that larger models perform better, actual model behavior may vary. Some small but well-optimized models outperform larger models. Therefore, it is more reasonable to allocate rewards to service providers on the blockchain based on output quality rather than computational workload. Finally, verifying the model inference output is usually much easier than the inference process itself. State-of-the-art NLP models, such as Llama 3 and Mixtral, usually contain billions of parameters, while more streamlined models with millions of parameters can effectively evaluate the output quality of these larger models.
[0044] like Figure 2 As shown, a new paradigm called Proof of Quality (PoQ) proposed in an embodiment of the present invention focuses on verifying the quality of the model reasoning output rather than the reasoning process itself. PoQ is designed to support trustworthy model reasoning services on the blockchain with minimal overhead. Specifically, first, given a user query q, such as a plain text question, a single participant with strong computing power (such as a GPU) runs a generative model with the query as input, generates and outputs a corresponding response r, such as a text answer or an image, through a generation function F within the generative model, and takes the query and response as a query-response pair (q, r).
[0045] S2, through multiple quality assessors in the blockchain, respectively runs the cross-encoder model, based on the query-response pairs, performs quality assessment on the responses and outputs multiple quality assessment scores encrypted with a private key.
[0046] In the new PoQ reasoning framework proposed in the embodiment, it is crucial to choose a suitable evaluation method based on the response domain R. The specific implementation of the framework will vary because different response domains R require very different quality evaluation methods. There is a huge difference between the quality of the generated image and the quality of the chatbot's reply. The cross-encoder technology is now commonly used as a filtering method for the retrieval-augmented generation (RAG) scheme. The basic idea is to connect the text query and the text document, and the combined string is input into a Transformer-based model, such as BERT, to generate a scalar score that measures the consistency between the query and the response, indicating the quality of the query answer. In PoQ, the embodiments of the present invention directly use the fully optimized cross-encoder models available on the Huggingface platform. These models are optimized based on large entities containing question pairs and related documents during model training. The performance statistics of the mainstream cross-encoder models (all BERT models) available in the open source community are summarized in Table 1. The inference latency and running cost of these models are much lower than those of common large language models (LLMs), such as Llama 2 and Mixtral. All of these cross-encoder models are able to run efficiently on both CPU and GPU. Such low resource requirements enable the quality assessment step in PoQ to reduce computational overhead and improve processing efficiency.
[0047] Table 1 Cross-encoder model performance statistics
[0048]
[0049] The performance results in Table 1 show that the cross-encoder model is very efficient, so it is affordable to deploy simpler consensus mechanisms with replicated computation to build robust and responsive decentralized systems.
[0050] In the embodiment, each query-response pair (q, r) is sent to k>1 quality assessors (using a large language model), and the quality assessors run a quality assessment method M: Q×R→S, where Q is the query domain, R is the response domain, and S is the score domain. Each pair of query q and response r is mapped to a score s in the score domain by the quality assessment method M. The score domain is a closed set of real numbers, such as [0, 10], and the larger the number, the better the quality of the response r. The quality assessment scores given by different quality assessors will be aggregated into a group consensus of the overall quality assessment. The potential risk of the collective quality assessment method is that lazy quality assessors may copy the scores of diligent quality assessors, and the possible motivation of these lazy quality assessors is to reduce computational costs and increase profits. In order to avoid potential problems, the embodiment introduces a two-phase consensus mechanism based on encryption, which means that all quality assessors calculate and encrypt the scores in the first phase, and only after the minimum number of scores is met, the public key is released in the second phase to decrypt and reach a consensus. This mechanism avoids the situation where nodes copy the scores of others to ensure that each quality assessor must independently calculate the incoming query and response pair.
[0051] S3, using manual quality assessment based on query-response pairs to obtain label quality assessment scores, using the label quality assessment scores to compare with the quality assessment scores generated by multiple quality assessors, assigning different reward values to each quality assessor according to the comparison results, and optimizing each quality assessor.
[0052] In the embodiment, the overall quality score of the query-response pair is agreed upon in the blockchain network, and the rewards of all participants are determined accordingly. Specifically, a manual method is adopted. First, an expert performs a quality assessment based on the query-response pair to obtain a label quality assessment score. Then, the label quality assessment score is compared with the quality assessment scores generated by multiple quality assessors. Finally, different reward values are assigned to each quality assessor based on the comparison results, and each quality assessor is optimized. This incentive mechanism can improve the robustness of PoQ, motivate participants to follow the protocol, and prevent lazy or malicious behavior.
[0053] S4, encrypting the quality assessment scores higher than the predetermined threshold with the public key and writing them into the shared file, restoring all the quality assessment scores in the shared file, and calculating the average of all the quality assessment scores in the shared file as the final quality assessment score of the response.
[0054] like Figure 3 As shown in the first consensus phase, after receiving the query-response pair, the i-th quality assessor calculates the quality assessment score by running the specified cross-encoder model, i.e., s i =M(q,r). At the same time, the quality assessor generates a pair of public and private keys for encryption. Given the private key Pri and public key Pu i , the quality assessor uses the private key Pr i Encrypt the score and pass the encrypted score to Write to an immutable file that is accessible to every participant in the blockchain network.
[0055] In the second consensus phase, a threshold is set to screen all the quality assessment scores obtained, and the quality assessment scores above the set threshold are written into the shared file using the public key. Any participant can restore the quality assessment score based on the shared file to obtain the decrypted score, and generate the average of the decrypted scores as the final quality assessment score of the response r.
[0056] The above two-stage mechanism has low operating costs because the public / private key generation and encryption process are efficient on modern CPUs or GPUs. Only minimal delay is incurred while waiting for all quality assessors to finalize their quality scores.
[0057] S5, further optimize the generative model based on the final quality assessment score and complete the model deployment.
[0058] In the embodiment, the performance of the generative model in different aspects is understood based on the final quality assessment score obtained. For example, it is possible to analyze which query types the model performs better on, which query types the model performs worse on, or which generation aspects (such as syntax, semantics, fluency, etc.) score higher and which score lower. According to the optimization direction, the parameters and structure of the model are adjusted, the retrained model is used again to generate responses, and a new quality assessment score is calculated until the iterative optimization reaches a satisfactory performance level, and then the generative model is deployed to the actual application scenario.
[0059] In summary, the embodiment of the present invention provides a generative model blockchain reasoning deployment method based on quality proof. Directly evaluating the quality of the generative model reasoning result through the new paradigm of quality proof can ensure the credibility of the output. Using the BERT-based cross encoder model to evaluate the quality of input and output can greatly reduce the computational overhead and improve processing efficiency. The use of incentive mechanism and two-stage consensus mechanism in the new paradigm of quality proof can prevent laziness or malicious behavior and ensure the robustness of PoQ.
[0060] Based on the same inventive concept, Figure 4 As shown, an embodiment of the present invention also provides a generative model blockchain reasoning deployment system 400 based on quality proof, including: a reasoning module 410, an evaluation module 420, an incentive module 430, a consensus module 440 and an optimization deployment module 450.
[0061] The reasoning module 410 is used to input a query into the generative model and output a response to obtain a query-response pair.
[0062] The evaluation module 420 is used to respectively run the cross-encoder model through multiple quality assessors in the blockchain, perform quality evaluation on the response based on the query-response pair, and output multiple quality evaluation scores encrypted by a private key.
[0063] The incentive module 430 is used to obtain a label quality assessment score by manually performing quality assessment based on query-response pairs, compare the label quality assessment score with the quality assessment scores generated by multiple quality assessors, assign different reward values to each quality assessor according to the comparison results, and optimize each quality assessor.
[0064] The consensus module 440 is used to encrypt the quality assessment scores above the predetermined threshold with the public key and write them into the shared file, restore all the quality assessment scores in the shared file, and calculate the average of all the quality assessment scores in the shared file as the final quality assessment score of the response.
[0065] The optimization deployment module 450 is used to further optimize the generative model based on the final quality assessment score and complete the model deployment.
[0066] Based on the same inventive concept, an embodiment of the present invention also provides an electronic device, including a memory and a processor, the memory is used to store a computer program, and the processor is used to implement the above-mentioned generative model blockchain reasoning deployment method based on quality proof when executing the computer program.
[0067] Based on the same inventive concept, an embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a computer, the above-mentioned generative model blockchain reasoning deployment method based on quality proof is implemented.
[0068] It should be noted that the generative model blockchain reasoning deployment system based on quality proof, electronic device and computer-readable storage medium provided in the above embodiments all belong to the same inventive concept as the generative model blockchain reasoning deployment method based on quality proof. The specific implementation process is detailed in the embodiment of the generative model blockchain reasoning deployment method based on quality proof, which will not be repeated here.
[0069] The specific implementation methods described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A generative model blockchain reasoning deployment method based on quality proof, characterized in that: The following steps are involved: Input the query to the generative model and output the response to obtain a query-response pair; Run the cross-encoder model separately through multiple quality assessors in the blockchain, evaluate the quality of the response based on the query-response pair, and output multiple quality assessment scores encrypted with a private key; The quality assessment scores higher than the predetermined threshold are encrypted with the public key and written into the shared file, all the quality assessment scores in the shared file are restored, and the average value of all the quality assessment scores in the shared file is calculated as the final quality assessment score of the response; The generative model is further optimized based on the final quality assessment score and the model is deployed.
2. The method for deploying a generative model blockchain inference based on quality proof according to claim 1, characterized in that: Also includes: Manual quality assessment is performed based on query-response pairs to obtain label quality assessment scores, which are then compared with quality assessment scores generated by multiple quality assessors. Different reward values are given to each quality assessor based on the comparison results, and each quality assessor is optimized.
3. The method for deploying a generative model blockchain reasoning based on quality proof according to claim 1 or 2, characterized in that: Quality assessors use large language models.
4. The method for deploying a generative model blockchain reasoning based on quality proof according to claim 1, characterized in that: The cross encoder model adopts the BERT model.
5. The method for deploying a generative model blockchain reasoning based on quality proof according to claim 1, characterized in that: Quality assessors assess the quality of responses based on their consistency with the query.
6. The method for deploying a generative model blockchain reasoning based on quality proof according to claim 1, characterized in that: The cross-encoder model supports efficient running on CPU or GPU.
7. A generative model blockchain reasoning deployment system based on quality proof, implemented by the generative model blockchain reasoning deployment method based on quality proof according to any one of claims 1 to 6, characterized in that: include: Reasoning module, evaluation module, consensus module and optimization deployment module; The reasoning module is used to input a query into a generative model and output a response to obtain a query-response pair; The evaluation module is used to respectively run the cross-encoder model through multiple quality assessors in the blockchain, perform quality evaluation on the response based on the query-response pair, and output multiple quality evaluation scores encrypted by a private key; The consensus module is used to encrypt the quality assessment score higher than the predetermined threshold value with the public key and write it into the shared file, restore all the quality assessment scores in the shared file, and calculate the average value of all the quality assessment scores in the shared file as the final quality assessment score of the response; The optimization deployment module is used to further optimize the generative model based on the final quality assessment score to complete the model deployment.
8. The generative model blockchain reasoning deployment system based on quality proof according to claim 7 is characterized in that: Also includes: Incentive module; The incentive module is used to obtain a label quality assessment score by manually performing quality assessment based on query-response pairs, compare the label quality assessment score with the quality assessment scores generated by multiple quality assessors, assign different reward values to each quality assessor according to the comparison results, and optimize each quality assessor.
9. An electronic device comprising a memory and a processor, wherein the memory is used to store a computer program, wherein: The processor is used to implement the generative model blockchain reasoning deployment method based on quality proof as described in any one of claims 1-6 when executing the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a computer, the generative model blockchain reasoning deployment method based on quality proof as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Crowdsourcing quality safety assessment method based on federated learning under assistance of block chain
CN116777294A
Automatic optimization method and device for cue word, equipment and storage medium
CN117520507A
Blockchain-based decentralized computing
US20220012367A1
Method for training text quality assessment model and method for determining text quality
WO2023284327A1