Event-driven parameter self-adaptive updating method and system based on reasoning state perception

By introducing a reasoning state awareness mechanism into the large language model and dynamically adjusting parameter updates, the problems of wasted computational resources and reasoning drift in long context reasoning are solved, resulting in more efficient and stable generation results.

CN122047481APending Publication Date: 2026-05-15BEIJING KNOWLEDGE ATLAS TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING KNOWLEDGE ATLAS TECHNOLOGY CO LTD
Filing Date
2026-01-30
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing large language models suffer from increased computational burden, dispersed attention distribution, accumulated inference errors, and inconsistent generation in long context reasoning scenarios. Existing parameter update methods lack fine-grained perception and effective control, leading to wasted computational resources and the risk of inference drift.

Method used

The event-driven parameter adaptive update method based on reasoning state awareness constructs prediction confidence, uncertainty and attention focus features to monitor the model state in real time and trigger parameter updates when anomalies occur. It dynamically adjusts the update steps, learning rate and update range to achieve fine control.

Benefits of technology

It significantly improves the generation stability and efficiency of the model in long context reasoning, reduces computational costs, reduces the risk of reasoning drift, and is suitable for scenarios such as long text understanding, multi-turn dialogue, and complex instruction execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122047481A_ABST
    Figure CN122047481A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of artificial intelligence, and relates to an event-driven parameter adaptive updating method and system based on reasoning state perception, and the method comprises the steps: S1, constructing an input sequence needed by model reasoning; s2, performing model reasoning based on the input sequence, performing real-time monitoring on a model reasoning state in a model reasoning process, and collecting reasoning state characteristics; s3, carrying out fusion analysis on the reasoning state characteristics, and judging whether a parameter self-adaptive updating requirement exists in a current reasoning process or not; s4, when a parameter self-adaptive updating demand exists, generating a control parameter of the parameter updating according to the abnormal degree of the reasoning state feature; and S5, performing controlled adjustment on the model parameters according to the control parameters of the parameter updating. Based on reasoning state perception, on-demand triggering is carried out, the updating strength is finely controlled, and the reasoning efficiency, the generation stability and the engineering practicability of a large language model in long texts and complex reasoning tasks can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence technology and relates to a parameter adaptive update method and system, particularly an event-driven parameter adaptive update method and system based on reasoning state awareness. Background Technology

[0002] With the rapid development of large language models, their applications in long text understanding, multi-turn dialogue, complex instruction execution, and reasoning-intensive generation tasks are becoming increasingly widespread. Especially in long context reasoning scenarios, the model needs to model the context at multiple consecutive reasoning positions and generate output step by step. The stability, efficiency, and adaptability to context changes of the reasoning process directly determine the quality of the generated results and the usability of the system.

[0003] However, in practical applications, as the length of the inference context increases, the computational burden and uncertainty faced by the model during the inference phase rise significantly. On the one hand, long contexts lead to a gradual dispersion of attention distribution, reducing the model's ability to focus on key information; on the other hand, inference errors tend to accumulate and amplify during continuous generation, leading to inference drift, inconsistent outputs, and even factual errors. These problems are particularly prominent in long text generation and multi-turn interaction scenarios, and have become a major bottleneck restricting the inference performance and engineering deployment of large models.

[0004] To address the aforementioned issues, existing research has attempted to introduce parameter update or online adaptation mechanisms during the inference phase. This allows the model to adjust parameters based on the current context during inference, thereby improving its adaptability to specific inference tasks. Existing parameter update schemes mainly fall into the following categories: 1. Fixed-frequency inference phase update method.

[0005] Some methods update parameters at a fixed step size or at each generation position during the inference phase, enabling the model to continuously adapt to the current input context. While simple to implement, these methods often overlook the differences in actual parameter adjustment needs at different inference positions, easily introducing unnecessary updates in stable inference regions and wasting computational resources.

[0006] 2. Update methods based on loss or gradient triggering.

[0007] Some studies have attempted to trigger parameter updates when the loss increases by monitoring changes in loss or gradient magnitude during the inference phase. While this approach introduces dynamism to some extent, its triggering signals are usually quite simple and fail to accurately characterize the stability and risk level of the model's current inference state, making it prone to false triggers or missed triggers.

[0008] 3. Online learning or continuous adaptation methods.

[0009] Some approaches treat the inference phase as a continuous learning process, accumulating and updating model parameters over a long period to enhance the model's adaptability to specific tasks or users. However, these methods often lack effective control mechanisms for inference drift, which can easily lead to the reinforcement of errors in long-context inference, affecting the overall stability of the model.

[0010] While the above methods enhance the model's adaptability during the inference phase to some extent, the following significant shortcomings remain: (1) Existing methods generally lack the ability to perceive the reasoning state in a refined manner and fail to comprehensively evaluate whether the current reasoning of the model really needs parameter updates from the perspectives of prediction confidence, uncertainty or attention focus.

[0011] (2) Most inference stage update mechanisms adopt "unified triggering" or "fixed strategy", which fail to dynamically adjust the number of update steps, learning rate and update range according to the degree of abnormality of the inference state, making it difficult to achieve a balance between inference efficiency and stability.

