Residual routing constraint method and system for enhancing stability of neural network training

CN122334359BActive Publication Date: 2026-08-07TSINGHUA SHENZHEN INTERNATIONAL GRADUATE SCHOOL
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TSINGHUA SHENZHEN INTERNATIONAL GRADUATE SCHOOL
Filing Date
2026-06-08
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

这些控制信号需要在前向传播和反向传播中保持数值稳定和语义一致,任何微小的层间放大或衰减都可能导致控制决策失真,进而破坏整个系统的可靠性和可复现性

Benefits of technology

通过将后置缩放矩阵约束的取值范围大于0且小于2,提供了对层核心计算函数输出的灵活缩放能力,既能增强表征能力,又避免了过度的缩放导致的不稳定。将层核心计算函数具体化为自注意力或前馈神经网络,特别是混合专家模型中的前馈网络,使得本发明能直接应用于当前最先进的大语言模型架构,提升其训练效率与稳定性。专用于执行该方法的硬件芯片和训练服务系统,能够大幅提升训练速度,降低部署成本。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122334359B_ABST
    Figure CN122334359B_ABST
Patent Text Reader

Abstract

This invention discloses a residual routing constraint method and system for enhancing the training stability of neural networks, comprising the following steps: S1, based on the residual routing constraint in the neural network... l Input feature tensor of the layer x l S1. Generate the original values ​​of the pre-scaling matrix, the post-scaling matrix, and the residual routing matrix; S2. Apply non-negativity constraints to and to obtain the pre-scaling matrix. H pre and post-scaling matrix H post By constraining optimization to satisfy the double stochastic matrix condition, the residual routing matrix is ​​obtained. H res S3, Utilize H pre right x l Premixing is performed to obtain preprocessed characteristics. u l ;Will u l Enter to the number l Layer core calculation function F layer Calculations are performed to obtain the layer output features. y l ;Will H post Acting on y l The scaled output will be obtained. H res Acting on x l After obtaining the stable residual, the scaled output is summed with the stable residual to obtain the first... l Layer output features x l +1. This invention significantly improves the numerical stability of deep neural network training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and deep learning technology, and in particular to a residual connection constraint method and system for enhancing training stability in the training process of large-scale neural networks, especially large language models. Background Technology

[0002] As deep learning models, especially large language models based on the Transformer architecture, evolve towards greater depth and complexity (e.g., by introducing hybrid expert models (MoE) and long context processing), instability issues during training become increasingly prominent. These instabilities primarily manifest as gradient explosion or vanishing, and scale drift. These problems become even more severe when external control signals are introduced into the model (e.g., uncertainty vectors for inference control, evidence-bound cues, etc.). These control signals need to maintain numerical stability and semantic consistency during forward and backward propagation; any slight inter-layer amplification or attenuation can lead to distorted control decisions, thereby compromising the reliability and reproducibility of the entire system.

[0003] Existing technologies typically employ passive remedial measures such as gradient pruning and weight normalization to address training instability. However, these methods cannot fundamentally constrain the signal mixing process in residual connections, making it difficult to meet the high requirements of complex control architectures for the stability of underlying dynamics. Summary of the Invention

[0004] The technical problem to be solved by this invention is: how to fundamentally improve the training stability of deep neural networks, especially to suppress the representation scale drift and gradient instability caused by residual connections, so as to provide a stable and controllable dynamic environment for upper-layer applications that require highly reliable control signals (such as evidence-driven inference loops).

[0005] The technical problem of this invention is solved by the following technical solution: In a first aspect, the present invention provides a residual routing constraint method for enhancing the training stability of neural networks, comprising the following steps: S1, Dynamic Mapping Step: Based on the first step in the neural network... l Input feature tensor of the layer x l Generate the original values ​​of the pre-scaling matrix. The original value of the post-scaling matrix and the original values ​​of the residual routing matrix ; S2, Manifold Projection Step: Apply the original values ​​of the pre-scaling matrix... and the original value of the post-scaling matrix By applying a nonnegativity constraint, the pre-scaling matrix is ​​obtained.H pre and post-scaling matrix H post ; the original value of the residual routing matrix The residual routing matrix is ​​obtained by performing nonnegation processing and constrained optimization to satisfy the double stochastic matrix condition. H res The double random matrix is ​​required to have a sum of 1 in each row and a sum of 1 in each column; S3. Stable fusion step: Utilizing the aforementioned pre-scaling matrix H pre For the input feature tensor x l Premixing is performed to obtain preprocessed characteristics. u l The preprocessed features u l Enter to the number l Layer core calculation function F layer Calculations are performed to obtain the layer output features. y l ; the post-scaling matrix H post Acting on the output features of the layer y l After obtaining the scaled output, the residual routing matrix is... H res Acting on the input feature tensor x l After obtaining the stable residual, the scaled output is summed with the stable residual to obtain the first... l Layer output features x l +1.

[0006] In some embodiments, the following technical features are also included: In some embodiments, in step S2, the pre-scaling matrix H pre The original value of the pre-scaling matrix is ​​obtained by applying the Sigmoid function. The post-scaling matrix is ​​obtained by transformation. H post By applying the Sigmoid function to the original value of the post-scaling matrix The transformation result is obtained by multiplying it by a coefficient of 2, which makes the post-scaling matrix... H post The value range is greater than 0 and less than 2.

[0007] In some embodiments, in step S3, the layer core calculation functionF layer This is a self-attention computation function or a feedforward neural network computation function.

[0008] In some embodiments, when the layer core calculation function F layer When it is a feedforward neural network computation function, it is the feedforward neural network computation function in the hybrid expert model.

[0009] Secondly, the present invention provides a neural network training stability enhancement device, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the above-mentioned residual routing constraint method is implemented.

[0010] Thirdly, the present invention provides a large language model training system, comprising: The base model contains multiple neural network layers; and A stability enhancement module is configured to apply the aforementioned residual routing constraint method at at least one neural network layer of the base model. An evidence-driven closed-loop inference control module is configured to generate and update a control signal, the control signal including an uncertainty vector; wherein, the stability enhancement module ensures that the control signal remains numerically stable as it propagates between the neural network layers of the base model by applying the residual routing constraint method.

[0011] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above-described residual routing constraint method.

[0012] Fifthly, the present invention provides an artificial intelligence chip, wherein the artificial intelligence chip integrates hardware circuitry specifically for executing the above-described residual routing constraint method, the hardware circuitry comprising: Mapping unit, used for mapping based on input feature tensor x l Generate the original values ​​of the pre-scaling matrix. The original value of the post-scaling matrix and the original values ​​of the residual routing matrix ; Projection unit, used for the original values ​​of the pre-scaling matrix. and the original value of the post-scaling matrix Perform nonnegativity constraint processing to obtain the pre-scaling matrix. H pre and post-scaling matrix H post and to Perform Sinkhorn-Knopp iterations to obtain a double random matrix. H res ; A fusion computing unit is used to perform the calculations in the stable fusion step.

[0013] Sixthly, the present invention provides a neural network model training service system, comprising: A server cluster, configured with hardware resources for performing neural network model training; The service interface is configured to receive user-submitted neural network model training tasks and configuration parameters; and The training control engine is configured to invoke the residual routing constraint method described above during the execution of the neural network model training task, in order to improve the stability of the neural network model training.

[0014] In a seventh aspect, the present invention provides a computer program product comprising instructions that, when executed on a computer device, cause the computer device to perform the aforementioned residual routing constraint method.

[0015] Eighthly, the present invention provides a neural network model trained by the above-mentioned residual routing constraint method.

[0016] Ninthly, the present invention provides a method for data processing using the above-described neural network model, comprising: Receive input data; The input data is fed into the neural network model; Obtain the output result generated by the neural network model based on the input data.

[0017] In a tenth aspect, the present invention provides a data processing apparatus, comprising: The aforementioned neural network model; and A processing unit configured to process input data using the neural network model to produce output results.

[0018] In the eleventh aspect, the present invention provides a bitstream, which is generated by an encoder encoding parameters or intermediate features of a neural network model by performing the above-described residual routing constraint method.

[0019] In a twelfth aspect, the present invention provides a method for storing or transmitting a bit stream, comprising: The residual routing constraint method described above is used to generate encoded data of neural network model parameters or intermediate features; the bit stream generated from the encoded data is then stored or transmitted through a communication network.

[0020] In a thirteenth aspect, the present invention provides a method for enhancing the stability of a neural network model for industrial quality inspection and decision support. The method is applied to an industrial large language model containing multi-layer neural networks. This industrial large language model is used to process multimodal data from industrial scenarios and output quality analysis and decision recommendations. The method includes the following steps: F1, Dynamic Mapping Steps: Based on the first step in the neural network... l Input feature tensor of the layer x l Generate the original values ​​of the pre-scaling matrix. The original value of the post-scaling matrix and the original values ​​of the residual routing matrix ; F2, Manifold Projection Step: Apply the original values ​​of the pre-scaling matrix... and the original value of the post-scaling matrix By applying a nonnegativity constraint, the pre-scaling matrix is ​​obtained. H pre and post-scaling matrix H post ; the original value of the residual routing matrix After performing the exponential operation, the residual routing matrix is ​​projected onto a birandom matrix manifold using an iterative algorithm. H res The double random matrix is ​​required to have a sum of 1 in each row and a sum of 1 in each column; F3. Stable fusion step: Using the aforementioned pre-scaling matrix H pre For the input feature tensor x l Premixing is performed to obtain preprocessed characteristics. u l The preprocessed features u l Enter to the number l Layer core calculation function F layer Calculations are performed to obtain the layer output features. y l ; the post-scaling matrix H post Acting on the output features of the layer y l After obtaining the scaled output, the residual routing matrix is... H res Acting on the input feature tensor x l After obtaining the stable residual, the scaled output is summed with the stable residual to obtain the first...l Layer output features x l +1; The neural network model stability enhancement method enhances the numerical stability of model training by constraining residual routing, thereby ensuring the reliability of industrial control signals in the deep propagation of the model.

[0021] In some embodiments, in step F2, the pre-scaling matrix H pre The original value of the pre-scaling matrix is ​​obtained by applying the Sigmoid function. The post-scaling matrix is ​​obtained by transformation. H post By applying the Sigmoid function to the original value of the post-scaling matrix The result of the transformation is obtained by multiplying the coefficient 2.

[0022] In some embodiments, the layer core computation function F layer This is a self-attention computation function or a feedforward neural network computation function.

[0023] In some embodiments, when the layer core calculation function F layer When it is a feedforward neural network computation function, it is the feedforward neural network computation function in the hybrid expert model.

[0024] In some embodiments, it also includes: F4. Constructing and maintaining an evidence pool: The evidence pool is used to store and manage evidence items from industrial data sources that support quality judgments. Each evidence item includes at least content, source information, reliability identifier, and conflict relationship with other evidence items. The atomic claims in the quality analysis and decision recommendations output by the industrial big language model need to be bound to the evidence items in the evidence pool, and the adjudication is based on the sufficiency, reliability, and conflict relationship of the evidence items.

[0025] The beneficial effects of this invention compared to the prior art include: This invention introduces manifold constraint technology to impose double randomness constraints on the routing matrix in the residual connections of a neural network, achieving approximate "mass conservation" of signals during cross-layer propagation. This fundamental mechanism brings the following beneficial effects: significantly improving the numerical stability of deep neural network training. Specifically, the mathematical properties of the double random matrix (the sum of each row and the sum of each column are both 1) strictly limit the overall gain when signals mix between residual paths, thereby suppressing the gradient explosion / vanishing and representation scale drift problems commonly found in deep networks from the source. This stability of the underlying dynamics ensures the reliability and consistency of upper-layer control signals (such as uncertainty estimation) during propagation between model layers, avoiding control decision errors caused by signal distortion. Therefore, this invention provides an active, structured stability enhancement scheme. Compared to passive gradient clipping and other methods, this invention, by constraining residual routing through manifold projection, can effectively suppress the abnormal growth of gradient norms and scale drift of hidden layer activation values ​​during training, providing a more numerically stable training foundation for complex models (especially large language models with integrated control loops).

[0026] In addition, some embodiments also have the following beneficial effects: By constraining the post-scaling matrix to a value greater than 0 and less than 2, flexible scaling of the layer core computation function output is provided, enhancing representational capabilities while avoiding instability caused by excessive scaling. Specificifying the layer core computation function into a self-attention or feedforward neural network, particularly a feedforward network in a hybrid expert model, allows this invention to be directly applied to state-of-the-art large language model architectures, improving their training efficiency and stability. Dedicated hardware chips and training service systems for executing this method significantly improve training speed and reduce deployment costs.

[0027] Other beneficial effects of the embodiments of the present invention will be further described below. Attached Figure Description

[0028] Figure 1 This is a flowchart of a residual routing constraint method for enhancing the stability of neural network training in an embodiment of the present invention.

[0029] Figure 2 E in the embodiments of the present invention 3 - A schematic diagram illustrating the core principles and mechanisms of the Loop architecture.

[0030] Figure 3a and Figure 3b These are the five elements embedded in E in the embodiments of the present invention. 3 - A schematic diagram of the hierarchical closed-loop architecture of the Loop, Phase 1 and Phase 2.

[0031] Figure 4a and Figure 4b These are schematic diagrams of Phase 1 and Phase 2 of the base skin and parallel extension component architecture in the embodiments of the present invention.

[0032] Figure 5 E in the embodiments of the present invention 3 - Loop single-round decision-making flowchart.

[0033] Figure 6 This is a schematic diagram of the stabilization layer structure for mHC mapping and residual fusion in an embodiment of the present invention.

[0034] Figure 7 E is an embodiment of the present invention. 3 - A closed-loop flowchart of the Loop controller driving Sandbox for evidence collection and proof with prompts for refilling. Detailed Implementation

[0035] The present invention will be further described below with reference to the accompanying drawings and preferred embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.

