Privacy protection method for Transform model in end-side equipment reasoning scene

By using slice separation technology and efficient obfuscation algorithm of trusted execution environment in the end-side device inference scenario, the Transformer model is protected in privacy, solving the problem of performance and security contradictions, and achieving efficient privacy protection and inference performance of the model. Take into account both.

CN119026166APending Publication Date: 2024-11-26PEKING UNIV
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411141508.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

In the end-side device inference scenario, the existing obfuscation methods have performance and security contradictions in the Transformer model, and cannot take into account both model privacy and security and efficient inference calculation.

Method used

Using slice separation technology based on trusted execution environment, the model is divided into computationally intensive parts and deployed on the GPU, and the other parts are deployed in trusted execution environment. The matrix row vector is added and modulo-length unified by obfuscating keys, and The row order is disrupted, and the model reasoning is implemented by combining the coordinated interaction between the GPU and the trusted execution environment.

Benefits of technology

It improves the privacy security of the model under the end-side deployment, avoids attackers from obtaining privacy matrix information by publicly resuming confusing results by publicly resuming obfuscated results, while maintaining efficient inference performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119026166A_ABST
    Figure CN119026166A_ABST
Patent Text Reader

Abstract

The invention discloses a privacy protection method for a Transform model in an end-side equipment reasoning scene, and belongs to the field of artificial intelligence and computer network security. According to the method, a model is separated based on a model slice separation technology of a trusted execution environment, a model part with dense calculation is deployed in a GPU after being confused, the remaining part is deployed in the trusted execution environment, and a reasoning process is realized through cooperative interaction of the GPU and the trusted execution environment. According to the method, the security characteristic of the trusted execution environment and the efficient computing power of the GPU can be utilized at the same time, so that the privacy security and reasoning performance of the model are considered. The privacy security of the model under end-side deployment can be improved, and an attacker is prevented from obtaining key information of the privacy model through comparison with a public pre-training model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention provides a privacy protection method for a Transformer model in an end-side device reasoning scenario, and specifically relates to an efficient obfuscation algorithm utilizing a trusted execution environment, and belongs to the field of artificial intelligence and computer network security. Background Art

[0002] With the rapid development of deep neural networks and large language models, end-side machine learning has become the preferred choice for many companies and platforms to provide services. Specifically, the training of network models is still completed in a remote platform with stronger computing power. After the training is completed, the model will be deployed on the edge device, and the reasoning process will be performed on the user side. In the scenario of end-side machine learning, personal data is retained on the edge device, eliminating the overhead caused by frequent data transmission. The trained model is deployed on the user side at one time, and the user can freely choose the time and frequency of using the model, which fundamentally solves the problems of user privacy exposure and delayed waiting in cloud reasoning.

[0003] However, machine learning on the edge brings model privacy and security issues: since the model is ultimately deployed and inferred on edge devices, users can obtain complete information about the model, which greatly increases the success rate of attacks such as model theft attacks, causing serious losses to model providers. In order to solve the privacy and security issues, model slicing separation technology based on a trusted execution environment is a common method, which is to separate the model, deploy the computationally intensive part in the GPU after obfuscation, and deploy the remaining part in the trusted execution environment. This type of method can, to a certain extent, simultaneously utilize the security features of the trusted execution environment and the efficient computing power of the GPU, thereby taking into account both the privacy and security of the model and the inference performance. It is worth noting that since most of the model weights are deployed on the GPU after obfuscation (i.e., visible to the device owner), the security of this type of method depends largely on the security of the obfuscation method. On the other hand, a large number of obfuscated weights and intermediate results are used during model inference, and the obfuscated results are sent to the trusted execution environment for recovery. Considering the relatively weak computing power of the trusted execution environment, the inference performance also depends largely on the complexity of using the obfuscation algorithm and decrypting the obfuscated results.

[0004] However, the obfuscation methods used in existing works have a contradiction between performance and security in the Transformer model. Some obfuscation methods such as SLALOM and GROUPCOVER focus on the privacy and security of the model, but the complexity of applying the obfuscation algorithm and restoring the obfuscated results in the large number of matrix multiplications in the Transformer model is high, resulting in serious performance loss; the obfuscation methods of other works such as SOTER, ShadowNet and TransLinkGuard can achieve efficient reasoning, but the privacy and security of the model have serious problems. The attacker can observe the directional information of the original privacy matrix vector through the obfuscated ciphertext result, and restore the obfuscated result to the correct result by combining the public pre-trained model and fine-tuning technology. Summary of the invention

[0005] The purpose of the present invention is to provide a method for privacy protection of Transformer models in end-side device reasoning scenarios. The method is an application scenario of slice separation technology based on a trusted execution environment, which is used to solve the problem that model privacy security and efficient reasoning calculation cannot be taken into account when the model is deployed on the end-side device.