[0012] (3) In long context scenarios, existing solutions often lack effective update constraints and risk control mechanisms. Once an update is performed on an incorrect reasoning path, it is easy to cause reasoning drift and have a continuous negative impact on subsequent generation.

[0013] In summary, existing parameter update methods in the inference stage are either too crude in their update triggering mechanisms or fail to meet the actual needs of long-context inference scenarios in terms of stability and controllability. Therefore, there is an urgent need for a new method that can be based on inference state awareness, trigger on demand, and finely control the update intensity to improve the inference efficiency, generation stability, and engineering practicality of large-scale language models in long texts and complex inference tasks. Summary of the Invention

[0014] To overcome the shortcomings of existing technologies, this invention proposes an event-driven adaptive parameter update method and system based on reasoning state awareness. This method can overcome the problems of coarse update triggering, imperceptible reasoning state, high computational cost, and insufficient stability in existing parameter update methods during the reasoning stage. It significantly improves reasoning efficiency, generation stability, and system reliability in long context reasoning and complex generation tasks, and has high engineering practical value and promotion prospects.

[0015] To achieve the above objectives, the present invention provides the following technical solution: An event-driven parameter adaptive update method based on reasoning state awareness, characterized by the following steps: S1: Based on the user's input query request or task instruction, combined with the current session history or externally provided context, construct the input sequence required for model inference; S2: Perform model inference based on the input sequence and monitor the model inference state in real time during the model inference process, and collect inference state features to reflect the stability and uncertainty of model inference; S3: Perform fusion analysis on the inference state features and determine whether there is a need for adaptive parameter update in the current inference process; S4: When there is a need for adaptive parameter updates in the current inference process, control parameters for this parameter update are generated based on the degree of abnormality of the inference state characteristics. S5: Adjust the model parameters in a controlled manner based on the control parameters updated in this parameter update.

[0016] Preferably, in step S2, the first [value] with the highest probability value in the predicted probability distribution is [selected]. The candidate lexical elements constitute a candidate subset. ; Based on the candidate subset Construct an approximate probability distribution for inference state monitoring. : , In the formula, For candidate subsets Candidate word units in For the model in the first The context of each location, For model parameters, For candidate subsets Scale.

[0017] Preferably, in step S2, the collected reasoning state features reflecting the stability and uncertainty of reasoning include: S21: Prediction Confidence Features : ; S22: Uncertainty characteristics of probability distribution : , In the formula, For extremely small positive numbers that are numerically stable, to avoid [the following] Logarithmic operations near zero exhibit numerical divergence. S23: Attention-Focusing Characteristics : , , in, In the first Each inference location, the model's context The Middle Attention weights are assigned to each location.

[0018] Preferably, the fusion analysis of the reasoning state features in step S3 specifically involves: , in, This is the comprehensive evaluation metric after fusion analysis. These are non-negative weighting coefficients, either preset or determined empirically. Furthermore, the current inference process is considered to have a parameter adaptive update requirement when any of the following conditions are met: comprehensive evaluation quantity. Exceeding the preset threshold Prediction confidence features Below the preset confidence threshold Uncertainty characteristics of probability distribution Higher than the preset uncertainty threshold Attention-focusing features Higher than the preset focus threshold .

[0019] Preferably, in step S4, generating the control parameters for this parameter update based on the degree of abnormality of the inference state features specifically includes: S41: Normalize the comprehensive evaluation value to obtain the trigger strength. : , In the formula, The preset maximum risk value; The truncation function is indicated; the trigger strength is... This is used to characterize the degree of anomalousness of the inference state features; S42: Based on the trigger strength, generate the number of update steps for this parameter update. : , In the formula, To minimize the number of update steps, This represents the maximum number of update steps. S43: Based on the trigger strength, dynamically generate the learning rate for this parameter update. : , In the formula, and These are the preset minimum and maximum learning rates, respectively; S44: Based on attention focus features and model structure, determine the set of parameters participating in this parameter update. :

[0020] In the formula, Indicates the first Attention-focusing features corresponding to each network layer.

[0021] Preferably, step S5 specifically involves: based on the update step count Learning rate and the set of parameters involved in the update Only for the set of parameters involved in the update The model parameters within the model are iteratively updated, with the number of updates depending on the number of update steps. The update range is limited by the learning rate. control.

[0022] Preferably, it further includes: S6: During the controlled adjustment of the model parameters based on the control parameters, the adjustment process is monitored synchronously to determine whether the update behavior is still within a safe and effective range.

[0023] Furthermore, this invention also provides an event-driven parameter adaptive update system based on reasoning state awareness, characterized in that it includes: The user input and inference context building module is used to build the input sequence required for model inference based on user input query requests or task instructions, combined with the current session history or externally provided context. The inference state monitoring and feature acquisition module is used to perform model inference based on the input sequence and monitor the model inference state in real time during the model inference process, and acquire inference state features that reflect the stability and uncertainty of model inference. The update trigger determination module is used to perform fusion analysis on the inference state features and determine whether there is a parameter adaptive update requirement in the current inference process; An adaptive update control parameter generation module is used to generate control parameters for this parameter update based on the degree of abnormality of the inference state characteristics when there is a need for adaptive parameter update in the current inference process. The inference phase parameter adaptive update execution module is used to make controlled adjustments to the model parameters based on the control parameters of this parameter update.