[0036] The core of this invention lies in providing a stability mechanism called mHC (Manifold-Constrained Hyper-Connection), a training-phase regularization method applied to residual hyperconnections in neural networks. Its core principle is to force the residual mixing matrix to satisfy a double-random condition, achieving approximately "mass conservation" signal routing, thereby suppressing gradient instability and representation scale drift during deep network training. This provides a basis for complex control loops in upper layers (such as E...). 3 -Loop provides a stable and controllable dynamic environment.

[0037] In the current international context, the competitive focus of large language models has clearly shifted from the linear narrative of "larger parameters = stronger capabilities" to the system capability level of "verifiable inference control, compressible cost curve, and constrainable runtime behavior" (see [Zhang, C., Zhang, J., Lu, J., & Zhao, Y. (2026). Large language models meet energy systems: Opportunities, challenges, and future perspectives.). Applied Energy, 403, 127076.]). This directly connects with the closed-loop technology of inference control-evidence alignment-tool execution pointed to by the embodiments of the present invention. Specifically, at the structural level, the sparsity route represented by MoE (Mixture of Experts) selects the top-k experts for each token through a router, and controls expert congestion with load balancing loss and capacity factor, so that capacity expansion is no longer equivalent to a linear increase in FLOPs per token, referring to the literature [Cai, W., Jiang, J., Wang, F., Tang, J., Kim, S., & Huang, J. (2025). A survey on mixture of experts in large language models. IEEE Transactions on Knowledge and Data Engineering. At the inference service level, the memory usage, fragmentation, and scheduling latency of the KV cache are considered decisive bottlenecks. By separating prefill / decode, using paginated KV management, and employing batch processing strategies, the conflicts between long contexts and high concurrency are transformed into an engineeringable resource allocation problem, as referenced in [Wu, Y., Chen, S., Zhong, Y., Huang, R., Tan, Y., Zhang, W., ...&Huang,P. (2026). DualPath: Breaking the Storage Bandwidth Bottleneck in Agentic LLMInference]. arXiv preprint arXiv:2602.21548. More importantly, the new trend toward reliability shapes the model into an "actionable runtime system," explicitly performing retrieval, computation, and verification within constrained tool interfaces and sandbox environments. This upgrades the "generate-execute-feedback-revise" process from a hinting technique to a replayable trajectory and an auditable closed loop, thereby binding inference quality and inference budget within the same control framework. This avoids replacing evidence and verification with lengthy, self-consistent narratives when uncertain, as seen in the reference [Gartlehner, G., Kahwati, L., Hilscher, R., Thomas, I., Kugley, S., Crotty, K., ... & Chew, R. (2024). Data extraction for evidence synthesis using a large language model: A proof-of-concept study]. Research synthesis methods, 15 (4), 576-589.].

[0038] In parallel with the aforementioned international trend towards controllability, the development of large language models in China was constrained earlier by the hard constraints of computing power cost, deployment density, and delivery stability. Therefore, its technical approach is more focused on the coupling of sparse structure and inference system engineering, which in turn exposes the mechanistic gap caused by the "lack of a trainable control plane" more quickly. See reference [Chen, S., Wang, W., Chen, X., Zhang, M., Lu, P., Li, X., & Du, Y. (2025). Enhancing Chinese comprehension and reasoning for large language models: an efficient LoRA fine-tuning and tree of thoughts framework. Journal of Supercomputing, 81 (1).] and [Li, Z., Qiu, W., Ma, P., Li, Y., Li, Y., He, S.,...&Gu, W. (2024). An empirical study on large language models in accuracy and robustness under chinese industrial scenarios. arXiv preprint arXiv: 2402.01723. On the one hand, domestic models generally use MoE sparsity and route governance to reduce the cost per unit token, and improve the controllability of online services through route stability, overflow strategies and tail delay management, referring to the literature [Abnar, S., Shah, H., Busbridge, D., Ali, AME, Susskind, J., & Thilk, V. (2025). Parameters vs flops: Scaling laws for optimal sparsity for mixture-of-expertslanguage models]. arXiv preprint arXiv:2501.12370.On the other hand, long context landing places greater emphasis on prefill acceleration, chunked scheduling, kernel pipelining and bandwidth optimization, transforming "how long can be read" into engineering problems such as "whether prefill can scale linearly, whether memory access is controllable, and whether concurrency throughput is stable," referring to the literature [Haoyang, LI, Li, Y., Tian, ​​A., Tang, T., Xu, Z., Chen, X., ...&Chen,L. (2025). A survey on large language model acceleration based on kv cachemanagement]. Transactions on Machine Learning Research. ].

[0039] It is precisely under such strong engineering constraints that, if the rigid binding of evidence and conclusion is still lacking, citation drift and passive assertions are prone to occur; if the judgment and back-injection constraints for execution triggering are lacking, tool calls will be highly sensitive to contextual noise, resulting in false triggers / missed triggers. If the differential consistency and rollback mechanism for revision is lacking, error correction will degenerate into regeneration and cause belief drift; high-risk tail illusions will be masked by average indicators and erupt in key scenarios. From the perspective of functional differentiation rather than biological isomorphism, the internal synergy of current large language models in task allocation, attention focus, language organization, and semantic integration can approximate some of the functions of the prefrontal cortex, parietal cortex, Broca's area, and Wernicke's area in the human brain, but its fundamental limitation shared with the human brain is that the system mainly relies on the self-consistent reorganization between existing representations to complete judgment, reasoning, and generation, rather than continuously, directly, and bindingly taking in and correcting external evidence during operation. Therefore, evidence should not be regarded as supplementary information in the existing generation chain, but rather as a key fulcrum propelling large language models from "internal representation closure" to "external constraint convergence." This is precisely the most fundamental and long-neglected core issue in the current architectural evolution. Specific research gaps are as follows: The decoupling of evidence and conclusion remains a structural gap: the generation process lacks a hard protocol that "assertions must carry locatable evidence pointers and explicitly preserve conflict relationships," leading to reference drift, passive assertions, and silent overriding of conflicts in long contexts or multi-source splicing, which are difficult to suppress stably through cue engineering.

[0040] Tool triggering strategies lack learnable runtime states: current triggering decisions are often approximated by templates, static rules, or lightweight classifiers, lacking a joint representation of evidence sufficiency, verifiability, action cost, and failure risk. This makes the system highly sensitive to wording and noise, resulting in budget and tail delay inflation caused by false triggers, and missed triggers causing the system to continue generating and forming a chain of errors during the verification process.

[0041] The computational allocation during the inference period is generally rigid: difficult and easy problems share a nearly isomorphic decoding process, and the model can only pretend to delve deeper into inference by "generating more text," but it lacks a controllable mechanism to direct the extra budget to retrieval, execution, and verification. Therefore, the increase in cost does not necessarily translate into a gain in reliability.

[0042] The revision lacks "version semantics" and differential constraints: When faced with new evidence or error correction needs, the model tends to replace the minimum necessary update with regeneration. The change boundary is uncontrollable, the commitment is inconsistent and semantic drift occurs frequently, and there is no verifiable binding between the revision reason and the evidence increment, making it difficult to maintain controllability for multi-round collaboration and iterative tasks.

[0043] High-risk tail illusions are difficult to manage with average metrics: when there is insufficient evidence, conflicting information, or ambiguity in the question, the system may still make a highly certain assertion; traditional training and evaluation tend to optimize the average accuracy rate, lacking a scalable monitoring and adjudication loop for "conservative exit when lacking evidence, clarification or verification of conflicts, and meeting the evidence threshold for key assertions".

[0044] Control and auditing often remain at the "glue layer," lacking a unified behavioral contract: memory retrieval, rejection strategies, tool injection, and anomaly avoidance are not solidified into optimizable goals and replayable state transitions, resulting in online behaviors that are not attributable and cannot be retrained. The larger the system, the more difficult it is to converge the triggered deviations.

[0045] After the bottlenecks of long context and high concurrency inference stack are solved by engineering, new contradictions are amplified: control information such as evidence blocks, audit logs, and tool specifications will directly compete for resources with KV cache bandwidth, scheduling strategies and memory fragmentation. If budget governance and structured compression strategies are lacking, the introduction of the control plane may worsen tail latency and reduce system throughput.

[0046] Furthermore, current parameter fine-tuning projects, while fundamentally addressing the instability of current large language models in open tasks, have dragged the R&D process into a high-investment, low-certainty cycle of "evaluation-regression-re-parameter tuning." A single round of fine-tuning often means not only a continuous stacking of data cleaning, sample construction, training scheduling, and hyperparameter search, but also a subsequent exponentially expanded metric retesting, scenario regression, manual review, and version comparison. The workload and computational consumption often far exceed the apparent training cost itself. More importantly, given the rapid iteration and continuously rising capability boundaries of open-source foundation models like DeepSeek and Qwen, parameter patching implemented to address a single defect is often partially covered by the capabilities of the new generation of foundation models before stable verification is completed. This ultimately leads to a structural dilemma of "long adaptation cycles, high verification costs, short benefit windows, and weak overall gains." Therefore, what is truly scarce at this stage is no longer the ability to continue making localized repairs around the parameter layer, but rather the ability to build a control plane that can steadily improve system performance within a given budget, so that system performance no longer relies primarily on expensive and fragile repeated fine-tuning, but can instead achieve stable improvements through a trainable, auditable, and reproducible control plane.

[0047] The aforementioned gaps all point to the same necessity: simply relying on a larger base, longer context, or stronger alignment cannot fundamentally eliminate the structural mismatch of "being able to talk but not stable." It is necessary to elevate "evidence gating - execution verification - rollback revision - budget termination - immutable log" into a trainable and auditable operating mechanism. This will significantly reduce the variance of the model achieving similar performance metrics (such as validation set loss) in multiple independent training runs, thereby improving the repeatability and stability of the training process.

[0048] To address the aforementioned technical shortcomings, such as "generative self-consistency replacing factual constraints, lack of reproducible adjudicative semantics in tool-triggered methods, and the susceptibility to drift and difficulty in auditing multiple rounds of revisions," this invention proposes an evidence-driven closed-loop truth-seeking intelligent reasoning and generation method called "E." 3 The "-Loop" architecture. Its core innovation lies in elevating evidence from a post-generational, supplementary support to a primary control variable throughout the entire process of reasoning, execution, revision, and termination. By continuously implementing evidence constraints, conflict resolution, and closed-loop correction during runtime, it transforms the large language model from a probabilistic generation mechanism relying on internally consistent representations into an evidence-driven truth-seeking mechanism oriented towards the open world. Its distinctiveness lies in E... 3-Loop does not simply attribute the problem to insufficient base parameters, but rather revisits the cognitive structure of the brain based on first principles. While existing large language models have functionally formed synergistic links of prefrontal cortex-like policy control, parietal cortex-like attentional integration, Broca's area-like representation generation, and Wernicke's area-like semantic understanding, their reasoning process, like human cognition, is still primarily based on the self-consistent reorganization of internal representations. They lack a rigid mechanism for continuously acquiring external evidence, explicitizing conflicts, and rewriting refutations during operation. Therefore, once entering open-world, multi-source information, and executable task scenarios, generation, triggering, revision, and risk suppression can easily become unstable simultaneously. Given that there is currently no operable "beyond the human brain" cognitive paradigm, this invention adopts a higher-order cognitive control approach borrowed from scientific researchers: "hypothesis generation - external evidence acquisition - contradiction identification - differential revision - re-verification closed loop." It systematically establishes evidence as the primary control object across the entire chain of reasoning, execution, revision, and output, proposing a model based on E... 3 -Loop is an evidence-driven, closed-loop, truth-seeking intelligent reasoning and generative architecture.

[0049] It is worth noting that E 3 The innovative Loop design is not a low-level computational backbone at the same level as Transformer, Mamba, or MoE, nor does it replace operator mechanisms such as attention. Instead, it is an evidence-driven reasoning control architecture and runtime control plane located above the base model. It addresses not the problem of training a single model, but rather the long-standing lack of a unified constraint mechanism for conclusion validity, tool triggering, revision rollback, and risk mitigation under open-world conditions. To this end, this invention uses evidence objects, state transitions, execution decisions, differential revisions, and budget governance as a unified control unit. This enables the system to achieve low-cost adaptation, multi-scenario migration, and rapid iteration to multiple open-source or closed-source base models while retaining the representational capabilities of the existing base model. This is achieved through efficient parameter tuning and context engineering, transforming the path to improving the capabilities of large language models from high-cost, low-determinism repetitive parameter fine-tuning to an upgrade to a trainable, auditable, and reproducible operational mechanism centered on evidence constraints.

[0050] Example 1 This embodiment provides a residual routing constraint method for enhancing the stability of neural network training. Its core lies in introducing manifold constraint technology into the training process. By forcing the residual mixing matrix to satisfy the double-stochastic condition, it achieves approximately "mass-conserved" signal routing, thereby providing a stable and controllable dynamic environment for the upper-level control loop. The method includes the following steps: S1, Dynamic Mapping Step: Based on the first step in the neural network... l Input feature tensor of the layer xl Generate the original values ​​of the pre-scaling matrix. The original value of the post-scaling matrix and the original values ​​of the residual routing matrix ; S2, Manifold Projection Step: Apply the original values ​​of the pre-scaling matrix... and the original value of the post-scaling matrix By applying a nonnegativity constraint, the pre-scaling matrix is ​​obtained. H pre and post-scaling matrix H post ; the original value of the residual routing matrix The residual routing matrix is ​​obtained by performing nonnegation processing and constrained optimization to satisfy the double stochastic matrix condition. H res The double random matrix is ​​required to have a sum of 1 in each row and a sum of 1 in each column; S3. Stable fusion step: Utilizing the aforementioned pre-scaling matrix H pre For the input feature tensor x l Premixing is performed to obtain preprocessed characteristics. u l The preprocessed features u l Enter to the number l Layer core calculation function F layer Calculations are performed to obtain the layer output features. y l ; the post-scaling matrix H post Acting on the output features of the layer y l After obtaining the scaled output, the residual routing matrix is... H res Acting on the input feature tensor x l After obtaining the stable residual, the scaled output is summed with the stable residual to obtain the first... l Layer output features x l +1.

