Parameter safety re-calibration and response method, device, equipment and medium

By comparing the parameters of the base model and the fine-tuned model, gradient sensitivity analysis and anomaly correlation graphs are used to identify insecure parameters and perform security recalibration. This solves the problem of insufficient security after model fine-tuning and achieves a balance between security and task performance in the fields of fintech and healthcare.

CN121235013APending Publication Date: 2025-12-30PING AN TECH (SHENZHEN) CO LTD

Patent Information

Application Number
CN202511392696.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-26
Publication Date
2025-12-30

AI Technical Summary

Technical Problem

Existing technologies cannot accurately identify and correct unsafe behaviors introduced by new parameters after model fine-tuning. This results in improved task performance but significantly weakened security alignment capabilities, especially in the fintech and healthcare sectors, where there are compliance risks and legal liabilities.

Method used

By acquiring the parameters of the base model and the fine-tuned model, gradient sensitivity analysis is performed on the differential parameters to generate anomaly correlation maps, identify unsafe parameters, and perform security recalibration after removal or sparsification. Combined with a scenario-based security verification set update strategy, a secure application model is generated.

Benefits of technology

It achieves significant improvement in security and compliance while maintaining model task performance, avoiding the contradiction between improved task capabilities and weakened security alignment capabilities in traditional methods, and ensuring the safe and reliable operation of the model in complex application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121235013A_ABST
    Figure CN121235013A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, can be applied to business scenes of financial science and technology, medical health and the like, and discloses a parameter security re-calibration and response method, device, equipment and medium, and the method comprises the steps: obtaining parameters of a basic model and a fine-tuned model, and comparing the parameters to obtain differential parameters; performing gradient sensitivity analysis on the differential parameters to generate an abnormal correlation map; detecting the fine-tuned model by using an abnormal association map to determine unsafe parameters; unsafe parameters are processed, safe re-calibration is completed, and basic model parameters are fused to form a re-calibration model; verifying the re-calibration model based on the scenarized security verification set and obtaining feedback; according to the feedback updating strategy, re-calibration is carried out again, and a security application model is generated; and processing the task request through the security application model to obtain a security response result. According to the method, unsafe parameters are identified and corrected through differential analysis and closed-loop recalibration, the safety and the compliance are enhanced while the model performance is kept, and reliable application in a complex scene is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, apparatus, device, and medium for parameter safety recalibration and response. Background Technology

[0002] In the fintech sector, large language models are increasingly being applied to customer service, intelligent question answering, claims assistance, and compliance review. Existing model fine-tuning methods primarily focus on improving performance in business scenarios, often neglecting security. When models encounter sensitive questions involving investment risks, insurance clause interpretation, or arbitrage advice, they are prone to unauthorized responses or inappropriate interpretations. Such issues can not only mislead customers but also lead to compliance risks and legal liabilities. Furthermore, existing security measures largely rely on standardized security instruction tuning or simple post-filtering, which struggles to cover newly introduced parameter changes after fine-tuning. These new parameters often introduce potential unsafe behaviors, and existing methods lack mechanisms for targeted identification and correction. In addition, some financial institutions rely on manual review or external rule bases for remediation, which suffers from low efficiency, high maintenance costs, and difficulty in handling complex dialogue contexts.

[0003] In the healthcare field, large language models are used in scenarios such as assisted diagnosis, health consultation, and medication advice. However, existing model fine-tuning processes also suffer from prioritizing task performance over safety. When users inquire about disease symptoms, medication use, or treatment plans, the model may generate incorrect or exaggerated answers, or even involve unapproved treatment recommendations. Such unsafe outputs not only threaten patient health but may also raise medical liability and regulatory compliance risks. Existing safety correction methods often employ general filters or static rule sets, but these methods are insufficient in identifying safety defects in newly added parameters after fine-tuning, and cannot effectively prevent the model from generating misleading answers in complex medical dialogues. Furthermore, relying on manual review is ill-suited to the real-time and professional requirements of medical scenarios, easily leading to delays and omissions. Summary of the Invention

[0004] The main objective of this invention is to provide a parameter safety recalibration and response method, apparatus, device, and storage medium, which aims to solve the technical problem that the existing technology cannot accurately identify and correct unsafe behaviors introduced by new parameters after model fine-tuning, resulting in improved task performance but significantly weakened safety alignment capability.

[0005] To achieve the above objectives, the present invention provides a parameter safety recalibration and response method, comprising:

[0006] Obtain the parameters of the base model and the parameters of the fine-tuned model, and perform parameter comparison processing on the parameters of the base model and the parameters of the fine-tuned model to obtain the difference parameters;

[0007] Gradient sensitivity analysis is performed on the differential parameters to generate an anomaly correlation map;

[0008] Based on the aforementioned anomaly correlation graph, trigger detection processing is performed on the fine-tuned model to determine unsafe parameters;

[0009] The unsafe parameters are removed or sparsified to obtain parameters to be recalibrated. The parameters to be recalibrated are then subjected to safe recalibration to obtain recalibrated parameters. The recalibrated parameters are then fused with the parameters of the base model to form a recalibrated model.

[0010] Obtain a scenario-based security verification set, and perform security verification processing on the recalibration model based on the scenario-based security verification set to obtain verification feedback information;

[0011] Based on the verification feedback information, the strategy for determining insecure parameters and the security recalibration strategy are updated to obtain the updated strategy.

[0012] Based on the updated strategy, a secure recalibration process is performed on the recalibration model to generate a secure application model;

[0013] Obtain a task request, process the task request through the security application model, and obtain a security response result.

[0014] Furthermore, to achieve the above objectives, the present invention provides a parameter safety recalibration and response device, comprising:

[0015] The parameter comparison module is used to obtain the parameters of the base model and the parameters of the fine-tuned model, and to perform parameter comparison processing on the parameters of the base model and the parameters of the fine-tuned model to obtain the difference parameters.

[0016] The sensitivity analysis module is used to perform gradient sensitivity analysis on the difference parameters and generate anomaly correlation maps;

[0017] The trigger detection module is used to perform trigger detection processing on the fine-tuned model based on the abnormal correlation graph to determine unsafe parameters;

[0018] The recalibration module is used to perform elimination or sparsification processing on the unsafe parameters to obtain parameters to be recalibrated, perform safe recalibration processing on the parameters to be recalibrated to obtain recalibrated parameters, and fuse the recalibrated parameters with the parameters of the base model to form a recalibrated model.

[0019] The security verification module is used to acquire a scenario-based security verification set, perform security verification processing on the recalibration model based on the scenario-based security verification set, and obtain verification feedback information.

[0020] The strategy update module is used to update the strategy for determining insecure parameters and the security recalibration strategy based on the verification feedback information, so as to obtain the updated strategy.

[0021] The application generation module is used to perform a secure recalibration process on the recalibration model based on the updated strategy, and generate a secure application model.

[0022] The task processing module is used to obtain task requests, process the task requests through the security application model, and obtain security response results.

[0023] Furthermore, to achieve the above objectives, the present invention also provides a computer device, the computer device including a memory, a processor, and a parameter safe recalibration and response program stored in the memory and executable on the processor, wherein when the parameter safe recalibration and response program is executed by the processor, it implements the steps of the parameter safe recalibration and response method as described above.

[0024] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a parameter-safe recalibration and response program, which, when executed by a processor, implements the steps of the parameter-safe recalibration and response method as described above.

[0025] Beneficial Effects: This invention relates to the field of artificial intelligence technology and can be applied to business scenarios such as fintech and healthcare. It discloses a parameter security recalibration and response method, apparatus, device, and medium, comprising: acquiring basic model parameters and fine-tuned model parameters; performing parameter comparison processing to obtain differential parameters; performing gradient sensitivity analysis on the differential parameters to generate an anomaly correlation graph; performing trigger detection processing on the fine-tuned model based on the anomaly correlation graph to determine unsafe parameters; performing elimination or sparsification processing on the unsafe parameters to obtain parameters to be recalibrated, and obtaining recalibrated parameters through security recalibration processing; fusing the recalibrated parameters with the basic model parameters to form a recalibrated model; acquiring a scenario-based security verification set; performing security verification processing on the recalibrated model to obtain verification feedback information; updating the unsafe parameter determination strategy and security recalibration strategy based on the verification feedback information to generate an updated strategy; performing security recalibration processing on the recalibrated model based on the updated strategy to generate a secure application model; acquiring a task request; processing the task request through the secure application model to obtain a security response result. This invention, by comparing the parameters of the base model and the fine-tuned model and combining this with gradient sensitivity analysis, can accurately identify insecure parameters introduced during the fine-tuning process and dynamically correct these insecure parameters through a cyclical mechanism of security recalibration and policy update. This not only maintains the model's task performance but also significantly improves security and compliance, avoiding the contradiction between improved task capabilities and weakened security alignment capabilities found in traditional methods, and enabling the model to operate safely and reliably in complex application scenarios. Attached Figure Description

[0026] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings:

[0027] Figure 1 This is a schematic diagram of an application environment for the parameter safety recalibration and response method in one embodiment of the present invention;

[0028] Figure 2 This is a flowchart illustrating an embodiment of the parameter safety recalibration and response method of the present invention;

[0029] Figure 3 This is a schematic diagram of the functional modules of a preferred embodiment of the parameter safety recalibration and response device of the present invention;

[0030] Figure 4 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention;

[0031] Figure 5 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation

[0032] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0033] The parameter safety recalibration and response method provided in this invention can be applied to applications such as... Figure 1 In this application environment, the client communicates with the server via a network. The server can obtain the basic model parameters and the fine-tuned model parameters from the client, perform parameter comparison processing to obtain the differential parameters, perform gradient sensitivity analysis on the differential parameters to generate an anomaly correlation graph, perform trigger detection processing on the fine-tuned model based on the anomaly correlation graph to identify unsafe parameters, perform elimination or sparsification processing on the unsafe parameters to obtain the parameters to be recalibrated, and obtain the recalibrated parameters through safe recalibration processing, fuse the recalibrated parameters with the basic model parameters to form a recalibrated model, obtain a scenario-based safety verification set, perform safety verification processing on the recalibrated model to obtain verification feedback information, update the unsafe parameter determination strategy and the safe recalibration strategy based on the verification feedback information to generate an updated strategy, perform safe recalibration processing on the recalibrated model based on the updated strategy to generate a safe application model, obtain task requests, process the task requests through the safe application model to obtain a safe response result. This invention, by comparing the parameters of the base model and the fine-tuned model and combining this with gradient sensitivity analysis, can accurately identify insecure parameters introduced during the fine-tuning process and dynamically correct these insecure parameters through a cyclical mechanism of security recalibration and policy update. This not only maintains the model's task performance but also significantly improves security and compliance, avoiding the contradiction between improved task capabilities and weakened security alignment capabilities found in traditional methods, and achieving safe and reliable operation of the model in complex application scenarios. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will be described in detail below through specific embodiments.

[0034] Please see Figure 2 , Figure 2 This is a flowchart illustrating an embodiment of the parameter safety recalibration and response method provided by the present invention. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.

[0035] like Figure 2 As shown, the parameter safety recalibration and response method proposed in this invention includes the following steps:

[0036] S10, obtain the parameters of the base model and the parameters of the fine-tuned model, perform parameter comparison processing on the parameters of the base model and the parameters of the fine-tuned model to obtain the difference parameters;

[0037] In this embodiment, obtaining the parameters of the base model refers to extracting the weight matrix, bias vector, and structured configuration data from the already trained model used as a benchmark. These parameters typically originate from the pre-training process of a large-scale general corpus, encompassing stable semantic representations and structured knowledge in language modeling. The file format may be binary storage or tensorized weights. Parameters can be obtained through model interface calls or by directly reading the stored file. During reading, it is essential to ensure that the version number and storage format are consistent to avoid parsing errors.

[0038] Obtaining the parameters of a fine-tuned model refers to updating the weights and biases after fine-tuning the pre-trained parameters of the base model using task-specific data. These parameters reflect the task-specific data distribution and bias. The parameter file of the fine-tuned model usually maintains the same structure as the base model, but the values ​​have been adjusted locally or globally at multiple levels. The method of obtaining these parameters is similar to that of the base model; a parameter snapshot can be directly exported from the training platform, or the training output can be extracted through a model management system.

[0039] Performing parameter comparison processing on the base model parameters and the fine-tuned model parameters means matching the parameters from both sources item by item to identify the range and magnitude of numerical changes. To achieve this, alignment at the dimensional level is required, i.e., confirming the structural consistency of the parameter tensors to avoid incomparability due to model version mismatches. Comparison processing can employ element-wise interpolation or normalized distance metrics, such as Euclidean distance or cosine similarity.