[0024] Furthermore, the present invention also provides an event-driven parameter adaptive update device based on reasoning state awareness, characterized in that it includes: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the inference state-aware event-driven parameter adaptive update method as described above. Finally, the present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that, when the program is executed by a processor, it implements the steps of the event-driven parameter adaptive update method based on inference state awareness as described above.

[0025] Compared with existing parameter adaptation methods that use fixed-frequency updates or "update as you read" during the inference phase, the event-driven adaptive parameter update method based on inference state awareness proposed in this invention has significant advantages in inference efficiency, stability control, update fineness, and engineering usability, specifically in the following aspects: 1. Trigger updates on demand to overcome the limitations of the "unified update" strategy.

[0026] Existing parameter update methods in the inference phase typically employ a fixed step size or perform update operations uniformly at each inference position, failing to distinguish the actual needs for parameter adjustment at different inference positions. This results in a large number of positions that do not require learning still triggering updates, leading to a waste of computational resources.

[0027] To address the aforementioned issues, this invention constructs inference state features such as prediction confidence, uncertainty, and attention focus to perceive the model's current inference stability in real time. Based on an event-driven mechanism, it triggers adaptive parameter updates only when an inference state anomaly is detected. This approach fundamentally avoids redundant learning at stable inference positions and effectively overcomes the shortcomings of traditional "update as you read" strategies, which suffer from coarse updates and single triggering conditions.

[0028] 2. An adaptive control mechanism that balances inference efficiency and generation stability.

[0029] Existing methods often face the problem of significantly increased inference latency or decreased model stability after introducing parameter updates during the inference phase, making it difficult to achieve a balance between efficiency and accuracy.

[0030] This invention achieves multidimensional adaptive control of parameter update intensity, magnitude, and location by explicitly mapping the degree of anomaly in the inference state to the number of update steps, learning rate, and update range. Only a small number of local updates are performed when the inference state is slightly anomalous; the update intensity is moderately increased when the risk level is high. This significantly reduces the computational overhead of ineffective updates while maintaining the stability and consistency of the inference results, resolving the contradiction in existing technologies where "updates improve adaptability but sacrifice efficiency."

[0031] 3. Significantly reduces inference drift risk and improves system robustness.

[0032] In long-context reasoning scenarios, existing reasoning stage update methods, once parameter updates are performed on incorrect reasoning paths or when attention is out of focus, are prone to continuously reinforcing erroneous perceptions, thereby causing reasoning drift and having a lasting negative impact on subsequent generation.

[0033] This invention introduces attention-focusing and uncertainty features to jointly determine whether the model correctly focuses on key contextual information. When the model is "confident but focusing on errors" or "temporarily hesitant but not yet invalid," a more cautious update strategy or suppression of update behavior is adopted, effectively preventing erroneous inference paths from becoming entrenched. Through this mechanism, this invention significantly improves the stability of the inference process and the overall robustness of the system in long texts and complex inference tasks.

[0034] 4. More suitable for engineering applications with long contexts and complex reasoning scenarios.

[0035] Thanks to its inference state awareness and event-driven parameter update mechanism, this invention can dynamically adjust its update behavior according to the actual needs of different inference stages, demonstrating good adaptability in scenarios such as long-context inference, multi-turn dialogues, and complex instruction execution. When the inference state is stable, this invention significantly improves system throughput by skipping update operations; when the inference state is unstable or the context changes significantly, it can enhance the model's context adaptability through controlled updates. Therefore, this invention effectively reduces the computational cost of the inference stage while ensuring generation quality, possessing high engineering practical value and potential for large-scale deployment. Attached Figure Description

[0036] Figure 1 This is a flowchart of the event-driven parameter adaptive update method based on reasoning state awareness according to the present invention.

[0037] Figure 2 This is a schematic diagram of the structure of the event-driven parameter adaptive update system based on reasoning state awareness of the present invention.

[0038] Figure 3 This is a structural block diagram of the event-driven parameter adaptive update device based on reasoning state awareness according to the present invention. Detailed Implementation

[0039] Before detailing any embodiment of the invention, it should be understood that the invention, in its application, is not limited to the details of the construction and arrangement of the components set forth in the following description or illustrated in the following figures. The invention can have other embodiments and can be practiced or carried out in various ways. Furthermore, it should be understood that the wording and terminology used herein are for descriptive purposes and should not be considered limiting. The use of “comprising” or “having” and variations thereof in this invention is intended to cover the items set forth below and their equivalents, as well as any additional items. Unless otherwise specified or limited, the terms “installation,” “connection,” “support,” and “linkage,” and variations thereof are used broadly and cover both direct and indirect installation, connection, support, and linking. Moreover, “connection” and “linkage” are not limited to physical or mechanical connections or links. Furthermore, firstly, in the disclosure of this invention, the terms "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the above terms should not be construed as limiting this invention. Secondly, the term "a" should be understood as "at least one" or "one or more," that is, in one embodiment, the number of an element can be one, while in another embodiment, the number of the element can be multiple. The term "a" should not be construed as a limitation on the quantity.

