An online rectification method and system of neural symbol double-flow closed loop

By employing a neural symbolic dual-stream closed-loop method, the actions of the network-controlled agent are monitored and corrected in real time, solving the problem of action illusion in the network-controlled agent. This enables network control under high security and real-time requirements, improving the flexibility and generalization ability of the network-controlled agent.

CN122334516APending Publication Date: 2026-07-03XIAMEN UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAMEN UNIV
Filing Date
2026-06-04
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing technologies suffer from the illusion of action problem in network-controlled agents, and cannot effectively solve the problems of nondeterministic soft constraints, post-verification lag, and the inability of discrete templates to handle semantic-level dynamic state constraints, leading to difficulties for network-controlled agents under high security and real-time requirements.

Method used

The neural symbolic dual-stream closed-loop method is adopted. By extracting hidden states in the Transformer decoder and normalizing them to a unit hypersphere, and combining them with the symbolic side rule template library to generate allowable cone and taboo cone constraints, the method monitors in real time and performs minimum perturbation pullback, and updates the key value cache synchronously to ensure the security and compliance of network actions.

Benefits of technology

It enables real-time monitoring and correction of network actions, ensuring the safety and compliance of network control agents in high-risk environments, improving real-time performance and flexibility, reducing computational overhead, and providing an auditable network automation control solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122334516A_ABST
    Figure CN122334516A_ABST
Patent Text Reader

Abstract

This invention discloses an online bias correction method and system for neural symbolic dual-stream closed loops, belonging to the field of artificial intelligence technology. The method includes: when generating network action tokens from a large language model, extracting hidden vectors at a fixed bias correction layer and performing spherical normalization; instantiating rule templates through symbolic side-channels and mapping them to allowed and forbidden cones; generating gating signals based on violation energy, and upon triggering, solving for the minimum perturbation in the tangent space to obtain the corrected state, while simultaneously updating multi-layer multi-head key-value caches; performing consistency verification on the output network actions, and issuing a safe default action and recording audit information upon failure. This invention enables real-time, interpretable, and implementable security constraints on network action chains.
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 an online correction method and system for a neural symbolic dual-flow closed loop. Background Technology

[0002] In recent years, intelligent agents based on large language models have been increasingly applied to network automated configuration and fault self-healing due to their powerful natural language understanding, intent reasoning, and code generation capabilities. However, they are essentially generative models based on probabilistic prediction. When facing scenarios like network operations and maintenance, which have extremely high requirements for accuracy and security, existing technical solutions suffer from the agent illusion problem. The action chains generated by the model may contain non-existent object references, incorrect configuration parameters, or operations that violate permission boundaries. However, there is an irreconcilable contradiction between the flexibility of generation and the security of control in existing technologies. The industry urgently needs a corrective method that can fundamentally solve the action illusion and compliance problems of network control agents while ensuring real-time performance.

[0003] In existing technologies, the mainstream methods for correcting the illusion of action of network-controlled intelligent agents can be divided into three categories: soft constraint methods based on retrieval enhancement generation and prompting engineering, defense methods based on post-verification and digital twins, and controlled decoding methods based on discrete templates or syntax trees.

[0004] The first category is soft-constraint methods based on retrieval-enhanced generation and suggestion engineering. To address the lack of domain knowledge in large language models, retrieval-enhanced generation and suggestion engineering techniques are widely adopted in the industry. By introducing external knowledge bases and injecting relevant context into model suggestions, this approach attempts to reduce the probability of models "imagine things out of thin air" from the outset.

[0005] However, such methods are characterized by nondeterministic "soft constraints." Introducing context can only reduce the probability of errors, but it cannot mathematically prevent the model from deviating from the real network state or security rules during inference. When faced with complex network topology dependencies, large language models may still generate seemingly reasonable but actually illegal actions based on probability. This uncontrollable randomness is an unacceptable risk in core network control.

[0006] The second category is defense methods based on post-event verification and digital twins. To prevent erroneous actions from taking effect, researchers have introduced a defense mechanism based on "post-event verification" and digital twins. After generating a complete action chain using a large language model, a sandbox environment or simulation system is used for pre-playing to intercept operations that may lead to failure.

[0007] However, such methods suffer from severe lag and wasted computational resources. Network fault self-healing often requires response times on the order of seconds or even milliseconds, while high-fidelity sandbox simulations are time-consuming, causing agents to fail to meet real-time requirements. This process is a passive trial-and-error mechanism; once the model gets stuck in incorrect reasoning logic, the system can only retry repeatedly, resulting in extremely low efficiency.

[0008] The third category is controlled decoding methods based on discrete templates or syntax trees. To enhance the standardization of the output, some techniques employ controlled decoding schemes based on discrete templates or syntax trees.

[0009] However, such methods can only address syntactic compliance and cannot handle semantic-level dynamic state constraints. Network rules are often high-dimensional and strongly correlated with states, and simple discrete masks are insufficient to represent such continuous geometric boundaries. Furthermore, excessive template-based approaches limit the generalization ability of large language models, making them unable to flexibly cope with unknown and complex faults. Summary of the Invention

[0010] The purpose of this invention is to provide an online correction method and system for neural symbol dual-stream closed loops, aiming to solve the technical problems of existing technologies in dealing with the illusion of action of network-controlled intelligent agents, such as the inability of nondeterministic soft constraints to prevent out-of-bounds behavior, the inability of post-verification lag to meet real-time requirements, and the inability of discrete templates to handle semantic-level dynamic state constraints.

[0011] To achieve the above objectives, the first aspect of the present invention provides an online error correction method for neural symbolic dual-stream closed loops, comprising: In the process of autoregressive generation of network action tokens by the Transformer decoder of the large language model, the hidden vector of the current decoding step is extracted as the controlled state in a preset fixed correction layer, and the controlled state is normalized to a unit hypersphere to obtain the normalized state; wherein, the autoregressive generation process of the Transformer decoder constitutes the main neural pathway. The preset rule template library is parsed through the symbolic side path, and slot filling is performed based on the current network observation and generation context to obtain the structured rule set of the current decoding step. The structured rule set is then mapped to the set of allowed cones and the set of forbidden cones on the unit hypersphere. The violation energy is calculated based on the normalized state, the allowed cone set, and the forbidden cone set, and a gating signal is generated based on the comparison result of the violation energy and the preset energy threshold. If the gating signal indicates that correction is triggered, then the minimum perturbation is solved in the tangent space of the normalized state and mapped back to the unit hypersphere by the shrinkage operator to obtain the corrected state; Based on the correction state, the cache entries corresponding to the current decoding step in the multi-head key-value cache of the fixed correction layer and each layer after the fixed correction layer are synchronously updated. A consistency check is performed on the network action token generated in the current decoding step and the network action constituted by the network action token. If the check passes, the network action is issued; if the check fails, a preset security default action is issued and audit information is recorded. The security default action is a preset backup network action.

[0012] Further, the step of extracting the hidden vector of the current decoding step as a controlled state in a preset fixed correction layer, and normalizing the controlled state to a unit hypersphere to obtain a normalized state, includes: At the fixed bias correction layer where the parameters remain unchanged during the autoregressive inference process of the Transformer decoder, the hidden vector of the current decoding step is extracted as the controlled state. The controlled state is normalized according to a preset normalization rule, so that the controlled state is mapped onto the unit hypersphere while retaining the direction information, thus obtaining the normalized state; the normalization rule includes a numerical stability term.

[0013] Through the above technical solutions, the subsequent rule cone discrimination, violation energy calculation and minimum perturbation optimization are all applied to a unified and online accessible variable, avoiding the uncontrollable impact of directly rewriting the model parameters; at the same time, the introduction of numerical stability terms avoids numerical instability caused by the norm approaching zero in extreme cases; and since the normalized state is located on the unit hypersphere, all subsequent constraint discrimination can be quickly performed on the unit hypersphere through cosine similarity.