[0040] Obtaining the difference parameters indicates that the differences between the two parameters have been extracted and represented in a structured manner after comparison. The difference parameters can be stored as a tensor set, with each element corresponding to the parameter differences of a specific layer or module. The difference results not only record the magnitude of the differences but can also incorporate statistical distribution information to form inputs for subsequent analysis. The difference parameters are the foundation for subsequent sensitivity analysis and screening for insecure parameters; their generation process must ensure numerical precision to avoid biases caused by floating-point operations or truncation errors.

[0041] In practice, different technical approaches can be used to obtain and compare parameters. For example, one approach is to directly compare parameter files, first parsing the basic parameter set and the fine-tuning parameter set, storing them as key-value pairs, and then calculating the differences key by key. Alternatively, parameter values ​​can be extracted from memory at runtime through the model interface, avoiding file read / write overhead.

[0042] During the comparison process, a threshold filtering method can be used to retain only parameter entries that exceed a set difference threshold, thereby reducing meaningless minor fluctuations and interference. The granularity of the comparison can also be adjusted for different task scenarios; for example, in resource-constrained scenarios, only high-level semantic parameters can be compared, while in high-security scenarios, a full parameter comparison can be performed item by item.

[0043] Regarding the representation of difference parameters, matrix storage can be chosen to facilitate subsequent gradient analysis; alternatively, a hierarchical index can be used to organize the difference parameters according to the hierarchical relationship of the model structure to support hierarchical backtracking and localization.

[0044] It can also adapt to different parameter management methods in different production environments. For example, in a distributed storage environment, processing can be accelerated by sharding and comparison; in environments with high security requirements, such as medical or financial institutions, a dual verification mechanism can be introduced, that is, first generating a preliminary difference through numerical comparison, and then confirming the consistency of the difference through hash verification.

[0045] This embodiment obtains and compares the base model parameters with the fine-tuned model parameters, enabling direct identification of differences introduced during fine-tuning training without relying on external rules. The generation of these difference parameters provides accurate input for subsequent analysis, helping to identify potential safety risks while maintaining task performance, thereby achieving higher parameter controllability and interpretability.

[0046] S20, perform gradient sensitivity analysis on the difference parameters to generate an anomaly correlation map;

[0047] In this embodiment, performing gradient sensitivity analysis on the difference parameters means taking the difference parameters generated in the previous step as input and, in conjunction with the gradient changes of the model under specific input data, evaluating the sensitivity of these difference parameters to the model output. The difference parameters themselves are merely the result of static numerical comparisons and cannot directly reveal the impact of the parameters on the prediction results. Therefore, it is necessary to measure the change in model response using the gradient derivative. Here, the gradient refers to the partial derivative of the loss function with respect to the model parameters, representing the direction and magnitude of the contribution of parameter changes to the output loss.

[0048] In practice, gradients can be calculated on multiple input samples to ensure that the analysis results cover different scenarios. Input samples can be task data, compliance data, or simulated interaction data. The gradient value corresponding to each difference parameter is calculated through backpropagation, resulting in a set of parameter gradient information. To more clearly quantify sensitivity, the gradient values ​​need to be combined with the difference magnitude to assess the overall risk under numerical shift.

[0049] Sensitivity analysis involves not only the absolute magnitude of the gradient but also its trend. For example, if certain parameters consistently exhibit high gradient responses under different input conditions, it indicates that these parameters are extremely sensitive to the output and may conceal potential security risks. Conversely, if a parameter's gradient fluctuates minimally across multiple scenarios, even with numerical differences, its impact on the output is limited, and this can be identified as a low-risk region.

[0050] Obtaining an anomaly correlation graph refers to the structured representation of the relationship between differential parameters and their corresponding anomaly risks, based on the results of sensitivity analysis. The anomaly correlation graph is not merely a numerical table, but rather presents parameter nodes, anomaly type nodes, and their connections in a graph structure. Parameter nodes represent the detected differential parameters, and anomaly nodes represent potentially high-risk behaviors, such as incorrect reasoning, unauthorized responses, or compliance deviations. The weights of the edges can be characterized using gradient sensitivity scores or anomaly levels. This graph format provides a visual representation of the correspondence between parameters and anomalies, and offers structured input for subsequent screening and correction of unsafe parameters.

[0051] In the implementation process, single-sample gradient analysis can be used, which involves calculating the gradient of the difference parameters under a small number of typical inputs. This method can quickly assess high-risk parameters. Alternatively, multi-sample gradient aggregation can be used, which involves inputting data from multiple scenarios into the model and weighting the gradient results of the difference parameters to obtain a more stable sensitivity index.

[0052] In terms of sensitivity calculation methods, absolute gradient values ​​can be chosen as the sensitivity measure, or normalization-based metrics can be selected, such as calculating the variance or standard deviation of gradient values, to reflect the volatility under different inputs. For cases requiring finer control, loss function class decomposition can be introduced to calculate gradients for different classes in the classification task, in order to determine whether the parameters exhibit anomalous sensitivity only on specific classes.

[0053] In constructing anomaly association graphs, adjacency matrices can be used to store the connections between parameters and anomaly risks, with the values ​​of matrix elements determined by gradient sensitivity scores. Alternatively, a graph database can be used to persist parameter nodes, risk nodes, and edge attributes for later querying and analysis. For large-scale models, a sparsity mechanism can be introduced during graph generation, retaining only high-weight edges to reduce storage and computational complexity.

[0054] The granularity of analysis can be adjusted depending on the application environment. For example, in financial tasks, more granular analysis can be performed on hierarchical parameters involving investment advice or compliance review; in medical tasks, modules related to drug recommendations or treatment guidelines can be given special attention.

[0055] This embodiment performs gradient sensitivity analysis on the differential parameters and generates anomaly correlation maps, which can capture potential risk areas beyond numerical differences and identify which parameters have the greatest impact on output security during actual inference. This makes subsequent screening of insecure parameters more targeted, avoiding blind and large-scale modifications, while preserving task capabilities and achieving a balance between risk identification and performance maintenance.

[0056] S30, based on the abnormal correlation graph, perform trigger detection processing on the fine-tuned model to determine unsafe parameters;

[0057] In this embodiment, trigger detection processing is performed based on the anomaly correlation graph. First, the anomaly correlation graph generated in the previous step is used as input. The graph contains parameter nodes, anomaly risk nodes, and their connection weights. The essence of trigger detection processing is to selectively input stimuli into the model and observe its performance in parameter-sensitive regions, thereby identifying the set of parameters that may lead to abnormal behavior. After fine-tuning, the model now carries the combined characteristics of the basic model and incremental parameters, and the anomaly correlation graph provides directional guidance for detection, avoiding unordered testing.

[0058] In practice, a set of security tags can be generated using a security knowledge base. This knowledge base is derived from compliance regulations, financial regulatory provisions, or medical treatment guidelines; these tags define risk points that the system must not trigger or must strictly control. Simultaneously, a test query set needs to be constructed based on a benchmark question-and-answer set. The test query set consists of filtered questions, dialogue inputs, or task requests, covering potentially high-risk scenarios, such as illegal arbitrage in finance or inappropriate medication advice in medicine.

[0059] When the test query set is input into the fine-tuned model, corresponding model response outputs are obtained. By comparing these outputs with the safety label set, it can be determined whether unsafe behavior has been triggered. If the model produces non-compliant or unauthorized responses under sensitive inputs, it indicates that the model response corresponds to the risk label. Furthermore, through the parameter-anomaly relationship in the anomaly correlation graph, these unsafe responses can be back-mapped to differential parameters, forming a high-risk parameter set. Based on this, the trigger detection process is completed, and these confirmed unsafe parameters are output, providing input for subsequent removal or sparsification operations.

[0060] Depending on the implementation path, trigger detection can employ either static or dynamic detection. In static detection, the test query set consists of pre-defined typical questions, and the model outputs a response under fixed input, which is then matched against safety labels through manual or rule-based comparison. Dynamic detection, on the other hand, expands the test input in real time through generative models, for example, by continuously constructing new questions using adversarial generative methods to test the model's performance in boundary scenarios.

[0061] In terms of mapping mechanisms, gradient attribution methods, such as ensemble gradients or feature occlusion, can be used to track the relationship between model output and difference parameters, thereby improving the accuracy of parameter localization. Alternatively, graph traversal methods can be employed to map the risk nodes corresponding to anomalous responses in the graph back to their connected parameter nodes, extracting the set of parameters most likely to cause anomalies.

[0062] The construction of test query sets can be adjusted across different domains. In financial transactions, the focus can be on sensitive tasks such as investment risk warnings and contract term interpretation; in healthcare, it can cover drug use and indications. By using differentiated test inputs, trigger detection can specifically identify insecure parameters in different application scenarios.

[0063] This embodiment utilizes trigger detection based on anomaly correlation graphs to quickly locate differential parameters highly correlated with risky behaviors within a large-scale parameter set, eliminating the need for full traversal or manual review. This method significantly improves detection efficiency and accuracy, ensures traceability of identification results, and provides precise targets for subsequent parameter correction, thereby reducing the impact on the overall model performance.

[0064] S40, perform elimination or sparsification processing on the unsafe parameters to obtain parameters to be recalibrated, perform safe recalibration processing on the parameters to be recalibrated to obtain recalibrated parameters, and fuse the recalibrated parameters with the parameters of the base model to form a recalibrated model;

[0065] In this embodiment, after unsafe parameters are detected, these parameters need to be removed or sparsified. Removal refers to directly removing unsafe parameters identified as high-risk from the model, preventing them from participating in the model's calculation and prediction process. Sparsification, on the other hand, uses structured pruning or weight sparsity strategies to reduce the values ​​of unsafe parameters to near-zero, maintaining the model's structural integrity while reducing the impact of these parameters on the output. The goal of this operation is to weaken or eliminate the adverse effects of unsafe parameters on the model output, while maximizing the retention of the effective contributions of other normal parameters.

[0066] Even after elimination or sparsification, the set of parameters to be recalibrated still contains some uncertainty, thus requiring secure recalibration. Secure recalibration is typically performed through adversarial training or regularization constraints. A dataset containing both non-compliant question-and-answer samples and compliant response samples is used as training data to update the gradients of the parameters to be recalibrated, causing them to converge in the compliance direction. This training process emphasizes constraining the parameters to be recalibrated to output a response that conforms to safety regulations when faced with risky inputs.

[0067] After completing the safety recalibration process, the recalibrated parameters need to be fused with the parameters of the base model. Fusion methods can include linear weighting, parameter replacement, or hierarchical embedding. Linear weighting combines the recalibrated parameters with the base parameters proportionally by setting fusion weights; parameter replacement replaces the original base parameters with the recalibrated parameters in a localized area; hierarchical embedding retains the base parameters as the backbone and uses the recalibrated parameters as enhancement layers. The final fusion result constructs the recalibrated model, maintaining the stability of the original base model while incorporating the corrected safety constraints.

[0068] The handling of insecure parameters can vary depending on the implementation. For example, in parameter removal, structured pruning can be used to directly delete neurons or matrix rows and columns corresponding to insecure parameters, thereby reducing the model size; alternatively, soft masking can be used to set the weights of insecure parameters to zero, rendering them ineffective in forward propagation.

[0069] In the sparsification approach, the low-rank approximation can be used to decompose the insecure parameter tensor into multiple low-rank sub-matrices, thereby reducing its expressive power and minimizing interference with the overall structure of the model.

[0070] In the safety recalibration process, adversarial training methods can be used to pair non-compliant inputs with compliant outputs, forcing the model to learn compliant responses during optimization. Alternatively, gradient alignment optimization can be introduced to constrain the gradient distribution of the recalibration parameters to be close to the gradient distribution of the base model, thereby ensuring the overall consistency of the model.

[0071] Different strategies can be adopted in the parameter fusion stage. It can be a simple linear weighted fusion, parameter replacement in certain high-risk modules, or a hierarchical embedding approach, which applies recalibration parameters only to specific layers or channels to achieve finer adjustments.

[0072] This embodiment significantly weakens or removes the impact of insecure parameters through elimination or sparsification, preventing them from triggering non-compliant outputs during model inference. Subsequently, secure recalibration training restores the parameters' compliance and security, and they are integrated with the base model parameters. This preserves the task performance of the base model while strengthening overall security constraints. The resulting recalibrated model better balances stability and compliance in application scenarios.

[0073] S50, obtain a scenario-based security verification set, perform security verification processing on the recalibration model based on the scenario-based security verification set, and obtain verification feedback information;