[0040] With the widespread application of large language models in reasoning-intensive scenarios such as long text understanding, multi-turn dialogue, and complex instruction execution, the adaptability of models to contextual changes and the stability of reasoning during the reasoning phase have become increasingly prominent issues. Especially in long contextual reasoning, models often need to make predictions at multiple consecutively generated reasoning positions. The reasoning path is easily affected by factors such as context drift, attention distraction, and the accumulation of uncertainty, which can lead to unstable generation results, amplified errors, or decreased reasoning efficiency.

[0041] To alleviate the aforementioned problems, existing research has attempted to introduce parameter update or online adaptation mechanisms during the inference phase, enabling the model to dynamically adjust parameters to adapt to the current context during inference. However, existing technical solutions still generally suffer from the following limitations: (1) Most methods adopt the "read and update" or fixed frequency update strategy, that is, the parameter update is uniformly performed at each inference position or preset step size. This fails to distinguish the actual needs of different inference positions for parameter adaptation, resulting in a large number of positions that do not need to be learned still triggering update operations, causing unnecessary computational overhead and significantly reducing inference throughput.

[0042] (2) The existing inference stage update mechanism lacks the ability to effectively perceive the inference state. Even if the model shows high confidence in the current output but actually focuses on the wrong context, it may still perform parameter updates, thereby further solidifying the wrong inference path, introducing the risk of model drift, and affecting the reliability of subsequent generated results.

[0043] (3) Although some methods can adjust parameters during the inference stage, they lack a fine-grained discrimination mechanism for risk states such as inference uncertainty and attention loss. If the update is rashly executed when the model is still in a state of temporary hesitation or multi-branch uncertainty, it will destroy the model's existing knowledge structure and make it difficult to achieve a balance between inference efficiency and stability.

[0044] To address the aforementioned technical bottlenecks, this invention proposes an event-driven parameter adaptive update method based on reasoning state awareness. Its core idea includes: (1) During the reasoning stage, the model reasoning state is monitored in real time. By constructing multi-dimensional reasoning state features such as prediction confidence, uncertainty and attention focus, the stability of the current reasoning of the model is comprehensively evaluated. (2) Based on the above inference state characteristics, a fusion analysis is performed, and an event-driven update triggering judgment mechanism is designed. The parameter adaptive update is triggered only when the abnormal inference state of the model is detected and there is a parameter adaptation requirement, so as to avoid ineffective learning at the stable inference position. (3) When triggering an update, the number of steps, learning rate and update range of parameter updates are dynamically generated according to the degree of abnormality of the inference state, so as to realize the adaptive control of the intensity, magnitude and position of parameter updates during the inference stage, and effectively suppress the risk of model drift while improving the context adaptability.

[0045] Through the above solution, the present invention can overcome the problems of coarse update triggering, imperceptible inference state, high computational cost and insufficient stability in existing inference stage parameter update methods. It can significantly improve inference efficiency, generation stability and system reliability in long context reasoning and complex generation tasks, and has high engineering practical value and promotion prospects.

[0046] Figure 1 A flowchart of the event-driven parameter adaptive update method based on reasoning state awareness of the present invention is shown. Figure 1 As shown, the event-driven parameter adaptive update method based on reasoning state awareness of the present invention includes the following steps: S1: User input and reasoning context construction.

[0047] Based on user-inputted query requests or task instructions, and combined with the current session history or externally provided context, the input sequence required for model inference is constructed.

[0048] Specifically, the present invention first receives a query request or task instruction input by the user, and then constructs the input sequence required for model inference by combining the current session history or externally provided context information. .

[0049] The goal of this step is to form a complete reasoning context, enabling the model to perform subsequent reasoning and response generation in a unified context, and providing basic input for the determination of adaptive parameter updates.

[0050] S2: Inference state monitoring and feature acquisition.

[0051] Model inference is performed based on the input sequence, and the model inference state is monitored in real time during the model inference process. Inference state features that reflect the stability and uncertainty of model inference are collected.

[0052] During the forward inference process of the model on the input sequence, this invention monitors the model's inference state in real time and collects inference state features that reflect the stability and uncertainty of the inference. Let the input context sequence be: .

[0053] in, Represents the input sequence The first in The input sequence contains input words, and the input sequence is... There are a total of The model takes the nth input word. Each inference position is based on the input context. Next word Predicting based on the value of (i.e., based on the previous) The first input word prediction (Predicted value of each word).

[0054] Suppose that the vocabulary used in the model is a discrete symbol set: .

[0055] in, Indicates vocabulary size. The model is in the [number]th [stage]. Each location is based on context. and model parameters In the vocabulary The above shows the predicted probability distribution for the next word: , And satisfy: .

[0056] However, in modern large language models, vocabulary size Typically large, directly based on the probability distribution of the complete vocabulary. Performing item-by-item analysis not only leads to high computational complexity, but is also unnecessary in most cases, because the probabilistic quality of the model is often concentrated on a small number of high-probability candidate words.

[0057] To address the aforementioned issues, this invention introduces a Top-k approximation of the predicted probability distribution while maintaining the complete semantics of probabilistic modeling. Specifically, the predicted probability distribution is defined as follows: The one with the highest probability value The candidate lexical elements constitute a candidate subset. : .

[0058] in, It is a positive integer that is preset or adaptively determined, and satisfies: .

[0059] Based on this, the candidate subset can be used Construct an approximate probability distribution for inference state monitoring: , , In the formula, For candidate subsets Candidate word units in For candidate subsets Scale.

