Generative large model anomaly detection and adaptive deviation correction training system
Through multi-dimensional feature analysis and adaptive bias correction mechanism, the abnormalities of the generated large model are accurately positioned and corrected, which solves the problem of model sensitivity and insufficient adaptability to data noise, and achieves efficient and stable training and application.
Patent Information
- Application Number
- CN202510478691.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-08-01
AI Technical Summary
Existing generative large models are sensitive to data noise in training and application, and training data deviation problems frequently occur, resulting in the model being unable to fully learn effective features and being difficult to adapt to the dynamically changing application environment, affecting the accuracy and stability of the model. Traditional error correction methods are inefficient and resource consumption are high.
The anomaly detection module, which combines the Mahayana distance and baseline model residual analysis, is adopted to accurately locate the abnormality through gradient backtracking and SHAP value analysis, dynamically adjust the model parameters and feature weights, and realize adaptive deviation correction.
It improves the training robustness and accuracy of generative large models, reduces manual intervention, enhances the stability and adaptability of the model, reduces maintenance costs, and ensures the efficient operation of the model in a variable data environment.
Smart Images

Figure CN120408194A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of artificial intelligence and machine learning. Specifically, it relates to a generative large model anomaly detection and adaptive bias correction training system. Background Art
[0002] In recent years, deep learning technology has developed rapidly, and generative large models have been extremely widely used in many fields such as natural language processing, computer vision, and speech recognition. With its powerful learning ability and excellent expressiveness, the large model has achieved breakthrough results in many tasks, greatly promoting the progress of related fields.
[0003] However, as the complexity and scale of the model continue to increase, many severe challenges have emerged in its practical applications. In the data processing link, the large model is extremely sensitive to data noise, and the problem of training data bias frequently occurs. These problems not only seriously affect the training effect of the model, causing the model to be unable to fully learn the effective features in the data, but also trigger a series of errors in the inference stage, fundamentally weakening the accuracy and reliability of the model's decision-making. At the same time, the input data in the actual application environment is not static. Situations such as domain transfer and dynamic changes in data distribution occur frequently, which will lead to a sharp decline in model performance. If the model cannot adapt to the changes in data distribution, when facing complex situations, it is very likely to make decision-making mistakes, seriously threatening driving safety and posing a huge potential threat to the security and stability of critical tasks.
[0004] Traditional error correction methods are unable to cope with these problems of large models. Model correction methods based on manual rule verification require professionals to spend a lot of time and effort formulating rules, which are not only inefficient but also difficult to cover all possible error situations of the model. Methods such as human feedback reinforcement learning also rely on manual test intervention or require retraining the entire model. This means that a huge amount of human and computing resources need to be invested, and the whole process is time-consuming and laborious. Especially when dealing with large-scale models, this inefficiency becomes even more prominent, seriously restricting the further development and application of large models.
[0005] Through the retrieval of patent documents, it is found that the invention patent with the publication number CN117331780A discloses a method and device for constructing an anomaly detection model and an anomaly detection method and device. The method includes: obtaining anomaly detection requirement fields, corresponding category labels, and an initial XGboost anomaly detection model; performing matrix transformation on the anomaly detection requirement fields; obtaining a training set and a test set; training the initial XGboost anomaly detection model according to the training set and the category labels corresponding to the training set, and obtaining the target optimization function of the trained XGboost anomaly detection model; and updating the target optimization function according to the test set and the category labels corresponding to the test set to obtain the target XGboost anomaly detection model. This patent only focuses on constructing an anomaly detection model based on XGboost, with a narrow field; the method is single, relying on training and optimizing the model.
[0006] In summary, aiming at the problems of the above-mentioned existing technologies, researching a generative large model anomaly detection and adaptive bias correction training system has become a key task that needs to be solved urgently at present. Summary of the Invention
[0007] Aiming at the defects in the prior art, the purpose of the present invention is to provide a generative large model anomaly detection and adaptive bias correction training system.
[0008] According to a generative large model anomaly detection and adaptive bias correction training system provided by the present invention, it includes:
[0009] Anomaly detection module, through multi-dimensional feature analysis, real-time identifies abnormal behaviors in the forward propagation of the generative model and marks the abnormal points;
[0010] Anomaly analysis and location module, based on the abnormal points, through an error location mechanism of gradient backtracking and feature importance analysis, identifies the specific layer or node in the generative model where the anomaly exists;
[0011] Adaptive bias correction module, based on the specific layer or node where the anomaly exists, through dynamically adjusting the parameters of the generative model and the input feature vector processing mechanism, real-time corrects the abnormal behavior.
[0012] Preferably, the anomaly detection module includes:
[0013] Data collection and monitoring sub-module, through a real-time monitoring system, collects and stores the input feature vectors and their corresponding generative model outputs. The input feature vectors include multi-dimensional data features, and the generative model output is the actual output or intermediate layer activation value calculated by the generative model based on the input feature vectors.
[0014] Mahalanobis distance calculation sub-module, which calculates the deviation degree between the input feature vector and the overall distribution using the Mahalanobis distance. The overall distribution is the feature space distribution described by the mean and covariance matrix of the input feature vector; by setting a dynamic threshold, it captures abnormal points whose deviation degree exceeds the dynamic threshold in real time.
[0015] Baseline model residual analysis sub-module, which uses the baseline model to provide the expected output, analyzes the residual between the output of the generative model and the predicted output, and detects abnormal points through the fluctuation or exceeding the preset range of the residual;
[0016] Composite anomaly detection sub-module, which combines the Mahalanobis distance and the baseline model residual analysis to form a composite anomaly detection mechanism, comprehensively judges the relationship between the input feature vector and the output, and marks abnormal points.
[0017] Preferably, in the Mahalanobis distance calculation sub-module, the calculation formula of the Mahalanobis distance is:
[0018]
[0019] where \(x\) is the input feature vector, \(\mu\) is the feature mean, \(\Sigma\) is the covariance matrix, and \(\Sigma^{-1}\) is the inverse matrix of the covariance matrix. -1 is the inverse matrix of the covariance matrix.
[0020] Preferably, in the baseline model residual analysis sub-module, let \(y_{actual}\) actual be the actual output of the generative large model, and \(y_{predicted}\) baseline be the predicted output of the baseline model, then the residual \(r\) is expressed as:
[0021] \(r = y_{actual}-y_{predicted}\) actual \(-y_{predicted}\) baseline (2)
[0022] Preferably, the anomaly analysis and localization module includes:
[0023] Forward propagation sub-module, which performs forward propagation on the input feature vector of the abnormal point; during the forward propagation process, it calculates the output through each layer of the generative model and records the activation values of the intermediate layers;
[0024] Gradient backtracking sub-module, which performs gradient backtracking on the target output corresponding to the activation value, calculates the gradient change of each layer's parameters through the chain rule, and identifies the preliminarily located abnormal parameters and layers;
[0025] SHAP value sub-module, for the preliminarily located abnormal parameters and layers, adopts an interpretability method based on SHAP values. By calculating the SHAP values of the abnormal points, it analyzes the contribution degree of each input feature vector to the output of the generative model. Using a comprehensive analysis method, by combining the gradient change information and the SHAP value information, it identifies the input feature vector with the highest contribution degree to the output of the generative model.
[0026] The abnormal comprehensive positioning sub-module identifies the specific layer or node with abnormality in the generative model by combining abnormal parameters and the input feature vector with the highest layer and contribution degree.
[0027] Preferably, in the forward propagation sub-module, for a given input feature vector, the activation value a is obtained through the calculation of each layer. (l) The formula is as follows:
[0028] a (l) = f(W (l) (a (l-1) + b (l) )) (3)
[0029] where l represents the layer number, W (l) and b (l) are the weight and bias respectively, and f is the activation function.
[0030] Preferably, in the gradient backtracking sub-module, the partial derivative of the loss function with respect to each parameter is calculated layer by layer through the chain rule. For the weight W , the gradient is calculated as shown in (4), where δ (l) is the error term of the l-th layer, defined as shown in (5), and z (l) is as shown in (6): (l) As shown in (6):
[0031]
[0032] δ (l) = (δ (l+1) W (l+1) ) ⊙ f′(z (l) ) (5)
[0033] z (l) = W (l) a (l-1) + b (l) (6)
[0034] Preferably, the adaptive bias correction module includes:
[0035] The abnormal feedback correction sub-module: Based on the specific layer or node of the abnormality, by comparing the output of the generative model with the expected output of the baseline model, the residual is calculated, and whether to perform bias correction is determined according to the size of the residual;
[0036] The weight adjustment and optimization sub-module: Based on the change rate of the current residual and historical residual of the generative model, the learning rate of the generative model is dynamically adjusted; if the current residual decreases significantly, the learning rate will be decreased to stabilize the model training; if the current residual increases, the learning rate will be increased to quickly correct the bias;
[0037] Weighting mechanism sub-module: Based on outliers and SHAP values, re-weight the input feature vector to dynamically adjust the weights of each feature;
[0038] Verification and tuning sub-module: Evaluate the performance of the corrected model through backtesting and cross-validation. If the verification results show that the model fails to effectively correct the bias or there is overfitting, the system will adjust the bias correction strategy again and continue to optimize the model parameter adjustment rules.
[0039] Preferably, in the weight adjustment and optimization sub-module, the learning rate is adjusted based on the change rate of the current model error and the historical error:
[0040]
[0041] where α t is the current step size, r t and r t-1 are the residuals at the current and previous moments respectively.
[0042] Preferably, in the weighting mechanism sub-module, the input feature vector reprocessing and re-weighting mechanism is based on SHAP values and gradient information to dynamically adjust the weights of each feature, emphasizing the contribution of important features to the model output; adjust the weighting coefficient ρ of the input feature vector according to the SHAP value of the outlier, and perform feature re-weighting through the following formula:
[0043] ρ new = ρ old ·SHAP(x) (8)
[0044] where ρ old is the original weight, and SHAP(x) is the SHAP value of the input feature vector corresponding to the outlier.
[0045] Compared with the prior art, the present invention has the following beneficial effects:
[0046] 1. In terms of anomaly detection, the present invention combines Mahalanobis distance and baseline model residual analysis to effectively detect abnormal behaviors of input features and model outputs during the training process, timely discover potential problems, and greatly improve the robustness and accuracy of training. In the problem location link, the present invention can accurately locate the source of abnormal behavior and identify the key parameters and features affecting the model output through gradient backtracking and SHA value analysis. It not only accelerates problem diagnosis but also provides a solid data basis for subsequent model optimization.
[0047] 2. During the training process, the present invention dynamically adjusts model parameters, feature weights, and learning rates based on a real-time feedback mechanism to minimize training bias to the greatest extent. Through the adaptive adjustment mechanism, the model can maintain good stability and generalization ability when facing variable data, avoiding overfitting or underfitting phenomena.
[0048] 3. Overall, through a closed-loop mechanism of monitoring, analysis, and correction, the present invention optimizes all aspects of large model training to ensure efficient training, thereby improving the accuracy and stability of the final model.
[0049] 4. The mechanism developed by the present invention for automatically detecting, analyzing, and correcting errors in large models significantly reduces manual participation, enhances the stability and reliability of the model, and at the same time significantly reduces maintenance costs and time overhead. The introduced automated error detection and repair process endows the model with self-optimization capabilities, enabling it to better adapt to diverse and dynamically changing application scenarios, laying a solid foundation for the wide application and continuous development of large models.
[0050] 5. Through innovative automated design and an efficient closed-loop feedback mechanism, the present invention provides a new technical solution for anomaly correction in large models, effectively improving the overall performance of the model and providing key technical support for the reliable deployment and efficient training of large-scale artificial intelligence systems.
[0051] In summary, the technical solution of the present invention can effectively improve the stability and accuracy of large model training, and provides stronger anomaly detection, analysis, and correction capabilities for the training of generative large models. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Other features, objectives, and advantages of the present invention will become more apparent by reading the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0053] Figure 1 It is a schematic diagram of a generative large model anomaly detection and adaptive bias correction training system in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0054] The present invention will be described in detail below with reference to specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but do not limit the present invention in any form. It should be noted that those of ordinary skill in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.
[0055] The present invention aims to construct a generative large model anomaly detection and adaptive bias correction training system to solve the problems of low efficiency, high cost of manual intervention, and insufficient model adaptability in the prior art. By creating a complete closed-loop system for error detection, analysis, repair, and feedback, the present invention can achieve real-time optimization of the model during dynamic training, significantly improving its stability, robustness, and adaptability, and ensuring efficient and reliable operation in diverse application scenarios.
[0056] The innovative points of the present invention are mainly reflected in the following aspects:
[0057] First, an automated error detection module based on multi-dimensional feature analysis is set up. This module can accurately identify abnormal behaviors of the model caused by data noise, training bias, or input distribution changes. By detecting the input-output relationship of the model in real time, this module can efficiently capture errors, providing a basis for subsequent analysis and repair.
[0058] Second, for the detected anomalies, an automatic analysis and localization mechanism is set up. Combining context features with the dynamic changes of the model's internal parameters, this mechanism can quickly locate the root cause of the problem, such as specific model layers, parameters, or input features. Gradient backtracking and feature importance analysis are used to ensure the accuracy and efficiency of problem localization.
[0059] Third, in the error repair stage, an adaptive strategy generation mechanism is proposed. This mechanism can dynamically generate optimal repair solutions according to different error types. Combining predefined rules with data-driven methods, this mechanism supports the automatic implementation of various repair means such as parameter adjustment, model structure optimization, and data augmentation, thereby realizing the automatic adjustment of the model performance and enhancing the model's adaptive ability.
[0060] The present invention adopts a distributed modular architecture. The main modules include an anomaly detection module, an anomaly analysis and localization module, and an adaptive deviation correction module. Each module works together through standardized interfaces to form a complete closed-loop mechanism for realizing the automatic self-repair and error correction of large models. Each module runs in the form of an independent service, and data is transmitted between modules through a message queue, realizing loose coupling and high fault tolerance. This setting supports the flexible expansion of the processing capacity of a single module and can quickly recover when a module fails. In addition, the distributed architecture has the ability to process real-time operations of large-scale data and can meet the high-efficiency operation requirements in complex scenarios.
[0061] Embodiment 1:
[0062] Figure 1 It is a schematic diagram of a generative large model anomaly detection and adaptive deviation correction training system in an embodiment of the present invention.
[0063] As Figure 1 shown, this embodiment provides a generative large model anomaly detection and adaptive deviation correction training system, including:
[0064] An anomaly detection module, which can identify abnormal behaviors in the forward propagation of the generative model in real time through multi-dimensional feature analysis and mark the abnormal points.
[0065] In this embodiment, the anomaly detection module uses the Mahalanobis Distance for multi-dimensional anomaly detection and combines the residual analysis technology of the baseline model to ensure the accuracy and real-time performance of the detection.
[0066] Specifically, the anomaly detection module includes:
[0067] A data collection and monitoring sub-module that collects and stores input feature vectors and their corresponding generative model outputs through a real-time monitoring system. The input feature vectors include multi-dimensional data features, and the generative model output is the actual output or intermediate layer activation value calculated by the generative model based on the input feature vectors.
[0068] A Mahalanobis distance calculation sub-module that calculates the deviation degree of the input feature vector from the overall distribution using the Mahalanobis distance. The overall distribution is the feature space distribution described by the mean and covariance matrix of the input feature vectors; by setting a dynamic threshold, abnormal points whose deviation degree exceeds the dynamic threshold are captured in real time.
[0069] Specifically, if a certain input feature vector is far from the mean, it indicates that the position of the input data in the feature space is abnormal and may represent abnormal behavior. By monitoring the relationship between the input feature vectors and the model outputs, using statistical methods and time series analysis, abnormal points can be captured in real time by setting a dynamic threshold.
[0070] The Mahalanobis distance is a measurement method in statistics for measuring the distance between a point and the center of a distribution, which can comprehensively consider the correlation between features. In this embodiment, the calculation formula of the Mahalanobis distance is:
[0071]
[0072] where \(x\) is the input feature vector, \(\mu\) is the feature mean, \(\Sigma\) is the covariance matrix, and \(\Sigma^{-1}\) is the inverse matrix of the covariance matrix.[[ID=XX]] -1 is the inverse matrix of the covariance matrix.
[0073] A baseline model residual analysis sub-module that uses the baseline model to provide an expected output, analyzes the residual between the generative model output and the predicted output, and detects abnormal points through the fluctuation of the residual or exceeding the preset range.
[0074] Specifically, the baseline model is a standard model that has been trained for a long time and is used to provide the expected output of the normal behavior of the generative model. The purpose of analyzing the residual is to capture the deviation caused by changes in the input feature vectors, model drift, or abnormal behavior.
[0075] In this embodiment, let \(y\) actual be the actual output of the generative large model, and \(y\) baseline be the predicted output of the baseline model. Then the residual \(r\) is expressed as:
[0076] \(r = y\) actual - \(y\) baseline (2)
[0077] The composite anomaly detection sub-module combines the Mahalanobis distance and baseline model residual analysis to form a composite anomaly detection mechanism in order to comprehensively consider the relationship between the input feature vector and the output, comprehensively judge the relationship between the input feature vector and the output, and mark the anomaly points.
[0078] Specifically, at each data input, first, the deviation degree of the input feature vector is calculated through the Mahalanobis distance to judge the anomaly of the input feature vector; at the same time, the expected value of the generative model output is calculated through the baseline model, and the residual between the actual output and the expected value is analyzed; if both the Mahalanobis distance and the residual analysis indicate anomalies, the system marks this point as an anomaly point.
[0079] The anomaly analysis and localization module, based on the anomaly points, uses an error localization mechanism of gradient backtracking and feature importance analysis to identify the specific layer or node with anomalies in the generative model.
[0080] In this embodiment, the anomaly analysis and localization module performs backpropagation on the input feature vector of the anomaly point to trace the gradient changes of the internal parameters of the generative model, thereby locating the specific layer or node of the problem; at the same time, through an interpretability method based on SHAP values, it evaluates the impact of the input feature vector on the output of the generative model to further narrow down the scope of the problem.
[0081] Specifically, the anomaly analysis and localization module includes:
[0082] The forward propagation sub-module performs forward propagation on the input feature vector of the anomaly point; during the forward propagation process, the output is calculated through each layer of the generative model, and the activation values of the intermediate layers are recorded.
[0083] Furthermore, in the forward propagation sub-module, for a given input feature vector, through the calculation of each layer, the activation value a (l) is obtained, and the formula is as follows:
[0084] a (l) = f(W (l) (a (l-1) + b (l) )) (3)
[0085] where l represents the layer number, W (l) and b (l) are the weight and bias respectively, and f is the activation function.
[0086] The gradient backtracking sub-module performs gradient backtracking on the target output corresponding to the activation value, calculates the gradient changes of the parameters of each layer through the chain rule, and identifies the preliminarily located abnormal parameters and layers whose gradient norms exceed the threshold.
[0087] In this embodiment, the loss function is calculated layer by layer using the chain rule The partial derivative of each parameter, for the weight W (l) , the gradient is calculated as shown in (4), where δ (l) is the error term of the l-th layer, defined as shown in (5), and z (l) is as shown in (6):
[0088]
[0089] δ (l) =(δ (l+1) W (l+1) )⊙f′(z (l) ) (5)
[0090] z (l) =W (l) a (l-1) +b (l) (6)
[0091] The SHAP value sub-module uses an interpretability method based on SHAP values for the preliminarily located abnormal parameters and layers. By calculating the SHAP values of abnormal points, it analyzes the contribution degree of each input feature vector to the output of the generative model. An integrated analysis method is adopted to identify the input feature vector with the highest contribution degree to the output of the generative model by combining gradient change information and SHAP value information.
[0092] Specifically, in feature importance analysis, SHAP values provide a unified feature importance measurement standard, which can quantify the contribution degree of each input feature vector to the model output. The calculation of SHAP values is based on the concept of Shapley values, considering the marginal contribution of all possible feature combinations to the output.
[0093] The abnormal comprehensive location sub-module identifies the specific layer or node with abnormalities in the generative model by combining the abnormal parameters and layers with the input feature vector with the highest contribution degree.
[0094] Specifically, the root cause of the problem is accurately located by integrating the results of gradient change and feature importance analysis, and at the same time, the role of the input feature vector with the highest contribution degree in the abnormal behavior is clarified.
[0095] The adaptive bias correction module, based on the specific layer or node with abnormalities, dynamically adjusts the parameter and input feature vector processing mechanism of the generative model to correct abnormal behaviors in real time, optimize the training process of the generative model, and ensure that the system can adapt to the changing input environment.
[0096] Specifically, the adaptive bias correction module includes:[[]]
[0097] Abnormal feedback correction sub-module: Based on the specific layer or node of the abnormality, by comparing the output of the generative model with the expected output of the baseline model, calculate its residual, and decide whether to perform deviation correction according to the size of the residual;
[0098] Furthermore, if the residual exceeds the set threshold, an adaptive adjustment mechanism is triggered, and the weights and biases of the generative model are adjusted through the Adam optimization algorithm to reduce the prediction error and improve the model stability.
[0099] Weight adjustment and optimization sub-module: Dynamically adjust the learning rate of the generative model based on the change rate of the current residual and historical residual of the generative model; if the current residual decreases significantly, the learning rate will be decreased to stabilize the model training; if the residual increases, the learning rate will be increased to quickly correct the deviation.
[0100] Specifically, the weight adjustment and optimization sub-module introduces a dynamic weight adjustment and learning rate optimization mechanism, which can automatically adjust the learning rate according to the detected abnormality or significant deviation, ensuring that the generative model can be trained with a reasonable step size and avoiding overfitting or over-updating during the training process.
[0101] In this embodiment, the adjustment of the learning rate of the generative model is based on the change rate of the current model residual and historical residual:
[0102]
[0103] where α t is the current step size, r t and r t-1 are the current and previous residuals respectively.
[0104] Weighting mechanism sub-module: Based on the abnormal points and SHAP values, re-weight the input feature vectors and dynamically adjust the weights of each feature.
[0105] In this embodiment, when the anomaly detection module finds that the input feature vectors deviate from the model expectation, the system will re-weight these input feature vectors to ensure that their influence on the model output is more in line with the actual situation. By adjusting the weights, the contribution of key features to the final output is increased, thereby further improving the accuracy and robustness of the model.
[0106] Specifically, the weighting mechanism sub-module introduces an input feature reprocessing and re-weighting mechanism, and dynamically adjusts the weights of each feature based on SHAP values and gradient information, emphasizing the contribution of important features to the model output; adjusts the weighting coefficient ρ of the input feature vector according to the SHAP value of the abnormal point, and performs feature re-weighting through the following formula:
[0107] ρ new = ρ old·SHAP(x) (8)
[0108] where ρ old is the original weight, and SHAP(x) is the SHAP value of the input feature vector corresponding to the outlier point.
[0109] In this embodiment, the adjustment object is the input feature marked as an "outlier point" (i.e., a data point where the input feature significantly deviates from the expected distribution of the model) by the outlier detection module. The adjustment target is to suppress the negative impact of the outlier feature or enhance the important features suppressed by the outlier point by dynamically correcting the weight of the outlier point feature, thereby improving the robustness of the model in the outlier scenario.
[0110] Verification and tuning sub-module: Evaluate the performance of the corrected model through backtesting and cross-validation. If the verification result shows that the model fails to effectively correct the deviation or there is overfitting, the system will adjust the deviation correction strategy again and continue to optimize the model parameter adjustment rules.
[0111] In this embodiment, backtesting verifies the correction effect based on historical data and known abnormal behaviors, and cross-validation ensures the generalization ability of the model on unseen data by dividing the dataset into a training set and a validation set.
[0112] Those skilled in the art know that in addition to implementing the system and its various devices, modules, and units provided by the present invention in the form of pure computer-readable program code, the method steps can be logically programmed to enable the system and its various devices, modules, and units provided by the present invention to be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers, etc., to achieve the same functions. Therefore, the system and its various devices, modules, and units provided by the present invention can be regarded as a hardware component, and the devices, modules, and units included therein for implementing various functions can also be regarded as the structures within the hardware component; the devices, modules, and units for implementing various functions can also be regarded as both software modules for implementing the method and the structures within the hardware component.
[0113] The specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. Without conflict, the embodiments of the present application and the features in the embodiments can be combined arbitrarily.
Claims
1. A generative large model anomaly detection and adaptive bias correction training system, characterized in that, Including: An anomaly detection module that, through multi-dimensional feature analysis, real-time identifies abnormal behaviors in the forward propagation of the generative model and marks the abnormal points; An anomaly analysis and localization module that, based on the abnormal points, through an error localization mechanism of gradient backtracking and feature importance analysis, identifies the specific layers or nodes with anomalies in the generative model; An adaptive bias correction module that, based on the specific layers or nodes with anomalies, through dynamically adjusting the parameters of the generative model and the input feature vector processing mechanism, real-time corrects the abnormal behaviors.
2. The anomaly detection and adaptive bias correction training system for a generative large model according to claim 1, wherein, The anomaly detection module includes: A data collection and monitoring sub-module that collects and stores input feature vectors and their corresponding generative model outputs through a real-time monitoring system, where the input feature vectors include multi-dimensional data features, and the generative model output is the actual output or intermediate layer activation value calculated by the generative model based on the input feature vectors; A Mahalanobis distance calculation sub-module that uses the Mahalanobis distance to calculate the deviation degree of the input feature vector from the overall distribution, where the overall distribution is the feature space distribution described by the mean and covariance matrix of the input feature vectors; by setting a dynamic threshold, it real-time captures the abnormal points where the deviation degree exceeds the dynamic threshold; A baseline model residual analysis sub-module that uses the baseline model to provide an expected output, analyzes the residual between the generative model output and the predicted output, and detects abnormal points through the fluctuation or exceeding the preset range of the residual; A composite anomaly detection sub-module that combines the Mahalanobis distance and the baseline model residual analysis to form a composite anomaly detection mechanism, comprehensively judges the relationship between the input feature vector and the output, and marks the abnormal points.
3. The generative large model anomaly detection and adaptive bias correction training system according to claim 2, wherein In the Mahalanobis distance calculation sub-module, the calculation formula of the Mahalanobis distance is: where \(x\) is the input feature vector, \(\mu\) is the feature mean, \(\Sigma\) is the covariance matrix, and \(\Sigma\) -1 is the inverse matrix of the covariance matrix.
4. The generative large model anomaly detection and adaptive bias correction training system according to claim 2, wherein In the baseline model residual analysis sub-module, let y actual be the actual output of the generative large model, and y baseline be the predicted output of the baseline model. Then the residual r is expressed as: r = y actual -y baseline (2).
5. A generative large model anomaly detection and adaptive bias correction training system according to claim 1, characterized in that, The anomaly analysis and localization module includes: A forward propagation sub-module that performs forward propagation on the input feature vector of the abnormal point; during the forward propagation process, it calculates the output through each layer of the generative model and records the activation values of the intermediate layers; A gradient backtracking sub-module that performs gradient backtracking on the target output corresponding to the activation value, calculates the gradient changes of each layer's parameters through the chain rule, and identifies the preliminarily located abnormal parameters and layers; A SHAP value sub-module that, for the preliminarily located abnormal parameters and layers, adopts an interpretability method based on SHAP values, calculates the SHAP values of the abnormal points, analyzes the contribution degree of each input feature vector to the generative model output, and adopts a comprehensive analysis method to identify the input feature vector with the highest contribution degree to the generative model output by combining gradient change information and SHAP value information; An anomaly comprehensive localization sub-module that, by combining the abnormal parameters and layers with the input feature vector with the highest contribution degree, identifies the specific layers or nodes with anomalies in the generative model.
6. The anomaly detection and adaptive bias correction training system for a generative large model according to claim 5, characterized in that In the forward propagation sub-module, for a given input feature vector, the activation value a is obtained through the calculation of each layer (l) , and the formula is as follows: a (l) = f(W (l) (a (l-1) + b (l) )) (3) where l represents the layer number, W (l) and b (l) are the weight and bias respectively, and f is the activation function.
7. A generative large model anomaly detection and adaptive bias correction training system according to claim 5, characterized in that In the gradient backtracking sub-module, the partial derivatives of the loss function with respect to each parameter are calculated layer by layer through the chain rule. For the weight W the gradient is calculated as shown in (4), where δ (l) is the error term of the l-th layer, defined as shown in (5), and z (l) is as shown in (6): (l) as shown in (6): δ (l) = (δ (l+1) W (l+1) ) ⊙ f′(z (l) )(5)z (l) = W (l) a (l-1) + b (l) (6).
8. The anomaly detection and adaptive bias correction training system for a generative large model according to claim 1, characterized in that The adaptive bias correction module includes: An anomaly feedback correction sub-module: Based on the specific layers or nodes with anomalies, by comparing the generative model output with the expected output of the baseline model, calculates the residual, and decides whether to perform bias correction according to the size of the residual; Weight adjustment and optimization sub-module: Dynamically adjust the learning rate of the generative model based on the change rates of the current residual and the historical residual in the generative mode; if the current residual decreases significantly, the learning rate will be decreased to stabilize the model training; if the current residual increases, the learning rate will be increased to quickly correct the deviation. Weighting mechanism sub-module: Re-weight the input feature vector based on the outlier and the SHAP value, and dynamically adjust the weights of each feature. Verification and tuning sub-module: Evaluate the performance of the corrected model through backtesting and cross-validation. If the verification results show that the model fails to effectively correct the deviation or there is an overfitting situation, the system will adjust the deviation correction strategy again and continue to optimize the model parameter adjustment rules.
9. The anomaly detection and adaptive bias correction training system for a generative large model according to claim 8, wherein In the weight adjustment and optimization sub-module, the adjustment of the learning rate is based on the change rates of the current model error and the historical error. where α t is the current step size, r t and r t-1 are the residuals at the current and previous moments, respectively.
10. A generative large model anomaly detection and adaptive bias correction training system according to claim 8, characterized in that, In the weighting mechanism sub-module, the reprocessing and re-weighting mechanism of the input feature vector dynamically adjusts the weights of each feature based on the SHAP value and the gradient information, emphasizing the contribution of important features to the model output; adjust the weighting coefficient ρ of the input feature vector according to the SHAP value of the outlier, and perform feature re-weighting through the following formula: ρ new = ρ old ·SHAP(x) (8) where ρ old is the original weight, and SHAP(x) is the SHAP value of the input feature vector corresponding to the outlier point.
Citation Information
Patent Citations
Abnormal detection model construction method and device and abnormal detection method and device
CN117331780A
Cited By
Industrial Internet of Things time series data anomaly detection method based on concept drift identification
CN120873698A