[0074] In this embodiment, to ensure the security and compliance of the recalibration model in real-world applications, it needs to be verified using a scenario-based security verification set. This set is a dataset extracted, expanded, and synthesized from multiple real-world business scenarios, covering various dimensions such as healthcare, financial risk control, insurance compliance, and privacy protection. This data typically originates from real-world dialogue records, abstractions of typical cases, key question-and-answer sets defined by regulatory requirements, and simulated high-risk questions. Through scenario classification, the data is categorized into different types, such as claims Q&A, venture capital consulting, medication guidelines, or sensitive privacy protection.

[0075] After obtaining the scenario-based security verification set, it needs to be input into the recalibrated model for security verification. During the verification process, the model receives each input from the verification set and outputs a response. The system simultaneously records the response content and the corresponding security reference standard. Through an automated detection mechanism, it is possible to identify whether the model generates illegal, unauthorized, or misleading outputs in these scenarios, and to label each response with both performance and security metrics.

[0076] Finally, all validation results are aggregated to obtain validation feedback information. This feedback information includes not only a simple result indicating whether the model has passed validation, but also detailed performance metrics (such as response accuracy, coverage, and latency) and security metrics (such as violation rate, compliance confidence, and number of sensitive triggers). This information provides a foundation for subsequent policy updates.

[0077] In different implementation methods, the construction of scenario-based security verification sets can be accomplished through various channels. For example, anonymized interactive question-and-answer pairs can be extracted from real business data, question-and-answer data can be automatically generated based on existing rule bases or knowledge graphs, and challenging questions for specific scenarios can be generated by simulating user input.

[0078] During the security verification process, a batch verification mode can be adopted, in which the verification set is input into the model in batches to ensure that system resources are controllable; or a real-time streaming verification mode can be adopted, in which each item is input and the output is recorded immediately, so as to capture potential risks more quickly.

[0079] In terms of result generation, multi-layered feedback information can be set up. The first layer is a direct pass or fail judgment; the second layer is quantitative analysis of indicators, including response accuracy, compliance rate, and violation trigger rate; the third layer is scenario-specific statistics, such as the performance of venture capital-related issues in a financial scenario and the performance of drug dosage-related issues in a medical scenario. Such a hierarchical feedback structure can provide targeted basis for subsequent strategy updates.

[0080] This embodiment introduces a scenario-based security verification set and performs security verification on the recalibrated model. This realistically simulates the model's performance in complex business environments, ensuring that it not only meets performance requirements but also maintains stability in terms of compliance and security. The verification feedback provides quantifiable results, avoiding reliance on subjective human judgment and making subsequent strategy adjustments and parameter recalibration traceable and data-supported.

[0081] S60, based on the verification feedback information, update the strategy for determining insecure parameters and the strategy for secure recalibration to obtain the updated strategy;

[0082] In this embodiment, after obtaining the verification feedback information, this feedback information needs to be used to guide the subsequent determination of insecure parameters and the updating of security recalibration strategies. Verification feedback information typically includes performance data, security compliance data, and comprehensive evaluation results, which can reveal the model's performance in different business scenarios. By performing strategy impact analysis on this feedback data, it can be determined which insecure parameter thresholds need adjustment and which security recalibration methods need optimization.

[0083] When updating the strategy for identifying unsafe parameters, the focus is on adjusting the parameter screening thresholds based on the false positives or false negatives identified in the feedback. For example, if the verification feedback shows that some high-risk parameters are not identified, the sensitivity threshold in the trigger detection needs to be lowered; if too many low-risk parameters are falsely identified as high-risk, the threshold needs to be raised to reduce unnecessary recalibration.

[0084] When updating the security recalibration strategy, it is necessary to adjust the training data distribution, optimize the proportion of adversarial samples, or correct the training hyperparameters to address security vulnerabilities identified in the validation feedback. Optimizing training parameters can mitigate the impact on model performance while ensuring compliance.

[0085] After completing the above adjustments, the updated strategy for determining insecure parameters needs to be integrated with the updated security recalibration strategy to form a unified strategy integration scheme. This scheme needs to undergo validity verification to ensure that the strategy update does not introduce new problems. Finally, the verified strategy integration scheme will be adopted as the updated strategy, providing a basis for subsequent security recalibration processes.

[0086] A threshold-based adjustment approach can be adopted to adjust the strategy for determining unsafe parameters. For example, the screening threshold can be corrected in real time by dynamically calculating the parameter distribution in different scenarios.

[0087] Alternatively, a feedback-driven optimization approach can be adopted, using accumulated data from historical verification feedback to train a policy optimization model to predict reasonable parameter thresholds and safety calibration parameters.

[0088] For updating the security recalibration strategy, a data-driven approach can be adopted, introducing a new set of adversarial examples and performing security recalibration on the updated training set. Alternatively, an optimization algorithm-based approach can be used, such as gradient descent, Bayesian optimization, or evolutionary algorithms, to optimize training parameters like the learning rate, regularization coefficient, and adversarial perturbation magnitude.

[0089] When merging strategies, a weighted combination approach can be used to fuse the updated deterministic strategy with the updated recalibration strategy at the parameter level; alternatively, priority rules can be set to select and execute corresponding policy subsets under different risk scenarios. Strategy effectiveness can be verified by re-running a subset of key scenario validation sets to ensure the updated strategy is feasible and stable in real-world business applications.

[0090] This embodiment updates the strategy for determining unsafe parameters and the safety recalibration strategy based on verification feedback information, forming a dynamic closed-loop optimization mechanism. This mechanism can continuously iterate based on the model's performance in actual verification, ensuring the accuracy of unsafe parameter determination and the effectiveness of safety recalibration. Therefore, the final updated strategy enhances compliance while ensuring that task performance is not excessively weakened.

[0091] S70, Based on the updated strategy, perform a secure recalibration process on the recalibration model to generate a secure application model;

[0092] In this embodiment, security recalibration based on the updated strategy first requires clarifying the composition and source of the updated strategy. The updated strategy originates from the verification feedback information in the previous stage and includes two categories: one is the judgment rules and threshold set for identifying insecure parameters, used to guide risk location and shielding scope; the other is the training and inference control settings for security recalibration, used to constrain training objectives, data distribution, loss term allocation, decoding control, and rejection triggering. This strategy can be represented as a hierarchical configuration table, a parameterized vector, or a graph structure, for unified parsing within both the training and inference chains. During strategy parsing, element verification, version consistency verification, and dependency expansion must be completed to ensure that all switches and weights correctly take effect during subsequent recalibration.

[0093] Performing security recalibration on the recalibrated model involves introducing new security constraints and training signals based on existing recalibration results, completing parameter-level realignment and inference-level constraint injection. Parameter-level realignment can target the adapter layer, low-rank insertion layer, decoding-side linear layer, or routing gating unit. Constraint injection includes security-label-driven rejection signals, weight boosting of risk domain samples, boundary tightening of sensitive trigger scenarios, and vocabulary masking and temperature downgrading during decoding. The training objective employs a multi-objective synthetic loss, including at least task retention terms, compliance constraint terms, and confidence calibration terms, dynamically adjusted by weight coefficients in the strategy under different scenarios. Training data consists of security-enhanced samples and regular task samples, organized in batches to ensure coverage of risk samples within each training window. Parameter updates employ a limited-range update and tiered learning rate, increasing constraints in high-risk modules and maintaining stability in low-risk modules.

[0094] Generating a secure application model involves more than just outputting a new set of parameters; it also includes assembling runtime security mechanisms and solidifying traceable metadata. Runtime security mechanisms include rejection trigger flags during decoding, a dangerous word masking table, confidence gating thresholds, and fallback strategies. Metadata records policy versions, training data summaries, key hyperparameters, and evaluation fingerprints to facilitate subsequent auditing and canary rollback. The export process completes parameter packaging, structural consistency verification, checksum generation, and loading self-checks to ensure stable loading and execution in the target environment.

[0095] Implementation Path 1 employs a lightweight parameter update and decoding constraint joint approach. Policy parsing yields the adapter layer set, learning rate table, and rejection gating threshold. The adapter layers are loaded into the recalibrated model, a security-enhancing data queue is constructed, and risk samples and general samples are mixed according to policy weights. Constrained updates are performed using hierarchical learning rates and weight decay. After parameter updates, rejection markers, a masked vocabulary, and temperature reduction thresholds are injected into the decoder. The model file and runtime configuration are exported, and a loading self-check and fingerprint verification are performed. This path involves minimal parameter changes and rapid deployment, making it suitable for latency-sensitive online scenarios.

[0096] Implementation path two employs low-rank approximation and adversarial retraining. The strategy provides a list of high-risk modules and an adversarial sample ratio, decomposing the target weights into low-rank representations and updating only the decomposed factor matrix to constrain the degrees of freedom. Compliance loss and confidence calibration loss are added under adversarial sample-driven conditions, with dynamic ratios achieved through weight coefficients in the strategy. After training, bundle search truncation and sensitive segment blocking are enabled on the inference side, and the thresholds, blocking tables, and parameters are fixed together, outputting a deployable package. This path demonstrates refined performance on high-risk local modules and is suitable for scenarios with stringent regulatory requirements.

[0097] Path three employs a policy-to-parameter mapping orchestration. The updated policy is translated into a constraint graph containing module nodes, constraint edges, and weight labels. The training scheduler sequentially activates module-level updates, loss term injection, and inference-side control injection according to the graph topology. Each completed subgraph branch update triggers a small-loop evaluation; branches that fail to meet the criteria are rolled back to the previous checkpoint with weights loosened or tightened, and iteration continues. Once the entire graph converges, the parameters are frozen, and the deployment artifacts and metadata are output. This path emphasizes traceability and local rollback, making it suitable for production clusters with multi-domain parallel evolution.

[0098] When adapting to different scenarios, the proportion of regulatory-related samples can be increased, the threshold for refusing to answer can be tightened, and the weight of blocked words can be increased in financial dialogues; similarly, the window density of drug and contraindication samples can be expanded, the decoding temperature can be lowered, and the confidence threshold scale resolution can be enhanced in medical consultations. In resource-constrained environments, block export and on-demand loading can be adopted to ensure controllable deployment memory usage; in high-throughput environments, tensor parallelism and asynchronous loading can be used, and the injection of security mechanisms can be split into a warm-up phase and an online switching phase to reduce switching jitter. In environments with high parameter security and compliance requirements, dual-person review and hash locking strategies can be enabled to ensure consistency between the deployed artifacts and the evaluation fingerprints.

[0099] This embodiment performs a safe recalibration of the recalibration model based on the updated strategy. This can transform the risk perception in the verification feedback into a synchronous constraint between the parameter layer and the decoding layer. By restricting updates and runtime gating, the probability of generating high-risk segments is reduced. At the same time, the task capability is not excessively weakened under the hierarchical control of strategy weights and learning rates. The metadata and threshold configurations that are fixed along with the exported workpiece enable the online entity to have auditable, rollback and canary-scale engineering capabilities, meeting the comprehensive requirements of security, performance and maintainability.

[0100] S80, Obtain the task request, process the task request through the security application model, and obtain a security response result.

[0101] In this embodiment, obtaining a task request refers to receiving an input unit from a user terminal or upstream business system in the runtime environment. This input includes text content, context identifiers, source channels, timing markers, permission markers, and session state. The text content serves as the main semantic carrier for model inference; the context identifier is used to associate previous and subsequent dialogues with business scenarios; the source channel is used to distinguish between web pages, mobile terminals, agent terminals, or API calls; the timing marker is used for sorting and deduplication prevention; the permission marker is used to limit the scope of answers and the level of information that can be exposed; and the session state is used to maintain dialogue coherence and multi-turn constraints. The secure application model refers to a deployable model entity that has completed parameter recalibration and decoding-period security gating configuration, including parameter weights, structural descriptions, decoding control tables, rejection trigger rules, risk word masking tables, confidence thresholds, fallback strategies, and audit metadata. Processing the task request refers to executing a series of steps, including parsing, filtering, inference, verification, correction, and formatting, according to the input pipeline. The parsing process breaks down text content into instructions, constraints, supplementary information, and domain tags, merging them with contextual identifiers. Filtering applies sensitive segment detection, unauthorized trigger detection, and channel-level restrictions on the input side, outputting purified inference units. Inference is generated within the security application model based on temperature, sampling upper bounds, bundle search truncation, and a masked vocabulary, recording confidence distribution and candidate paths during the process. Verification performs compliance rule matching, risk graph comparison, and confidence gating on the output side, marking states as ready for direct release, requiring correction, or requiring rejection. Correction applies structured replacement, supplementary reminders, and source citation marking when necessary. Formatting generates text, structured fields, and auditable additional information according to channel specifications. The security response result refers to the response unit that can be released externally after the above processing, possessing content fields, compliance markers, confidence indicators, citation identifiers, audit fingerprints, and rollback records to meet business availability and compliance traceability requirements. A data contract connects the acquisition of task requests and the processing of those requests; the security application model provides dual-channel capabilities for inference and security control; security response results are written back to the audit and monitoring channels, providing data support for subsequent policy adjustments and recalibration.