[0014] Further, mapping the structured rule set to the set of allowed cones and the set of forbidden cones on the unit hypersphere includes: For each rule in the structured rule set, one or more concept keys are determined, and a set of anchor vectors corresponding to the concept keys is obtained from a preset semantic anchor library; Based on the set of anchor point vectors, construct the axis vector and half-angle parameters of the rotationally symmetric cone on the unit hypersphere, and configure the rule weights of the rotationally symmetric cone and the angle safety margin of the taboo cone; The mapping results are divided into the set of allowed cones, which represent the requirement to enter compliant semantic regions, and the set of forbidden cones, which represent the requirement to stay away from dangerous semantic regions, according to the rule attributes.

[0015] By limiting the convex cone to a rotationally symmetric cone using the above technical solutions, online determination of whether the rules are met only requires calculating the dot product once and comparing it with the threshold, thus achieving real-time monitoring of the token; at the same time, the safety margin of the taboo cone's angle is used to establish a buffer zone before entering the forbidden zone, thereby improving robustness to sampling noise and subsequent drift.

[0016] Furthermore, the preset semantic anchor library is constructed in the following way: Extract operation instruction sequences marked as successful and matching the corresponding concept key from historical network security audit logs, and whose confidence level is greater than a preset confidence threshold, and classify them according to the concept key to obtain an anchor source set; For each sequence of operation instructions in the anchor source set, the large language model with input parameters frozen, the normalized hidden vector of the corresponding token at the fixed correction layer is extracted as the anchor vector of the concept key, forming the preset semantic anchor library; Alignment verification is performed on the preset semantic anchor library based on the nearest neighbor retention rate index. When the nearest neighbor retention rate is lower than the preset alignment threshold, anchor vectors whose distance from the center vector of the anchor vector set corresponding to the concept key is greater than the preset outlier threshold are removed, or the rule weight of the corresponding concept cone is reduced.

[0017] The above technical solutions overcome the problem of misalignment between symbol rules and vector space semantics in traditional inventions, making rule constraints interpretable and verifiable; and by using the nearest neighbor retention rate as a verifiable alignment indicator, the unverifiable "heap concept" is avoided.

[0018] Furthermore, the method also includes: Calculate the angle between the axis vectors of any two cones in the allowed cone set and the forbidden cone set; Using the included angle of the axis and the corresponding half-angle parameter, perform geometric discrimination of implied and mutually exclusive relationships; When the included angle between the axes of two allowed cones in the allowed cone set or two forbidden cones in the forbidden cone set and the corresponding half-angle parameter satisfy the preset implication condition, it is determined that there is a geometric implication relationship between the two allowed cones or the two forbidden cones, and implication compression is performed on the two allowed cones or the two forbidden cones. The implication compression includes deleting the implied redundant cone or reducing the rule weight corresponding to the implied redundant cone. When the included angle between the axes of two allowed cones in the allowed cone set and their corresponding half-angle parameters satisfy a preset mutual exclusion condition, and the rules corresponding to the two allowed cones are both marked as mandatory, or when the included angle between the axes of one allowed cone in the allowed cone set and one taboo cone in the taboo cone set and their corresponding half-angle parameters satisfy a preset mutual exclusion condition, and the corresponding allowed cone rule is marked as mandatory, it is determined that there is a geometric conflict in the structured rule set, and the corresponding rule is discarded or the security default action is issued according to the preset rule priority.

[0019] The above technical solutions reduce redundant constraints and identify infeasible combinations in advance, thereby reducing the number of energy terms, reducing false triggers and inference delays, and avoiding ineffective iterations on the set of infeasible constraints during the optimization process.

[0020] Furthermore, before calculating the violation energy based on the normalized state, the set of allowed cones, and the set of forbidden cones, the method further includes: Based on the mutually exclusive semantic relationships of rules in the structured rule set and the preset rule priority, a symbol-level conflict pre-detection is performed on the rules in the structured rule set; If two rules that are both marked as mandatory are found to be semantically mutually exclusive, it is determined that there is a symbolic conflict in the structured rule set. The priority rule of the two rules is determined according to the preset rule priority, and the rule constraint corresponding to the other rule is excluded from the current constraint combination. If the two rules have the same preset rule priority, making it impossible to determine the priority rule, or if there are still rules in the structured rule set that are marked as mandatory and semantically mutually exclusive after excluding the rule constraint corresponding to the other rule from the current constraint combination, then the security default action is directly issued, and the conflict rule set and triggering reason are recorded.

[0021] By employing the above technical solutions, the principle of "logical solution preceding geometric optimization" is followed to resolve conflicts, thus avoiding ineffective iterations in a space where no solution exists during the optimization process. This ensures the feasibility of the invention under complex network rule combinations. Furthermore, when core conflicts cannot be eliminated, a safe default action is directly issued and the set of conflict rules and the triggering reasons are recorded to ensure that the final issued action has deterministic security.

[0022] Further, the step of calculating the violation energy based on the normalized state, the set of allowed cones, and the set of forbidden cones, and generating a gating signal based on the comparison result of the violation energy and a preset energy threshold, includes: For each allowed cone in the set of allowed cones, the allowed cone out-of-bounds energy is calculated using a hinge-type function based on the cosine similarity between the normalized state and the axis vector of the allowed cone. For each taboo cone in the taboo cone set, the violation energy of the taboo cone is calculated using a hinge-type function based on the cosine similarity between the normalized state and the axis vector of the taboo cone, as well as a preset angular safety margin. The allowed cone out-of-bounds energy and the forbidden cone violation energy are weighted and summed according to the rule weight and the taboo priority factor to obtain the violation energy; When the violation energy exceeds the preset energy threshold, the gating signal is set to trigger correction. When the violation energy is not greater than the preset energy threshold, the gating signal is set to not trigger correction, and decoding continues according to the original autoregressive process of the Transformer decoder; wherein the preset energy threshold is dynamically set according to the network risk level.

[0023] The above technical solutions enable energy to be both interpretable and express the risk preferences of the network side; at the same time, the gating ensures that optimization is only initiated when the inference state deviates significantly from the legal region, thereby concentrating additional computation on high-risk steps, meeting the network system's requirements for real-time performance and throughput, and reducing interference with the coherence of normal inference.

[0024] Furthermore, if the gating signal indicates that correction is triggered, then the minimum perturbation is solved in the tangent space of the normalized state and mapped back to the unit hypersphere through the shrinking operator to obtain the corrected state, including: Construct a tangent space orthogonal to the normalized state, and restrict the perturbation vector within the tangent space; Construct a minimum perturbation objective function that includes a perturbation magnitude term and a violation energy term, wherein the perturbation magnitude term is used to keep the constrained state in the neighborhood of the semantic path corresponding to the Transformer decoder when no correction is triggered, under the sense of likelihood preservation. The hinge term in the violation energy is processed by subgradient or smooth approximation, and the gradient is projected onto the tangent space to obtain the projected gradient. The perturbation vector is iteratively updated along the descent direction of the projected gradient with a preset step size, and the update result is mapped back to the unit hypersphere through the shrinkage operator; wherein, the iterative process is constrained by both the maximum number of iterations and the time budget. The iteration stops when the violation energy drops below the preset energy threshold, or reaches the maximum number of iterations, or the time exceeds the time budget, and the shrinkage result corresponding to the stop is taken as the correction state.

[0025] The above technical solutions force the corrected state to remain in the neighborhood of the original high-probability semantic path as much as possible, thereby ensuring the naturalness of the generated network instructions in terms of syntax and pragmatics, and avoiding the generation of garbled text that is compliant but unreadable or deviates from the original meaning of the instructions. At the same time, through the dual constraints of the maximum number of iterations and time budget, a rigid balance is achieved between security and real-time performance, and the network control flow is never blocked in pursuit of the optimal solution.