[0060] The approximate probability distribution While significantly reducing computational complexity, it can still effectively reflect the deterministic and uncertain states of the model at the current inference position, thus providing a basis for subsequent inference state feature calculation and parameter adaptive update triggering judgment.

[0061] Based on the predicted probability distribution or its Top-k approximate probability score This invention further constructs inference state features for characterizing the stability of model inference and prediction uncertainty. The inference state features include at least one or more of the following: 1. Prediction confidence features.

[0062] The prediction confidence feature is based on the maximum probability value in the prediction probability distribution and is used to reflect the degree of certainty of the model regarding the output result at the current inference position. In one implementation, the maximum probability value in the Top-k approximate probability distribution can be used as the prediction confidence index. When this value is low, it indicates that the model hesitates more among candidate outputs, and the inference stability decreases. .

[0063] in, The larger the value, the more certain the model is about the most likely output term; The smaller the value, the more the model hesitates between candidate outputs.

[0064] 2. Uncertainty characteristics of probability distribution.

[0065] The probability distribution uncertainty feature is constructed based on the entropy value or an approximate form of the predicted probability distribution or its approximate representation, and is used to measure the overall uncertainty level of the model in the candidate output space. When the predicted probability distribution shows a relatively dispersed trend among multiple candidate words, the corresponding uncertainty feature value is large, indicating that the current inference state of the model is unstable.

[0066] , Among them, the probability distribution uncertainty feature The larger the value, the more dispersed the model's prediction probabilities across multiple candidate lexical units, and the higher the inference uncertainty. Among these, This is used for extremely small positive numbers that are numerically stable, and is used to avoid numerical divergence caused by logarithmic operations when the predicted probability is close to zero.

[0067] 3. Attention-focusing characteristics.

[0068] The attention-focusing feature is used to determine whether the model can focus its attention on key locations in the context during the reasoning process.

[0069] During the forward inference process, the model models the correlation between the current inference position and the historical context position based on an attention mechanism, generating corresponding attention weights. Specifically, in the... The inference position, the model in the context of the first inference position. Attention weights are assigned to each location. The attention weights It reflects the degree of attention the current reasoning position pays to each context position, and satisfies: .

[0070] The attention weights can be directly obtained by the model's internal attention module during inference, without additional calculation. Based on these attention weights, this invention constructs attention focus features to determine whether the model can stably focus on key information in the context during the current inference phase. In one embodiment, attention focus features are defined. for: .

[0071] When the attention focus feature When the value is large, it indicates that the attention weights are scattered across multiple contextual locations, and the model fails to effectively focus on key information; when A smaller value indicates that the model is highly focused and the reasoning process is more stable.

[0072] In summary, to address the key issues in traditional inference stage update mechanisms, this invention introduces a multi-dimensional inference state feature monitoring and trigger determination mechanism during the inference process, updating model parameters only when absolutely necessary, thereby avoiding ineffective learning and inference drift.

[0073] Specifically, the present invention addresses the above-mentioned problems from the following three aspects: (1) Regarding the question of "many positions do not actually need to be learned".

[0074] Instead of adopting a strategy of uniformly updating parameters at all inference positions, this invention constructs prediction confidence features to evaluate the degree of certainty of the model for the output result at the current inference position in real time.

[0075] When the model's prediction confidence is high, it indicates that the model has a sufficient grasp of the current context. This invention avoids redundant learning at stable inference positions by suppressing or skipping parameter update operations, thereby significantly reducing unnecessary computational overhead and improving the overall inference throughput.

[0076] (2) Regarding the problem that “the model is sometimes confident but wrong”.

[0077] To prevent the model from reinforcing incorrect cognitions when it focuses on the wrong context, this invention further introduces attention-focusing features to determine whether the model can focus its attention on key information locations in the context during reasoning.

[0078] When the model shows high prediction confidence, but the attention weights are significantly dispersed or abnormally distributed across multiple context locations, this invention identifies the state as a potentially high-risk inference state and triggers adaptive parameter updates or adopts a more cautious update strategy accordingly, thereby suppressing the continuous amplification of erroneous inference paths and reducing the risk of inference drift.

[0079] (3) Regarding the problem of “the model hesitates but has not yet collapsed”.

[0080] This invention introduces uncertainty features to characterize the overall discreteness of the model's predicted probability distribution, thereby identifying inference states where the model has significant discrepancies among multiple candidate outputs but has not yet completely failed.

[0081] When uncertainty increases significantly, it indicates that the model's current inference path has a potential risk of multiple branches. This invention does not immediately update the model parameters drastically. Instead, it makes a comprehensive judgment by combining prediction confidence and attention focus features. Only when uncertainty persists or occurs simultaneously with other risk features will the parameters be adaptively updated, thereby avoiding unnecessary damage to the model's existing knowledge structure during the temporary hesitation phase.

[0082] By collecting the aforementioned inference state characteristics, a basis for determining whether to perform adaptive parameter updates is provided.

[0083] S3: Update trigger determination.

[0084] The inference state features are fused and analyzed to determine whether there is a need for adaptive parameter updates in the current inference process.

[0085] After completing inference state monitoring and feature acquisition, this invention enters the update trigger determination stage. This stage involves fusing and analyzing the prediction confidence features, uncertainty features, and attention focus features to determine whether there is a need for adaptive parameter updates in the current inference process, thereby deciding whether to adjust the model parameters during the inference stage.