[0102] One implementation approach for high-concurrency online scenarios employs a lightweight pre-processing governance and fast inference chain. After authentication and throttling at the entry gateway, task requests are written to a message queue. Parsing and filtering are performed on edge computing nodes, using a cross-channel unified dictionary and regular expression templates to extract intent and domain tags, while applying sensitive phrase automata and unauthorized access rules to cleanse the input. The cleaned unit enters the inference service, where a security application model is loaded into persistent session memory, using temperature downgrading and beam search truncation to reduce the probability of high-risk generation. The inference result enters the verification unit, first matching the security tag set and risk vocabulary, then determining whether to publish, correct, or reject the answer based on the confidence threshold. The correction channel inserts compliance statements and guidance prompts when necessary. Finally, the formatting channel outputs text and structured metadata according to channel requirements and writes it to the audit log and metrics system. This approach reduces latency through edge preprocessing and session reuse, adapting to real-time customer service and intelligent question-and-answer services.

[0103] The second implementation method, designed for heavily regulated scenarios, employs deep validation and multi-level rollback. Task requests undergo dual-channel parsing, with the addition of a domain expert dictionary and rule base expansion in addition to general parsing, constructing finer-grained domain tags and constraint sets. During the inference phase, sensitive fragment blocking and word list masking are enabled on the security application model, while multiple candidate paths and confidence curves are recorded. In the validation phase, graph-based relationship validation and template-based compliance template alignment are superimposed. If either validation fails, a rollback strategy is implemented, with the rollback order being template response, knowledge retrieval and splicing, and rejection prompt. In the formatting phase, compliance prompts and citation identifiers are forcibly included, and key field summaries and model fingerprints are simultaneously written to the audit repository. This method ensures stable, reliable, and auditable output in scenarios such as healthcare consultation and financial compliance review.

[0104] The third implementation approach, designed for multi-domain mixed deployments and resource-constrained environments, employs layered inference and on-demand loading. Upon request arrival, the domain label and risk level are first determined. Low-risk and general queries enter the lightweight candidate model pipeline, while high-risk and sensitive queries enter the secure application model pipeline. To reduce memory consumption, the secure application model is resident in modules, with high-risk modules loaded immediately and unloaded during idle periods. During the inference phase, temperature, top threshold, and shielding strength are adaptively adjusted based on the risk level. During the verification phase, a lightweight rule set is executed for low-risk outputs, while a full rule set and graph comparison are performed for high-risk outputs. During the formatting phase, concise text is output for low-risk channels, while structured evidence and detailed audit metadata are output for high-risk channels. This approach maintains resource controllability and predictable response in multi-service shared clusters.

[0105] In terms of parameter and threshold optimization, dynamic adjustments can be made based on business statistics. Temperature, beam width, top threshold, and shielding strength can be optimized in a closed loop based on violation rate, rejection rate, first-pass rate, and average processing latency; confidence threshold and fallback order can be adaptively adjusted according to scenario weights; parsing and filtering dictionaries can be updated periodically through offline learning and manual review; audit fingerprints and indicator reporting frequency can be adjusted according to compliance requirements to balance traceability and system overhead.

[0106] This embodiment receives task requests and performs a series of processes—parsing, filtering, inference, verification, correction, and formatting—within the security application model. This ensures timeliness while controlling high-risk generation paths, guaranteeing that the output meets business requirements in terms of content, compliance, and traceability. Input-side cleansing reduces the probability of dangerous instructions entering the model, inference-stage gating and shielding reduce the chance of risky word generation, and output-side verification and rollback provide a final layer of protection. The final security response result can directly serve the production environment and provide a stable data source for subsequent optimizations.

[0107] This invention relates to the field of artificial intelligence technology and can be applied to business scenarios such as fintech and healthcare. It discloses a method, apparatus, device, and medium for parameter security recalibration and response, comprising: acquiring basic model parameters and fine-tuned model parameters; performing parameter comparison processing to obtain differential parameters; performing gradient sensitivity analysis on the differential parameters to generate an anomaly correlation graph; performing trigger detection processing on the fine-tuned model based on the anomaly correlation graph to determine unsafe parameters; performing elimination or sparsification processing on the unsafe parameters to obtain parameters to be recalibrated, and obtaining recalibrated parameters through security recalibration processing; fusing the recalibrated parameters with the basic model parameters to form a recalibrated model; acquiring a scenario-based security verification set; performing security verification processing on the recalibrated model to obtain verification feedback information; updating the unsafe parameter determination strategy and security recalibration strategy based on the verification feedback information to generate an updated strategy; performing security recalibration processing on the recalibrated model based on the updated strategy to generate a secure application model; acquiring a task request; processing the task request through the secure application model to obtain a security response result. This invention, by comparing the parameters of the base model and the fine-tuned model and combining this with gradient sensitivity analysis, can accurately identify insecure parameters introduced during the fine-tuning process and dynamically correct these insecure parameters through a cyclical mechanism of security recalibration and policy update. This not only maintains the model's task performance but also significantly improves security and compliance, avoiding the contradiction between improved task capabilities and weakened security alignment capabilities found in traditional methods, and enabling the model to operate safely and reliably in complex application scenarios.

[0108] In one embodiment, step S10 above includes:

[0109] S101, Obtain the parameter file of the basic model, perform parameter loading processing on the parameter file of the basic model, and obtain the basic parameter set;

[0110] S102, Obtain the parameter file of the fine-tuned model, and perform parameter loading processing on the parameter file of the fine-tuned model to obtain the fine-tuning parameter set;

[0111] S103, Perform parameter comparison processing on the basic parameter set and the fine-tuning parameter set to obtain parameter difference results;

[0112] S104, Perform a preset minor difference filtering process on the parameter difference results to extract the set of significantly different parameters;

[0113] S105, perform standardization processing on the set of significantly different parameters to generate difference parameters.

[0114] In this embodiment, obtaining the parameter file of the base model refers to reading the weight matrix, bias vector, and necessary structured configuration records from the output of the pre-trained model, which serves as a baseline. The file typically contains a tensor data area and an index area. The index area stores mapping information from key names to tensor positions, shapes, data types, and storage offsets, along with the model architecture version, vocabulary hash, training configuration summary, and integrity check value. During reading, container header parsing and version consistency checks are performed first, followed by check value comparison and decompression. Then, the tensor data is mapped to memory, ensuring consistent data types, end-ordering, and device placement, removing invalid padding, and establishing a reference table from key names to tensor objects. At the end of the parameter loading process, a basic parameter set is formed. This set is organized using key-value mappings, with each entry carrying a tensor value, shape, hierarchical path, module, and optional statistical summary (mean, norm, sparsity). It ensures that the key space is free of duplicates, path separators are consistent, and case sensitivity is uniform.

[0115] Obtaining the parameter file of the fine-tuned model refers to reading the updated parameter set from the weight snapshot produced by task-oriented training. This file should be structurally consistent with the baseline file to perform a one-to-one mapping. If adapters or incremental modules exist (e.g., inserted low-rank units or additional gated units), the new keys are registered during the loading phase by expanding the key space, and the source label and parent layer path are recorded. The parsing process is consistent with the aforementioned baseline, including integrity verification, decompression, type unification, and device placement. After loading, a fine-tuned parameter set is established, with its structure and fields aligned with the basic parameter set to ensure that key names, shapes, and module paths can be directly matched during subsequent comparisons.

[0116] Parameter comparison processing is performed on the basic parameter set and the fine-tuning parameter set, requiring key space alignment and shape alignment to be completed first. During the key space alignment stage, a stable key sequence is generated according to the path specification, and the intersection of the two sets, the key set existing only in the baseline, and the key set existing only in the fine-tuning are calculated. Shape consistency checks are performed on the keys within the intersection; inconsistent entries are marked as incompatible and moved to the structural anomaly list in the difference report. For shape-consistent entries, tensor-level differences are generated using element-wise interpolation, while multi-granularity statistics are calculated, including element-level absolute difference, relative difference, L1 / L2 norm difference, dimensional projection difference, symbol density, and quantile summaries. Broadcasting is prohibited to avoid errors caused by implicit expansion. If parameters are stored in parallel in slices, comparisons are performed within each slice first, and reductions are performed at slice boundaries to ensure the reproducibility of global differences and statistics. Keys existing only in the fine-tuning or only in the baseline are registered as newly added or missing difference items, respectively, for subsequent location of structural modifications in the training pipeline. The parameter comparison processing outputs the parameter difference results, which are given in the form of a record table. Each record corresponds to a key, which includes the tensor level difference or structural anomaly marker and the statistical summary associated with that key.

[0117] The parameter difference results undergo a pre-defined small difference filtering process to remove non-substantial biases caused by numerical noise, quantization jitter, or optimizer tail terms. The filtering strategy consists of two parts: an absolute amplitude threshold and a relative amplitude threshold, with intra-layer adaptive adjustment. The absolute amplitude threshold, based on tensor norm or quantiles, is used to suppress low-amplitude differences; the relative amplitude threshold, based on the ratio of the difference to the baseline norm, is used to identify entries with small amplitude but significant relative changes. Intra-layer adaptive adjustment dynamically balances the threshold sensitivity of different levels by statistically analyzing the difference distribution of each layer, avoiding systematic bias in deep or embedded layers caused by a single threshold. The filtering execution order is as follows: first, structurally anomalous entries are left unchanged at the record level; then, a double-threshold mask is calculated and merged into a retention mask for numerical entries; finally, robust estimation (such as median absolute deviation) is applied to the aggregated statistics to reduce the interference of extreme points on threshold determination. The filtering output is a set of significantly different parameters, containing only entries determined by the mask, while retaining their difference tensors and statistical summaries, and removing other small difference records.

[0118] Standardization is performed on the set of significantly different parameters to project differences at different levels and scales onto a comparable common scale and construct a data structure that is easy to consume in subsequent analyses. Standardization includes two layers: amplitude normalization and morphological normalization. Amplitude normalization scales the differences within each entry at the baseline scale or intra-layer scale, ensuring consistent dimensions across different levels. Morphological normalization expands or rearranges tensors according to agreed-upon dimensions, guaranteeing consistency in storage and computational paths for parameters of the same type. Simultaneously, data types and storage layouts are unified, stable key orders and sparse indexes are established, and necessary metadata (level position, module category, source of normalization factor) is added. After standardization, the difference parameters are output. These parameters are a well-structured set with the following attributes: stable key space, comparable numerical scales, one-to-one traceability with the original parameters on both sides, and direct referencing for subsequent sensitivity analysis and risk mapping. To ensure reproducibility, the entire process is executed with a fixed random seed, fixed operator implementation, and fixed precision settings. A checksum and metadata snapshot are written at the output stage for easy environment migration and auditing.

[0119] This embodiment forms an aligned set of basic parameters and a set of fine-tuned parameters by performing consistency verification and normalized loading on the parameter files of the two models. Through strict one-to-one mapping and element-wise calculation with broadcast disabled, parameter difference results containing structural anomalies and numerical offsets are obtained. Through adaptive filtering with absolute and relative dual thresholds, noise level variations are eliminated and significant difference parameters that are more likely to affect the output behavior are retained. Through dual standardization of amplitude and shape, differential parameters that are comparable in scale, traceable in structure, and directly usable by subsequent analysis in terms of data layout are produced.

[0120] In one embodiment, step S20 above includes:

[0121] S201, Perform gradient determination processing on the difference parameters to obtain parameter gradient information;

[0122] S202, Based on the parameter gradient information, perform influence degree analysis to determine the influence distribution of the difference parameters on the model output;

[0123] S203, perform anomaly scoring processing on the influence distribution to obtain the anomaly level of each difference parameter;

[0124] S204, Perform correlation analysis based on the anomaly level to establish the correspondence between parameters and anomaly types;

[0125] S205, Perform graph construction processing on the correspondence to generate an abnormal association graph.

[0126] In this embodiment, when performing gradient sensitivity analysis on the differential parameters, the input set and target signal for calculation are first determined. The input set covers frequently occurring business inquiries and potentially high-risk inquiries, including texts such as financial term interpretations, investment risk warnings, medical and drug consultations, contraindications, and dosage boundaries, and is batched by combining historical interaction samples and compliance templates. The target signal is represented by a hybrid of supervised and safety labels consistent with the output, and a single differentiable target is formed through loss term aggregation to ensure the consistency of parameter guidance. During the calculation process, under the settings of a fixed random seed and deterministic operators, backpropagation is performed batch by batch, and the partial derivative of the loss with respect to each differential parameter is collected as parameter gradient information. When there is parameter sharding or parallel partitioning, local accumulation is performed within each shard first, and then cross-shard reduction is performed to ensure consistency and reproducibility across devices. The parameter gradient information is organized by key name index and hierarchical path, recording values, symbol density, norm statistics, and quantile summaries. If necessary, a sliding window average is superimposed to suppress high-frequency jitter.

