Security vulnerability detection method of reinforcement learning model based on cache side channel
By detecting the state space dimension of the reinforcement learning model's policy matrix through Flush+Reload technology and the clustering pruning process, it solves the problem of difficulty in identifying policy matrix attacks with existing technology, achieves efficient and accurate security vulnerability detection, and significantly improves the model's performance. Security.
Patent Information
- Application Number
- CN202410646135.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2024-08-23
AI Technical Summary
Existing security vulnerability detection methods are difficult to effectively identify and defend specific attacks against the policy matrix of the reinforcement learning model, especially the precise operation of the policy matrix, and cannot improve the security of the model without affecting model performance and learning efficiency.
The cache side channel method based on Flush+Reload technology is used to detect the state space dimension of the policy matrix through iterative clustering and pruning processes, and the law of large numbers and data mapping technology are used to distinguish standard time and special time to determine the state space dimension, and then Identify potential security vulnerabilities.
It significantly improves the security vulnerability detection accuracy and efficiency of the reinforcement learning model, ensuring the stable operation and overall security level of the model.
Smart Images

Figure CN118540127A
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of network security and reinforcement learning technology, and in particular to a security vulnerability detection method based on a cache side channel reinforcement learning model. Background Art
[0002] In today's rapidly developing information age, artificial intelligence technology has developed rapidly around the world with its outstanding capabilities and wide range of applications. In recent years, reinforcement learning models, as an important branch of artificial intelligence, have demonstrated excellent performance in a variety of complex decision-making problems and are widely used in many fields such as autonomous driving, robot control, and game theory. However, with the increase in the application of reinforcement learning, its security issues have also received increasing attention.
[0003] Reinforcement learning models are now facing a variety of potential security threats, including adversarial attacks and model leakage. In these attacks, attackers may manipulate environmental feedback or directly tamper with model parameters to induce the model to make wrong decisions or leak sensitive information. In reinforcement learning models, the policy matrix is one of the core components. It defines the probability of selecting each action in a given state and is the basis for the model to make decisions. For the policy matrix, this means that attackers may cause the model to select non-optimal or harmful strategies by modifying the state space dimension in the policy matrix.
[0004] Most existing security vulnerability detection methods focus on traditional network security protection and data encryption technologies, but rarely consider the unique structure and operation mechanism of reinforcement learning models. As a result, these methods are often unable to effectively identify or defend against specific attacks on reinforcement learning models, especially those targeting the delicate operations of the policy matrix.
[0005] In view of this, it is particularly important to invent a security vulnerability detection method specifically for the policy matrix in the reinforcement learning model. This method needs to be able to identify potential vulnerabilities in the policy matrix through cache side channel technology and protect the model from potential security threats. In addition, this method also takes into account the real-time and dynamic nature of the reinforcement learning model to ensure that the security of the model is improved without affecting the model performance and learning efficiency. Summary of the invention
[0006] In view of the shortcomings of the existing technology, the present invention proposes a method for effectively detecting security vulnerabilities in the state space dimension of the policy matrix in the model, and provides a guarantee for the stable operation of the system, thereby greatly improving the overall security level of reinforcement learning applications.
[0007] The technical solution adopted by the present invention is as follows: A security vulnerability detection method based on a reinforcement learning model of a cache side channel:
[0008] 1) Using the cache channel measurement method of Flush+Reload technology, the time required for the function to load specific data is obtained as the original data;
[0009] Introduce a variable t, which represents the time required to iterate a data block. Assume that t is proportional to the size of the block processed during the iteration, that is, as the block size increases, the time required for iteration also increases accordingly;
[0010] t={t1,t2,...,t i} (1)
[0011] where t i Represents the time consumption of the i-th iteration.
[0012] 2) Use an iterative clustering and pruning process to group the time data into groups, one group represents standard time and the other group represents special time:
[0013] Each iteration obtains a row of the matrix and stores it in the cache, and the time required is in a roughly similar range. When all times in the sample are standard times, the law of large numbers is applied to detect the subsequent iteration time t i Is it standard time?
[0014]
[0015] Where E(t i ) and D(t i ) is t i The mean and variance of , ε is an arbitrarily small positive number;
[0016] Assume that in the subsequent iteration process, the iteration time t i obeys the law of large numbers, then it will be classified as standard time; however, if t i It does not conform to the law of large numbers and is considered as a special time. In this case, the iteration stores part of a row of the matrix in the cache and completes the iteration in a shorter time than the standard time.
[0017] 3) Obtain the size of the state space dimension m according to the total number of iterations of the function and the data of the special time, and obtain the detection result;
[0018] If the cache is filled with data in some iterations, there will be both special times and standard times in the sample. In order to distinguish them, an iterative clustering and pruning process is introduced. Through the clustering algorithm, the iteration times can be grouped into sets with similar characteristics, one group represents special times and the other represents standard times. These time sets are further analyzed and pruned to gradually determine all standard times.
[0019] First, cluster analysis is performed on the time sample X, and the difference between the standard time instance and the special time instance is enlarged using data mapping technology: after each clustering, the sample set X is divided into different clusters, where X i Most of the samples in X belong to standard time instances, so i The data is mapped as follows:
[0020] Avg(X i ) (3)
[0021] Where Avg represents the mean function, X represents the original sample and the value range of i is 1 to n;
[0022] Maximize X i and minimize X r The mean of the sample set X i Most of the samples in X belong to standard time instances, r It represents the remaining sample set after each clustering to obtain the standard time instance;
[0023] X r =XX i (4)
[0024]
[0025]
[0026] After each clustering is completed, identification and pruning operations are performed to determine the sample set X i ; Since the length of the standard time instance is longer than the special time instance, the remaining sample set X r When the mean of is less than or equal to the mean of the initial sample set X of each iteration, a subset X can be specified. i As a standard time cluster;
[0027] Avg(X r (X i ))≤Avg(X(X i )) (7)
[0028] The iteration process ends when two conditions are met:
[0029] First, when the sample set X and the remaining sample set X r The mean difference between them is lower than the predefined threshold, which is represented by an arbitrarily small positive number h; the remaining sample set X r The ratio of the standard time instance to the special time instance is also less than another arbitrarily small positive number l;
[0030] Avg(X(X i ))-Avg(Xr (X i ))≤h (8)
[0031] X r (X n ) / X r (X s )≤l (9)
[0032] Among them, X n and X s Respectively represent X r Standard time instances and special time instances in ;
[0033] After completing the entire clustering process, the law of large numbers is used to determine whether the subsequent time belongs to standard time or special time;
[0034] In the policy matrix, each row corresponds to a single state, but the update of the row data requires two iterations to complete, rather than one iteration. Therefore, the size of the state space dimension m is defined as:
[0035] m≤iter1-L / 2 (10)
[0036] Where L represents the number of special iteration times;
[0037] Δm≤g (11)
[0038] Finally, if the difference between the extracted value of m and the actual value of m is lower than a threshold, there is a security hole in the state space dimension of the policy matrix; otherwise, there is no security hole.
[0039] The beneficial effects created by the present invention are as follows: In certain problem areas, the action space is limited by the nature of the task itself, especially in applications involving physical systems, robots or industrial processes, and the number of actions available for selection is usually limited, resulting in a situation where the dimension k of the action space is known, such as the opening and closing of a switch. The present invention proposes a security vulnerability detection method for a policy matrix in a reinforcement learning model, which can efficiently identify and locate potential security vulnerabilities, significantly improving the accuracy and efficiency of vulnerability detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0041] Matrix operations in reinforcement learning models are one of the key factors to improve model performance and efficiency. The Eigen library provides row-centric iterator operations that can directly iterate and modify the elements in each row of the matrix. Assuming that the policy matrix A of the target model is an m × k matrix, the row iterator operation can traverse the entire matrix row by row. Each time its core function Matrixbase::row is called, a row of data of matrix A can be obtained and stored in the buffer, and the total number of iterations is represented by iter1. Therefore, the address referenced by the MatrixBase::row function is designated as the detection address. The purpose of the present invention is to use a cache side channel method based on Flush+Reload technology to extract the value of m from the row iterator algorithm implementation of the library and compare it with the actual value of m.
[0042] The Flush+Reload technique plays a key role in obtaining the initial tracking data. The Flush+Reload technique reveals the execution flow of the program based on the time difference between cache hits and cache misses. When the required data is already in the cache, a cache hit is observed; and when the required data is not in the cache and needs to be read from a slower storage medium, a cache miss is observed. In specific operations, specific data in the CPU cache is first cleared, and then the time required to reload the data is measured, and the resulting time is used as the raw data of the present invention.
[0043] In computers, CPU cache is a limited and fixed-size storage space, usually using a mixed structure of set associative and fully associative. When faced with limited cache size, one iteration may not be able to accommodate the entire row of data when processing a row of data. Therefore, a second iteration is required to process the remaining data. In order to optimize memory usage to the greatest extent, we treat each row as a discrete block.
[0044] The present invention provides a security vulnerability detection method based on a cache side channel reinforcement learning model, specifically:
[0045] 1) Using the cache channel measurement method of Flush+Reload technology, the time required for the function to load specific data is obtained as the original data;
[0046] Introduce a variable t, which represents the time required to iterate a data block. Assume that t is proportional to the size of the block processed during the iteration, that is, as the block size increases, the time required for iteration also increases accordingly;
[0047] t={t1,t2,...,t i} (1)
[0048] where t i Represents the time consumption of the i-th iteration.
[0049] 2) Use an iterative clustering and pruning process to group the time data into groups, one group represents standard time and the other group represents special time:
[0050] Each iteration obtains a row of the matrix and stores it in the cache, and the time required is in a roughly similar range. When all times in the sample are standard times, the law of large numbers is applied to detect the subsequent iteration time t i Is it standard time?
[0051]
[0052] Where E(t i ) and D(t i ) is t i The mean and variance of , ε is an arbitrarily small positive number;
[0053] Assume that in the subsequent iteration process, the iteration time t i obeys the law of large numbers, then it will be classified as standard time; however, if t i It does not conform to the law of large numbers and is considered as a special time. In this case, the iteration stores part of a row of the matrix in the cache and completes the iteration in a shorter time than the standard time.
[0054] 3) Obtain the size of the state space dimension m according to the total number of iterations of the function and the data of the special time, and obtain the detection result;
[0055] If the cache is filled with data in some iterations, there will be both special times and standard times in the sample. In order to distinguish them, an iterative clustering and pruning process is introduced. Through the clustering algorithm, the iteration times can be grouped into sets with similar characteristics, one group represents special times and the other represents standard times. These time sets are further analyzed and pruned to gradually determine all standard times.
[0056] First, cluster analysis is performed on the time sample X, and the difference between the standard time instance and the special time instance is enlarged using data mapping technology: after each clustering, the sample set X is divided into different clusters, where X i Most of the samples in X belong to standard time instances, so i The data is mapped as follows:
[0057] Avg(X i ) (3)
[0058] Where Avg represents the mean function, X represents the original sample and the value range of i is 1 to n;
[0059] Maximize Xi and minimize X r The mean of the sample set X i Most of the samples in X belong to standard time instances, r It represents the remaining sample set after each clustering to obtain the standard time instance;
[0060] X r =XX i (4)
[0061]
[0062]
[0063] After each clustering is completed, identification and pruning operations are performed to determine the sample set X i ; Since the length of the standard time instance is longer than the special time instance, the remaining sample set X r When the mean of is less than or equal to the mean of the initial sample set X of each iteration, a subset X can be specified. i As a standard time cluster;
[0064] Avg(X r (X i ))≤Avg(X(X i )) (7)
[0065] The iteration process ends when two conditions are met:
[0066] First, when the sample set X and the remaining sample set X r The mean difference between them is lower than the predefined threshold, which is represented by an arbitrarily small positive number h; the remaining sample set X r The ratio of the standard time instance to the special time instance is also less than another arbitrarily small positive number l;
[0067] Avg(X(X i ))-Avg(X r (X o ))≤h (8)
[0068] X r (X n ) / X r (X s )≤l (9)
[0069] Among them, X n and X s Respectively represent X r Standard time instances and special time instances in ;
[0070] After completing the entire clustering process, the law of large numbers is used to determine whether the subsequent time belongs to standard time or special time;
[0071] In the policy matrix, each row corresponds to a single state, but the update of the row data requires two iterations to complete, rather than one iteration. Therefore, the size of the state space dimension m is defined as:
[0072] m=iter1-L / 2 (10)
[0073] Where L represents the number of special iteration times;
[0074] Δm≤g (11)
[0075] Finally, if the difference between the extracted value of m and the actual value of m is lower than a threshold, there is a security hole in the state space dimension of the policy matrix; otherwise, there is no security hole.
Claims
1. A security vulnerability detection method based on a cache side channel reinforcement learning model, characterized in that: 1) Using the cache channel measurement method of Flush+Reload technology, the time required for the function to load specific data is obtained as the original data; 2) Use an iterative clustering and pruning process to group the time data into groups, one group represents standard time and the other group represents special time: Each iteration obtains a row of the matrix and stores it in the cache, and the time required is in a roughly similar range. When all times in the sample are standard times, the law of large numbers is applied to detect the subsequent iteration time t i Is it standard time? Where E(t i ) and D(t i ) is t i The mean and variance of , ε is an arbitrarily small positive number; Assume that in the subsequent iteration process, the iteration time t i Following the law of large numbers, it would then be classified as standard time; However, if t i It does not conform to the law of large numbers and is considered as a special time. In this case, the iteration stores part of a row of the matrix in the cache and completes the iteration in a shorter time than the standard time. 3) Obtain the size of the state space dimension m according to the total number of iterations of the function and the data of the special time, and obtain the detection result; If the cache is filled with data in some iterations, there will be both special times and standard times in the sample. In order to distinguish them, an iterative clustering and pruning process is introduced. Through the clustering algorithm, the iteration times can be grouped into sets with similar characteristics, one group represents special times and the other represents standard times. These time sets are further analyzed and pruned to gradually determine all standard times. First, cluster analysis is performed on the time sample X, and the difference between the standard time instance and the special time instance is enlarged using data mapping technology: after each clustering, the sample set X is divided into different clusters, where X i Most of the samples in X belong to standard time instances, so i The data is mapped as follows: Avg(x i ) (3) Where Avg represents the mean function, X represents the original sample and the value range of i is 1 to n; Maximize X i and minimize the mean of X r The mean of the sample set X i Most of the samples in X belong to standard time instances. r It represents the remaining sample set after each clustering to obtain the standard time instance; X r =X-X i (4) After each clustering is completed, identification and pruning operations are performed to determine the sample set X i ; Since the length of the standard time instance is longer than the special time instance, the remaining sample set X r When the mean of is less than or equal to the mean of the initial sample set X of each iteration, a subset X can be specified. i As a standard time cluster; Avg(X r (X i ))≤Avg(X(X i )) (7) The iteration process ends when two conditions are met: First, when the sample set X and the remaining sample set X r The mean difference between them is lower than the predefined threshold, which is represented by an arbitrarily small positive number h; the remaining sample set X r The ratio of the standard time instance to the special time instance is also less than another arbitrarily small positive number l; Avg(X(X i ))-Avg(X r (X i ))≤h (8) X r (X n ) / X r (X s )≤l (9) Among them, X n and X s Respectively represent X r Standard time instances and special time instances in ; After completing the entire clustering process, the law of large numbers is used to determine whether the subsequent time belongs to standard time or special time; In the policy matrix, each row corresponds to a single state, but the update of the row data requires two iterations to complete, rather than one iteration. Therefore, the size of the state space dimension m is defined as: m=iter1-L / 2 (10) Where L represents the number of special iteration times; Δm≤g (11) Finally, if the difference between the extracted value of m and the actual value of m is lower than a threshold, there is a security hole in the state space dimension of the policy matrix; otherwise, there is no security hole.
2. The security vulnerability detection method based on the cache side channel reinforcement learning model according to claim 1, characterized in that: In the above 1), specifically: Introduce a variable t, which represents the time required to iterate a data block. Assume that t is proportional to the size of the block processed during the iteration, that is, as the block size increases, the time required for iteration also increases accordingly; t={t1,t2,…,t i } (1) where t i Represents the time consumption of the i-th iteration.