[0086] 1. State feature fusion.

[0087] In the Let there be inference positions, and let the prediction confidence features obtained in step S2 be... The uncertainty characteristic is Attention-focusing features are Based on the above features, this invention constructs a comprehensive reasoning state evaluation quantity. This is used to characterize the overall stability level of the model during the current inference phase. .

[0088] in, These are pre-defined or empirically determined non-negative weighting coefficients used to balance the influence of various state features in trigger determination. Through this fusion method, when model confidence decreases, uncertainty increases, or attention focus ability declines, the comprehensive evaluation... This will be increased accordingly, thus reflecting the potential risk level of the model's current inference state.

[0089] 2. Updated trigger condition determination.

[0090] Based on the comprehensive evaluation, this invention determines whether to trigger adaptive parameter updates. In one embodiment, adaptive parameter updates are triggered at the current inference position when any of the following conditions are met: (1) Comprehensive evaluation quantity Exceeding the preset threshold ; (2) Prediction confidence features Below the preset confidence threshold ; (3) Uncertainty characteristics Higher than the preset uncertainty threshold ; (4) Attention-focusing characteristics Higher than the preset focus threshold .

[0091] The aforementioned thresholds can be preset or dynamically adjusted based on the specific model structure, task type, or operating environment. When any triggering condition is met, it is determined that the model has a parameter adaptation requirement in the current inference stage, and the parameter adaptive update process begins.

[0092] Preferably, when condition (1) is met, the current inference position is determined to trigger the adaptive update of parameters, so as to comprehensively consider the influence of various inference state features.

[0093] 3. Handling of non-triggered situations.

[0094] When none of the aforementioned triggering conditions are met, the model is determined to be in a stable inference state, possessing high certainty regarding the current context and exhibiting reasonable focus. In this case, the present invention does not perform parameter update operations and directly proceeds to the subsequent decoding generation or output process, thereby avoiding unnecessary computational overhead at stable inference positions.

[0095] Through the above-mentioned update triggering judgment mechanism, the present invention can achieve fine control over parameter update behavior during the inference stage, triggering adaptive parameter updates only when the model prediction is unstable, attention is out of focus, or there is a risk of multi-branch uncertainty, thereby effectively reducing the number of invalid updates, suppressing inference drift, and improving overall inference efficiency and system stability.

[0096] S4: Adaptive update of control parameter generation.

[0097] When there is a need for adaptive parameter updates in the current inference process, control parameters for this parameter update are generated based on the degree of anomaly of the inference state characteristics.

[0098] When step S3 determines that the current inference position requires adaptive parameter update, the present invention initiates adaptive update control and generates control parameters for this parameter update based on the degree of abnormality of the inference state characteristics.

[0099] 1. Trigger strength.

[0100] To facilitate continuous adjustment of subsequent control parameters, the comprehensive evaluation quantity is... After normalization, the trigger strength is obtained: , In the formula: To update the trigger threshold; The preset maximum risk value; This represents the truncation function.

[0101] The trigger strength It is used to characterize the severity of the anomalies in the current inference state.

[0102] 2. Generation of parameter update steps.

[0103] Based on the trigger strength, the present invention generates the number of update steps for this parameter update: , in: Minimum update steps; This represents the maximum number of update steps.

[0104] When the trigger strength is high, more update steps are generated to enhance the model's adaptability to the current inference state; when the trigger strength is low, only a small number of updates or minimal updates are performed.

[0105] 3. Generation of learning rate.

[0106] Correspondingly, this invention dynamically generates the learning rate based on the trigger strength: , in: and These are the preset minimum and maximum learning rates, respectively.

[0107] Using the above method, the higher the degree of abnormality in the inference state, the greater the corresponding parameter adjustment range; conversely, a more conservative parameter update strategy is adopted.

[0108] 4. Determining the parameter update range.

[0109] In one embodiment, the present invention determines the set of parameters to be updated based on attention-focusing features and model structure. : , in: Indicates the first Attention focus features corresponding to each network layer; This is a preset threshold.

[0110] In this invention, Indicates the first Layers (e.g., layer 1, layer 2, etc.); Indicates the first The layer in the first The level of focus during walking (which can be understood as whether this layer is currently paying close attention to key information); This refers to a threshold, which sets a standard that a level of focus must exceed to be considered "relevant".

[0111] Therefore, this parameter set This means selecting all layers where "attention focus is greater than the threshold" as layers allowed to be updated. For example, assuming the model has 6 layers, the calculated result is: Layer 1: ; Level 2: ; Level 3: ; Level 4: ; Level 5: ; 6th floor: Set a threshold. Therefore, the layers with a value exceeding 0.60 are: layers 3, 4, and 6. This means that only layers 3, 4, and 6 are updated, while the other layers remain frozen.

[0112] By constraining the range of parameter updates, this invention can avoid indiscriminate updates to all model parameters, thereby effectively reducing the overall model drift risk during the inference phase.

[0113] Through the above-mentioned control parameter generation mechanism, this invention explicitly maps the degree of inference state anomaly to the number of parameter update steps, learning rate, and update range, so that the parameter adaptive update process can be dynamically controlled in three dimensions: update intensity, update amplitude, and update position. Thus, under the premise of ensuring inference performance, stable and efficient parameter adaptive update in the inference stage can be achieved.