[0127] When performing impact analysis based on parameter gradient information, a two-level normalization and cross-sample aggregation are introduced. The first level performs amplitude normalization within each item at either the baseline scale or the intra-layer scale, eliminating dimensional differences between different layers and tensor dimensions. The second level aligns items across layers based on intra-layer statistics, preventing a single layer from dominating the overall assessment during aggregation. Aggregation is then performed according to the input set and risk scenario dimensions to obtain the distribution of the difference parameters' impact on the model output. The aggregation index comprehensively considers gradient amplitude, directional consistency, cross-scenario stability, and the orientation towards safety labels, forming a comparable sensitivity scale. To reduce the impact of outliers, robust estimation is introduced, and long-tail and extreme values ​​are weighted and compressed. Items with extremely low proportions but consistent directions retain independent channels to avoid being overwhelmed by averaging effects.

[0128] When performing anomaly scoring on the impact distribution, the sensitivity scale is transformed into anomaly severity. The scoring function consists of a weighted average of amplitude, stability, and safety orientation components, with weights derived from the strategy configuration of business risk appetite and regulatory constraints. The amplitude component reflects the instantaneous intensity of the impact on the output; the stability component is derived from consistency measurements across samples and scenarios; the safety orientation component is reduced or increased based on the relevance to unsafe outputs and the degree of suppression of compliant outputs. The scoring results are monotonically mapped to discrete anomaly levels, typically divided into several tiers for subsequent screening and handling; to avoid inter-level imbalance, level boundaries are set in both the intra-level and global domains and fine-tuned using calibration samples.

[0129] When performing correlation analysis based on anomaly levels, a correspondence between differential parameters and anomaly types is constructed. Anomaly types are derived from a risk classification system, covering categories such as unauthorized responses, sensitive information leakage, inappropriate medication recommendations, regulatory circumvention tendencies, and misinterpretation of clauses. The correlation strength consists of two parts: first, the contribution of a parameter to triggering an unsafe output of that category, derived from the sensitivity aggregation of parameter gradient information in the corresponding scenario; second, the strength of the linkage, reflecting the combined influence of neighboring parameters at the same level and cross-level dependencies on that category, weighted propagation through structural paths and gating connections. Low-confidence links are truncated and sparsified, while high-confidence backbone paths are retained to improve interpretability and computational efficiency. Finally, a weighted correspondence is obtained on the parameter-anomaly type binary structure, and the source batch, scenario label, and statistical summary are recorded to ensure traceability.

[0130] When performing graph construction on the correspondence, parameter entries and anomaly type entries are used as nodes, and weighted correspondences are used as edges to generate an anomaly association graph. The graph includes node metadata (hierarchical position, module category, anomaly level), edge metadata (association strength, evidence count, scene coverage), and global metadata (input set fingerprint, loss configuration summary, operator version identifier). To facilitate subsequent retrieval and handling, multi-view projections are generated according to hierarchy and business scenario; the edge set is further sparsified and connected component partitioned to extract high-risk subgraphs; centrality indicators and community partitioning results are calculated for nodes and edges to form a priority handling sequence. The graph is persisted as a combination of adjacency list and index storage, and also outputs checksums and timestamps, supporting version management and differential updates.

[0131] This embodiment calculates parameter gradient information using differential parameters as the analysis object, obtains the impact distribution after intra-layer and global dual-domain normalization, generates anomaly levels through multi-component weighting, and finally establishes a correspondence between anomaly types and constructs an anomaly correlation map. This transforms static numerical differences into structured evidence of their impact on output behavior. This process narrows the scope of subsequent handling, improves positioning accuracy, supports interpretable decision-making, and provides standardized input for triggered detection and parameter recalibration, thereby improving the efficiency and stability of security governance without compromising mission capabilities.

[0132] In one embodiment, step S30 above includes:

[0133] S301, Perform security tag construction processing based on the security knowledge base to obtain a security tag set;

[0134] S302, Query construction processing is performed based on the benchmark question-and-answer set to obtain the test query set;

[0135] S303, Use the test query set to perform query processing on the fine-tuned model to obtain the model response output;

[0136] S304, Perform anomaly parameter filtering processing based on the anomaly correlation graph to obtain a set of high-risk parameters;

[0137] S305, Perform a matching analysis process between the model response output and the security label set to determine an unsafe response;

[0138] S306, perform association mapping processing based on the insecure response and the set of high-risk parameters to determine the insecure parameters.

[0139] In this embodiment, when trigger detection is performed based on the anomaly correlation graph, the construction of security tags is completed first. The security knowledge base includes regulatory provisions, industry standards, professional guidelines, and historical audit highlights. The content is organized into four categories of meta-fields: risk category, triggering condition, prohibited behavior, and mitigation wording. Each entry is accompanied by source, version, and applicable domain tags. The construction of security tags uses knowledge base entries as atomic units, mapping them to the risk semantic space and outputting a set of security tags. Each tag includes a category identifier, a decision predicate, a set of key phrases, contextual constraints, and a response strategy indication. The decision predicate is described using Boolean expressions or contextual patterns, and the contextual constraints are used to limit the boundaries of roles, channels, regions, or populations. During the construction process, conflict merging, synonym merging, and hierarchical folding are performed, preserving the minimum decision formula and reversible mapping, generating machine-readable and searchable tag items, and writing tag fingerprints for version tracking.

[0140] When constructing queries based on a benchmark question-and-answer set, the question-and-answer samples are first labeled with domain and risk dimensions to extract triggering intent, task slots, and contextual dependencies, forming a query prototype. Then, three generation operators—semantic transformation, contextual rewriting, and boundary perturbation—are used to expand the prototype. Semantic transformation covers common expressions through synonym substitution, word order replacement, and phrasing variations; contextual rewriting injects conditional information such as channel, region, and user role to simulate a real business environment; boundary perturbation constructs critical inputs around threshold conditions, monetary expressions, and age or dosage boundaries. To avoid distribution drift, a minimum coverage set is set for each risk category, and stratified sampling is performed according to three dimensions: category, trigger words, and contextual constraints, to obtain the test query set. All query items include generation paths, applicable tag candidates, and difficulty scales to facilitate alignment with subsequent detection results.

[0141] When performing query processing on the fine-tuned model, the test query set is fed into the inference interface one by one, with fixed temperature, top threshold, beamwidth, and number of candidates. The main output and candidate distribution, confidence trajectory, decoding step-level token sequence, and positional attention are recorded. For entries requiring multi-turn context, the preceding turns are injected according to the context dependency of the query item while maintaining session state consistency. The output side generates the model response output, which includes the main text, candidate set, probability vector, attention alignment matrix, and timestamp fingerprint for subsequent judgment and attribution.

[0142] When performing anomaly parameter filtering based on anomaly correlation graphs, the graph is first sliced ​​according to risk category and business scenario to obtain subgraphs matching the current query. For each subgraph, node centrality and edge weight strength are calculated, and a candidate parameter list is generated by combining prior anomaly levels. Subsequently, lightweight attribution is performed on the model's forward and backward paths, using gradient × input, attention backtracking, and feature occlusion to cross-validate the contribution of candidate parameters to the current output, forming a parameter contribution score. To identify high-risk parameters, the score and subgraph edge weights are normalized and fused, focusing on identifying nodes that exhibit high sensitivity under multiple attribution methods and are highly correlated with the anomaly label. By setting intra-layer and global dual thresholds, parameters exceeding the risk threshold in both local impact and global propagation are filtered out, resulting in a high-risk parameter set. For cross-layer propagation paths, upstream nodes are traced back along structural connections, and adjacency parameters with distributed weights are added to ensure the high-risk set has connectivity and manageability.

[0143] When performing matching analysis on the model response output and the safe label set, the output text is first fragmented and entity extracted to obtain named entities, numerical slots, key phrases, and speech act annotations. Then, predicates are determined based on the labels for matching. The matching engine runs in two stages: the first stage performs rapid filtering based on keywords and rule templates, and the second stage performs fine-tuning based on semantic similarity and logical constraint verification. Responses that reach the label threshold generate unsafe response markers and output matching evidence, including hit fragments, label identifiers, trigger expressions, and satisfaction of contextual constraints. At the same time, confidence is calculated and a divergence metric with the candidate set is recorded to reduce occasional false positives.

[0144] When performing association mapping based on insecure responses and high-risk parameter sets, the evidence of insecure responses is aligned with the contribution paths of the parameter sets. The alignment process consists of two parts: first, time-step alignment, which maps the decoding step index and attention alignment matrix corresponding to the insecure segment to the hidden unit and output transformation weight that generated the segment; second, structural path alignment, which connects the upstream dependencies of hidden units through parameter nodes and edge relationships in the graph, calculating the path score from the parameter to the insecure segment. The path score is composed of node contribution and edge weight accumulation, and logarithmic domain reduction is used to suppress long path expansion. Non-maximum suppression is applied to all candidate paths, retaining a small number of highly representative paths. Finally, parameters with high path coverage and scores exceeding a threshold are marked as insecure parameters, and the parameter key, hierarchical position, association category, and evidence summary are output, forming a list that can be directly consumed in subsequent processing stages.

[0145] This embodiment constrains output judgment with a set of security labels, targets risk scenarios with a set of test queries, narrows the parameter space with anomaly correlation graphs, and establishes a traceable correlation mapping between the response side and the parameter side. This enables the mapping of explicit evidence of unsafe behavior with the responsibility path of internal differential parameters. The continuous derivation from static differentiation to dynamic triggering, and from output matching to parameter localization, makes the identification of high-risk parameters directional, sparsity, and interpretable, reducing the overhead and probability of misjudgment caused by full traversal. It provides a directly executable parameter list for subsequent elimination, sparsity reduction, and realignment, while retaining evidence and version information to support auditing and rollback.

[0146] In one embodiment, step S40 above includes:

[0147] S401, perform structured pruning or low-rank approximation on the insecure parameters to obtain a set of candidate parameters;

[0148] S402, Perform key task verification processing on the candidate parameter set to obtain the parameters to be recalibrated;

[0149] S403, Construct an adversarial training dataset containing samples of illegal question-and-answer statements and security response statements;

[0150] S404, Use the adversarial training dataset to perform secure adversarial training on the parameters to be recalibrated to obtain preliminary recalibration parameters;

[0151] S405, Perform gradient alignment optimization processing on the preliminary recalibration parameters to obtain the recalibrated parameters;

[0152] S406, Perform linear weighted fusion processing on the recalibrated parameters and the parameters of the base model to obtain a fusion parameter set;

[0153] S407, Based on the structure of the fusion parameter set and the basic model, construct a recalibration model.

[0154] In this embodiment, structured pruning or low-rank approximation is performed on insecure parameters. First, a one-to-one mapping is established between the parameter key space and the network structure to locate the dependencies between weight tensors and corresponding computational units. Structured pruning generates pruning masks at the granularity of channels, attention heads, feedforward branches, and residual branches. These masks are derived from the connectivity of insecure parameters in the anomaly correlation graph, their contribution to trigger detection, and their proportion in key operators. After pruning, shape metadata and routing relationships are updated synchronously to ensure that there are no isolated nodes in the forward and reverse paths. Low-rank approximation performs decomposition and replacement at the block or intra-layer submatrix level, mapping insecure parameters to a rank-restricted representation. Factorization reduces the degrees of freedom and attenuates the expressive power of dangerous directions while preserving the shape and alignment of the interface tensor. Both processing paths produce candidate parameter sets, which record the source, location, transformation method, and recovery strategy for subsequent verification and rollback.

[0155] Key task verification processing was performed on the candidate parameter set, and a shadow inference link was constructed. Impact assessment was conducted item by item under decoding and constraint settings consistent with the online version. During the assessment process, task probes for target question answering, clause interpretation, medication consultation, and sensitive refusal were fed in batches, and answer consistency, compliance triggering, refusal timing, and contextual continuity were observed. Items that significantly reduced task capabilities or negatively perturbed compliance behavior were removed, and items requiring further realignment were retained as parameters to be recalibrated. Simultaneously, summaries of response differences before and after comparison, gradient direction changes, and module-level impact matrices were recorded for weight allocation in subsequent training.

[0156] An adversarial training dataset was constructed, comprising violation question-and-answer samples and security response samples. Coverage was achieved across risk scenarios, industry sectors, and demographic characteristics. Samples were derived from compliance templates, historical audit dialogues, synthetic boundary cases, and scenario-based rewrites. Each sample was bound to a risk category, trigger tag, contextual constraints, and target response paradigm. Violation question-and-answer samples emphasized overstepping authority inducements and implicit evasion expressions, while security response samples emphasized refusal strategies, clarification constraints, and compliance guidance. The two datasets were weighted according to scenario and template leakage and corpus bias were eliminated to form a training batch that could be directly used for restricted updates.