[0026] Further, the step of synchronously updating the cache entries corresponding to the current decoding step in the multi-head key-value cache of the fixed bias correction layer and each subsequent layer based on the correction state includes: The corrected state replaces the hidden state of the fixed bias correction layer in the current decoding step, and the forward calculation of each layer after the fixed bias correction layer is continued to be completed to obtain the corrected hidden state of each layer in the current decoding step. For the fixed correction layer and each layer and attention head after the fixed correction layer, the key vector and value vector are recalculated based on the key projection matrix and value projection matrix of the corresponding layer and the corresponding attention head using the corrected hidden state. Only replace the key cache entries and value cache entries in the multi-head key-value cache whose time index is the current decoding step, while keeping the cache entries corresponding to other time indices unchanged.

[0027] The above technical solutions avoid the problem that when only the internal state is corrected but the cache is not updated, subsequent attention will still read the old key vector and value vector and pull the inference trajectory back to the violation direction. By only replacing the cache entries of the current decoding step to control the overhead and keep the history unchanged, the correction effect is propagated along the attention path to the subsequent inference chain, forming a step-consistent controlled evolution, and continuously suppressing the violation direction during the generation of network action chains.

[0028] Further, a consistency check is performed on the network action token generated in the current decoding step and the network action constituted by the network action token. If the check passes, the network action is issued; if the check fails, a preset security default action is issued and audit information is recorded, including: For the network action token generated in the current decoding step and the network action constituted by the network action token, predicate verification is performed according to each rule in the structured rule set; If a rule marked as mandatory is not satisfied, or a rule marked as taboo is triggered, or the violation energy is still greater than the preset energy threshold due to reaching the maximum number of iterations or the time budget during the iteration process of the minimum perturbation solution, then the correction is deemed to have failed. When the current correction fails, select the security default action from the preset security default action set according to the risk type and issue it. The preset security default action set includes at least one or more of the following: refuse to execute change-type actions and return an alarm and reason, only perform read-only probe, roll back or undo to security snapshot, transfer to manual approval, and transfer to work order flow. The audit information is recorded, which includes at least the violation rule identifier, violation energy value, preset energy threshold, budget exhaustion flag, rule parser version, and consistency checker version.

[0029] The above technical solutions resolve the potential nonlinear gap between hidden layer correction and final output mapping, ensuring that the final issued action has deterministic security. At the same time, by recording audit information such as violation rule identifiers, violation energy values, preset energy thresholds, budget exhaustion markers, rule parser versions, and consistency checker versions, the entire correction process becomes traceable and auditable.

[0030] Secondly, the present invention provides an online error correction system for a neural symbol dual-stream closed loop, comprising: The state extraction module is used to extract the hidden vector of the current decoding step as a controlled state in the process of autoregressive generation of network action tokens by the Transformer decoder of the large language model, and normalize the controlled state to a unit hypersphere to obtain a normalized state; wherein, the autoregressive generation process of the Transformer decoder constitutes the main neural pathway. The rule mapping module is used to parse the preset rule template library through the symbol side path, and perform slot filling based on the current network observation and generation context to obtain the structured rule set of the current decoding step, and map the structured rule set to the set of allowed cones and the set of forbidden cones on the unit hypersphere; An energy gating module is used to calculate the violation energy based on the normalized state, the set of allowed cones, and the set of forbidden cones, and to generate a gating signal based on the comparison result of the violation energy and a preset energy threshold. The perturbation correction module is used to solve for the minimum perturbation in the tangent space of the normalized state and map it back to the unit hypersphere through the shrinkage operator if the gating signal indicates that correction is triggered, so as to obtain the corrected state. The cache update module is used to synchronously update the cache entries corresponding to the current decoding step in the multi-head key-value cache of the fixed correction layer and each layer after the fixed correction layer based on the correction state; The output module is used to perform consistency verification on the network action token generated in the current decoding step and the network action composed of the network action token. If the verification passes, the network action is issued; if the verification fails, a preset security default action is issued and audit information is recorded. The security default action is a preset backup network action.

[0031] Compared with the prior art, the present invention has the following beneficial effects: 1. By extracting hidden states in the Transformer decoder and normalizing them to a unit hypersphere, and combining the allowable cone and taboo cone constraints generated by the symbolic rule base, the network actions generated by the agent are monitored in real time and pulled back with minimal perturbation. This enables immediate correction of illegal actions and synchronous updating of key-value cache, thereby ensuring the security and compliance of the action chain in high-risk network environments.

[0032] 2. Introduce semantic anchors and nearest neighbor retention rate alignment mechanisms from historical audit logs to make rule constraints interpretable and verifiable. Through automatic weight reduction of conflict rules or security fallback strategies, ensure that the system can be implemented in complex network scenarios.

[0033] 3. By geometricizing auditable symbolic rules into rotationally symmetric allowed and forbidden cones on a sphere in the semantic space, and using semantic anchors mined from historical audit logs in conjunction with nearest neighbor retention rate for alignment verification, the rule constraints are interpretable, verifiable, and can achieve token-level real-time discrimination with a single dot product threshold comparison, thereby avoiding the traditional problem of "writing rules but semantic misalignment and difficulty in implementation".

[0034] 4. When the correction is triggered, the model parameters are not changed. Instead, the hidden state is pulled back with minimal perturbation in the tangent space and the multi-layer multi-head key-value cache is updated simultaneously. This ensures that the correction not only maintains the original high-probability semantic path, but also continues to take effect along the attention memory step by step. This avoids the situation where only the current step is changed but the old cache pulls it back to the wrong direction. From an engineering perspective, this achieves a stable, low-risk, and controllable latency online security control closed loop.

[0035] 5. It improves the real-time performance and security of network control agents, while also taking into account the flexibility and generalization ability of action generation, realizing a low-overhead, deployable, and auditable network automation control solution, effectively solving the problems of unauthorized access, conflicts, and logical inconsistencies in existing technologies. Attached Figure Description

[0036] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments and, together with the description, serve to explain the principles of the invention. Other embodiments and many anticipated advantages of the embodiments will be readily recognized as they become better understood through reference to the following detailed description. Other features, objects, and advantages of this application will become more apparent from reading the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a flowchart of the online correction method for neural symbol dual-stream closed loop provided in an embodiment of the present invention; Figure 2 This is a framework diagram of the online error correction system for the neural symbol dual-flow closed loop provided in an embodiment of the present invention. Detailed Implementation