[0114] S5: Execution of adaptive parameter updates during the inference phase.

[0115] The model parameters are adjusted in a controlled manner based on the control parameters updated in this parameter update.

[0116] After generating the adaptive update control parameters in step S4, the present invention enters the inference phase parameter adaptive update execution phase. In this phase, without interrupting the inference process, the model parameters are adjusted in a controlled manner according to the control parameters to improve the model's adaptability to the current inference context.

[0117] Specifically, the present invention reads the update step number output in step S4. Learning rate and parameter update range and only update the range of the parameters. The model parameters within the model are iteratively updated, with the number of updates depending on the number of update steps. The update range is limited by the learning rate. control.

[0118] In one implementation, the update execution process can be represented as: in the first... In this iteration, only for The corresponding parameter subset Perform a parameter adjustment: .

[0119] in, This indicates the parameter update direction calculated in the current inference context; the update process is executed in total. The next iteration, the rest are not included. The parameters remain unchanged within the range.

[0120] The adaptive parameter update during the inference phase is performed only when the trigger determination result in step S3 indicates that an update is needed. When the trigger condition is not met, the invention skips the update process and directly proceeds to the subsequent output generation process. By limiting the update execution to on-demand triggering, controlled number of steps, controlled magnitude, and controlled range, the invention can effectively reduce the computational overhead and model drift risk caused by frequent updates while improving context adaptability, thus ensuring the stability and consistency of the inference process.

[0121] In this invention, the event-driven parameter adaptive update method based on reasoning state awareness may further include: S6: Update process monitoring and stopping.

[0122] During the controlled adjustment of the model parameters based on the control parameters, the adjustment process is monitored synchronously to determine whether the update behavior is still within a safe and effective range.

[0123] During the adaptive parameter update process in the inference phase, this invention synchronously monitors the update process to determine whether the update behavior is still within a safe and effective range.

[0124] When the model inference state features are detected to have returned to a stable range, or when the update magnitude reaches the preset upper limit, the current parameter update process is automatically terminated to avoid over-adjustment.

[0125] In one implementation, when an update action is detected to have a significant adverse effect on the current inference output, the update can be stopped and the model parameter state before the update can be maintained, thereby ensuring the stability and reliability of the inference process.

[0126] S7: Output results are generated.

[0127] After completing the adaptive parameter update or skipping the update, this invention performs the final decoding and generation process based on the current model parameter state, and outputs the result text that matches the user query or task instruction.

[0128] By introducing demand-triggered and adaptive control mechanisms, this invention significantly reduces unnecessary parameter updates while ensuring generation quality, thereby improving the overall efficiency and stability of the inference phase.

[0129] Figure 2 A schematic diagram of the event-driven parameter adaptive update system based on reasoning state awareness according to the present invention is shown. Figure 2 As shown, the event-driven parameter adaptive update system based on reasoning state awareness of the present invention includes: 1. User Input and Inference Context Building Module.

[0130] The user input and inference context construction module is used to construct the input sequence required for model inference based on the user's input query request or task instruction, combined with the current session history or externally provided context.

[0131] 2. Inference State Monitoring and Feature Acquisition Module.

[0132] The inference state monitoring and feature acquisition module is used to perform model inference based on the input sequence and to monitor the model inference state in real time during the model inference process, and to collect inference state features that reflect the stability and uncertainty of model inference.

[0133] 3. Update the trigger determination module.

[0134] The update trigger determination module is used to perform fusion analysis on the inference state features and determine whether there is a parameter adaptive update requirement in the current inference process.

[0135] 4. Adaptive update control parameter generation module.

[0136] The adaptive update control parameter generation module is used to generate control parameters for this parameter update based on the degree of abnormality of the inference state characteristics when there is a need for adaptive parameter update in the current inference process.

[0137] 5. The inference phase parameter adaptive update execution module.

[0138] The inference phase parameter adaptive update execution module is used to adjust the model parameters in a controlled manner based on the control parameters of this parameter update.

[0139] In this invention, the event-driven parameter adaptive update system based on reasoning state awareness may further include: 6. Update the process monitoring and stop module.

[0140] The update process monitoring and stopping module is used to synchronously monitor the adjustment process during the controlled adjustment of model parameters based on the control parameters, so as to determine whether the update behavior is still within a safe and effective range.

[0141] 7. Output Result Generation Module.

[0142] The output generation module is used to perform the final decoding and generation process based on the current model parameter state after completing the adaptive parameter update or skipping the update, and output the result text that conforms to the user query or task instruction.

[0143] Furthermore, this invention also provides an event-driven parameter adaptive update device based on reasoning state awareness. For example... Figure 3 As shown, the event-driven parameter adaptive update device based on reasoning state awareness of the present invention includes: a memory 11 for storing one or more programs; one or more processors 12; when the one or more programs are executed by the one or more processors 12, the one or more processors 12 implement the event-driven parameter adaptive update method based on reasoning state awareness of the present invention. Finally, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the event-driven parameter adaptive update method based on reasoning state awareness in the present invention.