[0157] An adversarial training dataset is used to perform secure adversarial training on the parameters to be recalibrated. The training engine only opens the update channel for the parameters to be recalibrated, while other weights are frozen or semi-frozen. The loss function combines task preservation, compliance constraints, and confidence calibration. Gradient pruning and weight constraints limit the update magnitude. Checkpoints are grouped and saved by scenario to support fine-grained rollback. After training, preliminary recalibration parameters are obtained, with parameter entries containing metadata such as scenario weights, convergence trajectories, and violation sample coverage.

[0158] Gradient alignment optimization is performed on the initial recalibrated parameters to make the update direction more consistent with the parameter distribution of the base model and reduce the risk of distribution drift. During the alignment process, the parameters and intermediate representations of the base model are used as references to calculate the alignment scale at the same layer and position. While maintaining the stability of the mission probe response, the update magnitude and direction are reweighted. Gating suppression is introduced for modules with strong cross-layer dependencies to avoid cascading shifts caused by local corrections. Stricter directional constraints and small-step updates are applied to the linear transformations on the decoding side close to the decision surface until they converge to the recalibrated parameters.

[0159] Linear weighted fusion is performed on the recalibrated parameters and the parameters of the base model. First, the bond space and shape consistency are checked, and then the weight combination is applied at the item level. The high-risk modules adopt a ratio that is more inclined to the recalibrated parameters, while the stable modules adopt a ratio that is closer to the base model. For structures with adapters or incremental units, mask fusion is introduced so that the fusion only acts on the local open update and keeps the rest of the path unchanged. After the fusion is completed, a set of fused parameters is obtained, and an item-level fusion record is generated to support reconciliation and auditing.

[0160] Based on the structure of the fusion parameter set and the basic model, a recalibration model is constructed, the fusion parameter set is loaded into the runtime graph, the connectivity of the computation graph and operator compatibility are verified, a small number of unit tests and scenario sampling are performed, including self-checks of three basic capabilities: rejection triggering, sensitive segment blocking and decoding gating; after verification, loadable workpieces and runtime configuration files are output to form the recalibration model.

[0161] This embodiment constrains high-risk representations from both structural and degree-of-freedom perspectives by structurally pruning and low-ranking approximations of insecure parameters. The candidate parameter set is filtered out through critical task verification to remove items that adversely affect task capabilities and compliance. Only parameters requiring recalibration are given restricted update channels. Under the continuous action of security adversarial training and gradient alignment optimization, recalibrated parameters are formed. Subsequently, a recalibrated model is generated through linear weighted fusion and structural consistency assembly. The overall process reduces the representation intensity of dangerous directions while maintaining the response stability of critical task paths, minimizing uncontrollable shifts caused by full model updates. Item-level recording and scenario-level sampling ensure traceability and rollback capability, providing a directly usable stable entity for subsequent verification and deployment.

[0162] In one embodiment, step S50 above includes:

[0163] S501, acquire multi-domain security test scenarios, perform scenario classification processing on the multi-domain security test scenarios, and obtain scenario classification information;

[0164] S502, Based on the scenario classification information, perform test case generation processing to generate a scenario-based security verification set;

[0165] S503, use the scenario-based security verification set to perform multiple rounds of testing on the recalibrated model to obtain a set of model response results;

[0166] S504, Perform performance index analysis and processing on the model response result set to obtain task performance data;

[0167] S505, Perform security compliance analysis and processing on the model response result set to obtain security compliance data;

[0168] S506, Perform comprehensive analysis and processing on the task performance data and the security compliance data to generate comprehensive analysis results;

[0169] S507, Generate verification feedback information based on the comprehensive analysis results.

[0170] In this embodiment, when acquiring multi-domain security testing scenarios, candidate scenario units are first extracted from business corpora, regulatory lists, historical audit records, and risk case libraries. For healthcare and fintech businesses, semantic domains such as drug usage and dosage, contraindications and interactions, patient population differences, privacy-sensitive inquiries, investment risk disclosure, interpretation of terms and conditions, prevention of sales misrepresentation, and arbitrage avoidance consultation are retained. The candidate scenario units undergo quality screening and deduplication, removing fragments with incomplete information, conflicting labels, or ambiguous expressions, while retaining metadata such as text, contextual anchors, role information, and channel identifiers, forming a multi-domain security testing scenario set that can be used for classification. When performing scenario classification processing for multi-domain security testing scenarios, a hierarchical tagging system is introduced to map top-level domain tags (healthcare business, fintech business) with sub-category risk tags (unauthorized responses, privacy leaks, improper medication, regulatory circumvention, and misinterpretation of terms, etc.). A joint judgment is made using lexical triggering, semantic vector matching, and template alignment to generate scenario classification information. Priority adjudication and threshold calibration are performed on multi-tag conflict items to ensure that each item has a stable primary tag and optional secondary tags, and judgment evidence and version fingerprints are retained to support subsequent traceability.

[0171] When generating test cases based on scenario-based classification information, a generation tree is expanded with each risk semantic as the root node. The root node is bound to a compliance template expression and a set of boundary conditions. Three types of operations are performed on each node: semantic transformation, contextual rewriting, and boundary perturbation. Semantic transformation ensures expression diversity and entity replacement coverage; contextual rewriting injects channel, region, role, and temporal constraints; boundary perturbation constructs critical inputs around sensitive boundaries such as dosage limits, monetary thresholds, age thresholds, and population contraindications. Decidability checks and distribution balance constraints are applied to the generated candidates, eliminating entries inconsistent with the classification information or lacking sufficient evidence. Difficulty stratified sampling and scenario-balanced sampling are applied to the set that passes the checks, outputting test case entries containing text, contextual requirements, expected judgment labels, and evidence anchors. These are aggregated into a scenario-based safety verification set, while the generation path and debiased summary are recorded to align with the evaluation results.

[0172] When performing multi-round testing on the recalibrated model using a scenario-based security verification set, the round sequence is organized according to the contextual dependencies of each test case. The decoding configuration (temperature, beamwidth, sampling upper bound, masking table, and rejection threshold) is fixed, and a unified random seed is used. Inference is triggered sequentially, collecting the main output and candidate paths, probability vectors, attention alignment matrices, and timestamps to construct a model response result set. For test cases with cross-round dependencies, the session state is kept consistent, and the content of the preceding round is injected. For test cases with channel differences, the output format and rate limiting strategy are switched according to the channel strategy to ensure consistency between testing and real deployment. Fault codes and context snapshots are recorded for abnormal interruptions and timeouts to avoid data gaps affecting subsequent statistics.

[0173] When performing performance index analysis on the model response result set, task performance data is statistically analyzed from both the task and system levels. The task level includes answer accuracy, consistency, coverage, contextual acceptance rate, and citation integrity; the system level includes latency, throughput, stability, and failure rate. Index calculation employs an alignment golden reference and fragment-level alignment rules. For legally valid expressions with incomplete matches, template alignment and semantic equivalence judgment are performed, outputting item-level and aggregate-level results along with confidence intervals. When performing security compliance analysis on the model response result set, judgments are made based on a security tag set. First, key phrases and rule templates are quickly filtered, followed by precise semantic matching and logical constraint judgment. For hit items, an insecurity evidence package is generated, including hit fragments, trigger tags, context constraint satisfaction, and candidate divergence metrics. Simultaneously, the reasonableness of rejection, the sufficiency of risk warnings, and the accuracy of boundary expressions are quantified, forming security compliance data.

[0174] When performing comprehensive analysis on task performance data and security compliance data, a dual-objective evaluation surface is constructed, integrating three quantitative dimensions: accuracy, stability, and compliance. Information is categorized by scenario and aggregated in buckets to output comprehensive analysis results. The trade-off relationship is represented by a Pareto front and a weighted joint representation of penalty terms, identifying scenario clusters that trigger insecure outputs while maintaining task performance and scenario clusters that experience excessive performance degradation under high-intensity protection. High-impact items are traced back to the use case generation path and classification evidence to verify whether data leakage or label offset exists. The comprehensive analysis results include hierarchical statistics by domain and risk category, indicator comparisons, anomaly clustering, and priority queues, along with uncertainty scales and suggested threshold windows, for direct consumption during policy update.

[0175] When generating verification feedback information based on comprehensive analysis results, the structure and metadata are solidified according to the data contract. The verification feedback information comprises three parts: first, a summary view, providing global compliance rate, rejection rate, first-pass rate, latency distribution, and key percentiles; second, a scenario view, listing high-risk subsets and performance degradation subsets by scenario classification information, and providing threshold adjustment suggestions and sample weight suggestions; and third, an evidence view, providing an item-level evidence package index, including model response, hit labels, judgment evidence, and contextual anchors. All views are written with version fingerprints, generation times, and configuration summaries to ensure that subsequent insecure parameter determination strategies and security recalibration strategies can be iterated based on the same reference.

[0176] This embodiment constructs scenario classification information based on multi-domain security testing scenarios, and generates a scenario-based security verification set that is sufficiently comprehensive, clearly defined, and definable. Then, under a configuration consistent with the deployment, the recalibrated model undergoes multiple rounds of testing to obtain a complete set of model response results. Through parallel computation of performance indicator analysis and security compliance analysis, both task performance data and security compliance data are simultaneously obtained. In the comprehensive analysis process, a hierarchical aggregation and weighted representation method is used to output comprehensive analysis results. Finally, verification feedback information including a summary view, a scenario view, and an evidence view is generated. This chain connects sampling, generation, testing, and evaluation with a unified data contract, stably revealing the sources of deviation between performance and compliance, locating high-risk scenario clusters and performance degradation scenario clusters, providing directly actionable quantitative basis for subsequent policy updates, reducing the burden of manual review and the probability of misjudgment, and improving the iteration efficiency and audit traceability after recalibration.

[0177] In one embodiment, step S60 above includes:

[0178] S601, Perform strategy impact analysis and processing on the verification feedback information to determine the strategy adjustment requirements;

[0179] S602, based on the policy adjustment requirements, perform parameter threshold update processing on the policy for determining the insecure parameters to obtain the updated policy;

[0180] S603, Based on the strategy adjustment requirements, the training parameters of the security recalibration strategy are optimized to obtain the updated recalibration strategy;

[0181] S604, Perform policy fusion processing on the updated determination policy and the updated recalibration policy to generate a policy integration scheme;

[0182] S605, verify the effectiveness of the strategy integration scheme, and generate an updated strategy based on the verified strategy integration scheme.

[0183] In this embodiment, when performing strategy impact analysis on verification feedback information, the performance indicators, compliance indicators, and cross-scenario comprehensive analysis results contained in the verification feedback information first need to be decomposed into quantifiable strategy impact factors. These impact factors typically include high-risk trigger frequency, performance degradation magnitude, false rejection rate, and compliance misjudgment rate. Through aggregation statistics, differential comparison, and sensitivity decomposition, a mapping table is formed to clarify which strategy parameters have significant dependencies on the feedback results. In this process, it is necessary to ensure both the stability of the overall indicators and the fine-grained capture of local risk scenarios. The final result is a set of strategy adjustment requirements, used to guide the direction of subsequent strategy modifications.

[0184] When updating the thresholds of unsafe parameters based on strategy adjustment requirements, it is necessary to extract the existing threshold definitions from the strategy, including trigger thresholds, filtering thresholds, and risk level limits. By comparing these thresholds with the set of strategy adjustment requirements, thresholds that underestimate risk are lowered, while those that are overly constrained are raised. This process can incorporate mechanisms such as interval expansion, tiered adjustment, or dynamic threshold adjustment, for example, dynamic sliding window updates based on moving averages or exponentially weighted updates based on feedback frequency. The updated strategy more closely approximates the risk characteristic distribution revealed by the verification feedback information, enabling a more accurate distinction between unsafe and safe parameters.

[0185] When optimizing training parameters for a security recalibration strategy based on policy adjustment requirements, it's necessary to reset hyperparameters during the recalibration training process, such as learning rate, regularization strength, gradient clipping threshold, and training epochs. By transforming the policy adjustment requirements into a hyperparameter search space, experimental simulations are conducted on different combinations to select the parameter combination that achieves a balance between compliance and performance metrics. Training parameter optimization also includes updating the sample selection mechanism, such as increasing the proportion of boundary samples or introducing synthetic adversarial samples to enhance the model's robustness in extreme scenarios. Ultimately, an updated recalibration strategy is formed, ensuring that subsequent recalibration processes maintain stable performance while strengthening security and compliance.