[0037] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0038] refer to Figure 1 This embodiment provides an online bias correction method for a neural symbolic dual-stream closed loop. This method addresses the risk of action illusions, such as overreach, conflict, or inconsistency, that may occur during the autoregressive generation of network actions by a network-controlled agent. It extracts the hidden vector of the current decoding step as the controlled state at a fixed bias correction layer in a Transformer and normalizes it to a sphere. Then, through the symbolic side path, an auditable rule template is instantiated under the current network observation and context conditions and mapped to a set of spherical allowed and forbidden cones. A monitor measures the degree of violation using cosine boundary energy and employs budget-aware gating for triggering. After triggering, the minimum perturbation pullback is solved in the tangent space to return the state to the legal semantic region while preserving the original high-probability semantic path as much as possible. Subsequently, a multi-layered multi-head key-value cache (KV-Cache) is updated synchronously. Finally, the output action is checked for consistency. If it still does not meet the requirements, a deterministic safe default action is output and audit information is recorded. This achieves real-time, interpretable, and implementable safety constraints on the network action chain without changing the model parameters. Specifically, it includes the following steps: S100, State Extraction and Spherical Normalization: During the autoregressive generation of network action tokens by the Transformer decoder in the large language model, the hidden vector of the current decoding step is extracted as a controlled state in a preset fixed bias correction layer, and the controlled state is normalized to a unit hypersphere to obtain a normalized state; wherein, the autoregressive generation process of the Transformer decoder constitutes the main neural pathway; specifically as described in steps 1.1 to 1.4 below; S200, Rule Instantiation and Cone Constraint Mapping: The preset rule template library is parsed through the symbolic side path, and slot filling is performed based on the current network observation and generation context to obtain the structured rule set of the current decoding step. The structured rule set is then mapped to the set of allowed cones and the set of forbidden cones on the unit hypersphere; as described in steps 2.1 to 3.3 below. S300, Violation Energy Calculation and Gating Trigger: Calculate the violation energy based on the normalized state, the allowed cone set, and the forbidden cone set, and generate a gating signal based on the comparison result of the violation energy and a preset energy threshold; specifically as described in steps 4.1 to 4.2 below; if the gating signal indicates that correction is triggered, then execute step S400; if the gating signal indicates that correction is not triggered, then skip steps S400 and S500 and directly execute step S600; S400, Minimum perturbation correction in tangent space: Solve for the minimum perturbation in the tangent space of the normalized state and map it back to the unit hypersphere through the shrinking operator to obtain the corrected state; specifically as described in steps 5.1 to 5.2 below; S500, KV-Cache Consistency Update: Based on the correction state, the cache entries corresponding to the current decoding step in the multi-head key-value cache of the fixed correction layer and each layer after the fixed correction layer are synchronously updated; specifically as described in steps 6.1 to 6.2 below; S600, Output Consistency Verification and Security Backup: Perform consistency verification on the network action token generated in the current decoding step and the network action constituted by the network action token. If the verification passes, the network action is issued; if the verification fails, a preset security default action is issued and audit information is recorded. The security default action is a preset backup network action; as described in step 6.3 below.

[0039] The implementation details of each step are explained below.

[0040] Step 1: Controlled State Spherization and Neural-Symbolic Loop Modeling Step 1.1 Composition of the intelligent network control system. To uniformly characterize the network control environment based on a large model, this embodiment establishes a system model that includes a neural network generation module, a symbolic rule base, and a controlled network environment.

[0041] The neural generation module is a large language model based on the Transformer architecture, responsible for generating action sequences based on network observations and historical context. The symbol rule base contains a set of predefined, auditable rule templates strongly related to business logic, defining the security boundaries of network operations. The controlled network environment refers to the actual physical or virtual network infrastructure, whose state changes dynamically over time and provides feedback to the agent's actions.

[0042] Step 1.2 Hyperspherical State Space and Normalized State Definition. To ensure that subsequent rule cone discrimination, violation energy calculation, and minimum perturbation optimization all operate on unified and online-accessible variables, and to avoid the uncontrollable effects of directly rewriting model parameters, this embodiment uses a fixed bias correction layer that remains unchanged throughout the entire inference process of the Transformer decoder when generating the t-th action token. The hidden vector in the correction layer during the decoding step is denoted as the controlled state as follows: ; in, Let t be the state of the t-th action. The selected correction layer index, To hide dimensions in the model, This represents the number of model layers. To eliminate the influence of modulus variations on the discrimination while preserving directional information, this embodiment normalizes and maps the controlled state to a unit hypersphere. Defined as: ; Furthermore, the state vector is normalized to a sphere to enable fast discrimination using cosine similarity: ; in It is a numerically stable term, used to avoid instability caused by the norm approaching zero in extreme cases. Because From time to time All subsequent constraint determinations can be performed within [the specified range]. The above method uses cosine similarity for rapid discrimination.

[0043] Step 1.3 Establishing the Unconstrained Autoregressive Dynamics Equation. To characterize the baseline evolution of the model inference chain when correction is not triggered, and to unify sampling randomness and network environment mutations into equivalent perturbation terms, thus providing a reference for "minimum perturbation pullback," this embodiment first defines the unconstrained autoregressive dynamics equation. When correction gating is not triggered, the system can directly generate network actions along this baseline, and its internal state can be abstracted as a state transition process driven by network observations and historical generation sequences: ; in It is a freeze parameter The inference engine maps the state changes induced by the correction layer. This represents the generated token sequence, i.e., the generated network action fragments. It is a dynamic network observation. This formula is used to characterize the equivalent perturbation of inference trajectory caused by sampling randomness and sudden changes in the network environment. It represents the baseline evolution of an uncontrolled inference chain; when corrective gating is triggered, subsequent corrections occur on spherical variables. By applying minimal perturbation and mapping back to the injection point through normalization, the generated trajectory can be pulled back to the compliant direction without changing the model parameters.

[0044] Step 1.4 Construct a neural-symbolic dual-stream architecture and form a closed-loop intervention interface. To enable auditable symbolic rules on the network side to constrain neural representations online and achieve a closed-loop intervention of "discrimination-triggering-correction-consistency update" with low computational overhead, this embodiment adopts a dual-stream architecture with parallel neural main pathways and symbolic side pathways. Let the rule template library be... After instantiation, it is mapped to a set of geometric cone constraints, and the gating trigger and key-value cache are updated synchronously to ensure consistency in subsequent inference.

[0045] The symbolic side path first accesses the rule template library. Perform semantic parsing and slot filling, construct the rule set for this step based on the current network state and context, and map it to a set of geometric cone constraints: ; in Templated rules Combining current network observation and generation context, It is a set of structured rules. In the current decoding step The total number of rules that are currently in effect. Each rule... It includes the subject of constraint, the object of constraint, the action of constraint, and the condition of constraint.

[0046] Subsequently, the structured rule set Mapped to a set of geometric cone constraints on a sphere : ; Transform each symbolic rule into a permissive cone and a taboo cone on a sphere, and output the parameters and weights of the permissive and taboo cones. For each rule First, map to one or more concept keys. Then retrieve the set of anchor vectors for that concept from the anchor library. Based on this, construct the axis vectors Half-angle parameter of the rotating diagonal cone : ; in Indicates the calculation of the first Statistical functions for quantiles. To cover quantiles, it means at least The historical success of the proportion lies within the allowable cone. This indicates that the projection of each anchor point vector onto the corresponding axis vector The set of inner integral distributions on the weights. Reflecting rule priority, the safety margin of the taboo cone. This indicates that the higher the risk, the larger the margin. Among them... This represents the preset minimum safety margin constant. To control the linear scaling factor of risk sensitivity, Based on the current network observation status The quantitative value of the dynamic risk level obtained from the assessment.

[0047] The monitor is then based on the normalized state. Calculate the violation energy and gate-trigger correction: ; in Used to quantify illegal energy. The threshold value can be adaptively set according to the network risk level. This is a standard indicator function; the value is 1 if the condition within the parentheses is true, and 0 otherwise. When... When this occurs, it indicates that the correction mechanism has been triggered.

[0048] To avoid inconsistencies between the corrected model output and the incremental decoding cache, this embodiment maintains a multi-head key-value cache in each layer's attention module during the autoregressive decoding process of the Transformer. This cache stores data up to the current decoding step. key vector sequence AND value vector sequence To support incremental updates for attention calculation in subsequent steps, this embodiment specifies that the internal state of the current step is first obtained in the correction layer. Its normalized state Then calculate the energy and the gating signal, if The minimum perturbation is then solved and the internal state of the layer is replaced. The forward and output calculations of subsequent layers are then completed, and the multi-head key-value cache entries corresponding to this step are updated synchronously to keep the cache consistent with the final output. This solidifies the correction effect into the attention memory of the current step and subsequent steps.

