A gpt model security access method based on deep learning
By constructing a latent space manifold and dynamically adjusting the covariance matrix, combined with optimal transport theory to generate protected data, the contradiction between privacy protection and semantic preservation in the GPT model is resolved, achieving privacy protection and efficient inference in different scenarios.
Patent Information
- Application Number
- CN202510039952.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-01-10
AI Technical Summary
Existing privacy protection methods present a contradiction between privacy protection and data semantic preservation in GPT models, and cannot dynamically adjust the strength of privacy protection, which affects the inference performance of the model.
By constructing a latent space manifold of user input data, introducing a target protection distribution and dynamically adjusting the covariance matrix, and combining optimal transport theory to calculate the mapping function, the protected data is generated and input into the GPT model for inference, dynamically balancing privacy protection and semantic integrity.
It achieves dynamic adjustment of privacy protection strength according to different scenarios, reduces the risk of privacy leakage, and maintains high semantic consistency and inference quality, thus adapting to the privacy protection effect of different task scenarios.
Smart Images

Figure CN119961971B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence data security technology, specifically to a secure access method for the GPT model based on deep learning. Background Technology
[0002] The rapid development of deep learning technology has led to significant achievements in natural language processing by large-scale pre-trained language models, such as GPT. These models demonstrate exceptional generative capabilities in tasks like machine translation, dialogue generation, and text summarization. However, in practical applications, GPT models require user input data for inference, and this input data often contains highly sensitive information such as personal privacy, medical records, and financial data. Therefore, protecting the privacy of user input data while maintaining the model's inference performance remains a key challenge in current research and applications.
[0003] Existing privacy protection methods, such as differential privacy and homomorphic encryption, offer a certain level of privacy protection, but they have significant limitations in practical applications. Differential privacy methods protect privacy by introducing noise into the data; noise can effectively mask sensitive information, but it also leads to the loss of semantic information in the data, reducing the inference accuracy of the GPT model. Homomorphic encryption protects privacy by encrypting the input data, but the high computational complexity of encryption significantly increases the model's inference time, failing to meet the performance requirements of practical applications. Furthermore, most methods employ static privacy protection strategies, unable to dynamically adjust the strength of privacy protection according to different task scenarios and user needs.
[0004] To address the aforementioned issues, recent research has attempted to combine mathematical optimization methods with deep learning models, employing manifold modeling and optimal transport theory to provide efficient solutions for privacy protection. For example, manifold modeling represents the local structural characteristics of user input data, while optimal transport theory can achieve optimal matching between different distributions, thus striking a balance between privacy protection and data semantic preservation. However, much of this research lacks practical application optimization for GPT models, particularly in terms of how to generate dynamic protective data and how to adapt protective data to GPT model inference.
[0005] Therefore, those skilled in the art provide a deep learning-based secure access method for the GPT model to address the aforementioned problems. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a deep learning-based secure access method for the GPT model, thereby resolving the problems mentioned in the background section.
[0007] To achieve the above objectives, the present invention provides the following technical solution: a secure access method for the GPT model based on deep learning, comprising:
[0008] Step 1: Construct the latent space manifold of the user input data. Process the user input data using a variational autoencoder. Map the user input data to the latent space representation through the encoder to obtain the probability distribution of the latent space. In the probability distribution of the latent space, set the prior distribution of the latent space to a Gaussian distribution and use the latent space representation as the embedding representation of the user input data manifold to construct the latent space manifold.
[0009] The construction of the latent space manifold in step 1 uses a probability distribution described by the following formula:
[0010] P(x) = ∫P(x|z)P(z)dz
[0011] Where P(x) represents the distribution of user input data,
[0012] P(z) represents the prior distribution of the latent space, denoted as a Gaussian distribution N(0,I), where N represents a normal distribution, 0 represents the mean vector, and I represents the identity matrix.
[0013] z represents the latent space representation of the user input data, P(x|z) is the generation distribution from the latent space to the input data, and dz represents the variable integrated in the latent space;
[0014] Step 2: Based on the latent space manifold constructed in Step 1, define the target protection distribution manifold and introduce a protection distribution on the latent space manifold. The target protection distribution is described by a Gaussian distribution, and the covariance matrix in the target protection distribution is used to control the strength of data protection.
[0015] The target protection distribution manifold in step 2 is described by the following formula:
[0016] Q(y)~N(0,Σ),
[0017] Where Q(y) represents the target protection distribution, y represents the protection data generated by noise on the latent space manifold, and N(0,Σ) is a Gaussian distribution with a mean of 0 and a covariance matrix of Σ.
[0018] A mean of 0 indicates that the noise in the target protection distribution is symmetrical about the center of the input data distribution in the latent space, and the covariance matrix Σ determines the amplitude and direction of the noise.
[0019] Step 3: Based on the target protection distribution manifold defined in Step 2, a mapping model is established from the latent space manifold of the user input data to the target protection distribution manifold. The mapping model establishes a mapping function between manifolds by calculating the data matching between the input manifold and the target manifold. The mapping function is used to convert the latent space representation of the input data into the target protection distribution representation.
[0020] Step 4: Based on the mapping model established in Step 3, generate protection data. The protection data is obtained by combining the latent space representation of the user input data with the dynamic noise distribution through the mapping function. The dynamic noise distribution is set based on the target protection distribution manifold. The protection data includes the mapped latent space representation and the generated dynamic noise.
[0021] Step 5: Input the protection data generated in Step 4 into the GPT model, use the GPT model for inference, perform semantic understanding on the latent space representation of the protection data during the inference process, combine the generated dynamic noise to complete the processing of the protection data, and output the inference results.
[0022] Preferably, the covariance matrix Σ is dynamically adjusted according to privacy protection requirements, and the adjustment method is expressed by the following formula:
[0023]
[0024] Where, Σ t Let Σ represent the covariance matrix at the current time. t-1 Let B represent the covariance matrix at the previous time step, B represent the adjustment rate, and Σ be the covariance matrix.
[0025] R(Σ) represents the privacy protection risk function, which is used to assess the impact of the current covariance matrix on the risk of privacy leakage.
[0026] Preferably, in step 3, the mapping model is established by solving the mapping function from the input manifold to the target manifold using the following formula:
[0027]
[0028] Where φ(x) represents the mapping function, φ * Let represent the optimal mapping function, x be the input data coordinates, dP(x) be the probability measure on the input manifold, and c(x,φ(x)) be the transportation cost function from the input manifold to the target manifold, described by the following formula:
[0029] c(x, φ(x))=g ij (x i -φ i (x))(x j -φ j (x)),
[0030] Among them, g ij Let x represent the metric tensor on the manifold. i and x j Let φ be the i-th and j-th coordinate components of the input data point x. i (x) and φ j (x) represents the i-th and j-th coordinate components of the mapped data point φ(x).
[0031] Preferably, the mapping function is represented by the potential function ψ(x), and the mapping function is solved as follows:
[0032]
[0033] Where φ(x) represents the mapping function, This represents the rate of change of the potential function ψ(x) at x;
[0034] The optimization objective of the potential function ψ(x) is to minimize the following loss function:
[0035]
[0036] Where L(ψ) is the loss function, g ij Let x represent the metric tensor on the manifold. i and x j Let the i-th and j-th coordinate components be the input data point x. and Let ψ(x) be the gradient components of the potential function ψ(x) in the i-th and j-th dimensions, and dP(x) be the probability measure on the input manifold.
[0037] Preferably, the mapping function is optimized using gradient descent, and the potential function is updated as follows:
[0038]
[0039] Where, ψ t Let ψ represent the potential function of the current iteration. t-1 Let α represent the potential function of the previous iteration, and α be the learning rate. It represents the partial derivative of the loss function L(ψ) with respect to the potential function ψ(x).
[0040] Preferably, the generation of protected data in step 4 includes the following process:
[0041] x′=φ(x)+η,
[0042] Where x′ represents the generated protection data, φ(x) is the mapping function, and η is the dynamic noise sampled in the target protection distribution Q(y).
[0043] Preferably, the generation of the protection data x′ satisfies the following disturbance strength constraint:
[0044] |φ(x)-x|≤∈,
[0045] Where φ(x) is the mapping function, and x is the user's original input data.
[0046] ∈ represents the upper bound of the perturbation intensity, used to ensure semantic consistency between protected data and user input data.
[0047] Preferably, in step 5, when the protected data x′ is input into the GPT model for inference, semantic processing is performed by combining the latent space representation of the protected data with dynamic noise, and the accuracy of the inference result y is evaluated by the BLEU score and the fluency score of the generated text.
[0048] BLEU is an automated evaluation metric used to measure the similarity between generated text and reference text.
[0049] This invention provides a secure access method for the GPT model based on deep learning. It has the following beneficial effects:
[0050] 1. This invention introduces a target protection distribution into the latent space manifold of user input data and combines it with a dynamic adjustment of the covariance matrix to achieve dynamic protection of user privacy. This results in the ability to adjust the protection strength in real time according to different scenarios and effectively reduce the risk of privacy leakage.
[0051] 2. This invention calculates the mapping function between the user input manifold and the target protected manifold based on optimal transport theory, thereby preserving the semantic information of the user input data during the generation process and achieving the effect of generating highly semantically consistent data while protecting privacy.
[0052] 3. This invention generates protected data by combining mapping functions and dynamic noise distribution, sets a limit on the perturbation intensity of the protected data, and achieves a dynamic balance between the strength of privacy protection and semantic integrity of the protected data, thereby obtaining a privacy protection effect that is adapted to different task scenarios.
[0053] 4. This invention achieves efficient semantic understanding of privacy-preserving data by inputting the protected data into the GPT model and combining the latent space representation of the protected data with the dynamic noise distribution for semantic processing. This results in the protected data maintaining high inference quality while protecting privacy. Attached Figure Description
[0054] Figure 1 This is a flowchart of the present invention. Detailed Implementation
[0055] To enable those skilled in the art to understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort should fall within the scope of protection of the present invention.
[0056] The present invention will now be described in detail with reference to the accompanying drawings:
[0057] Example:
[0058] Please see the appendix Figure 1 This invention provides a method for secure access to the GPT model based on deep learning, comprising:
[0059] Step 1: Construct the latent space manifold of the user input data. Process the user input data using a variational autoencoder. Map the user input data to the latent space representation through the encoder to obtain the probability distribution of the latent space. In the probability distribution of the latent space, set the prior distribution of the latent space to a Gaussian distribution and use the latent space representation as the embedding representation of the user input data manifold to construct the latent space manifold.
[0060] Step 2: Based on the latent space manifold constructed in Step 1, define the target protection distribution manifold and introduce a protection distribution on the latent space manifold. The target protection distribution is described by a Gaussian distribution, and the covariance matrix in the target protection distribution is used to control the strength of data protection.
[0061] Step 3: Based on the target protection distribution manifold defined in Step 2, a mapping model is established from the latent space manifold of the user input data to the target protection distribution manifold. The mapping model establishes a mapping function between manifolds by calculating the data matching between the input manifold and the target manifold. The mapping function is used to convert the latent space representation of the input data into the target protection distribution representation.
[0062] Step 4: Based on the mapping model established in Step 3, generate protection data. The protection data is obtained by combining the latent space representation of the user input data with the dynamic noise distribution through the mapping function. The dynamic noise distribution is set based on the target protection distribution manifold. The protection data includes the mapped latent space representation and the generated dynamic noise.
[0063] Step 5: Input the protection data generated in Step 4 into the GPT model, use the GPT model for inference, perform semantic understanding on the latent space representation of the protection data during the inference process, combine the generated dynamic noise to complete the processing of the protection data, and output the inference results.
[0064] By processing user input data using a variational autoencoder, the data is mapped to a latent space representation, and the probability distribution of the latent space is modeled as a Gaussian distribution, thus completing an abstract representation of the manifold structure of the input data. The latent space representation effectively captures local features of the data, reduces data dimensionality, and simplifies subsequent computation. Furthermore, the Gaussian distribution assumption lays the mathematical foundation for the introduction of transportation theory, enabling the privacy protection process to proceed with a rigorous mathematical model. Step 1's advantage lies in its efficient description of the input data distribution, while simultaneously providing support for subsequent generation of protected data.
[0065] A target protection distribution is introduced into the latent space manifold and described by a Gaussian distribution, where the covariance matrix controls the strength of the protected data. This process provides the foundation for a dynamic noise generation mechanism, allowing the strength of privacy protection to be flexibly adjusted according to different scenarios. By defining the target protection distribution, good mathematical operability between the protected data and the original data is ensured. The advantage of step 2 is that it provides high flexibility and adaptability for privacy protection, enabling dynamic adjustment in different application scenarios.
[0066] By calculating the data matching between the input manifold and the target manifold based on transport theory, a mapping model is established to generate a mapping function from the input manifold to the target protected manifold. This mapping function optimally transforms the latent space representation of the user input data into the target protected distribution representation while minimizing semantic loss during the data transformation process. Step 3 utilizes optimal transport theory to address the semantic preservation problem in the protected data generation process, ensuring that the original semantic information of the data is completely preserved during privacy protection. The benefit of Step 3 is that it significantly improves the semantic consistency of the protected data and avoids the negative impact of privacy protection on data quality.
[0067] Based on the mapping model, protected data is generated by combining a mapping function with dynamic noise distribution. The addition of dynamic noise enhances the strength of privacy protection while ensuring the adaptability of the protected data to the input data. The protected data includes the mapped latent space representation and the generated dynamic noise. By setting a perturbation strength limit, the relationship between privacy protection strength and semantic integrity is dynamically balanced. The benefit of step 4 is that it enables the dynamic generation of protected data, allowing the protection strength to adapt to different privacy requirements while ensuring the quality and reliability of the protected data.
[0068] By inputting the generated protected data into the GPT model, and combining the latent space representation and dynamic noise distribution of the protected data, the GPT model can perform semantic processing on the protected data and generate inference results. Step 5 optimizes the adaptation method between the protected data and the GPT model to ensure that the privacy-protected data can be correctly understood by the GPT model and generate inference results.
[0069] The construction of the latent space manifold in step 1 uses a probability distribution described by the following formula:
[0070] P(x) = ∫P(x|z)P(z)dz
[0071] Where P(x) represents the distribution of user input data,
[0072] P(z) represents the prior distribution of the latent space, denoted as a Gaussian distribution N(0,I), where N represents a normal distribution, 0 represents the mean vector, and I represents the identity matrix.
[0073] z represents the latent space representation of the user input data, P(x|z) is the generation distribution from the latent space to the input data, and dz represents the variable integrated in the latent space.
[0074] By mapping high-dimensional user input data x to a low-dimensional latent space representation z, the dimensionality of the data is reduced, effectively simplifying the complexity of subsequent calculations. The low-dimensional latent space representation preserves the main features of the input data, reducing the demand for computational resources.
[0075] The construction of the latent space manifold establishes an implicit structure model of the user input data through P(z). The prior distribution P(z) of the latent space is assumed to be Gaussian, which can describe the global distribution characteristics of the input data, while P(x|z) characterizes the local generation characteristics of the data. The two-layer modeling method can capture the complex characteristics and intrinsic relationships of the input data, and accurately represent the distribution of the data;
[0076] The integral form in the formula provides a unified mathematical description of the manifold construction of the input data. The joint distribution of P(x|z) and P(z) fully characterizes the generation process from the latent space to the original data. The probability distribution-based modeling method lays the theoretical foundation for subsequent transport theory and the definition of protection distributions, allowing the latent space manifold to be naturally embedded into the privacy protection process.
[0077] The introduction of the integral variable z in the latent space enables the generating distribution P(x|z) to dynamically adjust the characteristics of the generated data according to the latent space representation, allowing the generation of adapted protection data for different types of input data and application scenarios, and providing support for subsequent dynamic noise generation and mapping.
[0078] By using the latent space representation z-mapping, the original high-dimensional data x is decomposed into a low-dimensional representation and a generated distribution in the latent space, reducing the dependence on the original input data and minimizing the exposure of sensitive information, thus providing a barrier for subsequent privacy protection mechanisms.
[0079] The target protection distribution manifold in step 2 is described by the following formula:
[0080] Q(y)~N(0,Σ),
[0081] Where Q(y) represents the target protection distribution, y represents the protection data generated by noise on the latent space manifold, and N(0,Σ) is a Gaussian distribution with a mean of 0 and a covariance matrix of Σ.
[0082] A mean of 0 indicates that the noise in the target protection distribution is symmetrical about the center of the input data distribution in the latent space, and the covariance matrix Σ determines the amplitude and direction of the noise.
[0083] The covariance matrix Σ is dynamically adjusted according to privacy protection requirements, and the adjustment method is expressed by the following formula:
[0084]
[0085] Where, Σ t Let Σ represent the covariance matrix at the current time. t-1 Let B represent the covariance matrix at the previous time step, B represent the adjustment rate, and Σ be the covariance matrix.
[0086] R(Σ) represents the privacy protection risk function, which is used to assess the impact of the current covariance matrix on the risk of privacy leakage.
[0087] The covariance matrix Σ of the target protected distribution manifold determines the amplitude and direction of noise. Through a dynamic adjustment formula, the intensity and distribution characteristics of the noise are adjusted in real time according to different privacy protection requirements. For example, in high privacy scenarios, adjusting the covariance matrix increases the noise amplitude while reducing the likelihood of privacy leakage. In low privacy scenarios, noise intensity is reduced to preserve the semantic consistency of the data. This dynamic adjustment mechanism makes data protection more adaptable and flexible in responding to various task scenarios.
[0088] A mean of 0 indicates that the noise is symmetrical about the center of the input data distribution, ensuring that the noise is balanced within the latent space manifold and avoids deviation from the input data distribution. The adjustment of the covariance matrix Σ is optimized using the gradient of the privacy protection risk function R(Σ), assessing the risk of privacy leakage from the current noise distribution. Dynamic optimization of the risk function significantly reduces the probability of privacy leakage, enhancing the protection of user privacy through data preservation.
[0089] The dynamically adjusted covariance matrix controls the noise intensity and determines its direction. By rationally designing the direction of Σ, perturbations to the data semantics are avoided. Compared to traditional fixed noise distributions, the dynamic adjustment mechanism achieves a balance between privacy protection and semantic integrity, ensuring that the generated protected data is more accurate in preserving the original data characteristics.
[0090] The dynamic adjustment of the covariance matrix is achieved through gradient descent optimization of R(Σ). Compared to global optimization and regeneration of the noise distribution, the gradient-based local optimization method improves computational efficiency. The gradient computation cost of the privacy protection risk function is low, making it suitable for large-scale data scenarios. This allows our method to significantly reduce computational overhead while ensuring strong privacy protection.
[0091] In the formula for dynamically adjusting the covariance matrix, the adjustment rate B is a key parameter that determines the sensitivity of the dynamic adjustment. By setting different values for B, this formula can adapt to the privacy requirements of different task scenarios.
[0092] In step 3, the mapping model is established by solving the mapping function from the input manifold to the target manifold using the following formula:
[0093]
[0094] Where φ(x) represents the mapping function, φ * Let represent the optimal mapping function, x be the input data coordinates, dP(x) be the probability measure on the input manifold, and c(x,φ(x)) be the transportation cost function from the input manifold to the target manifold, described by the following formula:
[0095] c(x,φ(x))=g ij (x i -φ i (x))(x j -φ j (x)),
[0096] Among them, g ij Let x represent the metric tensor on the manifold. i and x j Let φ be the i-th and j-th coordinate components of the input data point x. i (x) and φ j (x) represents the i-th and j-th coordinate components of the mapped data point φ(x).
[0097] The mapping function is represented by the potential function ψ(x), and the solution to the mapping function is as follows:
[0098]
[0099] Where φ(x) represents the mapping function, This represents the rate of change of the potential function ψ(x) at x;
[0100] The optimization objective of the potential function ψ(x) is to minimize the following loss function:
[0101]
[0102] Where L(ψ) is the loss function, g ij Let x represent the metric tensor on the manifold. i and x j Let the i-th and j-th coordinate components be the input data point x. and Let ψ(x) be the gradient components of the potential function ψ(x) in the i-th and j-th dimensions, and dP(x) be the probability measure on the input manifold.
[0103] The mapping function is optimized using gradient descent, and the potential function is updated as follows:
[0104]
[0105] Where, ψ t Let ψ represent the potential function of the current iteration. t-1Let α represent the potential function of the previous iteration, and α be the learning rate. It represents the partial derivative of the loss function L(ψ) with respect to the potential function ψ(x).
[0106] Based on optimal transport theory, the mapping function φ(x) between the input manifold and the target manifold can optimally transform the data distribution. Minimizing the transport cost function c(x,φ(x)) ensures the correspondence between data points during the mapping process while preserving the semantic information of the input data to the greatest extent. The mapping method based on optimal transport effectively solves the problem of insufficient semantic consistency of data in traditional noise generation techniques.
[0107] By defining the transportation cost function c(x,φ(x)) and introducing the manifold metric tensor g ij This method considers the local geometric properties of the data in the mapping from the input manifold to the target manifold. The manifold metric tensor reflects the local relationships of data points in space, which can reduce the loss of data features during the mapping process and avoid semantic distortion caused by data preservation generation.
[0108] The mapping function φ(x) is solved using the potential function ψ(x) and optimized using gradient descent. The introduction of the potential function simplifies the complex mapping problem into an optimization problem of a single scalar function, significantly reducing the computational complexity of the mapping. Compared to directly calculating the mapping relationships between high-dimensional manifolds, this method is more computationally efficient and suitable for handling large-scale datasets and high-dimensional input manifolds.
[0109] By optimizing the potential function through gradient descent, this method can dynamically adjust the mapping function to approach the optimal mapping in each iteration. Gradient descent ensures the gradual convergence of the loss function L(ψ), making the mapping function more adaptable in dynamic environments. The dynamic optimization feature is particularly suitable for changing requirements in privacy-preserving scenarios, as it can adjust the mapping relationship according to real-time changes in input data and target distribution.
[0110] Step 4, the generation of protected data, includes the following processes:
[0111] x′=φ(x)+η,
[0112] Where x′ represents the generated protection data, φ(x) is the mapping function, and η is the dynamic noise sampled in the target protection distribution Q(y).
[0113] The generation of protected data x′ satisfies the following perturbation strength constraints:
[0114] |φ(x)-x|≤∈,
[0115] Where φ(x) is the mapping function, and x is the user's original input data.
[0116] ∈ represents the upper bound of the perturbation intensity, used to ensure semantic consistency between protected data and user input data.
[0117] By introducing dynamic noise η into the protected data, privacy protection of the original input data is achieved. The addition of dynamic noise can effectively mask sensitive information in the user input data, making it impossible for attackers to reconstruct the original data. The noise generation method based on sampling in the target protection distribution makes the protection mechanism highly unpredictable, thus significantly improving the security of privacy protection.
[0118] The perturbation intensity constraint during the data generation process prevents the mapped protected data from deviating from the semantic range of the user input data. The mapping function φ(x) projects the input data onto the target protected manifold, while the upper bound of the perturbation intensity limits the offset range of the data during the mapping process. This protects privacy while preserving the semantic consistency of the user input data to the greatest extent possible, avoiding the loss of practical value of the generated data due to excessive perturbation.
[0119] The protected data is generated by combining a mapping function φ(x) and dynamic noise η, giving the data protection mechanism a dynamic characteristic. Compared to static privacy protection methods, the introduction of dynamic noise can flexibly adjust the generation method of protected data according to the characteristics of the target protection distribution. The dynamic generation mechanism enables the protected data to better adapt to different task scenarios, while avoiding the shortcomings caused by a single protection strategy;
[0120] The generated protected data x′ contains both the output φ(x) of the mapping function and dynamic noise η, which makes the protected data highly random and can maintain the contextual consistency with the original data. This ensures that the protected data has high semantic availability while protecting privacy, and can be correctly understood and reasoned by the downstream GPT model.
[0121] By combining the mapping function φ(x) and dynamic noise, the generated protection data is freed from direct dependence on the user input data x. The semantic characteristics of the protection data x′ originate more from the target protection manifold and the mapping function than from the user's original input data.
[0122] In step 5, when the protected data x′ is input into the GPT model for inference, semantic processing is performed by combining the latent space representation of the protected data with dynamic noise. The accuracy of the inference result y is evaluated by the BLEU score and the fluency score of the generated text.
[0123] BLEU is an automated evaluation metric used to measure the similarity between generated text and reference text.
[0124] By combining the latent space representation of protected data with dynamic noise, the GPT model can correctly understand the semantic information of protected data while protecting privacy. This avoids the problem of semantic loss caused by data perturbation in traditional privacy protection methods, ensuring the semantic availability and integrity of protected data, and thus guaranteeing the quality of inference results generated by the GPT model.
[0125] Introducing the BLEU score as an evaluation criterion for inference results, the accuracy of the inference results can be intuitively quantified by comparing the n-gram matching between the generated text and the reference text. Simultaneously, combining the fluency score of the generated text supplements the BLEU score's shortcomings in assessing grammatical and contextual coherence, making the evaluation of inference results more comprehensive. This multi-dimensional evaluation method provides a quantifiable feedback mechanism for improving and optimizing the model.
[0126] Protected data, generated through mapping functions and dynamic noise, can impact the inference process of the GPT model. However, by combining latent space representation and dynamic noise, the GPT model can automatically adjust its semantic processing of input data during inference, maximizing its adaptation to the characteristics of protected data. This adaptability effectively improves the collaborative performance between privacy-preserving data and the GPT model.
[0127] While privacy-preserving mechanisms for data protection introduce a degree of randomness, this method can find a balance between privacy protection and inference performance by evaluating the BLEU score and text fluency of the inference results. The evaluation results of inference performance provide important insights for optimizing the data generation process, and further optimization of the synergistic effect between privacy protection and inference performance is crucial.
[0128] The BLEU score reflects the quality of the generated text's consistency with the reference text, while the fluency score measures the readability and contextual coherence of the generated text. By combining these evaluation metrics, the accuracy of the GPT model's inference results is ensured, and its practicality is enhanced, providing text generation results for real-world applications.
[0129] By using BLEU scores and fluency scores for quantitative evaluation, this method can effectively provide feedback on the quality of generated text and the suitability of protected data. The evaluation metrics can serve as a basis for subsequent optimization of the protected data generation method and adjustment of GPT model parameters, thereby continuously improving the overall performance of the system.
[0130] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A secure access method based on the GPT model using deep learning, characterized in that, include: Step 1: Construct the latent space manifold of the user input data. Process the user input data using a variational autoencoder. Map the user input data to the latent space representation through the encoder to obtain the probability distribution of the latent space. In the probability distribution of the latent space, set the prior distribution of the latent space to a Gaussian distribution and use the latent space representation as the embedding representation of the user input data manifold to construct the latent space manifold. The construction of the latent space manifold in step 1 uses a probability distribution described by the following formula: P(x) = ∫P(x|z)P(z)dz Where P(x) represents the distribution of user input data, P(z) represents the prior distribution of the latent space, denoted as a Gaussian distribution N(0,I), where N represents a normal distribution, 0 represents the mean vector, and I represents the identity matrix. z represents the latent space representation of the user input data, P(x|z) is the generation distribution from the latent space to the input data, and dz represents the variable integrated in the latent space; Step 2: Based on the latent space manifold constructed in Step 1, define the target protection distribution manifold and introduce a protection distribution on the latent space manifold. The target protection distribution is described by a Gaussian distribution, and the covariance matrix in the target protection distribution is used to control the strength of data protection. The target protection distribution manifold in step 2 is described by the following formula: Q(y)~N(0,Σ), Where Q(y) represents the target protection distribution, y represents the protection data generated by noise on the latent space manifold, and N(0,Σ) is a Gaussian distribution with a mean of 0 and a covariance matrix of Σ. A mean of 0 indicates that the noise in the target protection distribution is symmetrical about the center of the input data distribution in the latent space, and the covariance matrix Σ determines the amplitude and direction of the noise. Step 3: Based on the target protection distribution manifold defined in Step 2, a mapping model is established from the latent space manifold of the user input data to the target protection distribution manifold. The mapping model establishes a mapping function between manifolds by calculating the data matching between the input manifold and the target manifold. The mapping function is used to convert the latent space representation of the input data into the target protection distribution representation. Step 4: Based on the mapping model established in Step 3, generate protection data. The protection data is obtained by combining the latent space representation of the user input data with the dynamic noise distribution through the mapping function. The dynamic noise distribution is set based on the target protection distribution manifold. The protection data includes the mapped latent space representation and the generated dynamic noise. Step 5: Input the protection data generated in Step 4 into the GPT model, use the GPT model for inference, perform semantic understanding on the latent space representation of the protection data during the inference process, combine the generated dynamic noise to complete the processing of the protection data, and output the inference results.
2. The secure access method for the GPT model based on deep learning according to claim 1, characterized in that, The covariance matrix Σ is dynamically adjusted according to privacy protection requirements, and the adjustment method is expressed by the following formula: Where, Σ t Let Σ represent the covariance matrix at the current time. t-1 Let B represent the covariance matrix at the previous time step, B represent the adjustment rate, and Σ be the covariance matrix. R(Σ) represents the privacy protection risk function, which is used to assess the impact of the current covariance matrix on the risk of privacy leakage.
3. The secure access method for the GPT model based on deep learning according to claim 1, characterized in that, In step 3, the mapping model is established by solving the mapping function from the input manifold to the target manifold using the following formula: Where φ(x) represents the mapping function, φ * Let represent the optimal mapping function, x be the input data coordinates, dP(x) be the probability measure on the input manifold, and c(x,φ(x)) be the transportation cost function from the input manifold to the target manifold, described by the following formula: c(x,φ(x))=g ij (x i -f i (x))(x j -f j (x)), Among them, g ij Let x represent the metric tensor on the manifold. i and x j Let φ be the i-th and j-th coordinate components of the input data point x. i (x) and φ j (x) represents the i-th and j-th coordinate components of the mapped data point φ(x).
4. The secure access method for the GPT model based on deep learning according to claim 3, characterized in that, The mapping function is represented by the potential function ψ(x), and the solution to the mapping function is as follows: Where φ(x) represents the mapping function, This represents the rate of change of the potential function ψ(x) at x; The optimization objective of the potential function ψ(x) is to minimize the following loss function: Where L(ψ) is the loss function, g ij Let x represent the metric tensor on the manifold. i and x j Let the i-th and j-th coordinate components be the input data point x. and Let ψ(x) be the gradient components of the potential function ψ(x) in the i-th and j-th dimensions, and dP(x) be the probability measure on the input manifold.
5. The secure access method for the GPT model based on deep learning according to claim 4, characterized in that, The mapping function is solved using gradient descent, and the potential function is updated as follows: Where, ψ t Let ψ represent the potential function of the current iteration. t-1 Let α represent the potential function of the previous iteration, and α be the learning rate. It represents the partial derivative of the loss function L(ψ) with respect to the potential function ψ(x).
6. The secure access method for the GPT model based on deep learning according to claim 1, characterized in that, The generation of protection data in step 4 includes the following process: x′=φ(x)+η, Where x′ represents the generated protection data, φ(x) is the mapping function, and η is the dynamic noise sampled in the target protection distribution Q(y).
7. A secure access method for the GPT model based on deep learning according to claim 6, characterized in that, The generation of the protected data x′ satisfies the following disturbance strength constraint: |φ(x)-x|≤∈, Where φ(x) is the mapping function, and x is the user's original input data. ∈ represents the upper bound of the perturbation intensity, used to ensure semantic consistency between protected data and user input data.
8. The secure access method for the GPT model based on deep learning according to claim 1, characterized in that, In step 5, when the protected data x′ is input into the GPT model for inference, semantic processing is performed by combining the latent space representation of the protected data with dynamic noise. The accuracy of the inference result y is evaluated by the BLEU score and the fluency score of the generated text. BLEU is an automated evaluation metric used to measure the similarity between generated text and reference text.
Citation Information
Patent Citations
Multi-working-condition process fault monitoring and diagnosing method
CN115079660A
Ray-based lightweight distributed reinforcement learning training platform design method
CN119151019A