[0186] When performing policy fusion processing on the updated determined policy and the updated recalibration policy, a fusion framework needs to be constructed to integrate parameter threshold rules and training optimization rules into a unified policy integration scheme. During the fusion process, the priority, coverage, and conflicting parts of the rules are adjudicated. For example, when a threshold update leads to over-restriction while training optimization suggestions relax the restrictions, a weighted coefficient mechanism needs to be introduced to generate a final decision through weighted decision-making. Policy fusion also requires generating a structured description of the output results to ensure that subsequent validation can clearly trace the specific adjustment points.

[0187] When validating the policy integration scheme, policy simulation needs to be performed quickly on the validation or replay dataset. By comparing the risk distribution in the validation feedback with the output generated by the new policy integration scheme, it can be verified whether the policy effectively reduces the proportion of unsafe outputs without degrading overall performance. After successful validation, an updated policy is generated based on the policy integration scheme. This policy will become the direct input for subsequent iterations, ensuring the stable operation of the closed-loop optimization process.

[0188] Example: In the insurance business scenario of the fintech field, facing the ever-increasing demand for intelligent customer service, claims review and compliance audit, the model may introduce insecure parameters after fine-tuning, thereby bringing business and compliance risks.

[0189] First, the parameters of the basic model and the model parameters fine-tuned for the insurance task are obtained, and a systematic parameter comparison process is performed. By loading the basic parameter file and the fine-tuned parameter file, two sets of parameters are formed, and each parameter is compared to identify differences. In the comparison results, a filtering mechanism is used to remove minor perturbations, retaining significantly different terms, and further normalization is performed to obtain the differential parameters. These differential parameters can directly characterize the potential risk factors added or amplified during the fine-tuning process, laying a data foundation for subsequent analysis.

[0190] Next, gradient sensitivity analysis is performed on the differential parameters. By calculating the parameter gradients, the contribution of these parameters to the forward and backward propagation paths of the model is analyzed, and their impact distribution on the output is obtained. Based on this, anomaly levels are constructed and a correspondence between parameters and potential anomaly types is established, further generating an anomaly correlation map. This map can map risk parameters to possible triggered anomalous behaviors, providing a traceable chain of evidence for subsequent detection and handling.

[0191] After obtaining the anomaly correlation graph, trigger detection is performed by combining the insurance business's security knowledge base and benchmark question and answer set. A test query set is constructed to simulate real questions from insurance customers, such as explanations of claims terms and investment risk inquiries. The model is then fine-tuned to obtain response outputs. These outputs are then compared with a security label set to filter out unsafe responses. Simultaneously, the anomaly correlation graph is used to filter parameters, resulting in a set of high-risk parameters. These parameters are then correlated with unsafe responses to ultimately identify unsafe parameters that may lead to incorrect answers.

[0192] After identifying insecure parameters, they are removed or sparsified to obtain parameters to be recalibrated. The scope of risk parameters is reduced through structured pruning or low-rank approximation, while parameters essential to business operations are retained through key task validation. Then, an adversarial training dataset is constructed based on samples of both violating and secure question answers. The parameters to be recalibrated are then subjected to adversarial training, and further optimized through gradient alignment to obtain the recalibrated parameters. Finally, these parameters are linearly weighted and fused with the base model parameters to form a structurally complete and corrected recalibration model.

[0193] After initial model recalibration, scenario-based security verification is required. This involves constructing test scenarios covering multiple insurance business areas, such as policy cancellation consultations, claims refusal disputes, and investment return explanations, to generate a scenario-based security verification set. This verification set is then input into the recalibrated model multiple times to obtain response results. Performance and security compliance indicators are analyzed from these results to form a comprehensive analysis. This result reflects both the model's capabilities in actual business processing and reveals potential residual compliance risks, ultimately generating verification feedback information.

[0194] Based on the verification feedback, the strategies for determining insecure parameters and for security recalibration are updated. Policy thresholds and training parameters are adjusted through feedback analysis, fused to form a policy integration scheme, and its effectiveness is confirmed through a verification mechanism, resulting in the updated policy. The updated policy can serve as the basis for iterative optimization, enabling the model to possess long-term stable security evolution capabilities.

[0195] After the above processing is completed, the recalibrated model is recalibrated again based on the update strategy, ultimately forming a secure application model that can be used in actual business. This secure application model can run stably in scenarios such as customer service, claims assistance, and compliance review for insurance companies. When a customer task request is received, such as when the policyholder requests an explanation of the exclusion clauses, the model will generate a secure response under the constraints of the security mechanism, avoiding inappropriate answers or unauthorized interpretations, thereby ensuring compliance and customer trust.

[0196] In the healthcare sector, particularly in chronic disease management, health consultation, and elderly care support services, the system first needs to obtain the parameters of the basic health management model and the parameters of the model after personalized fine-tuning. The two sets of parameters are then compared to extract differential parameters. These differential parameters represent new changes introduced when the model is personalized for a specific user group or health scenario. These changes may improve the adaptability to tasks such as nutrition advice and medication reminders, but they may also introduce potential risks, such as providing inappropriate dietary advice or generating excessive exercise guidance. Therefore, identifying differential parameters through parameter comparison provides input for subsequent safety screening and remediation.

[0197] Subsequently, the system performs gradient sensitivity analysis on these differential parameters, calculates parameter gradient information, and derives their impact on the model output, generating an anomaly correlation map. In the health field, this map can reveal the relationship between parameters and potentially unsafe behaviors, such as whether parameters cause the model to generate incorrect or out-of-bounds recommendations on sensitive issues like nutritional contraindications, drug combinations, and psychological interventions. Through this graphical representation, it is possible to clearly identify which parameters are closely coupled with high-risk outputs.

[0198] With the support of an anomaly correlation graph, the system performs trigger detection on the fine-tuned model. It constructs a health and safety tag set using a pre-set health knowledge base and generates a test query set based on a benchmark health question and answer set to test the model. During this process, the model's response is collected and compared with the tag set. If deviations occur in areas such as contraindicated drug recommendations, dietary restrictions, or sensitive topics related to mental health, and these trigger corresponding high-risk nodes in the graph, these parameters are determined to be unsafe.

[0199] For identified unsafe parameters, the system performs elimination or sparsification, using structured pruning or low-rank approximation to remove or compress high-risk parameters, resulting in a candidate parameter set. Subsequently, through key task validation, only parameters meeting the requirements of the health consultation task are retained for recalibration. At this point, the system constructs an adversarial training dataset containing samples of non-compliant health advice and samples of safe responses conforming to health guidance, and retrains and optimizes the parameters for recalibration. After this process, the resulting recalibrated parameters are fused with the parameters of the base model to construct a recalibrated model that retains the effectiveness of the original health task while avoiding potentially inappropriate outputs.

[0200] To further verify the reliability of the recalibrated model, the system acquires scenario-based safety verification sets covering various health scenarios, such as dietary management, medication reminders, psychological counseling, and exercise advice for the elderly. The system first categorizes the scenarios and then generates comprehensive test cases to perform multiple rounds of testing on the recalibrated model. Performance analysis reveals the model's accuracy and coverage across various tasks, while safety and compliance analysis verifies whether the model avoids providing inappropriate advice in sensitive scenarios. Finally, the comprehensive evaluation results generate verification feedback information.

[0201] Based on the validation feedback, the system updates the strategy for determining unsafe parameters and the safety recalibration strategy. For example, if risks still exist in certain medication scenarios, the system updates the parameter thresholds and optimizes the training parameters in the recalibration strategy, forming new determination and recalibration strategies. These two strategies are then fused and validated for effectiveness, ultimately resulting in an updated strategy to guide the next round of model safety recalibration.

[0202] Under the updated strategy, the recalibrated model will undergo another security recalibration to generate the final secure application model. This model can not only handle routine health management tasks but also ensure compliance and robustness in special scenarios, avoiding the output of unsafe or unreasonable content. When a user submits a task request, such as consulting on dietary plans for chronic diseases, obtaining exercise advice, or receiving psychological adjustment prompts, the system will parse the request and conduct a risk assessment, selecting an appropriate inference mode to run the secure application model. The initial results will undergo a security filtering mechanism to remove potentially inappropriate content and be returned to the user in a suitable format, thus generating a secure response.

[0203] This embodiment sequentially executes policy impact analysis, threshold update, training parameter optimization, policy fusion, and effectiveness verification driven by validation feedback information, ultimately obtaining an updated policy. This approach gradually reduces the risks associated with unsafe parameter triggers while maintaining the model's original performance stability. Logically, this process forms a closed-loop mechanism from feedback to policy, enabling the policy to dynamically adapt to different business scenarios and risk environments, avoiding overfitting or overly lenient issues caused by single static rules. This not only improves security and compliance but also enhances the system's adaptability and long-term maintainability in complex tasks.

[0204] In one embodiment, a parameter safety recalibration and response apparatus is provided, which corresponds one-to-one with the parameter safety recalibration and response method described in the above embodiments. (Refer to...) Figure 3 , Figure 3 This is a functional block diagram of a preferred embodiment of the parameter safety recalibration and response device of the present invention. The module includes a parameter comparison module 10, a sensitivity analysis module 20, a trigger detection module 30, a recalibration module 40, a security verification module 50, a policy update module 60, an application generation module 70, and a task processing module 80. Detailed descriptions of each functional module are as follows:

[0205] The parameter comparison module 10 is used to obtain the parameters of the base model and the parameters of the fine-tuned model, and to perform parameter comparison processing on the parameters of the base model and the parameters of the fine-tuned model to obtain the difference parameters.

[0206] Sensitivity analysis module 20 is used to perform gradient sensitivity analysis on the difference parameters and generate anomaly correlation maps;

[0207] The trigger detection module 30 is used to perform trigger detection processing on the fine-tuned model based on the abnormal correlation graph to determine unsafe parameters;

[0208] The recalibration module 40 is used to perform elimination or sparsification processing on the unsafe parameters to obtain parameters to be recalibrated, perform safe recalibration processing on the parameters to be recalibrated to obtain recalibrated parameters, and fuse the recalibrated parameters with the parameters of the base model to form a recalibrated model.

[0209] The security verification module 50 is used to acquire a scenario-based security verification set, perform security verification processing on the recalibration model based on the scenario-based security verification set, and obtain verification feedback information.

[0210] The strategy update module 60 is used to perform update processing on the determination strategy for insecure parameters and the security recalibration strategy based on the verification feedback information, so as to obtain the updated strategy.

[0211] Application generation module 70 is used to perform a secure recalibration process on the recalibration model based on the updated strategy to generate a secure application model;

[0212] The task processing module 80 is used to obtain a task request, process the task request through the security application model, and obtain a security response result.

[0213] In one embodiment, the parameter comparison module 10 is specifically used for:

[0214] Obtain the parameter file of the basic model, perform parameter loading processing on the parameter file of the basic model, and obtain the basic parameter set;

[0215] Obtain the parameter file of the fine-tuned model, and perform parameter loading processing on the parameter file of the fine-tuned model to obtain the set of fine-tuned parameters;

[0216] Perform parameter comparison processing on the basic parameter set and the fine-tuning parameter set to obtain parameter difference results;

[0217] Perform a preset minor difference filtering process on the parameter difference results to extract the set of significantly different parameters;

[0218] The set of significantly different parameters is standardized to generate difference parameters.

[0219] In one embodiment, the sensitivity analysis module 20 is specifically used for:

[0220] Gradient determination processing is performed on the difference parameters to obtain parameter gradient information;

[0221] Based on the parameter gradient information, an influence degree analysis is performed to determine the distribution of the influence of the difference parameters on the model output;

[0222] Anomaly scoring processing is performed on the influence distribution to obtain the anomaly level of each difference parameter;

[0223] Based on the anomaly level, perform correlation analysis to establish the correspondence between parameters and anomaly types;

[0224] Perform graph construction processing on the correspondence to generate an anomaly association graph.

[0225] In one embodiment, the trigger detection module 30 is specifically used for:

[0226] A security tag set is obtained by performing a security tag construction process based on a security knowledge base.

[0227] Query construction is performed based on the benchmark question-and-answer set to obtain the test query set;

[0228] The fine-tuned model is processed using a test query set to obtain the model response output.

[0229] Based on the aforementioned anomaly correlation graph, anomaly parameter filtering processing is performed to obtain a set of high-risk parameters;

[0230] Perform a matching analysis process between the model response output and the security label set to determine unsafe responses;

[0231] Based on the insecure response and the set of high-risk parameters, an association mapping process is performed to determine the insecure parameters.

[0232] In one embodiment, the recalibration module 40 is specifically used for:

[0233] The unsafe parameters are subjected to structured pruning or low-rank approximation to obtain a set of candidate parameters;