[0049] Step 2: Aligning the rotationally symmetric rule cone representation with audit semantic anchor points Step 2.1 Define the rotationally symmetric cone representation. To reduce computational complexity and accommodate the attention mechanism, this embodiment limits the convex cone to a rotationally symmetric cone. For any concept We can use a rotationally symmetric cone to represent the semantic region that satisfies this concept on a sphere: ; in The unit axis vector, This is the half-angle of the aperture. To avoid conflicts between the description of the convex cone and the parameter range, the half-angle is limited to... This ensures the set remains geometrically convex and guarantees that the depth of the out-of-bounds error changes monotonically with the dot product. Thus, online determination of rule satisfaction requires only one computation. and with threshold The comparison enables real-time monitoring of the token.

[0050] Step 2.2 Constructing a semantic anchor set and alignment index based on audit logs. To overcome the misalignment between symbol rules and vector space semantics in traditional inventions, this embodiment introduces a semantic anchor mining mechanism based on historical audit logs. First, extract high-confidence operation instruction sequences (i.e., operation instruction sequences with confidence greater than a preset confidence threshold) marked as "Success" and conforming to concept c from the historical security audit logs of the network system. This sequence is denoted as the anchor source set. and by concept key The anchor source set is obtained by classification. Then, through topological isomorphic mapping, each instruction sequence is... Input the frozen model and extract the correction layer. The normalized hidden vector corresponding to the sequence token is used as the anchor point: ; Forming an anchor point library . This indicates vector normalization. Indicates the sequence of indicators The time step index of the corresponding concept token is triggered in the middle. This embodiment uses the nearest neighbor retention rate (NPR) as the verifiable alignment metric. Let... For symbolic space distance, Let the symbol be the nearest neighbor set, and let the geometric distance be... Let be the cosine distance, where and These represent any two normalized anchor vectors from the semantic anchor library that are used in the calculation. It is the cosine similarity between two anchor vectors. It is calculated using the geometric nearest neighbor set. Therefore, NPR is defined as: ; in Represents the set of anchor points The total number of instruction sequence samples in the data. This is the upper limit of the selected nearest neighbor range used for comparison. When If the value is 0.6, the alignment is considered insufficient: remove anchor vectors whose distance to the center vector of the anchor vector set corresponding to the concept key is greater than a preset outlier threshold, or reduce the weight of the concept cone. ( This avoids the unverifiable "heap concept".

[0051] Step 2.3 Geometric discrimination of implication and mutual exclusion, and online consistency processing. To reduce redundant constraints and identify infeasible combinations early, this embodiment defines the included angle between the two conceptual cone axes: ; and Representing concept cones and concept cone The unit axis vector. And online consistency processing is performed using the following sufficient conditions. Concept cone. and concept cone aperture radius and If the following conditions are met: ; Then it can be determined ,Right now Contains When the above implication condition is satisfied between two allowed cones in the allowed cone set or between two taboo cones in the taboo cone set, implication compression is performed on the two allowed cones or the two taboo cones. This implication compression includes deleting implied redundant cones during online constraint set construction or reducing the rule weights corresponding to implied redundant cones, thereby reducing the number of energy terms, minimizing false triggers, and reducing inference latency. If the following conditions are met: ; but When the relationship appears between allowable cone constraints that must be satisfied simultaneously, or between allowable and taboo cones and the corresponding allowable cone rule is marked as mandatory, it can be determined that there is a geometric conflict in the structured rule set. The corresponding rule is discarded according to the preset rule priority, or the subsequent conflict resolution and safety fallback branch is entered to issue the safety default action, so as to avoid the optimization process from performing invalid iterations on the infeasible constraint set.

[0052] Step 3: Instantiation of dynamic network rules and pre-resolution of logical conflicts Step 3.1 Instantiate network rules. Rule template library. Network rules are described using slots. This means that variable fields are reserved in the rules to represent network entities, action parameters, and activation conditions. These slots are used to apply abstract rules to the actual network objects and control boundaries. The system-side path is... Real-time network observation Extract and determine slot assignments based on context information. Then, slot filling and filtering are performed on the rule template to obtain the set of structured rules that need to be followed at the current moment. .

[0053] Through network rule instantiation, the same abstract rule can be instantiated into different concrete constraints under different network states and permission domains, thereby enabling the subsequent geometric constraint set. It can dynamically change with the environment and remain consistent with the traceable rules and operation records on the network side. At the same time, by retrieving and filling values ​​for variable fields in the rules, the abstract rules are specified to network objects and control boundaries, reducing the risk of inconsistencies or unauthorized actions.

[0054] Step 3.2 Allow and forbidden cone sets with legal region semantics. (By...) The resulting cone set is partitioned into allowed cone sets. (Required compliant semantic regions) and the set of taboo cones (dangerous semantic regions that must be avoided), and introduce rule weights. Indicates priority. The corresponding valid region is defined as: ; Represents the set of allowed cones The intersection of all allowed cone-defined compliant semantic regions in the middle. Represents the set of taboo cones The intersection of all forbidden cones on the complement region on the unit hypersphere is taken. The complement operation occurs on the sphere. Above. According to this definition, a legal state must satisfy all mandatory compliance directions while avoiding security-restricted directions. Even overall... It may be non-convex, but subsequent energy minimization can still provide a feasible approximate solution online and trigger a fallback strategy in case of conflict.

[0055] Step 3.3 Symbol-level conflict pre-detection and infeasibility set resolution. Logical contradictions in the rules themselves may cause subsequent geometric optimization to fall into oscillation or deadlock, or subsequent optimization may fail to reduce the energy to the threshold even if the budget is reached, resulting in an empty feasible region. In order to fill the gap and make the system feasible under real network rule combinations, this embodiment resolves the contradictions according to the principle of "logical solution before geometric optimization".

[0056] Before inputting the set of geometric constraints into the violation energy calculation or optimizer, a symbolic-level conflict detection is performed on the rules in the structured rule set based on the semantic mutual exclusion relationships of the rules and the preset rule priorities. If it is found that the rules are semantically mutually exclusive and are all marked as mandatory, then a symbolic-level conflict is determined to exist in the structured rule set. At this time, the system immediately determines the priority rule among the two rules according to the preset rule priorities, and excludes the rule constraints corresponding to the other rule from the current constraint combination to remove redundancy and ensure that the geometric constraints input into the optimizer correspond to the legal regions. Non-empty. This avoids the optimization process from performing invalid iterations in a space where no solution exists, thus ensuring the feasibility of this invention under complex network rule combinations.

[0057] If the two rules have the same preset rule priority, making it impossible to determine the priority rule, or if after excluding the rule constraint corresponding to the other rule from the current constraint combination, there are still rules in the structured rule set that are both marked as mandatory and semantically mutually exclusive, then the symbol-level conflict is determined to be unresolved, and a safe default action is output. The set of conflict rules and their triggering reasons are recorded for auditing purposes. (Security default action) Include Refuse to execute change actions and return an alarm with the reason. Perform only read-only probes Rollback or undo to a safe snapshot Transfer to manual approval or work order workflow. If unauthorized access or a non-existent object is involved, a rejection command will be output. Or transfer to manual approval instruction If information is insufficient, output the default security action of performing only read-only probes. If some changes have been issued and the risk is high, a rollback command will be output. .

[0058] Step 4: Modeling of Cosine Boundary Violation Energy and Budget-Aware Gating Trigger Step 4.1 Define the energy function based on the cosine boundary. Define the normalized state. illegal energy It consists of both permissive and taboo constraints. For permissive cones... Hinge-type out-of-bounds energy is defined based on cosine similarity: ; in Indicates that cones are allowed half-angle of the aperture, This represents the boundary cosine threshold of the allowed cone. When A state is considered to be within the allowed cone, with an energy of 0; otherwise, the energy increases linearly with the depth of the breach, which facilitates gradient-driven pullback. For the forbidden cone... Introducing an angle safety margin And defined as: ; in This is used to establish a buffer zone before entering the restricted area, thereby improving robustness to sampling noise and subsequent drift. The overall energy is defined as: ; in and These represent the controlled states respectively. The out-of-bounds energy relative to the corresponding permissible cone and the violation energy relative to the corresponding forbidden cone. Reflecting rule priority, This is used to reinforce taboo priority, so that energy can be both explained and expressed in terms of network-side risk preferences.

[0059] Step 4.2 Calculate budget-aware sparse trigger gating. To meet the millisecond-level latency requirements of computer network control, this embodiment introduces a budget-aware sparse correction mechanism. The gating signal is defined as: ; in It is a trigger threshold that can be dynamically set according to the risk level. If the current inference state does not trigger the correction gating, the system continues decoding and generating network actions along the main path. Only when... When this occurs, the minimum perturbation optimization process in step five of the correction activation is triggered. This gating ensures that optimization is only initiated when the inference state significantly deviates from the legal region, thereby concentrating additional computation on high-risk steps, meeting the network system's requirements for real-time performance and throughput, and reducing interference with the coherence of normal inference.

[0060] Step 5: Minimum perturbation pullback in tangent space and projection gradient correction optimization Step 5.1 Construct a tangent space optimization objective based on likelihood preservation. Since the regular cone discrimination depends only on the direction of the vector and is independent of the magnitude, in order to minimize the perturbation to the original inference representation while satisfying the constraints, this embodiment restricts the state update to a direction adjustment that keeps the magnitude unchanged, i.e., within a unit hypersphere. Optimization is performed on top of this. Therefore, controllable perturbations can be limited to the tangent space: ; in This indicates that the disturbance is orthogonal to the current direction. Let be the perturbation vector applied to the current normalized state. From a first-order approximation, only the direction is changed, not the magnitude. To map the update result back to the sphere, a shrinkage operator is defined: ; in To ensure numerical stability, this embodiment further constructs a minimum perturbation target: ; The term not only geometrically constrains the perturbation magnitude, but is also probabilistically equivalent to maximizing the likelihood of the original language model. It forces the modified state... By staying within the neighborhood of the original high-probability semantic path as much as possible, the generated network instructions are guaranteed to be syntactically and pragmatically natural, avoiding the generation of garbled text that is compliant but unreadable or deviates from the original meaning of the instructions. Forces energy to decrease in order to return to the compliance zone. The preset regularization weight coefficient is used to control the trade-off between the two.

[0061] Step 5.2 Projective gradient descent with budget constraints and early stopping strategy. To handle the problem of hinge terms being non-differentiable at inflection points, subgradients or softplus smoothing approximations can be used to stabilize gradient calculations. Let... Projecting the gradient onto the tangent space yields: ; For the first Gradient vector of objective function during step iteration The transpose operation ensures that the update direction satisfies the orthogonality constraint. Then, the step size is adjusted accordingly. Iteration: In order to achieve a rigid balance between safety and real-time performance, the iterative process is subject to a maximum number of iterations. With time budget Dual constraints: ; Indicates the first The gradient vector of the objective function, after orthogonal projection during each iteration, lies in the tangent space. Or reach the budget limit, that is Or takes longer The iteration stops. Let For the iterative index that satisfies the stopping condition, and take... , As a result of correction. If it achieves... or Still The remaining risks will be handled through the fallback mechanism in section 6.3, and the network control flow will never be blocked in pursuit of the optimal solution.

[0062] Step Six: Multi-layer, multi-head key-value cache consistency update and output fallback verification Step 6.1 Multi-layer multi-head key-value recomputation. The Transformer's incremental decoding relies on the multi-head key-value cache for each layer and head. If only the internal state is corrected without updating the cache, subsequent attention will still read the old value. And it pulls the reasoning trajectory back to the direction of the violation. To ensure consistency, the correction occurs at layer... Then, using the corrected state, continue the forward pass of the subsequent layers to obtain the corrected hidden state of each layer. and for layers All heads Recalculation: ; in For the corresponding layer and the corresponding head projection matrix, and These represent the key vector and value vector computed by the multi-head attention mechanism, respectively, ensuring that the description can be directly mapped to the actual model implementation.

[0063] Step 6.2 Replace the index Multiple key-value cache entries. To control overhead and maintain historical integrity, only entries with the correct time index are replaced in the cache. The entries, i.e., the layers , implement: ; and They represent the first Layer, First Each attention head is in the multi-head key-value cache, with the corresponding time index being... The key cache entries are compared with the value cache entries. This is then performed in the next attention calculation: ; in This represents the feature dimension of the key vector in a multi-head attention mechanism. This is the query vector for the next decoding step.

[0064] because The replaced number has been included. Therefore, the corrective effect will propagate along the attention path to the subsequent reasoning chain, forming a step-consistent controlled evolution, thereby continuously suppressing the direction of violation during the generation of network action chains.

[0065] Step 6.3 Output Consistency Verification and Loopback Implementation. To address the potential nonlinear gap between hidden layer corrections and the final output mapping, a loopback mechanism is implemented when generating the final network actions. Then, a quick backtracking verification step is added. The system will check the generated... Does it fall under the original rules? Within the semantic scope.

[0066] ; Perform predicate validation on each rule. If a mandatory rule is not satisfied or a taboo rule is triggered, then FAIL occurs. If the correction fails due to budget exhaustion in step 5.2 (i.e., the violation energy still exceeds the preset energy threshold due to reaching the maximum number of iterations or the time budget during the iteration process of the minimum perturbation solution), then the correction is deemed to have failed. In this case, the security default action selection and distribution logic defined at the end of step 3.3 of this embodiment is directly triggered: output ; Select the security default action from the preset security default action set according to the risk type and issue it. The preset security default action set includes at least one or more of the following: refuse to execute change-type actions and return an alarm and reason, only perform read-only probe, roll back or undo to security snapshot, transfer to manual approval, and work order flow.

[0067] At the same time, audit information such as violation rule ID, energy / threshold, budget exhaustion flag, rule parser version and consistency checker version is recorded to ensure that the final issued action has deterministic security.

[0068] refer to Figure 2 This embodiment also provides an online error correction system for a neural symbol dual-stream closed loop, the system specifically comprising: The state extraction module 201 is used to extract the hidden vector of the current decoding step as a controlled state in the process of autoregressive generation of network action tokens by the Transformer decoder of the network control agent based on the large language model, and normalize the controlled state to a unit hypersphere to obtain a normalized state; wherein, the autoregressive generation process of the Transformer decoder constitutes the main neural pathway.

[0069] Specifically, the state extraction module 201 is configured to perform the fixed bias correction layer extraction and normalization process described in step one above, including extracting hidden vectors at the fixed bias correction layer where the parameters remain unchanged during the autoregressive inference process of the Transformer decoder, and mapping them to the unit hypersphere according to the normalization rule containing numerically stable terms.

[0070] The rule mapping module 202 is used to parse the preset rule template library through the symbol side path, perform slot filling based on the current network observation and generation context, obtain the structured rule set of the current decoding step, and map the structured rule set to the set of allowed cones and the set of forbidden cones on the unit hypersphere.

[0071] Specifically, the rule mapping module 202 is configured to perform the rotational symmetric cone construction, audit semantic anchor alignment, rule instantiation, and symbolic conflict pre-resolution described in steps two and three above. This includes determining the concept key for each rule in the structured rule set and obtaining the anchor vector set from the preset semantic anchor library; constructing the axis vector and half-angle parameters of the rotational symmetric cone; performing alignment verification on the preset semantic anchor library based on the nearest neighbor retention rate index; and performing symbolic conflict pre-detection and implication compression.

[0072] The energy gating module 203 is used to calculate the violation energy based on the normalized state, the set of allowed cones and the set of forbidden cones, and generate a gating signal based on the comparison result of the violation energy and a preset energy threshold.

[0073] Specifically, the energy gating module 203 is configured to perform the cosine boundary violation energy modeling and budget-aware gating triggering described in step four above. This includes calculating the boundary energy of each permissible cone using a hinge-type function, calculating the violation energy of each forbidden cone using a hinge-type function after introducing an angular safety margin, obtaining the violation energy by weighting the rule weights and forbidden priority factors, and determining whether to trigger correction through a gating signal. The preset energy threshold is dynamically set according to the network risk level.

[0074] The disturbance correction module 204 is used to solve for the minimum disturbance in the tangent space of the normalized state and map it back to the unit hypersphere through the shrinkage operator when the gating signal indicates that correction is triggered, so as to obtain the corrected state.

[0075] Specifically, the perturbation correction module 204 is configured to perform the tangent space minimum perturbation pullback and projected gradient correction optimization described in step five above, including constructing a tangent space orthogonal to the normalized state; constructing a minimum perturbation objective function containing a perturbation amplitude term and a violation energy term; applying a subgradient or a smooth approximation to the hinge term in the violation energy and projecting the gradient to the tangent space; iteratively updating the perturbation vector along the descent direction of the projected gradient at a preset step size; and performing early stopping under the dual constraints of the maximum number of iterations and the time budget.

[0076] The cache update module 205 is used to synchronously update the cache entries corresponding to the current decoding step in the multi-head key-value cache of the fixed correction layer and each layer after the fixed correction layer based on the correction state.

[0077] Specifically, the cache update module 205 is configured to perform the multi-layer multi-head key-value recalculation and cache entry replacement described in steps 6.1 and 6.2 above, including replacing the hidden state of the fixed correction layer in the current decoding step with the corrected state and continuing to calculate the corrected hidden state of each layer; recalculating the key vector and value vector for each attention head in each layer based on the corresponding key projection matrix and value projection matrix; and only replacing the key cache entries and value cache entries in the multi-head key-value cache with the time index of the current decoding step.

[0078] Output module 206 is used to perform consistency verification on the network action token generated in the current decoding step and the network action composed of the network action token. If the verification passes, the network action is issued; if the verification fails, a preset security default action is issued and audit information is recorded.

[0079] Specifically, the output module 206 is configured to perform the output consistency verification and closed-loop fallback described in step 6.3 above, including performing predicate verification on each rule in the structured rule set for network actions; selecting and issuing a security default action from the preset security default action set according to the risk type when the current correction fails; and recording audit information including violation rule identifier, violation energy value, preset energy threshold, budget exhaustion flag, rule parser version and consistency checker version.

[0080] The neural symbolic dual-stream closed-loop online error correction system provided in this embodiment, through the collaborative work of the aforementioned modules, performs real-time monitoring and minimal disturbance pullback of network actions generated by the agent without altering model parameters. This enables immediate correction of illegal actions and synchronous updates of key-value caches, thereby ensuring the security and compliance of the action chain in high-risk network environments. Simultaneously, through semantic anchors and nearest-neighbor preservation rate alignment mechanisms in historical audit logs, rule constraints become interpretable and verifiable. Furthermore, automatic weight reduction of conflict rules or a safety fallback strategy ensures the system's feasibility in complex network scenarios. This mechanism not only improves the real-time performance and security of the network control agent but also considers the flexibility and generalization ability of action generation, achieving a low-overhead, deployable, and auditable network automation control solution. It effectively solves the problems of unauthorized access, conflicts, and logical inconsistencies in existing technologies.

[0081] The specific embodiments of the present invention have been described above, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

[0082] In the description of this invention, it should be understood that the terms "upper," "lower," "inner," "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the system or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The simple fact that certain measures are recited in mutually different dependent claims does not indicate that combinations of these measures cannot be used for improvement. Any reference signs in the claims should not be construed as limiting the scope.

Claims

1. An online rectification method of a neural-symbolic dual-flow closed loop, characterized in that, The method includes: In the process of autoregressive generation of network action tokens by the Transformer decoder of the large language model, the hidden vector of the current decoding step is extracted as the controlled state in a preset fixed correction layer, and the controlled state is normalized to a unit hypersphere to obtain the normalized state; wherein, the autoregressive generation process of the Transformer decoder constitutes the main neural pathway. The preset rule template library is parsed through the symbolic side path, and slot filling is performed based on the current network observation and generation context to obtain the structured rule set of the current decoding step. The structured rule set is then mapped to the set of allowed cones and the set of forbidden cones on the unit hypersphere. The violation energy is calculated based on the normalized state, the allowed cone set, and the forbidden cone set, and a gating signal is generated based on the comparison result of the violation energy and the preset energy threshold. If the gating signal indicates that correction is triggered, then the minimum perturbation is solved in the tangent space of the normalized state and mapped back to the unit hypersphere by the shrinkage operator to obtain the corrected state; Based on the correction state, the cache entries corresponding to the current decoding step in the multi-head key-value cache of the fixed bias correction layer and each subsequent layer are synchronously updated. A consistency check is performed on the network action token generated in the current decoding step and the network action constituted by the network action token. If the check passes, the network action is issued; if the check fails, a preset security default action is issued and audit information is recorded. The security default action is a preset backup network action.

2. The online deviation correction method of the neuro-symbolic dual-flow closed loop according to claim 1, wherein, The step of extracting the hidden vector of the current decoding step as a controlled state in a preset fixed correction layer, and normalizing the controlled state to a unit hypersphere to obtain a normalized state, includes: At the fixed bias correction layer where the parameters remain unchanged during the autoregressive inference process of the Transformer decoder, the hidden vector of the current decoding step is extracted as the controlled state. The controlled state is normalized according to a preset normalization rule, so that the controlled state is mapped onto the unit hypersphere while retaining the direction information, thus obtaining the normalized state; the normalization rule includes a numerical stability term.

3. The online correction method for neural symbol dual-stream closed loop according to claim 1, characterized in that, The step of mapping the structured rule set to the set of allowed cones and the set of forbidden cones on the unit hypersphere includes: For each rule in the structured rule set, one or more concept keys are determined, and a set of anchor vectors corresponding to the concept keys is obtained from a preset semantic anchor library; Based on the set of anchor point vectors, construct the axis vector and half-angle parameters of the rotationally symmetric cone on the unit hypersphere, and configure the rule weights of the rotationally symmetric cone and the angle safety margin of the taboo cone; The mapping results are divided into the set of allowed cones, which represent the requirement to enter compliant semantic regions, and the set of forbidden cones, which represent the requirement to stay away from dangerous semantic regions, according to the rule attributes.

4. The online error correction method for neural symbol dual-stream closed loop according to claim 3, characterized in that, The preset semantic anchor library is constructed in the following way: Extract operation instruction sequences marked as successful and matching the corresponding concept key from historical network security audit logs, and whose confidence level is greater than a preset confidence threshold, and classify them according to the concept key to obtain an anchor source set; For each sequence of operation instructions in the anchor source set, the large language model with input parameters frozen, the normalized hidden vector of the corresponding token at the fixed correction layer is extracted as the anchor vector of the concept key, forming the preset semantic anchor library; Alignment verification is performed on the preset semantic anchor library based on the nearest neighbor retention rate index. When the nearest neighbor retention rate is lower than the preset alignment threshold, anchor vectors whose distance from the center vector of the anchor vector set corresponding to the concept key is greater than the preset outlier threshold are removed, or the rule weight of the corresponding concept cone is reduced.

5. The online correction method for neural symbol dual-stream closed loop according to claim 3, characterized in that, The method further includes: Calculate the angle between the axis vectors of any two cones in the allowed cone set and the forbidden cone set; Using the included angle of the axis and the corresponding half-angle parameter, perform geometric discrimination of implied and mutually exclusive relationships; When the included angle between the axes of two allowed cones in the allowed cone set or two forbidden cones in the forbidden cone set and the corresponding half-angle parameter satisfy the preset implication condition, it is determined that there is a geometric implication relationship between the two allowed cones or the two forbidden cones, and implication compression is performed on the two allowed cones or the two forbidden cones. The implication compression includes deleting the implied redundant cone or reducing the rule weight corresponding to the implied redundant cone. When the included angle between the axes of two allowed cones in the allowed cone set and their corresponding half-angle parameters satisfy a preset mutual exclusion condition, and the rules corresponding to the two allowed cones are both marked as mandatory, or when the included angle between the axes of one allowed cone in the allowed cone set and one taboo cone in the taboo cone set and their corresponding half-angle parameters satisfy a preset mutual exclusion condition, and the corresponding allowed cone rule is marked as mandatory, it is determined that there is a geometric conflict in the structured rule set, and the corresponding rule is discarded or the security default action is issued according to the preset rule priority.

6. The online error correction method for neural symbol dual-stream closed loop according to claim 1, characterized in that, Before calculating the violation energy based on the normalized state, the set of allowed cones, and the set of forbidden cones, the method further includes: Based on the mutually exclusive semantic relationships of rules in the structured rule set and the preset rule priority, a symbol-level conflict pre-detection is performed on the rules in the structured rule set; If two rules that are both marked as mandatory are found to be semantically mutually exclusive, it is determined that there is a symbolic conflict in the structured rule set. The priority rule of the two rules is determined according to the preset rule priority, and the rule constraint corresponding to the other rule is excluded from the current constraint combination. If the two rules have the same preset rule priority, making it impossible to determine the priority rule, or if after excluding the rule constraint corresponding to the other rule from the current constraint combination, there are still rules in the structured rule set that are both marked as mandatory and semantically mutually exclusive, then the security default action is directly issued, and the set of conflicting rules and the triggering reason are recorded.

7. The online error correction method for neural symbol dual-stream closed loop according to claim 1, characterized in that, The step of calculating the violation energy based on the normalized state, the allowed cone set, and the forbidden cone set, and generating a gating signal based on the comparison result of the violation energy and a preset energy threshold, includes: For each allowed cone in the set of allowed cones, the allowed cone out-of-bounds energy is calculated using a hinge-type function based on the cosine similarity between the normalized state and the axis vector of the allowed cone. For each taboo cone in the taboo cone set, the violation energy of the taboo cone is calculated using a hinge-type function based on the cosine similarity between the normalized state and the axis vector of the taboo cone, as well as a preset angular safety margin. The allowed cone out-of-bounds energy and the forbidden cone violation energy are weighted and summed according to the rule weight and the taboo priority factor to obtain the violation energy; When the violation energy exceeds the preset energy threshold, the gating signal is set to trigger correction. When the violation energy is not greater than the preset energy threshold, the gating signal is set to not trigger correction, and decoding continues according to the original autoregressive process of the Transformer decoder; wherein the preset energy threshold is dynamically set according to the network risk level.

8. The online correction method for neural symbol dual-stream closed loop according to claim 1, characterized in that, If the gating signal indicates that correction is triggered, then the minimum perturbation is solved in the tangent space of the normalized state and mapped back to the unit hypersphere through the shrinking operator to obtain the corrected state, including: Construct a tangent space orthogonal to the normalized state, and restrict the perturbation vector within the tangent space; Construct a minimum perturbation objective function that includes a perturbation magnitude term and a violation energy term, wherein the perturbation magnitude term is used to keep the constrained state in the neighborhood of the semantic path corresponding to the Transformer decoder when no correction is triggered, under the sense of likelihood preservation. The hinge term in the violation energy is processed by subgradient or smooth approximation, and the gradient is projected onto the tangent space to obtain the projected gradient. The perturbation vector is iteratively updated along the descent direction of the projected gradient with a preset step size, and the update result is mapped back to the unit hypersphere through the shrinkage operator; wherein, the iterative process is constrained by both the maximum number of iterations and the time budget. The iteration stops when the violation energy drops below the preset energy threshold, or reaches the maximum number of iterations, or the time exceeds the time budget, and the shrinkage result corresponding to the stop is taken as the correction state.

9. The online error correction method for neural symbol dual-stream closed loop according to claim 1, characterized in that, The step of synchronously updating the cache entries corresponding to the current decoding step in the multi-head key-value cache of the fixed correction layer and subsequent layers based on the correction state includes: The corrected state replaces the hidden state of the fixed correction layer in the current decoding step, and the forward calculation of each layer after the fixed correction layer is continued to be completed to obtain the corrected hidden state of each layer in the current decoding step. For the fixed correction layer and each layer and attention head after the fixed correction layer, the key vector and value vector are recalculated based on the key projection matrix and value projection matrix of the corresponding layer and the corresponding attention head using the corrected hidden state. Only replace the key cache entries and value cache entries in the multi-head key-value cache whose time index is the current decoding step, while keeping the cache entries corresponding to other time indices unchanged.

10. The online correction method for neural symbol dual-stream closed loop according to claim 8, characterized in that, The consistency check is performed on the network action token generated in the current decoding step and the network action composed of the network action token. If the check passes, the network action is issued. If the verification fails, a preset security default action is issued and audit information is recorded, including: For the network action token generated in the current decoding step and the network action constituted by the network action token, predicate verification is performed according to each rule in the structured rule set; If a rule marked as mandatory is not satisfied, or a rule marked as taboo is triggered, or the violation energy is still greater than the preset energy threshold due to reaching the maximum number of iterations or the time budget during the iteration process of the minimum perturbation solution, then the correction is deemed to have failed. When the current correction fails, select the security default action from the preset security default action set according to the risk type and issue it. The preset security default action set includes at least one or more of the following: refuse to execute change-type actions and return an alarm and reason, only perform read-only probe, roll back or undo to security snapshot, transfer to manual approval, and transfer to work order flow. The audit information is recorded, which includes at least the violation rule identifier, violation energy value, preset energy threshold, budget exhaustion flag, rule parser version, and consistency checker version.

11. An online error correction system for a neural symbolic dual-stream closed loop, characterized in that, include: The state extraction module is used to extract the hidden vector of the current decoding step as a controlled state in the process of autoregressive generation of network action tokens by the Transformer decoder of the large language model, and normalize the controlled state to a unit hypersphere to obtain a normalized state; wherein, the autoregressive generation process of the Transformer decoder constitutes the main neural pathway. The rule mapping module is used to parse the preset rule template library through the symbol side path, and perform slot filling based on the current network observation and generation context to obtain the structured rule set of the current decoding step, and map the structured rule set to the set of allowed cones and the set of forbidden cones on the unit hypersphere; An energy gating module is used to calculate the violation energy based on the normalized state, the set of allowed cones, and the set of forbidden cones, and to generate a gating signal based on the comparison result of the violation energy and a preset energy threshold. The perturbation correction module is used to solve for the minimum perturbation in the tangent space of the normalized state and map it back to the unit hypersphere through the shrinkage operator if the gating signal indicates that correction is triggered, so as to obtain the corrected state. The cache update module is used to synchronously update the cache entries corresponding to the current decoding step in the multi-head key-value cache of the fixed bias correction layer and each layer after the fixed bias correction layer based on the correction state. The output module is used to perform consistency verification on the network action token generated in the current decoding step and the network action composed of the network action token. If the verification passes, the network action is issued; if the verification fails, a preset security default action is issued and audit information is recorded. The security default action is a preset backup network action.