[0006] The technical solution provided by the present invention is as follows:

[0007] A privacy protection method for a Transformer model in a terminal device inference scenario, characterized by comprising the following steps:

[0008] A. The service provider obtains a privacy network model containing privacy information and divides the model using slicing separation technology;

[0009] B. The service provider prepares the obfuscation key required for network model obfuscation;

[0010] C. The device owner requests the model owner to use the service, and the model owner sends the privacy model and obfuscation key to the trusted execution environment of the device;

[0011] D. The trusted execution environment uses the received obfuscation key to obfuscate the weight matrix of the computationally intensive part of the model. After obfuscation, the model part is deployed on the GPU of the device, and the rest is left in the trusted execution environment. Specifically, for each row vector of the privacy matrix, the row vector is first multiplied by the obfuscation coefficient and added to the obfuscated vector. After the addition operation is completed, the vector modulus is unified to 1. After all row vectors have completed the above operation, the matrix is ​​obfuscated by disrupting the row order.

[0012] E. Implement model reasoning through communication and interaction between GPU and trusted execution environment:

[0013] E1. When the intermediate result of the model passes through a certain layer, it first passes through the trusted execution environment, which obfuscates the intermediate result with the accepted key and sends it to the GPU;

[0014] E2. The GPU receives the obfuscated intermediate result, performs operations on the obfuscated weight matrix deployed on the GPU, obtains the obfuscated result, and sends the result to the trusted execution environment;

[0015] E3. After receiving the obfuscated result, the trusted execution environment recovers the result and verifies its correctness. After verification, the result is re-obfuscated and sent to the GPU for the next stage of operation.

[0016] E4. Repeat E1-E3 until the reasoning is completed.

[0017] The beneficial effects of the present invention are as follows:

[0018] The present invention is based on the model slicing separation technology of the trusted execution environment, which separates the model, deploys the computationally intensive model part in the GPU after obfuscation, and deploys the remaining part in the trusted execution environment. The reasoning process is achieved through the collaborative interaction between the GPU and the trusted execution environment. The present invention can simultaneously utilize the security features of the trusted execution environment and the efficient computing power of the GPU, thereby taking into account the privacy security and reasoning performance of the model. The present invention can improve the privacy security of the model under end-side deployment, and prevent attackers from obtaining key information of the privacy model by comparing it with a public pre-trained model. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a flow chart of the offline preparation stage of the present invention.

[0020] Figure 2 It is a flow chart of the online reasoning stage of the present invention. DETAILED DESCRIPTION

[0021] In order to better understand the present invention, this example uses Bert-Base-Uncased in HuggingFace as a public pre-trained model. The service provider obtains a privacy model for text classification by fine-tuning the public model.

[0022] The present invention provides a privacy protection method for a Transformer model, and the specific steps include the following:

[0023] (I) Offline preparation stage, such as Figure 1 Shown

[0024] A. Network model training and model slicing separation: The service provider obtains a private network model containing privacy information through fine-tuning technology, and divides the model using slicing separation technology.

[0025] A1. The service provider downloads the bert-base-uncased model and corresponding weights from huggingface and uses the CoLA dataset to fine-tune the public pre-trained model. The fine-tuned model (with stronger text classification capabilities) contains the privacy information of the service provider.

[0026] A2. The service provider slices and separates the model, dividing all the linear layers in the network model into the computationally intensive part (to be deployed on the GPU) and the nonlinear layers into other parts (to be deployed in the trusted execution environment).

[0027] B. Prepare the keys required for network model obfuscation: The service provider prepares sufficient obfuscation keys in advance according to the obfuscation method.

[0028] The obfuscation keys include the obfuscation keys for the model weights and the obfuscation keys for the intermediate results.

[0029] C. Distribution of the privacy model: The device owner requests the model owner to use the service, and the model owner sends the fine-tuned privacy model and key to the trusted execution environment of the device.

[0030] D. Obfuscation and deployment of the model: The trusted execution environment uses the received key to obfuscate the weight matrix of the computationally intensive part of the model (i.e., all linear layer parameter matrices in the Transformer layer). After obfuscation, this part of the model is deployed on the GPU of the device, and the rest remains in the trusted execution environment.

[0031] The obfuscation method focuses on protecting the vector direction information of the privacy matrix. For each row vector of the privacy matrix, a random obfuscation vector with the same direction but different vector modulus and an obfuscation coefficient are used to protect the privacy matrix vector. Specifically, for each row vector of the privacy matrix, the row vector is first multiplied by the obfuscation coefficient and added to the obfuscation vector. After the addition operation is completed, the vector modulus is unified to 1. After all row vectors have completed the above operations, the matrix is ​​finally obfuscated by scrambling the row order.