[0234] Perform critical task verification processing on the candidate parameter set to obtain the parameters to be recalibrated;

[0235] Construct an adversarial training dataset containing samples of illegal question-and-answer statements and security response statements;

[0236] The parameters to be recalibrated are subjected to secure adversarial training using the adversarial training dataset to obtain preliminary recalibration parameters.

[0237] Gradient alignment optimization is performed on the initial recalibration parameters to obtain the recalibrated parameters;

[0238] The recalibrated parameters and the parameters of the base model are subjected to linear weighted fusion processing to obtain a fused parameter set;

[0239] Based on the fusion parameter set and the structure of the basic model, a recalibration model is constructed.

[0240] In one embodiment, the security verification module 50 is specifically used for:

[0241] Obtain multi-domain security test scenarios, perform scenario classification processing on the multi-domain security test scenarios, and obtain scenario classification information;

[0242] Based on the scenario classification information, test case generation processing is performed to generate a scenario-based security verification set.

[0243] The recalibrated model is subjected to multiple rounds of testing using the scenario-based security verification set to obtain a set of model response results.

[0244] The model response result set is subjected to performance index analysis and processing to obtain task performance data;

[0245] Perform security compliance analysis on the model response result set to obtain security compliance data;

[0246] Perform comprehensive analysis and processing on the task performance data and the security compliance data to generate comprehensive analysis results;

[0247] Verification feedback information is generated based on the comprehensive analysis results.

[0248] In one embodiment, the policy update module 60 is specifically used for:

[0249] The verification feedback information is subjected to strategy impact analysis to determine the strategy adjustment requirements;

[0250] Based on the policy adjustment requirements, the policy for determining the insecure parameters is updated by performing parameter threshold update processing to obtain the updated policy.

[0251] Based on the aforementioned strategy adjustment requirements, the training parameters of the security recalibration strategy are optimized to obtain the updated recalibration strategy.

[0252] The updated determination strategy and the updated recalibration strategy are subjected to strategy fusion processing to generate a strategy integration scheme;

[0253] Verify the effectiveness of the strategy integration scheme and generate an updated strategy based on the verified strategy integration scheme.

[0254] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides determination and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When executed by the processor, the computer program implements the functions or steps of a parameter-safe recalibration and response method on the server side.

[0255] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 5As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides determination and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements the client-side functions or steps of a parameter-safe recalibration and response method.

[0256] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:

[0257] Obtain the parameters of the base model and the parameters of the fine-tuned model, and perform parameter comparison processing on the parameters of the base model and the parameters of the fine-tuned model to obtain the difference parameters;

[0258] Gradient sensitivity analysis is performed on the differential parameters to generate an anomaly correlation map;

[0259] Based on the aforementioned anomaly correlation graph, trigger detection processing is performed on the fine-tuned model to determine unsafe parameters;

[0260] The unsafe parameters are removed or sparsified to obtain parameters to be recalibrated. The parameters to be recalibrated are then subjected to safe recalibration to obtain recalibrated parameters. The recalibrated parameters are then fused with the parameters of the base model to form a recalibrated model.

[0261] Obtain a scenario-based security verification set, and perform security verification processing on the recalibration model based on the scenario-based security verification set to obtain verification feedback information;

[0262] Based on the verification feedback information, the strategy for determining insecure parameters and the security recalibration strategy are updated to obtain the updated strategy.

[0263] Based on the updated strategy, a secure recalibration process is performed on the recalibration model to generate a secure application model;

[0264] Obtain a task request, process the task request through the security application model, and obtain a security response result.

[0265] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0266] Obtain the parameters of the base model and the parameters of the fine-tuned model, and perform parameter comparison processing on the parameters of the base model and the parameters of the fine-tuned model to obtain the difference parameters;

[0267] Gradient sensitivity analysis is performed on the differential parameters to generate an anomaly correlation map;

[0268] Based on the aforementioned anomaly correlation graph, trigger detection processing is performed on the fine-tuned model to determine unsafe parameters;

[0269] The unsafe parameters are removed or sparsified to obtain parameters to be recalibrated. The parameters to be recalibrated are then subjected to safe recalibration to obtain recalibrated parameters. The recalibrated parameters are then fused with the parameters of the base model to form a recalibrated model.

[0270] Obtain a scenario-based security verification set, and perform security verification processing on the recalibration model based on the scenario-based security verification set to obtain verification feedback information;

[0271] Based on the verification feedback information, the strategy for determining insecure parameters and the security recalibration strategy are updated to obtain the updated strategy.

[0272] Based on the updated strategy, a secure recalibration process is performed on the recalibration model to generate a secure application model;

[0273] Obtain a task request, process the task request through the security application model, and obtain a security response result.

[0274] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0275] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0276] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0277] It should be noted that if any software tools or components not belonging to this company appear in the embodiments of this application, they are merely illustrative examples and do not represent actual use. The embodiments described above are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A parametric secure re-calibration and response method, characterized by, The method comprises the following steps: obtaining parameters of a base model and parameters of a fine-tuned model, performing parameter comparison processing on the parameters of the base model and the parameters of the fine-tuned model to obtain differential parameters; performing gradient sensitivity analysis processing on the differential parameters to generate an abnormal association graph; based on the abnormal association graph, performing trigger detection processing on the fine-tuned model to determine unsafe parameters; performing elimination or sparsification processing on the unsafe parameters to obtain parameters to be recalibrated, performing safe recalibration processing on the parameters to be recalibrated to obtain recalibrated parameters, and fusing the recalibrated parameters with the parameters of the base model to form a recalibration model; obtaining a scenario-based safety verification set, performing safety verification processing on the recalibration model based on the scenario-based safety verification set to obtain verification feedback information; based on the verification feedback information, performing update processing on the determination strategy of unsafe parameters and the safety recalibration strategy to obtain an updated strategy; based on the updated strategy, performing safety recalibration processing on the recalibration model to generate a safe application model; obtaining a task request and processing the task request through the safe application model to obtain a safe response result.

2. The parametric secure re-calibration and response method of claim 1, wherein, obtaining parameters of a base model and parameters of a fine-tuned model, performing parameter comparison processing on the parameters of the base model and the parameters of the fine-tuned model to obtain differential parameters, comprising: obtaining a parameter file of the base model, performing parameter loading processing on the parameter file of the base model to obtain a base parameter set; obtaining a parameter file of the fine-tuned model, performing parameter loading processing on the parameter file of the fine-tuned model to obtain a fine-tuned parameter set; performing parameter comparison processing on the base parameter set and the fine-tuned parameter set to obtain a parameter difference result; performing preset micro-difference filtering processing on the parameter difference result to extract a significant difference parameter set; performing standardization processing on the significant difference parameter set to generate differential parameters.

3. The parametric secure re-calibration and response method of claim 1, wherein, performing gradient sensitivity analysis processing on the differential parameters to generate an abnormal association graph, comprising: performing gradient determination processing on the differential parameters to obtain parameter gradient information; based on the parameter gradient information, performing influence degree analysis processing to determine the influence distribution of the differential parameters on model output; performing abnormal scoring processing on the influence distribution to obtain the abnormal level of each differential parameter; based on the abnormal level, performing association analysis processing to establish a corresponding relationship between parameters and abnormal types; performing graph construction processing on the corresponding relationship to generate an abnormal association graph.

4. The parametric secure re-calibration and response method of claim 1, wherein, based on the abnormal association graph, performing trigger detection processing on the fine-tuned model to determine unsafe parameters, comprising: based on a safety knowledge base, performing safety label construction processing to obtain a safety label set; based on a benchmark question and answer set, performing query construction processing to obtain a test query set; using the test query set to perform query processing on the fine-tuned model to obtain a model response output; based on the abnormal association graph, performing abnormal parameter screening processing to obtain a high-risk parameter set; performing matching analysis processing on the model response output and the safety label set to determine an unsafe response; Performing association mapping processing based on the unsafe response and the high-risk parameter set, to determine unsafe parameters.

5. The parametric security re-calibration and response method of claim 1, wherein, Performing elimination or sparsification processing on the unsafe parameters to obtain parameters to be recalibrated, performing safe recalibration processing on the parameters to be recalibrated to obtain recalibrated parameters, and fusing the recalibrated parameters with parameters of the base model to form a recalibration model, including: Performing structured pruning processing or low-rank approximation processing on the unsafe parameters to obtain a candidate parameter set; Performing key task verification processing on the candidate parameter set to obtain parameters to be recalibrated; Constructing an adversarial training data set containing rule-violating question and answer samples and safe response samples; Performing safe adversarial training processing on the parameters to be recalibrated using the adversarial training data set to obtain preliminary recalibrated parameters; Performing gradient alignment optimization processing on the preliminary recalibrated parameters to obtain recalibrated parameters; Performing linear weighted fusion processing on the recalibrated parameters and the parameters of the base model to obtain a fusion parameter set; Based on the fusion parameter set and the structure of the base model, a recalibration model is constructed.

6. The parametric security re-calibration and response method of claim 1, wherein, Obtaining a scenario-based safety verification set, performing safety verification processing on the recalibration model based on the scenario-based safety verification set to obtain verification feedback information, including: Obtaining a multi-domain safety test scenario, performing scenario classification processing on the multi-domain safety test scenario to obtain scenario classification information; Based on the scenario classification information, performing test case generation processing to generate a scenario-based safety verification set; Using the scenario-based safety verification set to perform multiple rounds of test processing on the recalibration model to obtain a model response result set; Performing performance indicator analysis processing on the model response result set to obtain task performance data; Performing safety compliance analysis processing on the model response result set to obtain safety compliance data; Performing comprehensive analysis processing on the task performance data and the safety compliance data to generate a comprehensive analysis result; Based on the comprehensive analysis result, generating verification feedback information.

7. The parametric security re-calibration and response method of claim 1, wherein, Based on the verification feedback information, performing update processing on the determination strategy of unsafe parameters and the safe recalibration strategy to obtain updated strategies, including: Performing strategy impact analysis processing on the verification feedback information to determine strategy adjustment requirements; Based on the strategy adjustment requirements, performing parameter threshold update processing on the determination strategy of unsafe parameters to obtain an updated determination strategy; Based on the strategy adjustment requirements, performing training parameter optimization processing on the safe recalibration strategy to obtain an updated recalibration strategy; Performing strategy fusion processing on the updated determination strategy and the updated recalibration strategy to generate a strategy integration scheme; Verifying the effectiveness of the strategy integration scheme, and generating an updated strategy based on the strategy integration scheme that passes the verification.

8. A parametrically secure re-calibration and response device, characterized by The parameter safety recalibration and response device includes: A parameter comparison module configured to obtain parameters of a base model and parameters of a fine-tuned model, perform parameter comparison processing on the parameters of the base model and the parameters of the fine-tuned model, and obtain difference parameters. The sensitivity analysis module is configured to perform gradient sensitivity analysis on the difference parameters to generate an abnormal correlation graph; The trigger detection module is configured to perform trigger detection on the fine-tuned model based on the abnormal correlation graph to determine unsafe parameters; The re-calibration module is configured to perform elimination or sparsification on the unsafe parameters to obtain to-be-re-calibrated parameters, perform safe re-calibration on the to-be-re-calibrated parameters to obtain re-calibrated parameters, fuse the re-calibrated parameters with parameters of the base model to form a re-calibrated model, and perform safe verification on the re-calibrated model based on a scenario-based safe verification set to obtain verification feedback information. The security verification module is configured to obtain a scenario-based security verification set, perform security verification on the re-calibrated model based on the scenario-based security verification set, and obtain verification feedback information. The policy updating module is configured to perform updating on a determination policy of unsafe parameters and a safe re-calibration policy based on the verification feedback information to obtain updated policies. The application generation module is configured to perform safe re-calibration on the re-calibrated model based on the updated policies to generate a safe application model. The task processing module is configured to obtain a task request, process the task request by using the safe application model, and obtain a safe response result.

9. A computer device, comprising: The computer device includes a memory, a processor, and a parameter security re-calibration and response program stored in the memory and executable on the processor. When the parameter security re-calibration and response program is executed by the processor, the steps of the parameter security re-calibration and response method according to any one of claims 1-7 are implemented.

10. A computer-readable storage medium, characterized in that, The storage medium stores a parameter security re-calibration and response program. When the parameter security re-calibration and response program is executed by the processor, the steps of the parameter security re-calibration and response method according to any one of claims 1-7 are implemented.

Citation Information

Patent Citations

  • Safety evaluation method based on large language model and related device

    CN119357021A

  • Federal collaborative optimization method, device, equipment and medium

    CN120598079A

  • Intelligent liquidation receipt management method based on multi-modal data fusion

    CN120632312A

Cited By

  • Visual model continuous publishing method and system based on high-risk scene slice regression gating

    CN122289904A