[0051] In step S1, the mHC stability mechanism is employed. mHC is a training-phase regularization hook applied to the residual hyperconnections of a neural network. It does not alter the mathematical definitions and forward computation of core operators such as Attention and FFN, but rather projects and constrains the mixed weights of the residual branches. Its core principle and implementation steps are as follows: Dynamic mapping generation: for a given layer's input feature tensor x l ∈R {B×n×d} First, the original logits (logical outputs) of the three types of structure matrices are generated through a lightweight linear projection layer: and .

[0052] In step S2, manifold projection and constraints are preferably used to modify the original values ​​of the residual routing matrix. After performing the exponentiation operation, it is projected onto a birandom matrix manifold using an iterative algorithm, specifically including: Pre- and post-scaling matrices: Their non-negativity is constrained by activation functions, for example: and (The value of the constraint scaling factor is greater than 0 and less than 2). These two matrices are used to premix the input and post-scale the layer output.

[0053] Manifold projection of the residual routing matrix: This is crucial for achieving stability. The residual routing matrix is ​​projected onto a double-stochastic matrix manifold using the Sinkhorn-Knopp iterative algorithm. DS ( n The doubly random matrix requires that the sum of each row and each column be 1. This mathematical property ensures that the overall "energy" or "mass" of the signal is approximately conserved when it propagates through multiple residual paths, thus strictly suppressing scale drift. Besides the Sinkhorn-Knopp iteration, optimization algorithms with row and column constraints (such as the projected gradient method) can be used, or parameterized matrices satisfying the doubly random condition can be constructed (such as using the Gumbel-Sinkhorn trick).

[0054] In step S3, stable residual fusion is performed: the final output of this layer is calculated using the following formula: u l =( H pre I d )· x l (Premixed) y l= F layer ( u 1 (Layer-level core computation, such as Attention or MoE-FFN) x {l+1} =( H post I d )· y l +( H res I d )· x l (Post-scaling + stable residual) Wherein I d This indicates that the matrix is ​​applied to the feature dimension. This fusion process ensures that the input signal can be transmitted in a controlled manner, even at deep layers.

[0055] In E 3 -The key role of a closed loop is reflected in: The introduction of mHC directly serves E 3 -Learnability of the Loop control plane: Control signal calibration stability: a five-dimensional vector generated by an uncertainty estimator U During cross-layer propagation, the numerical range and relative relationship are constrained within a controllable range, avoiding artificial highs or distortions caused by the accumulation of inter-layer gains, and ensuring the reliability of entropy router decisions.

[0056] Gating threshold consistency: The decision threshold for evidence gating is usually based on the statistical properties of the model's hidden states (such as energy values). mHC suppresses abnormal fluctuations in hidden state energy, thereby preventing unexpected drift in the decision threshold and ensuring that the "PASS / HOLD / FAIL" criteria remain consistent across different depths and samples.

[0057] Predictability of revision behavior: Rollback update module for claim set C Differential revisions rely on the model's representation of evidence. Stable dynamics ensure that the model's revision behavior (action distribution) is stable and predictable under similar budget and evidence inputs, which is the foundation for achieving an auditable closed loop.

[0058] The method in this embodiment has the following advantages: Pluggability: mHC is implemented as a wrapper, exposing the standard interface forward( x , F layer It can be flexibly inserted into any Pre-Norm or Post-Norm Transformer block without modifying the original computation kernel.

[0059] Low overhead: Sinkhorn iterations occur only during training and can be accelerated using GPUs. During inference, the fixed mixing matrix after training convergence can be used directly without any additional computation, resulting in zero impact on inference efficiency.

[0060] Monitorability: The training log can additionally record violations of constraints such as row and column and bias, which can serve as a priori indicators of training stability.

[0061] The method described in this embodiment will be explained in detail below: Innovations in architecture and algorithms: E 3 -Loop architecture principle In step S1, the central state includes the problem objective, a structured uncertainty vector, a budget ledger, an evidence pool, an atomic claim set, and an immutable loop log. The structured uncertainty vector includes at least one of the following dimensions: answer uncertainty, evidence sufficiency uncertainty, execution verification necessity uncertainty, tool specification consistency risk uncertainty, and high-risk assertion exposure uncertainty. The budget ledger is used to uniformly record and manage at least one of the following resources: lexical consumption, tool call cost, execution time consumption, and loop step consumption. 3 The innovation of the Loop lies not in continuously stacking additional capabilities such as retrieval, memory, tools, or execution, but in consolidating these originally loosely connected processes into a unified control semantic within the same closed loop: the system is centered on a single state. S t = { Q , U , B , E , C , L As the sole decision-making vehicle, among which Q This indicates the current problem objective and its sub-objectives. B This represents a unified budget ledger for tokens, tool calls, time, and steps. E This represents an evidence pool with source pointers, reliability, timestamps, and conflict edges. C This represents a set of atomic claims with risk labels and supporting pointers. L This represents an immutable circular log; where U = ( u answer , u evidence , u exec , u spec , u risk ) is a five-dimensional structured uncertainty vector, where, u answerCharacterizes the uncertainty of the candidate conclusion itself (i.e., the uncertainty of the answer). u evidence Characterizes the gap in sufficiency of evidence (i.e., uncertainty about the sufficiency of evidence). u exec Characterize the necessity of performing verification (i.e., the uncertainty of the necessity of performing verification). u spec Characterize the risk of consistency in tool specifications (i.e., uncertainty of tool specification consistency risk). u risk The high-risk assertion exposure (i.e., high-risk assertion exposure uncertainty) is represented. The aforementioned five-dimensional structured uncertainty is not manually annotated, but rather jointly generated and normalized by the uncertainty estimator after each round of reading the current hidden representation, evidence coverage, conflict edge density, tool parsing state, and risk label. It is also differentially updated after evidence addition, execution return, and rollback revision, thereby transforming the "fuzzy uncertainty" originally residing in the model's implicit representation into trainable, comparable, and auditable control variables. In a preferred embodiment, the uncertainty estimator is attached to the last layer of hidden states of the base model. h N The lightweight trainable multilayer perceptron above takes input from the pooled representation of the last hidden state, concatenated with statistical features of evidence coverage, conflict edge density, tool specification matching state, and risk label, and outputs a five-dimensional structured uncertainty vector after being mapped by a normalization function. U = ( u answer , u evidence , u exec , u spec , u risk The uncertainty estimator is trained under supervision using inference trajectory data with gated decision results, execution receipts, and rollback revision tags. It performs differential updates on the uncertainty vector after each round of evidence addition, execution return, or claim rollback, thus making uncertainty quantification a trainable, reproducible, and auditable runtime control variable. The Entropy Router is not a token router in the sense of attention sparsity, but rather a lightweight, trainable policy network located in the runtime control plane; it reads... U , B , E and C State summary, output restricted action set A Policy distribution on {THINK, RETRIEVE, MEMORY_LOOKUP, SANDBOX_EXEC, SUBMIT} π( S t It also provides a stopping threshold, depth of thought, and budget allocation bias, so that "internal reasoning first, proactive supplementary evidence first, memory check first, or execution verification first" no longer depends on the randomness of the prompt words, but becomes a learnable decision with the goal of reducing uncertainty benefits relative to budget costs.

[0062] After an action is selected and executed, the system enters a unified evidence gating and adjudication chain. Evidence Gate uses "proof-carrying gate" as its sole term, judging each atomic claim according to four categories of signals: "support coverage—source reliability—conflict relationship—risk level." It should be noted that the evidence in the evidence pool is at least divided into two categories: externally verifiable evidence and internal inference intermediate results. Externally verifiable evidence refers to evidence returned by retrieval systems, database queries, sandbox execution receipts, or other repeatable external sources, accompanied by source pointers and execution / query metadata. Internal inference intermediate results refer to intermediate semantic products generated by the THINK action, used only to form candidate claims or verification clues. For the two types of evidence, the system employs differentiated reliability assignment and update rules: externally verifiable evidence is assigned a higher initial reliability when its source is traceable, its return status is valid, and its results are verifiable; internal inference intermediate results are assigned only a conservative initial reliability and cannot be used alone as sufficient grounds for high-risk claims to pass evidence gating. Their reliability can only be increased after subsequent external evidence support or multi-source consistency verification. Therefore, the reliability of the evidence is not solely determined by model self-consistency, but rather by a combination of source type, verifiability, cross-source consistency, time validity, and conflict resolution results. This prioritizes externally verifiable constraints over internal generation tendencies and avoids evidence gating falling into circular reasoning. When evidence is insufficient or unresolved conflicts exist, but a clear next verification path (i.e., a verifiable path) exists, the ruling is HOLD. When a high-risk claim lacks any supporting evidence, the tool specification is not met, or there is conclusive rebuttal evidence, and the execution result constitutes disproving evidence, the ruling is FAIL, triggering belief_update_rollback to reduce the confidence level, rewrite the risk, or perform a minimum difference rollback on the corresponding claim. Here, tool invocation refers only to structured execution requests generated under ToolSpec, Schema, or finite state syntax constraints, while sandbox execution is the controlled execution process after the request enters an isolated environment; the two are not the same concept, the former is responsible for forming resolvable actions, and the latter is responsible for returning verifiable evidence. For conflicts between results from multiple tools, multiple receipts, or multiple sources, the Execution Arbiter does not use simple majority voting. Instead, it arbitrates based on the principles of prioritizing reproducible workpieces, weighting the reliability of the source, and prioritizing the freshness of time and the repeatability of the result. If the conflict is still unresolved, it maintains HOLD and prioritizes triggering further evidence collection, and does not allow generative wording to cover up the pending status.The Budget Governor, as an independent budget governance unit, performs unified hard deductions on tokens, tools, time, and steps, and applies soft constraints to the router when the budget approaches its limit and triggers hard termination when the budget is exhausted; the Stop Decider only stops when the gate passes and max( U When the value falls below a threshold, convergent output is allowed; otherwise, a bounded conservative conclusion is returned, including an index of claims and evidence, residual uncertainties, and budget ledgers. This ensures that the system's "truth-seeking" is no longer based on linguistic fluency, but rather on... U The decline E The incremental changes, consistent gating decisions, and log replayability serve as unified criteria, ensuring that the model's optimization process and convergence criteria no longer implicitly depend on the fluency of the output text. Instead, controllable optimization is achieved through stabilizing the underlying training dynamics. The mHC mechanism provided in this invention, compared to standard residual connections, effectively constrains the upper bound of the gradient norm and significantly reduces the scale drift of activation values ​​across different network depths. This stability reduces the sensitivity of the model training process to hyperparameters (such as the learning rate), resulting in smaller fluctuations and a more stable downward trend in the validation set loss within the same training period, providing a foundation for a controllable and reproducible training environment.

[0063] In its engineering implementation, this mechanism is solidified with replaceable interfaces (Policy / Uncertainty Estimator / Retriever / Memory Lookup / Thinker / Executor / Evidence Gate are replaceable), but the contract of "state - action - gating - adjudication - rollback update - budget termination - immutable log" remains unchanged, thus ensuring that the system is learnable, reproducible, and auditable. To enable this closed loop to form implementable and verifiable action selection rules under budget constraints, this embodiment uses a Budgeted Value-of-Information Router (BVoIR) as the core decision algorithm of the Entropy Router. Let the... t The wheel center state is S t = { Q t , U t , B t , E t , Ct , L t},in t Index for the number of loop iterations, Q t The current problem objectives and sub-objectives; U t This is a five-dimensional structured uncertainty vector; B t This is the remaining budget after token, tool, time, and step have been uniformly mapped to the same ledger caliber; E t For evidence pool; C t For atomic claim set; L t An immutable circular log; a set of actions A It includes five types of actions: THINK (internal inference), RETRIEVE (external retrieval), MEMORY_LOOKUP (memory lookup), SANDBOX_EXEC (sandbox execution), and SUBMIT (submit). To avoid budget overruns and specification mismatches, the system first constructs a set of actionable actions. A t feas Only actions that meet tool specification / parameter constraints and whose normalized cost does not exceed the current remaining budget are allowed to be included in the comparison. Subsequently, BVoIR uses "the expected reduction in uncertainty per unit budget" as the objective function. A t feas Select the optimal action .

[0064]

[0065] In step S2, the objective function of the budgeted value information router selection action is:

[0066] in, λ tok This is the weighting coefficient for the cost of word element consumption; λ tool The weighting factor for the cost item of tool call. λ time The weighting factor for the execution time cost item. λ step These are the weighting coefficients for the cost item of the cycle steps. Each weighting coefficient is a non-negative real number, used to map different types of resource consumption to the same budget for comparison and settlement. In a preferred embodiment, it can be set to... λ tok=0.4, λ tool =0.3, λ time =0.2, λ step =0.1, prioritizing the calculation of token cost.

[0067]

[0068] in, U = ( u answer , u evidence , u exec , u spec , u risk ) T ∈[0,1] 5 These represent the uncertainty of the current claim conclusion, the gap in evidence sufficiency, the necessity of external execution verification, the risk of tool specification consistency, and the exposure of high-risk assertions, respectively. This vector is jointly estimated by the Uncertainty Estimator in each round based on the current claim set, evidence coverage, conflict edges, matching of pending action specifications, and risk labels. 。 For any candidate action, represent the predicted value of the uncertainty vector in the next round after performing the action in the current state. 。g spec The action specification feasibility gating function is used to characterize whether the candidate action meets the tool specification, parameter constraints and pattern verification requirements. It is set to 1 when it meets the requirements and 0 or a low penalty value when it does not meet the requirements. T The transpose symbol is used to represent a vector as a column vector or to perform vector dot product operations. A small positive constant is used to avoid zero denominators and improve the numerical stability of the objective function calculation. argmax is the action that maximizes the objective function. E t It is an evidence pool that includes evidence content, source tracing, reliability, conflict markers, etc. It is in state S t Next action The uncertainty of the vector form decreases, which can be understood as Δ U = U t -U t+1 The expected version; This indicates a decrease in non-negative uncertainty resulting from the action; wThe previously mentioned five-dimensional non-negative weight vector is used to aggregate different types of uncertainty reduction into a single revenue scalar, ensuring that the sum of all components is 1; cost function It consists of a normalized weighted average of four parts: token consumption, tool call cost, execution time, and step overhead. For example, in a preferred embodiment, the lexical consumption, tool calls, execution time, and loop step costs in the cost function are normalized by dividing by the current corresponding remaining sub-budget to obtain comparable dimensionless cost items. Each normalized cost item is then combined using preset non-negative weighting coefficients to form the total cost of the candidate action under a unified budget ledger, which is used for subsequent action selection and budget settlement. "Subject to" means "satisfies the following constraints"; B t+1 The remaining budget after this round of actions; This represents the budget update equation for cost deductions. Once the action is selected, it is executed... Update the budget ledger; if no action satisfies the constraints, or if the budget has been exhausted, the action chain is no longer extended, and the Stop Decider outputs a bounded conservative conclusion with accompanying claims—an index of evidence, residual uncertainty, and a budget summary. Thus, BVoIR is no longer an empirical guideline for "think first, check first, or execute first," but rather a rewritten formal decision-making rule that is trainable, auditable, and repeatable under a unified state, a unified budget, and a unified definition of uncertainty.

[0069] Architectural and algorithmic innovations: Five elements embedded in E 3 -Loop hierarchical closed-loop collaborative mechanism In the above E 3 After the main framework of the Loop—"central state-routing-gating-execution-rollback-termination"—is established, this embodiment of the invention further concretizes it into a hierarchical closed-loop collaborative mechanism with five embedded elements. This consolidates retrieval, associative memory, internal reasoning, and external execution from scattered external capabilities into a collaborative unit that is auditable, accountable, and reproducible for the same cognitive state. The first element is the central cognitive state. S t = { Q , U , B , E , C , L}, where sub-targets Q Define the convergence direction of the task and the uncertainty vector. U The evidence pool expresses the evidence gaps, necessity of execution, and risk pressures in a structured way. ERisk-labeled atomic claim sets carry verifiable evidence based on source pointers, reliability, timestamps, and conflict edges. C The conclusion is broken down into adjudicable atomic claims, and an immutable circular log. L The trajectory of state-action-evidence-adjudication is solidified in an immutable manner; including a unified budget ledger. B Instead of being represented as an abstract, single limit, it is implemented as a structured budget ledger under a unified standard. This ledger records tokens, tool calls, execution times, loop steps, and remaining limits for rollback retention. The budget manager scalculates these costs into comparable decision costs before action selection and then settles and corrects them based on actual consumption after action execution. This divides the governance of heterogeneous resources into three interconnected but unambiguous layers: "presentation layer ledger—decision layer cost—execution layer settlement." The second element is the entropy routing control plane, which... U and B The input is not used for word generation, but for meta-control; when U When there is insufficient evidence, unresolved conflicts, or increased exposure to high-risk assertions, the strategy prioritizes allocating budget to the proactive verification action channel. Internal inference or external execution is only allowed into the candidate set when the reduction in predicted uncertainty has a positive benefit relative to budget costs, and the action meets the constraints of tool specifications and the budget feasible region. Furthermore, the product of internal inference can only enter subsequent adjudication as a "candidate claim" and cannot directly bypass the evidence chain to become a conclusion. The third element is the action channel layer, which unifies and reparameterizes retrieval, memory lookup, internal inference, and sandbox execution into a restricted action set, ensuring that all modules can only proceed through the action channel. S tThe incremental updates affect subsequent generation, and the mechanism prohibits implicit shortcuts that bypass evidence and budget constraints. Tool invocation is the act of forming a structured execution request, while sandbox execution is the controlled process of this request running in an isolated environment. The former is responsible for expressing the action as a parsable and verifiable call package, while the latter is responsible for returning verifiable artifacts, logs, failure codes, and execution evidence. The two have clear boundaries but are continuously connected within a closed loop. The fourth element is the evidence gating layer, which uses proof-carrying as a hard constraint to force each candidate claim to bind the source, reliability, time validity, and conflict relationship of the evidence items, and keeps unresolved conflicts explicitly visible and prohibits silent overwriting. When the support is sufficient and high-intensity conflicts have been resolved, the gating is approved. When the evidence is insufficient but there is a clear verifiable path, the gating is suspended and further evidence collection is triggered first. When a high-risk claim lacks support, the tool specifications are not met, or the execution result constitutes refutation, the gating is approved as a failure, thus transforming the "sufficiency of reasoning" into a computable and verifiable adjudication problem. The fifth element is the rollback update and budget termination layer. When the gating decision is invalid or the execution returns a negative result, the system only performs minimum differential rollback on the claims refuted by new evidence and their risk labels, and writes the conflict relationship back. E To solidify the causal chain, the budget governance device first performs pre-authorization and minimum rollback limit checks on each candidate action, and then completes settlement and correction based on the actual token, tool, time and step consumption after execution, avoiding the imbalance of the ledger caused by pre-estimation alone. At the same time, it prevents budget overdraft or rollback failure by using the method of "soft constraint guidance and hard boundary termination".

[0070] Therefore, the convergence criterion for closed-loop communication is no longer language fluency, but... U The decline E The system integrates incremental growth, consistent gating decisions, and replayable budget ledger settlement. When gating passes and residual uncertainty falls below a threshold, the system converges; when the budget is exhausted, the action set is empty, or the verification path does not exist, the system outputs a bounded conservative conclusion with an attached claim-evidence index, budget summary, and residual uncertainty, ensuring the closed loop can both terminate and be reproduced. The direct purpose of this hierarchical design is to first train the control semantics of "routing-gating-execution-rollback" to a stable convergence interval on the dense cortex of Phase 1, and then introduce MoE sparsification expansion only for cortex computation in Phase 2, using trajectory preservation constraints to avoid behavioral drift, so that capacity upgrades reflect computational efficiency improvements rather than control semantic deformation. In step S4, the trajectory preservation constraint is implemented by minimizing the loss function, which is optimized using the Trace-Preserving Cortex Upgrade (TPCU) algorithm. Its loss function is as follows:

[0071] The first constraint on Phase-2 is to prevent it from turning "tasks that should be retrieved / executed" into "more thinking and more writing." This constraint aims to guide the action selection strategy of the Phase-2 model, ensuring it doesn't deviate from the goal of efficiently utilizing the budget to reduce uncertainty, and avoiding wasting resources intended for retrieval or execution on ineffective internal inference. The second constraint prevents Phase-2 from exhibiting overconfidence or uncertainty drift. This constraint aims to constrain the uncertainty estimation calibration of the Phase-2 model, preventing calibration drift relative to the Phase-1 model (including overconfidence or increased uncertainty). (·) represents the average value of the uncertainty peak across a batch of tasks. T 1 and T 2 represents the generated log or track set; exp(·) is the exponential function that maps the penalty term to the compatibility weights in (0,1]. λ It is the weighting coefficient of the action distribution offset penalty. β These are the weighting coefficients for the uncertainty drift penalty, and both are positive numbers; p 1( a )and p 2( a ) respectively represent by T 1 and T Actions in the obtained Phase 1 and Phase 2 trajectories The empirical distribution or frequency.

[0072] Architectural and algorithmic innovations: pedestal cortex and parallel expansion architecture components After fixing the control semantics of "state-action-gating-adjudication-rollback-termination-log" in the five-element hierarchical closed loop, the embodiments of the present invention further abstract the computation backbone into a base cortex contract that can be stably invoked by the control plane, and attach the necessary sensing and constraints for convergence to the truth using parallel extension components (architectural add-ons) without changing the mathematical operators of attention and FFN (Feed-Forward Network). Specifically, Phase 1 uses a Dense decoder-only Transformer + RoPE (Rotary Position Embedding) as the base cortex. Pre-Norm (Pre-Normalization), RMSnorm (Root Mean Square Normalization), GQA (Grouped Query Attention), KV-cache (Key-Value cache), SwiGLU (Swish-Gated Linear Unit), and bound embedding form a reproducible experimental baseline. The open ports of the backbone are fixed to the hidden states of the final layer. h N The output distribution is logits (logic output), and the parallel extension components are not pre-trained from scratch with the base backbone. Instead, after general pre-training is completed in the base cortex and the port contracts are frozen, they are added to it in a parameter-efficient tuning manner during the closed-loop training phase. h N Above this, the uncertainty / calibration head maps sentence-level states to a five-dimensional uncertainty vector. U As a policy sensor for the router, it advocates for the output of token-level binding hints in the evidence binding header to reduce the cost of subsequent evidence alignment and conflict localization. The ToolSpec GrammarAdapter uses JSON Schema as the sole tool specification description language and compiles it into a finite state machine or equivalent token-mask constraints during the decoding phase. It applies grammatical filtering only to optional token sets to ensure that tool calls can be deterministically parsed without writing back the semantics of the main operators. The Phase2 upgrade is strictly limited to the cortical computation level, only replacing the FFN sublayer with MoE-FFN, and improving the efficiency of conditional computation through Top-k routing, load balancing, and capacity overflow management, while maintaining...h N The input / output contracts of logits and the aforementioned side ports remain unchanged, thus ensuring that capacity expansion translates into improved throughput and cost-effectiveness without introducing control semantic drift. To prevent Phase-2 from disrupting the Phase-1 control plane, the most crucial aspect is the algorithm for the auxiliary loss in MoE route governance:

[0073] The algorithm's function is to lock the MoE's "capability gain" within the FFN, while simultaneously forcing the route to prevent collapse. This allows Phase-2 to transform "conditional computation" into a controllable cost lever without altering the control plane. L bal This represents the auxiliary loss from routing load balancing; α These are the weighting coefficients of the auxiliary loss; ||·||2 refers to the L2 norm; This represents the mean of the routing probability vectors for all tokens within a batch, while p i Representing the i The routing probability vector of each token; N The number of tokens included in the statistics; u It is a uniformly distributed vector; E It represents the number of experts in the MoE architecture.

[0074] Mechanism innovation: The stability boundary of mHC at E 3 Structured Injection in a Loop mHC is a method that constrains a hybrid matrix with multi-stream residual hyperconnections to a birandom matrix manifold DS through Sinkhorn projection. n The stabilization mechanism of the attention / FFN operator is used to achieve near-mass-conserving residual routing and suppress scale drift and gradient instability in deep propagation without rewriting the semantics of the attention / FFN operator. See reference [Xie, Z., Wei, Y., Cao, H., Zhao, C., Deng, C., Li, J., ... & Liang, W. (2025). mhc: Manifold-constrained hyper-connections]. arXiv preprint arXiv:2512.24880. After the base skin and parallel expansion components complete port freezing, E 3For a loop to maintain reproducible convergence across multiple rounds of "evidence backfilling-gated adjudication-rollback revision," its underlying residual dynamics must possess a clear stability boundary. To this end, this invention employs the mHC (mature convolutional hash function) as a structured stability hook injected into the residual hyperconnection of the Base Cortex during training. This confines control signals (uncertainty routing, gating labels, budget deduction, and evidence binding hints) within a controllable geometric domain during cross-layer propagation. Specifically, during training, mHC approximates the multi-stream residual mixing matrix within a double-random matrix neighborhood and uses Sinkhorn-Knopp iterative execution of entropy-regularized normalized projection. This keeps the composite gain of each residual channel within a controllable boundary and approximately satisfies mean conservation, thereby mitigating the risk of representation scale drift and gradient explosion or vanishing caused by deep stacking and multi-path topology. This constraint directly serves the learnability of closed-loop control: the calibration of the uncertainty vector is not artificially inflated due to inter-layer amplification, the conflict resolution of evidence gating will not experience threshold drift due to hidden state energy fluctuations, and the differential revision of the claim set by rollback updates can maintain a stable action distribution under similar budgets. On the engineering side, mHC exists in the form of a training-period regularization that is "switchable, monitorable, and rollbackable," without changing the operator semantics of attention and FFN. It only applies projection and constraints to the hybrid weights of residual fusion, and combines kernel fusion and selective recomputation to reduce additional I / O overhead, so that this stability boundary works in the same direction as budget governance, rather than sacrificing the inference budget for apparent stability.

[0075] Mechanism Innovation: Low-cost memory collaboration mechanism for injecting engram evidence boundaries. After the training-period stability boundary provided by mHC constrains the deep residual dynamics within a controllable domain, this embodiment of the invention further borrows from and improves the Engram evidence boundary injection mechanism to achieve closed-loop collaboration that is "usable but does not overshadow the main context" with the lowest possible storage and access overhead. Engram is a sparse conditional memory mechanism constrained by evidence boundaries. It writes retrieved memory entries into the evidence pool in the form of Evidence Blocks carrying source pointers, reliability, and conflict markers, and is subject to gating adjudication, rather than injecting the context without boundaries. This provides traceable and rollbackable memory collaboration with low access overhead, as described in reference [Cheng, X., Zeng, W., Dai, D., Chen, Q., Wang, B., Xie, Z., ... & Liang, W. (2026). Conditional memory via scalable lookup: A newaxis of sparsity for large language models.] arXiv preprint arXiv:2601.07372.It is used only as an analogy for engineering functions to refer to the subject of E. 3 - This is a loop-controlled conditional memory surface, rather than a direct claim to the biological neural memory mechanism. Unlike viewing memory as a freely splicable long-term context, this embodiment reconstructs it as an auditable, evidence-based memory layer: the system uses only normally segmented Evidence Blocks as the smallest unit of writing, with each entry generating a compressed key from a stable semantic fingerprint. k and with compact value slots v The system stores evidence summaries, source pointers, timestamps, reliability, conflict flags, scope of application, and revocable signatures. In a preferred embodiment, the memory table is organized using a "hash index directory + fixed-length Evidence Block records + hotspot cache" structure to achieve deterministic queries, low random read costs, and ease of audit playback. KV Block or hierarchical vector quantization codebooks are only used as alternative implementations for different capacity or compression scenarios. To prevent evidence contamination, model-generated text that has not been approved by the Evidence Gate or verified by external retrieval / sandbox execution receipts must not be directly written into the Engram; entries can only be added to the table if their source is traceable, their metadata is complete, and they meet the minimum reliability threshold. If subsequent evidence or execution results prove otherwise, the system will revoke, demote, or isolate the corresponding entry, and retain a tombstone marker to maintain version replayability. At runtime, the Router only processes uncertain vectors. U Prioritize evidence gaps and budget ledgers B An engram query is triggered only when MEMORY_LOOKUP has a higher unit cost benefit compared to continuing generation; the returned result does not directly increase the generation probability, nor is it allowed to bypass the main branch implicit fusion as an assertion. Instead, it is uniformly written into the evidence pool in the form of candidate Evidence Blocks. E Then, the evidence is passed to the Evidence Gate for proof and adjudication: those with sufficient support can participate in the subsequent conclusion convergence, while those with unresolved conflicts are only marked as disputed and trigger external retrieval or SANDBOX_EXEC for further verification, thus rewriting "memory recall" into "evidence candidate injection". In terms of cost governance, Engram uses a combination of sparse access, hot spot caching, batch prefetching and merged query to reduce memory access jitter during the decoding stage, and allows a portion of the sparse capacity budget to be transferred from the MoE expert side to the memory side in a controlled manner in Phase 2, replacing simple computing power stacking with the synergy of "sparse storage + sparse computation"; however, no matter how the capacity expands, its evidence boundary, write threshold, gating adjudication and rollback discipline remain unchanged, ensuring from a mechanism that memory only enters the closed loop as auditable evidence, and cannot degenerate back into a free association context that bypasses verification.

[0076] Engineering innovation: Low-cost closed-loop enhancement of external forensics and executable verification via the Sandbox. In the aforementioned E 3 -After the loop control semantics were identified as the core content of the invention, the embodiments of the present invention further provide an engineering implementation path that is strictly isomorphic to this loop, namely, low-cost loop enhancement of external forensics and executable verification of the Sandbox, in order to systematically migrate "generation when evidence is insufficient" to "adjudicable actions and back-injections". Sandbox refers to the external verification channel that drives verification and rollback revision in a virtual computing environment with least privilege isolation, using deterministically parsable tool calls to perform retrieval, file and code computation, and back-injecting the generated verifiable products and return codes as evidence, in accordance with the literature [Cheng, D., Huang, S., Gu, Y., Song, H., Chen, G., Dong, L., ...&Wei, F. (2026). Llm-in-sandbox elicits general agentic intelligence. arXiv preprint arXiv:2601.16206.In its specific implementation, the model explicitly expands the action set into external forensic and execution primitives such as search / fetch / compute / file-parse during inference runtime. It then uses ToolSpec+Schema / FSM constraints to converge the model output into a deterministically parsable call package (containing tool name, parameters, budget limit, timeout, and expected output type), enabling programmatic verification and replay of the execution chain. The Sandbox is implemented using a containerized isolated environment or other equivalent controlled execution environment, imposing least privilege constraints on network access, file system visibility, system call interfaces, and process permissions. The execution environment also sets upper limits on the time, memory, number of steps, and output size of a single execution. When unauthorized access, abnormal resource expansion, or exceeding limits is detected, execution is immediately terminated, a failure code is returned, and the exception information is written to the immutable circular log. The raw output returned by the execution is normalized into an Evidence Object and written into the evidence pool E, along with the source chain, timestamp, digest hash, and failure code. Subsequently, the Evidence Gate processes "retrieval evidence, execution evidence, and internal memory evidence" using the same adjudication semantics. When the result refutes a candidate claim, belief_update_rollback is triggered for minimum difference revision and solidification of conflict edges, thus forming an adjudicable trajectory of "hypothesis generation - external evidence acquisition - contradiction identification - differential revision - re-verification closed loop." This engineering innovation is methodologically aligned with the agency search / agent loop approach emphasized by Anthropic in recent years: its core is to allow the model to cyclically advance between tool calls and observation results, and to reduce context occupancy and error rates through clearer tool boundaries, procedural tool calls, and reproducible evaluation. The large model further structures this direction into a budget-governed closed-loop adjudication mechanism, making external evidence acquisition no longer an optional enhancement, but rather a cost-reliability integrated control mechanism that, together with stable convergence under budget constraints, mandatory alignment of evidence and conclusions, precise decision-making triggered by execution, and minimizing deviations in the revision process. This mechanism effectively suppresses high-risk assertions through evidence gating. When evidence is insufficient, the system tends to conservatively exit or actively seek verification rather than generating uncertain content, thereby systematically improving the reliability of the output.

[0077] Engineering innovations: Closed-loop fine-tuning training and auditable engineering deployment strategy under budget constraints. When the large model is already in E 3After solidifying the "external forensics—execution verification—reinjection revision" process into an adjudicable closed loop within the Loop framework, the next crucial step is to transform this closed-loop discipline from inference-phase orchestration rules into a learnable behavioral distribution during the training phase, and maintain end-to-end auditable consistency during deployment. Accordingly, this invention proposes a budget-constrained closed-loop fine-tuning training and auditable engineered deployment strategy, ensuring that convergence to truth no longer depends on the randomness of prompt words. The training side uses E... 3 - The Loop contract serves as the highest constraint, meaning that samples no longer only contain instructions and answers, but must also carry a central state. S t ={ Q , U , B , E , C , L The serialized trajectory, discrete action labels and parameter slots (such as RETRIEVE query template, SANDBOX_EXEC tool specification, MEMORY_LOOKUP key space), source information of Evidence Block (provenance / reliability / conflict tags), and differential rollback records of claim set C and uncertainty U are used to transform "evidence backfilling → gating decision → rollback revision → budget termination" into supervised state transition learning. To prevent the model from learning to "output structured text" instead of "making correct verification decisions", the training log synchronously records action distribution, gating pass rate, rollback frequency and budget deduction ledger, and requires the trajectory to be reproducible and ablation-comparable with the same budget caliber. On the engineering side, a PyTorch distributed training stack is used to handle FSDP / ZeRO-3, bf16 hybrid processing, activation recomputation, and efficient attention kernels, incorporating tool call artifacts and evidence artifacts into the first type of objects in the data pipeline. When computing power is limited, LoRA (Low-Rank Adaptation) / QLoRA (Quantized Low-Rank Adaptation) is used only as a controlled cost reduction measure, and its improvement in policy decision-making rather than format simulation must be demonstrated by closed-loop metrics. On the deployment side, the principle of "training-inference-audit consistency" is followed, unifying weight hashing and sharding versions, evidence artifact formats, log replay protocols, and budget ledger standards. Dialogue style is injected through an independent adapter or policy layer and decoupled from gating decisions. The Sandbox execution environment adopts least privilege and strong isolation, with encrypted artifact storage and an expiration destruction policy to ensure that any high-risk assertion under elastic scaling can be verified by the evidence chain and replay logs.

[0078] To facilitate a clear definition of the large model in E 3- The structural components, interface boundaries, and state transition relationships in a closed loop, with an attached diagram showing the central state. S t The diagram illustrates the connection methods between action routing and gating decisions, sandbox execution back-injection, rollback revision, budget termination, and audit logs, and serves as a unified reference for each step and data structure in subsequent specific implementations.

[0079] Figure 2 The E of the large model is given. 3 - How does the Loop “prefrontal control plane” maintain a central state (i.e., ...) during inference? Figure 2 (Central state in the middle) S Achieve auditable, budgetary convergence to truth → provable output: The system will output the current problem / sub-objective. Q Structural uncertainty (profile) U (u_answer / u_evidence / u_exec / u_spec / u_risk), Budget B (tokens / tools / time / steps), Evidence Pool E (Source chain + conflict + reliability) and set of claims C (Draft claims + confidence level + risk labels) and immutable circular logs L (Audit trail) is uniformly packaged as a single decision-making vehicle. S t ={ Q , U , B , E , C , LThe evidence items are pooled in the form of Evidence Objects, and at least include id (number), type, content_ref, source information (source, uri, span, timestamp), reliability (score, method), conflict list (conflicts[{evidence_id, relation, score}]), and hash. Claims are managed in the form of Claims, and at least include id, text (draft claim text), spans, confidence, risk_tag, support [evidence_id], and status. A "total assertion" refers to the smallest semantic assertion unit that can be determined as true / false / pending by a single piece of evidence. Its boundaries are defined by predicate-argument or the smallest falsifiable phrase. It is not equivalent to a token-level fragment and allows nesting, but parent-child dependencies must be explicitly recorded. Candidate assertions are written into the draft output by the Base Cortex after being rule-based segmentation by the Claim Parser. C This is accompanied by initial confidence and risk labels. The control loop (meta-control) is read by the Entropy Router loop. S t ( U , E , B , C Generate action strategies π ( S (Select action) and allocate computational (computing power) budget, setting stop / continue. The action space must at least include retrieval / memory lookup / internal inference / sandbox execution / rollback revision / termination; the Router determines whether to enter external verification based on thresholds and budget, for example, when the maximum uncertainty max( U )≥ U When the uncertainty threshold is reached, or when there is a high-risk claim with insufficient supporting evidence and option B allows, priority is given to obtaining evidence or taking action. Subsequently, the Evidence Gate triggers a gated decision. g ( C , E ), testing claims C And compare with the evidence E right CExecute the "proof carrying" verdict item by item and detect conflicts: If risk_tag is high and there is no evidence item in support with a reliability not lower than reliability_min (the minimum reliability threshold), then judge FAIL; If the evidence pointed to by support has unresolved conflicts, then judge HOLD and explicitly expose the conflict edges; When judging PASS, the traceability between the claim and the evidence pointer is forcibly required. When the gating is in HOLD / FAIL or the u_exec (execution uncertainty) increases and the proposition is falsifiable, the execution arbiter (real-world feedback) executes the verdict v(exec) to trigger sandbox_exec to run checks / checks / computations / tests in a least-privilege isolation environment, perform verification, output executable facts, and return the execution verdict result exec_verdict(pass / fail) and the execution evidence Δ E The execution product and return code are evidenced as an Evidence Object and back-injected E . Trigger rollback / update: If exec_verdict is fail or new evidence falsifies an existing claim, then call belief_update_rollback to perform "minimum differential revision", whose semantics is to only update the status / confidence / risk_tag / support of the Claim entries that are falsified or affected by conflicts and record Δ C , and simultaneously update the relevant dimensions Δ U in U . Rewriting the full text is prohibited in place of local rollback. In addition, there are also parallel action channels. After retrieval / evidence seeking, query the data source → Δ E ; Think / draft claims, internal reasoning → Δ C , Δ U . After executing / verifying facts (if feasible), then run checks / computations / tests → Δ E (execution evidence) + verdict. The Budget Governor makes hard deductions (decrease B ) for each round of tokens, tool calls, time, and steps, and uses Budget.exhausted() as a strong termination boundary (hard stop rule, including step / time limits); The stop condition of the Convergence / StopDecider is: When "all high-risk claims pass the gating and max(U) < U_threshold (residual UThe output terminates under two conditions: "acceptable" or "budget exhausted / external execution infeasible". `finalize_answer` (answer generation) (final output) only returns the claim-evidence index (chain of evidence), a summary of residual uncertainty (unresolved uncertainty), and a minimal audit summary, without exposing the unauditable implicit reasoning text. To meet the "immutable" requirement, L An append-only audit log is used to form a hash chain. Each record contains at least ts, step, S_hash (state hash), action, gate_verdict (gating decision result), exec_verdict (execution decision result), delta_C (claim set increment), delta_U (uncertainty increment), budget_delta (budget consumption increment), prev_hash (previous hash), and entry_hash (this record hash). Any tampering will break the chain verification, thus ensuring that the closed-loop trajectory is replayable and verifiable.

[0080] exist Figure 2 Based on the given "control surface driven closed-loop decision", Figure 3a and Figure 3b E of the large model 3 - The loop unfolds into an achievable two-modal division of labor and evidence convergence path: central state (i.e. Figure 3a and Figure 3b Central Cognitive State S t ) by E 3 -After continuous reading and writing to the prefrontal control plane of the Loop, the system operates according to the uncertainty vector. U With budget B Switching between Active Seeking Mode and Internal Thinking Mode (dynamic thinking), the former is the researcher's principle, namely "if uncertain → seek verification": generating ΔE through two channels: Retrieve (external) query and Memory Lookup (conditional memory), and forcibly attaching proofance and reliability (corresponding to externally retrieved evidence and engrammed evidence, respectively). O (1) Memory evidence) (proof gating), the latter being reasoning and drafting under constraints, i.e., "only when it can reduce U "Only when the time comes to think": The computational backbone Base Cortex (dense Transformer + RoPE rotational position encoding) produces only candidate Δ values ​​under budget constraints. CAnd update Δ U Furthermore, this update is smoothed / truncated via the manifold-constrained hyperconnection mHC Stability Constraint (mHC stability constraint, i.e., a training-stable complex path) to avoid gradient and gating threshold drift caused by control signals and memory insertion; both types of evidence are uniformly entered into the Evidence Pool. E Afterwards, Evidence Gate performs proof-carrying and conflict resolution on the risk-tagged claimset. If the claims are deferred (if unresolved), they are moved to the Execution Channel (tools & external). Verifiable run, test, and compute operations are performed in the Sandbox / Tools, outputting the deterministic artifact Exec Verdict and execution evidence Δ. E (Conflict diagram and usage history), and trigger a Belief Update / Rollback decision pair. C and U Perform minimum difference revisions and write them to the audit log. L The loop eventually ends under the condition of "convergence or budget exhaustion," rather than covering up unproven parts with lengthy narratives.

[0081] Figure 4a and Figure 4b It describes the pluggable implementation boundary of the large model "base cortex + parallel extension components": input tokens (lexicons) x l ,..., x t After tie-embedding, it is mapped to the initial hidden state. h 0 ( E [ x → h 0 ∈R B ×T×d After that, it enters the Nth layer Pre-Norm decoder block, and performs block (decoder block) operations. l ( l =1,..., NThe network performs pre-normalization (root mean square normalization), ensuring density and compatibility with the FlashAttn algorithm. The attention sublayer is fixed as RoPE+GQA (group query attention) and compatible with KV-cache (key-value cache), i.e., causal self-attention, to stabilize decoding bandwidth. In the hybrid expert feedforward layer, Phase 2 only replaces the FFN sublayer with a Top-k gated MoE-FFN (SwiGLU hybrid expert-feedforward network), resulting in residual 1: h' = h + attn_out; residual 2: h_next = h' + ffn_out. Router r ( x Calculate the logistic regression value logits for each token. r = W r· h (Each word), and the probability is obtained by softmax normalization. p r =softmax(logits r ), then select k One expert { E1, .., En The capacity expansion is performed by dispatching and weighted composition, thus constraining capacity expansion to conditional computation and output. without changing the output port ℎ N ∈R B×T×d With logical output logits∈R B×T×|V| Hybrid expert governance (main layer) includes load balancing loss management, capacity / overflow policies, expert discarding / redundancy, and route stability monitoring. Top-k expert selection (… e 1, e 2, w 1 ,w 2) Distribute word units → expert [ e ]; y e =Expert e ( h token Aggregation → y = w 1* y e1 + w 2* y e2 The entire process sequentially involves root mean square normalization, LM Head (Language Model Head) (linear mapping | V |, binding weights (tied), pre-normalized output logits, and each word. Among these,W To map the hidden representation of the current token to a trainable projection matrix of the expert routing score, r This corresponds to the routing logical value vector for each expert. w 1 ,w 2 represents the logical value vector from the routing path. r The weight values ​​of the top-2 experts selected are used to adjust the output of the corresponding experts. y e1 , y e2 Perform a weighted summation. N This is the last layer number of the base decoder. d To hide the state dimension, | V | represents the vocabulary size. In the architecture add-ons, inputs include ℎ N (Main input) + logits (optional). ArchitecturalAdd-ons read in parallel on this port. N Two types of side signals are output: one is generated by the uncertainty / calibration head. U = ( u a , u e , u x , u s , u r )∈[0,1] 5 As E 3 - The loop uses policy sensors to provide stop / continue signals and budget allocation targets; the second is the claim → evidence binding head. U =bind∈R B×T×K By providing evidence-carrying hints, asserting fragments + evidence IDs, and supporting conflict perception, a binding hint matrix is ​​provided at the token level to reduce the cost of subsequent evidence alignment search. u a , u e , u x , u s , u r That is, in Example 1 u answer , u evidence , u exec, u spec , u risk The Uncertainty / Calibration Head, Claim→Evidence Binding Head, and ToolSpec Grammar Adapter are all mounted as parallel attachment heads on the same BaseCortex. h N Above this, gradients are shared end-to-end with the backbone network by default, and joint training is conducted under supervision along with the closed-loop trajectory. Alternatively, the backbone can be frozen during deployment, with only the additional headers fine-tuned to reduce migration costs. Subsequently, two types of side signals enter the control stack, E 3 - The Loop controller can optionally enable the ToolSpec Grammar Adapter to apply a token-mask to logits, forcing deterministic parsing of the tool specification flow. Then, the tool_result (the tool execution result, i.e., the original result) is wrapped into a stable Evidence Block through the Engram Evidence Boundary. The evidence is then re-injected into the next round of prompts / context, forming a closed-loop interface of "execution product → evidence object → reusable input". h N (Step-by-step) trained mHC ConstraintHooks are attached to the system in the form of hidden dynamics penalty terms. h N Above, a loss term is added without rewriting the semantics of the attention / FFN operator; it only provides a stability prior to prevent gradient and threshold drift caused by control signals and memory injection. Furthermore, Figure 4b It also includes the pedestal cortex: The MoE decoder includes: embeddings, blocks: attention (rotational position encoding + group query attention) + hybrid expert-feedforward network, h N Logits. Through porting (adaptation and porting), state snapshot: policy + evidence alignment. Conditional memory evidence boundaries: (conditional memory storage + retrieval) including: key: n-gram / context hash; value: payload vector + metadata. Through retrieval (context...) 键 Conditional memory gating: ɑ = gating ( h 词元Evidence (suppressing conflict / noise). Then, evidence is emitted, injected into the adapter via conditional memory, including ID, source, timestamp; claim fragment / n-gram; confidence, conflict; and an injection tensor, injected into the adapter via conditional memory: h' = h + ɑ∙Proj(val); where Proj(val) is a linear projection function. The actions sequentially pass through the policy sensor and controller: {query interaction / retrieval / execution / correction / ...}. Upon entering the conditional memory trigger, the context is constructed. 键 The system calls the retrieval tool to obtain the call condition memory. After entering the evidence adjudicator, it checks the source chain, detects conflicts, and determines acceptance / rejection. The final output gating is: only allowing evidence to be carried, based on accepted evidence or experience sandbox results.

[0082] Figure 5 Shown in E 3 The single-round decision-making minimum complete path under the Loop closed-loop truth-seeking architecture is designed not to make the model "think one more step," but to reconstruct generative reasoning into an auditable, reproducible, and rollback-capable verification process within budget constraints. Initially, the system reads and uses the central state... S t = { Q , U , B , E , C , L As the sole decision-making vehicle, computational action set A feas The current problem / sub-goal Q Structural uncertainty U ,Budget B Evidence pool E Atomic Claims Collection C With immutable circular logs L By unifying everything into a single state machine, every subsequent action can be traced back to a clearly defined input and resource; based on this, the Entropy Router reads ( U , E , B , C Output the action for this round. a t and the depth of reasoning and the stopping threshold, and the execution action channel (according to) a t (Branch), and select external retrieval in the action channel → generate Δ E (Including traceability / reliability / conflict) write E Conditional Engram lookup table → Fast writing of candidate evidence E Internal (base cortex) drafting candidate claims Δ C and updateΔ U (Candidates only) or trigger Sandbox executable verification → return to execution decision and Δ E Write E This explicitly transforms the researcher-driven iterative verification process of "hypothesis generation - external evidence acquisition - contradiction identification - differential revision - re-verification closed loop" into a controllable sequence of actions. Evidence gate then applies this to the claim set. C Each proof-carrying ruling is executed and marked PASS / HOLD / FAIL. The conclusion must carry a locatable evidence pointer, and conflicting relationships must not be silently overwritten. When gating fails and the proposition is falsifiable, the Execution Arbiter triggers SANDBOX_EXEC to obtain verifiable execution evidence and the ruling result. If necessary, a rollback revision is used to update the rejected claims using a minimum difference method. C And adjust simultaneously U This mechanism aims to prevent "rewriting the narrative" from replacing "revising beliefs." Budget management: The Budget Governor performs hard deductions on tokens / tools / time / steps. B The data is written to budget_delta, and the actions, gating, and execution decisions are written to an immutable log in the form of an append-only hash chain. L This ensures the closed-loop trajectory has an unalterable audit standard; ultimately, the Stop Decider uses "budget exhaustion" and "evidence gating all PASS and max( U )< U The two-conditional approach of "_threshold" completes hard termination or convergence output and returns only the claim-evidence index, residual uncertainty, and minimum audit summary, thus transforming the system's optimization objective from the fluency of generated text to a series of quantifiable, objective metrics directly related to training dynamics and generalization ability. Training stability: The gradient norm is constrained within a controllable range, and activation value scaling drift is suppressed.

[0083] Convergence performance: With the same number of training steps or budget, the model converges more stably on the validation set, resulting in a lower final loss value.

[0084] Decision reliability: When control signals (such as uncertainty vectors) propagate between different layers of the model, their numerical range remains stable, avoiding decision errors caused by signal distortion.

[0085] refer to Figure 6 In step S2, the pre-scaling matrix H pre The original value of the pre-scaling matrix is ​​obtained by applying the Sigmoid function. ẼH pre The post-scaling matrix is ​​obtained by transformation. H post By applying the Sigmoid function to the original value of the post-scaling matrix ẼH post The transformation result is obtained by multiplying it by a coefficient of 2, which makes the post-scaling matrix... H post The value range is greater than 0 and less than 2.

[0086] In step S3, the layer core calculation function F layer This is either a self-attention computation function or a feedforward neural network computation function. When the core computation function of the layer... F layer When it is a feedforward neural network computation function, it is the feedforward neural network computation function in the hybrid expert model.

[0087] Figure 6 Located in E 3 Within the Loop's "computational bearing layer (base cortex / Phase 2 MoE cortex)," the function is not to generate new control rules, but rather to repeatedly write Δ to the control surface. U Δ C Evidence injection provides verifiable numerical stability boundaries, ensuring that the closed loop does not experience gating threshold drift and calibration distortion due to instability in deep residual dynamics during multiple iterations. The mechanism unfolds sequentially along the arrow path: In the first layer of the mHC mapping @ (), for each layer's input flow vector (i.e., feature tensor)... x l ∈R {B×n×d} First, perform dynamic mapping generation, then generate vec( x l (Representation vectorization) is obtained through linear projection. and Then, in the manifold projection stage, three types of structural matrices are formed, among which... and Used to constrain the pre-mixing and post-increment to be non-negative scaling. Right now Explicitly projected to DS ( n A double random matrix manifold is used to achieve residual routing with "approximate mass conservation"; subsequently, ( H pre I d )right x l Premixing, i.e. u l =( Hpre I d )· x l , obtain the input layer function F (Composed of causal self-attention of RoPE+GQA+KV-cache and MoE-FFN of SwiGLU or Phase2), output features y l= F layer ( u 1 )(Right now Figure 6 In y l= F ( u 1) After () H pos t I d ) Form delta=( H post I d )· y l (Increment) and ( H res I d )· x l Stable residual fusion is performed to obtain x {l+1} =( H res I d )· x l +delta ensures that crossflow residual propagation remains bounded, repeatable, and has a limited number of convections during both training and inference. n streams It is insensitive to dynamic changes. mHC only operates on the pre-mixing and fusion routing of residual connections, without rewriting the operator semantics or forward computation process of attention / FFN. In implementation, this module exposes forward(...) as an mHC wrapper. x , F layer The interface internally uses a sinkhorn. knopp (An iterative algorithm) Iterative implementation DS (n) projection, and in constrainthook The (constraint hook) provides row and column sums, biases, non-negative boundaries, and an optional "sharpness" penalty as a training-period stability hook; therefore, it is in E 3 - The loop serves as a "stable and controllable cortical dynamic" rather than a substitute for evidence gating or execution of adjudication semantics.

[0088] Figure 7 Give a large model in E 3 The key to implementing closed-loop forensics for Sandbox within the Loop lies not in "calling tools" themselves, but in transforming tool calls into an auditable event flow that is constrained by the control plane, accepted by the evidence gate, and capable of driving belief revisions in reverse. Policy Sensors first output policy signals related to task risk, remaining budget, and trigger thresholds. These signals are then processed by the controller and by E... 3 The Loop Controller condenses this into two types of constraints: one type acts on the action tendency and stopping conditions of the LLM Policy (Large Language Model Policy), and the other type is issued to the ToolSpec Grammar Adapter in the form of policy + budgets. This applies a token-mask based on a finite state machine / schema to the candidate output, ensuring that the model can only generate resolvable calls that meet the tool specification, thus compressing the output space that is "tool-like but actually fabricated" from the source. Subsequently, the LLM Policy initiates a tool call according to controlled syntax, entering the Sandbox. Within the three isolated domains of External Access, FileSystem, and Code Execution, deterministic observations and artifacts are generated. These artifacts do not directly contribute to the final answer; instead, they are first fed into Proof-carrying Hints, binding the execution result with verifiable fingerprints such as artifact hashes, source and timestamps, and failure reasons as traceable evidence. This evidence is then fed back into the LLM Policy (loop) to trigger secondary inference and necessary rewriting. Final Output is only output when the evidence-carrying conditions are met and the control plane allows the submit() function. This structure creates a closed loop of "external evidence gathering - evidence carrying - policy loop," thus elevating execution verification from a one-off external step to a system mechanism that is budget-governed, gated, and reliably drives the convergence of metrics such as revision fidelity and execution trigger accuracy.

[0089] Example 2 To ensure the reproducibility and auditability of the large model in specific implementation, the initial implementation steps are solidified in the form of "documented contract + code implementation". 3 - Loop core technology: E 3 - The closed-loop semantics, five key elements, and central state of a loop. S t ={ Q , U , B , E , C , L Field constraints and action space A The system includes standardized technical solutions for triggering conditions such as retrieval / memory / internal inference / sandbox execution / rollback revision / termination, strategy generation and budget allocation for Entropy Router, proof-carrying adjudication and conflict arbitration for Evidence Gate, executable verification and evidence injection for Execution Arbiter, deduction rules and hard stop boundaries for Budget Governor, convergence criteria and conservative exit for Stop Decider, and replay parameters for immutable audit log L. These are all recorded in the sword_23.md file as an unambiguous runtime contract. The corresponding Python core script provides typed state and evidence objects, run_e3_loop control functions and standardized interfaces. The ToolSpec Grammar Adapter and Sandbox tool layer implement deterministic parsing and least privilege isolation. EngramEvidence Boundary confers evidence for memory entries and injects noise suppression. mHC constraints stabilize residual dynamics with switchable training hooks, thereby locking the closed-loop truth-seeking mechanism into a reproducible implementation scheme through executable code paths.

[0090] In practical training implementation, "closed-loop post-training" serves as the main approach. You must first freeze the E data you've already completed in the aforementioned sections. 3- The Loop control contract includes central state, action routing, evidence gating, executable verification, rollback revision, budget deduction and termination criteria. It then uses five strong bases as the starting line for capabilities. Through unified data tracing and replayable sandbox execution, it writes closed-loop discipline into the weight distribution, and finally derives new safetensors (safe tensor format) shard weights and completes auditable deployment. The five bases are fixed according to their uses: a general flagship, two general lightweight bases, a coding agent, and an embodied VLA (Visual-Language-Action / Vision-Language Model). The general flagship uses Qwen3.5-397B-A17B, while the general lightweight bases use Qwen3-30B-A3B-Instruct-2507 and Qwen3-30B-A3B-Thinking-2507 respectively to correspond to the Instruct (instruction execution) and Thinker strategies. The coding side uses Qwen3-Coder-Next for agency coding and tool loop, and the embodied side uses the LingBot-VLA model for vision-language-action loop. The engineering meaning of this combination is to entrust "general semantics and knowledge coverage" to the strong base, and to entrust "within-budget convergence, evidence-conclusion alignment, execution trigger accuracy, revision fidelity, and high-risk fabrication zeroing rate" to E. 3 - Training is solidified after the loop, ensuring that the training budget is consumed on verifiable closed-loop reliability, rather than being diluted by verbose narratives. The availability of general and lightweight bases and model artifact formats are based on their open-source repositories, and the coding base Qwen3-Coder-Next is also based on the official release.

[0091] The core of data engineering is not to "manually rewrite" all open-source corpora into complete closed-loop trajectories, but to establish a hierarchical trajectory protocol so that closed-loop supervision primarily comes from computable and replayable signals. When samples are added to the database, at least machine-readable task context and action records should be generated. Q , B The evidence and execution artifacts (including tool calls, gating decisions, execution return codes, artifact hashes, and evidence source pointers) are uniformly encapsulated as Evidence Objects and written into the evidence pool E, automatically generating auditable logs. L Uncertainty vector U With Atomic Claims Collection C By default, it does not rely on subjective manual annotation. Instead, training labels are automatically derived from the model output, gating results, execution decisions, and conflict graphs. Examples of labels include "whether evidence collection / execution was triggered," "gating PASS / HOLD / FAIL," "execution verdict (adjudication result)," and "rollback differential Δ." C"As a supervisory signal, manual labeling is introduced only for a small number of high-risk or high-value samples to calibrate thresholds and correct biases; this avoids increasing the cost of the entire dataset with subjective annotations and eliminates the logical loop that 'training data must first satisfy closed-loop discipline.' Evidence is uniformly packaged as 'Evidence'." The minimum requirements for the Object field are to include source pointer, reliability, conflict marker, timestamp, digest hash, and verifiable product reference, making "evidence-conclusion alignment" a decisionable constraint during training rather than a post-hoc description. Deduplication and contamination control are based on cross-set hash deduplication, benchmark leakage filtering, and tool output forgery detection. Distribution balancing explicitly increases the proportion of high-risk assertions, conflicting evidence, failure rollbacks, and tool execution samples, naturally covering the closed-loop behavior of "insufficient evidence → postponement / verification," "unresolved conflicts → remaining unresolved," and "execution failure → minimum difference revision." Preference and alignment data primarily use UltraFeedback (an open-source preference dataset) and Tülu (a data system) to narrow convergence gate thresholds and conservative exit boundaries, preventing the model from confidently outputting high-risk assertions when evidence is insufficient.

[0092] Tools and Sandbox forensics should not be described as temporary add-ons during deployment, but rather as E 3 - The "executable verification channel" shared by the Loop in both training and inference is consistently modeled: during the training phase, data such as ToolBench, which provides tool call trajectories, is used as the main source. The call sequences, parameter slots, return codes, and failure reasons of multiple tool tasks are standardized into replayable records. The product summary, source chain, and timestamp generated by each call are encapsulated and written back to the evidence pool so that evidence gating and rollback revisions can be learned and adjudicated on the same data structure. The sandbox employs a least-privilege isolated execution domain, separating external retrieval, web crawling, file system, numerical computation, and code execution into independent executors. Each executor is given a ToolSpec and Schema or FSM constraint. During the decoding phase, a token-level mask is applied by the syntax adapter to ensure that the model output falls only within a deterministically parsable call space, thus systematically compressing the generation freedom of "pseudo-tool call-based fabrication." Observations and artifacts returned by the sandbox are first evidenced as Evidence Objects (containing verifiable fingerprints, return codes, timeout and conflict markers) before being injected into the next round of state updates. Execution failures are also recorded as evidence events in the audit log to drive minimum-difference rollback. For coding branches, the sandbox can be extended to a repository-level execution environment to replay dependency installation, unit testing, and build processes, forming deterministic feedback. For embodied branches, an execution channel in the form of simulation or data replay can be selected, writing environmental feedback as isomorphic evidence objects into the evidence pool, thereby maintaining Evidence under different modalities. 3 - The gating semantics of the loop are consistent with the auditable closed loop.

[0093] Regarding the selection of open-source datasets, this implementation plan requires that each type of data can provide a "decidable signal" for the closed-loop mechanism, rather than simply improving language fluency. ToolBench is used for general tools and execution trajectories; Ultra Feedback and Tülu's open recipes are used for general alignment and preferences; SWE-bench is used as a benchmark for real-world defect repair and testing for coding tasks, and APPS and Code Contests are used to supplement the distribution of decidable programming problems, enabling the model to learn to transform inference into runnable products under budget constraints and accept test judgments. For embodied tasks, Open X-Embodiment and Bridge DataV2 are used as cross-platform trajectory and manipulation data sources to cover vision-language-action conditional policy learning and cross-environment generalization, and success / failure, keyframe feedback, and task progress are explicitly written into the evidence object. Although the Code Contests repository is archived, the data and task definitions can still be used as training corpus and evaluation distributions, and its public description as a source of Alpha Code training data can be used to demonstrate its task attributes and decision-making mechanism.

[0094] Step S3 specifically includes: Reasoning trajectories that follow the discipline of the state-action-evidence gating-rollback revision closed-loop control architecture are used as positive samples, while those that violate this discipline are used as negative samples. At least one of the following—evidence gating pass rate, execution trigger accuracy, and rollback revision precision—is used as a reward signal to optimize the behavior distribution of the large language model foundation. Fine-tuning training is implemented in a distributed post-training pipeline within the PyTorch framework. The core principle is to train the "closed-loop protocol" into a generalizable policy, rather than simply training the structured text surface. The training process begins with closed-loop protocol supervision and fine-tuning: trajectory data is used to supervise the model's output action selection and tool specifications, ensuring that it can stably trigger retrieval, memory, or sandbox execution when uncertainty increases or evidence gaps appear, and generating an atomic claim set with evidence pointers after the evidence pool is updated. Next, gating threshold and preference convergence training is performed: preference data and failed replay samples are used to penalize strategies such as "making strong assertions with insufficient evidence," "silently covering unresolved conflicts," "skipping execution when it should be executed," and "excessive rollback leading to semantic drift," ensuring stable boundaries for gating decisions and stopping conditions. Finally, sandbox consistency replay verification is performed: a fixed set of executable samples is repeatedly replayed in the later stages of training, requiring reproducible tool calls under the same budget, consistent evidence injection formats, and interpretable rollback differences, thus making the auditability of the closed loop a hard condition for training completion.

[0095] This process applies only minimal modifications to each pedestal required for its function: Qwen3.5-397B-A17B prioritizes parameter-efficient post-training, focusing its learnable capacity on layers related to uncertainty / calibration, claim-evidence binding, and tool specification constraints. The underlying reason is that the flagship pedestal already possesses strong representations, and the larger model needs to supplement closed-loop control semantics. Qwen3-30B-A3B-Instruct-2507 leans towards execution control, with training focusing on low-overhead tool triggering and gating stability. The underlying reason is that its advantage of achieving significant results with limited resources must be realized by reducing invalid inference and improving execution trigger accuracy. Qwen3-30B-A3B-Thinking-2507 is biased towards... For highly complex reasoning but constrained by budget, the training focus is on the discipline of "reasoning output only entering the gating as candidate claims" and the minimum difference rollback after failure. The underlying reason is that its value lies in turning reasoning into adjudicable actions rather than long texts. Qwen3-Coder-Next must use repository-level sandbox replay as hard supervision and solidify the closed loop of patch generation and test adjudication as a strategy. The underlying reason is that the reliability of coding comes from execution verification and rollback rather than static completion. LingBot-VLA mainly uses behavior cloning and introduces failure replay evidence training, so that the action output is also subject to gating adjudication and rollback revision. The underlying reason is that the error cost of embodied scenarios is higher, and the zero-risk fabrication rate can only rely on verifiable feedback. The training process employs PyTorch's distributed capabilities (such as FSDP / ZeRO-like strategies), bf16 hybrid processing, activation recomputation, and an efficient attention kernel. Gating pass rate, execution trigger hit rate, rollback frequency, budget deduction ledger, and evidence conflict graph size are recorded as first-class training logs, along with the loss curve, to demonstrate that the closed-loop behavior converges rather than occurs by chance.

[0096] Weight production and engineering deployment are terminated based on the criteria of "product traceability, protocol alignment, and audit replayability." After each model training is completed, it is exported as safetensors shard weights and a version stamp and hash digest are written. The data list used for training, filtering rules, trajectory protocol version, tool specification schema, random seed, and key hyperparameters are all solidified into a product list. The inference framework uses an engine capable of handling long contexts and high-throughput decoding as its foundation, such as an inference service stack compatible with the Transformers ecosystem and supporting KV-cache and batch processing. The Qwen official model card also clearly states its compatibility with inference frameworks such as vLLM and SGLang. Meanwhile, the upper-layer runtime implements E... 3- The Loop controller, tool syntax constraints, sandbox execution, and evidence object back-injection make "evidence collection and execution" a systemic action governed by budget governance rather than a loose add-on. The backend persistence layer stores Evidence Objects, gating decision records, budget ledgers, rollback differentials, and sandbox artifact hashes as first-class artifacts, supporting offline replay review and failure attribution; online monitoring uses the full names of five Chinese indicators as a unified standard, transforming model iteration from "more eloquent" to "more stable and verifiable under the same budget," and ensuring the consistency of closed-loop semantics between the deployment and training periods through periodic sampling of sandbox replay samples.

[0097] Tools and sandbox forensics should not be described as temporary add-ons during deployment, but rather as E 3 - The "executable verification channel" shared by the Loop in both training and inference is consistently modeled: during the training phase, data such as ToolBench, which provides tool call trajectories, is used as the main source. The call sequences, parameter slots, return codes, and failure reasons of multiple tool tasks are standardized into replayable records. The product summary, source chain, and timestamp generated by each call are encapsulated and written back to the evidence pool so that evidence gating and rollback revisions can be learned and adjudicated on the same data structure. The sandbox employs a least-privilege isolated execution domain, separating external retrieval, web crawling, file system operations, numerical computation, and code execution into independent executors. For each type of executor, a ToolSpec and Schema or FSM (Finite State Machine) constraint are defined. During the decoding phase, a token-level mask is applied by the syntax adapter to ensure that the model output falls only within a deterministically parsable call space, thus systematically compressing the degree of freedom in generating "pseudo-tool call-based fabrication." Observations and artifacts returned by the sandbox are first evidenced as EvidenceObjects containing verifiable fingerprints, return codes, timeout and conflict flags, and then injected back into the next round of state updates. Execution failures are also recorded as evidence events in the audit log to drive minimum-difference rollback. For coding branches, the sandbox can be extended to a repository-level execution environment to replay dependency installation, unit testing, and build processes, forming decidable feedback. For embodied branches, an execution channel in the form of simulation or data replay can be selected, writing environmental feedback as isomorphic evidence objects into the evidence pool, thereby maintaining Evidence under different modalities. 3 - The gating semantics of the loop are consistent with the auditable closed loop.

[0098] Example 3 This embodiment provides a residual routing constraint method applied to a hybrid expert model. The difference between this embodiment and Embodiment 1 is that the residual routing constraint method is applied to the feedforward neural network layer in the hybrid expert model. In this embodiment, the core computation function Flayer is specifically MoE-FFN. An mHC wrapper is applied outside the MoE-FFN layer. The MoE-FFN itself contains a router that distributes the input to the top-k experts, each of whom is an independent feedforward neural network whose output is weighted and summed. The mHC mechanism applies to the input and output of the MoE-FFN layer, and its dynamic mapping, manifold projection, and stable fusion steps are similar to those in Embodiment 1. The stability of mHC contributes to the stability of MoE routing decisions, avoiding routing jitter caused by scale drift of input features.

[0099] The working principle of this embodiment is that the stable signal routing provided by mHC at the MoE-FFN layer makes expert selection more reliable and reduces the problem of unbalanced expert load caused by fluctuations in activation values.

[0100] When applied to the MoE layer, the scaling matrix of mHC can be co-optimized with the output of the MoE routers, for example, through a lightweight coordination network, or by using the confidence of the MoE routers as one of the additional inputs generated by mHC, to ensure consistency of routing decisions between the two layers.

[0101] Example 4 This embodiment provides a neural network training stability enhancement device integrating residual routing constraints, comprising a processor and a memory. The memory stores a computer program, which, when executed by the processor, implements the residual routing constraint method described in Embodiment 1 or 2. This device can be integrated into a large language model training system, which includes a base model and a stability enhancement module. The stability enhancement module embeds mHC wrappers at specified layers of the base model (e.g., every few layers or all layers). Further, the system may also include an evidence-driven closed-loop reasoning control module (e.g., E... 3 - Loop Controller): The mHC ensures that the control signals (such as the uncertainty vector U) generated by this module propagate stably between the layers of the base model. Components and Connections: The stability enhancement module (implementing the mHC function) is connected to the neural network layers of the base model, receiving layer input. x l After the output stabilizes x l +1. The evidence-driven closed-loop reasoning control module is connected to the final hidden layer or a specific interface layer of the base model to acquire state information and generate control signals.

[0102] The working principle of this embodiment is as follows: During training, the stability enhancement module continuously operates to ensure the stability of the underlying dynamics. The evidence-driven closed-loop inference control module makes more reliable decisions (such as whether to trigger tool calls) based on the stable model state.

[0103] Implementation steps: In the training script, instantiate the mHC wrapper class and insert it into the model definition. During the training loop, it integrates seamlessly with the forward propagation process.

[0104] Example 5 This embodiment provides an artificial intelligence chip that integrates hardware circuitry dedicated to executing residual routing constraint methods. The hardware circuitry includes: Mapping Unit: Contains a dedicated matrix multiplier (MAC) array and activation function unit for fast linear projection, generating... ẼH pre , ẼH post and ẼH res .

[0105] Projection unit: Contains a lookup table (LUT) or dedicated circuitry for computing the Sigmoid function, and iterative computation logic for performing Sinkhorn-Knopp iterations. This logic may include row / column summing circuitry and a divider to efficiently perform double randomized projection.

[0106] Fusion computing unit: Contains efficient tensor multipliers and adders for computation. u l , y l , and finally x l +1.

[0107] How this embodiment works: The chip is designed to accelerate mHC computation. During training or inference, data flows through these dedicated units, completing all computational steps of the mHC at speeds far exceeding those of general-purpose processors.

[0108] Example 6 In high-end intelligent manufacturing (such as semiconductor wafer fabrication or aerospace precision component production), production lines generate massive amounts of multimodal data, including sensor time-series data, machine vision images, equipment logs, and manual quality inspection reports. Traditional quality inspection systems based on rules or simple machine learning models struggle to handle such complex, high-dimensional data with long-range dependencies, leading to high false positive and false negative rates and an inability to provide in-depth root cause analysis and decision recommendations. This embodiment describes a large language model system integrating the aforementioned residual routing constraint method to achieve stable and reliable end-to-end quality analysis and decision support. The large language model system includes: The base model employs a decoder-only Transformer architecture with long context processing capabilities, consisting of over 100 layers, to capture complex patterns ranging from microscopic sensor fluctuations to macroscopic production batches.

[0109] The data preprocessing and fusion module is used for multimodal data fusion and control signal injection.

[0110] The multimodal data fusion refers to aligning and normalizing sensor data (temperature, pressure, vibration) at different sampling frequencies through time series, and then concatenating them with visual features (defect images) extracted by a convolutional neural network (CNN) and natural language quality inspection report text features that have undergone word embedding to form a unified input sequence.

[0111] The control signal injection refers to inputting the specifications (such as tolerance range) and equipment health status indicators of the current production batch as key control signals into the model along with multimodal data. These control signals need to maintain numerical stability and semantic consistency during deep propagation in the model; any distortion may cause the decision to deviate from the actual constraints.

[0112] The residual routing constraint method (mHC mechanism) is applied to the critical layers of the base model of the system in this embodiment (e.g., an mHC layer is inserted every 5-10 layers, especially in the layer that processes control signal fusion), including the following steps: F1, Dynamic Mapping Steps.

[0113] For the l Input feature tensor of the layer x l (Its shape is [batch size, sequence length, feature dimension], for example [32, 2048, 4096]), generating three original matrix values ​​through a lightweight linear projection layer (e.g., a learnable weight matrix): Original values ​​of the pre-scaling matrix Original values ​​of the post-scaling matrix : Original values ​​of the residual routing matrix. These original values ​​are based on the current input. x l Dynamically generated, this allows the routing strategy to adapt to the characteristics of the input data.

[0114] F2, manifold projection steps.

[0115] Pre-scaling / post-scaling matrix: for and Apply a nonnegativity constraint. Specifically: The values ​​are constrained to the (0,1) interval and used as premixed weights for the input features.

[0116] By constraining the value to the (0,2) range, the output of the layer core computation is provided with flexible scaling capability, which can both enhance the representation and avoid over-amplification.

[0117] Residual routing matrix: This is the core of stability. Perform exponentiation Ensure non-negativity, then project it onto a birandomized matrix manifold using the Sinkhorn-Knopp iterative algorithm (e.g., 10-20 iterations). This means the final matrix... H res The sum of each row and the sum of each column are strictly equal to 1. This mathematical property ensures that the overall "energy" of the signal is approximately conserved when it is mixed between residual paths, fundamentally suppressing gradient explosion / vanishing and representation scale drift in deep networks.

[0118] F3, Stable fusion steps.

[0119] Premixing: utilizing H pre For input x l Perform the transformation: u l = ( H pre I d )· x l (in I d This indicates that operations are performed on the feature dimension.

[0120] Layer core computation: preprocessed features u l Enter to the number l Core functions of the layer F layer In this embodiment, F layer This could be a self-attention mechanism (used to capture long-range dependencies) or a feedforward neural network in a hybrid expert model (MoE) (used to efficiently handle complex feature transformations). For example, in MoE-FFN, the router... u l The signal is distributed to the most relevant expert networks for processing.

[0121] Stable output: Calculate the final output of this layer. x l +1: yl= F layer ( u 1 ) Scaled output = ( H post I d )· y l Stable residual = ( H res I d )· x l x l +1 = Scaled output + Stable residual This fusion approach ensures that even with a deep model, the original input information (especially key control signals) can be transmitted to higher layers in a controllable and stable manner.

[0122] In this embodiment of the system, the Evidence Pool is a core data structure used to store and manage all information fragments that support the final quality judgment. It is not only a collection of information, but also a network with relationships and weights.

[0123] Assuming this embodiment analyzes a quality issue with wafer batch number WF-2024-08-001, evidence pool E may contain the following entries: 1. E1: {Type: "Sensor Data", Content: "Temperature fluctuation of Etching Machine A exceeded the threshold ±2℃ between timestamps T1 and T2", Source: "Sensor ID-S1234 Log", Reliability: 0.95, Timestamp: T2}.

[0124] 2. E2: {Type: "Visual Inspection", Content: "Micro-scratch pattern found in wafer edge area", Source: "AOI camera Cam-5 image ID-IMG5678", Reliability: 0.90, Timestamp: T3}.

[0125] 3. E3: {Type: "Device Log", Content: "Robot R7 failed to complete the standard calibration process before the start of the batch", Source: "MES System Event Log", Reliability: 0.85, Timestamp: T0}.

[0126] 4. E4: {Type: "Historical Knowledge", Content: "Past data shows that temperature fluctuations combined with abnormal robotic arm calibration are correlated with the current type of scratch defects by up to 80%", Source: "Historical Database Statistical Analysis", Reliability: 0.88}.

[0127] 5. E5: {Type: "Conflicting Evidence", Content: "Another set of sensor data shows that the cooling system was working normally during the same period", Source: "Sensor ID-S5678", Reliability: 0.80, Related Evidence: E1, Conflict Relationship: "Partially contradictory"}.

[0128] The evidence pool in this embodiment has the following functions: Supporting Decisions: When the model generates a preliminary conclusion, such as "Batch WF-2024-08-001 has high-risk edge defects, primarily caused by etching machine temperature runaway and abnormal pre-processing," this conclusion is associated with entries in the evidence pool. Each atomic claim in the conclusion (such as "temperature runaway") must point to supporting evidence (such as E1, E4) in the evidence pool. This achieves a rigid binding between conclusion and evidence, avoiding passive assertions.

[0129] Conflict Detection and Adjudication: The evidence pool explicitly records conflict relationships between pieces of evidence (such as E1 and E5). Instead of silently covering up conflicts, the system marks them and may trigger further investigative actions (such as retrieving more detailed sensor data or performing simulations), thereby avoiding erroneous decisions based on incomplete information.

[0130] Uncertainty quantification: The sufficiency, reliability, and existence of conflicts of evidence directly affect the uncertainty vector U generated by the system. For example, if a key claim lacks support from highly reliable evidence or there are unresolved strong conflicts, the corresponding uncertainty dimensions (such as evidence, urisk) will remain high, prompting the system to adopt a conservative strategy (such as "postponing the decision and suggesting manual review") rather than blindly giving a highly certain answer.

[0131] Auditability: The inputs to the entire reasoning process, the intermediate claims generated, the evidence cited, and their relationships are all recorded in an immutable log. This makes any decision traceable and auditable, meeting the stringent requirements of industry for process interpretability and quality traceability.

[0132] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, several equivalent substitutions or obvious modifications can be made without departing from the concept of the present invention, and all such modifications, achieving the same performance or purpose, should be considered within the scope of protection of the present invention.

Claims

1. A residual routing constraint method for enhancing the stability of neural network training, characterized in that, Includes the following steps: S1, Dynamic Mapping Step: Based on the first step in the neural network... l Input feature tensor of the layer x l Generate the original values ​​of the pre-scaling matrix. The original value of the post-scaling matrix and the original values ​​of the residual routing matrix ; S2, Manifold Projection Step: Apply the original values ​​of the pre-scaling matrix... and the original value of the post-scaling matrix By applying a nonnegativity constraint, the pre-scaling matrix is ​​obtained. H pre and post-scaling matrix H post ; the original value of the residual routing matrix The residual routing matrix is ​​obtained by performing nonnegation processing and constrained optimization to satisfy the double stochastic matrix condition. H res The double random matrix is ​​required to have a sum of 1 in each row and a sum of 1 in each column; S3. Stable fusion step: Utilizing the aforementioned pre-scaling matrix H pre For the input feature tensor x l Premixing is performed to obtain preprocessed characteristics. u l The preprocessed features u l Enter to the number l Layer core calculation function F layer Calculations are performed to obtain the layer output features. y l ; The post-scaling matrix H post Acting on the output features of the layer y l After obtaining the scaled output, the residual routing matrix is... H res Acting on the input feature tensor x l After obtaining the stable residual, the scaled output is summed with the stable residual to obtain the first... l Layer output features x l +1.

2. The residual routing constraint method according to claim 1, characterized in that, In step S2, the pre-scaling matrix H pre The original value of the pre-scaling matrix is ​​obtained by applying the Sigmoid function. The post-scaling matrix is ​​obtained by transformation. H post By applying the Sigmoid function to the original value of the post-scaling matrix The transformation result is obtained by multiplying it by a coefficient of 2, which makes the post-scaling matrix... H post The value range is greater than 0 and less than 2.

3. The residual routing constraint method according to claim 1 or 2, characterized in that, In step S3, the layer core calculation function F layer This is a self-attention computation function or a feedforward neural network computation function.

4. The residual routing constraint method according to claim 3, characterized in that, When the core calculation function of the layer F layer When it is a feedforward neural network computation function, it is the feedforward neural network computation function in the hybrid expert model.

5. A large language model training system, characterized in that, include: The base model contains multiple neural network layers; as well as A stability enhancement module is configured to apply the residual routing constraint method as described in any one of claims 1 to 4 at at least one neural network layer of the base model; An evidence-driven closed-loop inference control module is configured to generate and update a control signal, the control signal including an uncertainty vector; wherein, the stability enhancement module ensures that the control signal remains numerically stable as it propagates between the neural network layers of the base model by applying the residual routing constraint method.

6. A neural network model training service system, characterized in that, include: A server cluster, configured with hardware resources for performing neural network model training; The service interface is configured to receive neural network model training tasks and configuration parameters submitted by users. as well as A training control engine is configured to invoke the residual routing constraint method as described in any one of claims 1 to 4 during the execution of the neural network model training task, so as to improve the stability of the neural network model training.

7. A bitstream, characterized in that, The bitstream is generated by an encoder that encodes the parameters or intermediate features of a neural network model by performing the residual routing constraint method according to any one of claims 1 to 4.

8. A method for enhancing the stability of a neural network model for industrial quality inspection and decision support, characterized in that, The neural network model stability enhancement method is applied to an industrial large language model containing multi-layer neural networks. This industrial large language model is used to process multimodal data in industrial scenarios and output quality analysis and decision-making suggestions. The neural network model stability enhancement method includes the following steps: F1, Dynamic Mapping Steps: Based on the first step in the neural network... l Input feature tensor of the layer x l Generate the original values ​​of the pre-scaling matrix. The original value of the post-scaling matrix and the original values ​​of the residual routing matrix ; F2, Manifold Projection Step: Apply the original values ​​of the pre-scaling matrix... and the original value of the post-scaling matrix By applying a nonnegativity constraint, the pre-scaling matrix is ​​obtained. H pre and post-scaling matrix H post ; the original value of the residual routing matrix After performing the exponential operation, the residual routing matrix is ​​projected onto a birandom matrix manifold using an iterative algorithm. H res The double random matrix is ​​required to have a sum of 1 in each row and a sum of 1 in each column; F3. Stable fusion step: Utilizing the aforementioned pre-scaling matrix H pre For the input feature tensor x l Premixing is performed to obtain preprocessed characteristics. u l The preprocessed features u l Enter to the number l Layer core calculation function F layer Calculations are performed to obtain the layer output features. y l ; the post-scaling matrix H post Acting on the output features of the layer y l After obtaining the scaled output, the residual routing matrix is... H res Acting on the input feature tensor x l After obtaining the stable residual, the scaled output is summed with the stable residual to obtain the first... l Layer output features x l +1; The neural network model stability enhancement method enhances the numerical stability of model training by constraining residual routing, thereby ensuring the reliability of industrial control signals in the deep propagation of the model.

9. The method for enhancing the stability of a neural network model according to claim 8, characterized in that, In step F2, the pre-scaling matrix H pre The original value of the pre-scaling matrix is ​​obtained by applying the Sigmoid function. The post-scaling matrix is ​​obtained by transformation. H post By applying the Sigmoid function to the original value of the post-scaling matrix The result of the transformation is obtained by multiplying the coefficient 2.

10. The method for enhancing the stability of a neural network model according to claim 8, characterized in that, Also includes: F4. Constructing and maintaining an evidence pool: The evidence pool is used to store and manage evidence items from industrial data sources that support quality judgments. Each evidence item includes at least content, source information, reliability identifier, and conflict relationship with other evidence items. The atomic claims in the quality analysis and decision recommendations output by the industrial big language model need to be bound to the evidence items in the evidence pool, and the adjudication is based on the sufficiency, reliability, and conflict relationship of the evidence items.

Citation Information

Patent Citations

  • Reasoning acceleration method of large language model based on hybrid neural network structure

    CN117787410A

  • Generative adversarial network-based MRI-PET mode conversion method and system

    CN121190599A