[0032]

[0033] Among them, Enc(A) refers to the matrix after confusion, is the row vector of the matrix before confusion, r q is the confusion coefficient, t q and They correspond to the modulus and direction of the confusion vector respectively, is the normalization coefficient, q∈{1...n}, and Π is the order shuffling function. The value range of each dimension of the vector and the value range of the coefficient correspond to the model parameter precision. Taking the model with parameter precision of float16 as an example, the value range is [-65504,0)∪(0,65504].

[0034] (ii) Online reasoning stage, such as Figure 2 shown.

[0035] E. Model reasoning process: Model reasoning is achieved through communication and interaction between GPU and trusted execution environment

[0036] E1. When the model input (intermediate result) passes through a certain layer, it first passes through the trusted execution environment. The trusted execution environment obfuscates the input (intermediate result) with the accepted key and sends it to the GPU.

[0037] E2. The GPU receives the obfuscated input (intermediate result), performs operations on the obfuscated weight matrix deployed on the GPU, obtains the obfuscated result, and sends the result to the trusted execution environment.

[0038] E3. After receiving the obfuscated result, the trusted execution environment recovers the result and verifies its correctness. After verification, the result is re-obfuscated and sent to the GPU for the next stage of operation.

[0039] E4. Repeat E1-E3 until the reasoning is completed.

[0040] The efficient obfuscation algorithm provided by the present invention improves the privacy security of the model when deployed on the client side, and prevents attackers from obtaining key information of the privacy model by comparing it with a public pre-trained model.

Claims

1. A privacy protection method for the Transformer model in the edge device inference scenario. It is characterized in that The specific steps include: A. The service provider obtains a privacy network model containing privacy information and divides the model using slicing separation technology; B. The service provider prepares the obfuscation key required for network model obfuscation; C. The device owner requests the model owner to use the service, and the model owner sends the privacy model and obfuscation key to the trusted execution environment of the device; D. The trusted execution environment uses the received obfuscation key to obfuscate the weight matrix of the computationally intensive part of the model. After obfuscation, the model part is deployed on the GPU of the device, and the rest is left in the trusted execution environment. Specifically, for each row vector of the privacy matrix, the row vector is first multiplied by the obfuscation coefficient and added to the obfuscated vector. After the addition operation is completed, the vector modulus is unified to 1. After all row vectors have completed the above operation, the matrix is ​​obfuscated by disrupting the row order. E. Implement model reasoning through communication and interaction between GPU and trusted execution environment.

2. The privacy protection method of the Transformer model in the terminal device inference scenario as claimed in claim 1, It is characterized in that In step A, the service provider obtains a private network model containing private information. Specifically, the service provider downloads a public pre-trained model from a public platform and uses a data set in a certain field to fine-tune the public pre-trained model. The fine-tuned model contains the private information of the service provider.

3. The privacy protection method of the Transformer model in the terminal device reasoning scenario as claimed in claim 1, It is characterized in that In step A, the service provider slices and separates the model. Specifically, the network model is divided into a computationally intensive part and other parts, and the computationally intensive part is deployed on the GPU, and the other parts are deployed in a trusted execution environment.

4. The privacy protection method of the Transformer model in the terminal device reasoning scenario as claimed in claim 1, It is characterized in that The obfuscation keys include the obfuscation keys for the model weights and the obfuscation keys for the intermediate results.

5. The privacy protection method of the Transformer model in the terminal device reasoning scenario as claimed in claim 1, It is characterized in that Step E specifically includes the following steps: E1. When the intermediate result of the model passes through a certain layer, it first passes through the trusted execution environment, which obfuscates the intermediate result with the accepted key and sends it to the GPU; E2. The GPU receives the obfuscated intermediate result, performs operations on the obfuscated weight matrix deployed on the GPU, obtains the obfuscated result, and sends the result to the trusted execution environment; E3. After receiving the obfuscated result, the trusted execution environment recovers the result and verifies its correctness. After verification, the result is re-obfuscated and sent to the GPU for the next stage of operation. E4. Repeat E1-E3 until the reasoning is completed.

Citation Information

Cited By

  • Large model security reasoning method and system fusing trusted execution environment and differential privacy

    CN120494087A

  • Privacy protection method and reasoning method for U-shaped speculative decoding reasoning framework

    CN121118085A

  • Data encryption processing method and device, server and storage medium

    CN121239475A

  • Model hybrid distributed secret state fine tuning method and system based on trusted data space

    CN122333536A

  • Large model weight protection method and device, storage medium and program product

    CN122758441A