[0144] The computer-readable storage medium includes both permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device. As defined in this invention, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0145] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0146] The steps of the methods or algorithms described in conjunction with the embodiments disclosed in this invention can be implemented in hardware, software modules executed by a processor, or a combination of both. The software modules can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art.

[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit the scope of protection of the present invention. Those skilled in the art can modify or make equivalent substitutions to the technical solutions of the present invention based on the concept of the present invention, without departing from the essence and scope of the technical solutions of the present invention.

Claims

1. An event-driven adaptive parameter update method based on reasoning state awareness, characterized in that, Includes the following steps: S1: Based on the user's input query request or task instruction, combined with the current session history or externally provided context, construct the input sequence required for model inference; S2: Perform model inference based on the input sequence and monitor the model inference state in real time during the model inference process, and collect inference state features to reflect the stability and uncertainty of model inference; S3: Perform fusion analysis on the inference state features and determine whether there is a need for adaptive parameter update in the current inference process; S4: When there is a need for adaptive parameter updates in the current inference process, control parameters for this parameter update are generated based on the degree of abnormality of the inference state characteristics. S5: Adjust the model parameters in a controlled manner based on the control parameters updated in this parameter update.

2. The event-driven parameter adaptive update method based on reasoning state awareness according to claim 1, characterized in that, In step S2, firstly, based on the largest probability value in the predicted probability distribution... The candidate lexical elements constitute a candidate subset. ; And based on the candidate subset Construct an approximate probability distribution for inference state monitoring. : , In the formula, For candidate subsets Candidate word units in For the model in the first The context of each location, For model parameters, For candidate subsets Scale.

3. The event-driven parameter adaptive update method based on reasoning state awareness according to claim 2, characterized in that, In step S2, the collected reasoning state features, which reflect the stability and uncertainty of reasoning, include: S21: Prediction Confidence Features : ; S22: Uncertainty characteristics of probability distribution : , In the formula, For extremely small positive numbers that are numerically stable, to avoid [the following] Logarithmic operations near zero exhibit numerical divergence. S23: Attention-Focusing Characteristics : , , in, In the first Each inference location, the model's context The Middle Attention weights are assigned to each location.

4. The event-driven parameter adaptive update method based on reasoning state awareness according to claim 3, characterized in that, The specific steps of the fusion analysis of the reasoning state features in step S3 are as follows: , in, This is the comprehensive evaluation metric after fusion analysis. These are non-negative weighting coefficients, either preset or determined empirically. Furthermore, the current inference process is considered to have a parameter adaptive update requirement when any of the following conditions are met: comprehensive evaluation quantity. Exceeding the preset threshold Prediction confidence features Below the preset confidence threshold Uncertainty characteristics of probability distribution Higher than the preset uncertainty threshold Attention-focusing features Higher than the preset focus threshold .

5. The event-driven parameter adaptive update method based on reasoning state awareness according to claim 4, characterized in that, In step S4, generating the control parameters for this parameter update based on the degree of abnormality of the inference state features specifically includes: S41: Normalize the comprehensive evaluation value to obtain the trigger strength. : , In the formula, The preset maximum risk value; The truncation function is indicated; the trigger strength is... This is used to characterize the degree of anomalousness of the inference state features; S42: Based on the trigger strength, generate the number of update steps for this parameter update. : , In the formula, To minimize the number of update steps, This represents the maximum number of update steps. S43: Based on the trigger strength, dynamically generate the learning rate for this parameter update. : , In the formula, and These are the preset minimum and maximum learning rates, respectively; S44: Based on attention focus features and model structure, determine the set of parameters participating in this parameter update. : , In the formula, Indicates the first Attention-focusing features corresponding to each network layer.

6. The event-driven parameter adaptive update method based on reasoning state awareness according to claim 5, characterized in that, Step S5 specifically involves: based on the update step count Learning rate and the set of parameters involved in the update Only for the set of parameters involved in the update The model parameters within the model are iteratively updated, with the number of updates depending on the number of update steps. The update range is limited by the learning rate. control.

7. The event-driven parameter adaptive update method based on reasoning state awareness according to any one of claims 1-6, characterized in that, Further includes: S6: During the controlled adjustment of the model parameters based on the control parameters, the adjustment process is monitored synchronously to determine whether the update behavior is still within a safe and effective range.

8. An event-driven parameter adaptive update system based on reasoning state awareness, characterized in that, include: The user input and inference context building module is used to build the input sequence required for model inference based on user input query requests or task instructions, combined with the current session history or externally provided context. The inference state monitoring and feature acquisition module is used to perform model inference based on the input sequence and monitor the model inference state in real time during the model inference process, and acquire inference state features that reflect the stability and uncertainty of model inference. The update trigger determination module is used to perform fusion analysis on the inference state features and determine whether there is a parameter adaptive update requirement in the current inference process; An adaptive update control parameter generation module is used to generate control parameters for this parameter update based on the degree of abnormality of the inference state characteristics when there is a need for adaptive parameter update in the current inference process. The inference phase parameter adaptive update execution module is used to make controlled adjustments to the model parameters based on the control parameters of this parameter update.

9. An event-driven parameter adaptive update device based on reasoning state awareness, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the event-driven parameter adaptive update method based on inference state awareness as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the event-driven parameter adaptive update method based on inference state awareness as described in any one of claims 1-7.