Computer simulation optimization system based on numerical and language model cooperation
Patent Information
- Application Number
- CN202611171300.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-04
- Publication Date
- 2026-10-30
AI Technical Summary
[0003]然而,大语言模型受基于Token的概率分布生成机制影响,在宏观周期与高频交易叠加的多智能体仿真中,必然产生与宏观基本面无关的单向累积语义漂移;其根因在于非确定性概率语义空间的输出被强行穿透进确定性偏微分方程,完全忽略了语义空间累积散度与方程底层流形的内在背离特征,导致情绪驱动项与随机波动率乘数之间形成不受静态参数约束的高维失控耦合
[0023]本申请以价格更新方程的雅可比偏微分结构作为约束锚点,将大语言模型语义空间与数值仿真物理空间进行非线性耦合,彻底消除了长周期仿真中因语义漂移引发的虚假价格崩溃与计算溢出;本申请采用梯度方向投影拉回处理越限情绪因子,相比硬截断更能保留大语言模型的微观异质性情绪震荡,在约束数值的同时保证仿真叙事真实感;本申请引入指数衰减漂移残差特征值作为语义发散监控指标,赋予仿真系统可量化、可追溯的内生容错机制。
Smart Images

Figure CN123013434A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the interdisciplinary field of multi-agent simulation and financial computing, specifically a computer simulation optimization system based on the collaboration of numerical and language models. Background Technology
[0002] Existing multi-agent socio-economic simulation engines generally employ a four-layer composite architecture and a unified price update equation for deterministic asset clearing. The standard information flow design of this architecture involves a narrative layer driven by a large language model outputting a structured sentiment factor scalar, which, after being constrained by static constant coefficients, is input into the market layer price equation to drive liquidation. The static constant coefficients in its default equation are sufficient to constrain the probability output of the large language model within a reasonable range.
[0003] However, due to the token-based probability distribution generation mechanism, large language models inevitably produce unidirectional cumulative semantic drift unrelated to macroeconomic fundamentals in multi-agent simulations where macroeconomic cycles and high-frequency trading overlap. The root cause is that the output of the nondeterministic probabilistic semantic space is forcibly penetrated into the deterministic partial differential equation, completely ignoring the inherent divergence between the cumulative divergence of the semantic space and the underlying manifold of the equation. This leads to a high-dimensional uncontrolled coupling between the sentiment-driven term and the random volatility multiplier, which is not constrained by static parameters.
[0004] In simulation scenarios spanning dozens of macroeconomic ticks over long periods, the aforementioned defects will cause exponential numerical distortions in the sentiment-driven term and the stochastic volatility multiplier in the price equation. This can lead to causeless false price collapses or liquidity deadlocks and computational overflows even against a healthy macroeconomic foundation. Consequently, the continuous, uninterrupted operation lifecycle of the multi-agent simulation engine will be significantly shortened, causing it to lose its self-consistency in key simulation scenarios involving long-term complex financial derivatives.
[0005] Therefore, how to construct an intrinsic manifold constraint mechanism for semantic drift of large language models by utilizing the partial differential mathematical structure of the price update equation itself under normal multi-agent simulation conditions, and eliminate the underlying defect of long-term numerical explosion of the unified price clearing equation caused by the breaking of the rigid constraints of macroeconomic fundamentals due to the emotional factors, has become an urgent technical problem to be solved. Summary of the Invention
[0006] The purpose of this application is to provide a computer simulation optimization system based on the collaboration of numerical and language models, which aims to improve the long-cycle dynamic self-consistency and continuous, intervention-free operation stability of multi-agent simulation engines.
[0007] The objective of this application can be achieved through the following technical solution: Firstly, a computer simulation optimization system based on the collaboration of numerical and language models, comprising the following modules:
[0008] The sequence acquisition module is used to synchronously acquire the emotion factor sequence generated by the preset language model within a preset time window, as well as the macro factor sequence corresponding to each time node within the preset time window.
[0009] The feature extraction module is used to obtain the drift residual feature value of the emotion factor sequence relative to the macro factor sequence based on a preset decay weight factor;
[0010] The boundary generation module is used to obtain the macroeconomic factors at the current time point and substitute them into the preset price update equation. Under the condition of satisfying the preset numerical constraints, it reversely solves the allowable boundary for the output data of the preset language model.
[0011] The gradient extraction module is used to obtain the initial sentiment factor output by the preset language model at the current time node, and to obtain the local evolution gradient for the initial sentiment factor in combination with the price update equation.
[0012] The sequence correction module is used to perform projection pullback processing on the initial emotion factor to the allowable boundary based on the local evolution gradient when the absolute value of the drift residual feature value is greater than a preset higher-order threshold, so as to obtain a corrected emotion factor.
[0013] The simulation output module is used to obtain the net excess demand that characterizes the micro-level supply and demand deviation of the global interactive environment. The modified sentiment factor and the net excess demand are substituted into the price update equation to output the asset price at the current time node, and the asset price is used as the simulation benchmark parameter for the next time node.
[0014] Secondly, the computer simulation optimization method based on the synergy of numerical and language models includes the following steps:
[0015] Synchronously acquire the emotion factor sequence generated by the preset language model within the preset time window, as well as the macro factor sequence corresponding to each time node within the preset time window;
[0016] The drift residual characteristic value of the emotion factor sequence relative to the macro factor sequence is obtained based on a preset decay weighting factor;
[0017] Obtain the macroeconomic factors at the current time point and substitute them into the preset price update equation. Under the condition of satisfying the preset numerical constraints, solve in reverse the allowable boundary for the output data of the preset language model.
[0018] Obtain the initial sentiment factor output by the preset language model at the current time point, and combine it with the price update equation to obtain the local evolution gradient for the initial sentiment factor;
[0019] When the absolute value of the drift residual feature value is greater than the preset higher-order threshold, the initial emotion factor is projected back to the allowable boundary based on the local evolution gradient to obtain the corrected emotion factor.
[0020] The net excess demand, which characterizes the micro-level supply and demand deviation of the global interactive environment, is obtained. The modified sentiment factor and the net excess demand are substituted into the price update equation to output the asset price at the current time point, and this price is used as the simulation benchmark parameter for the next time point.
[0021] Thirdly, a computer storage medium stores computer-executable instructions, which, when executed, implement the computer simulation optimization system based on the collaboration of numerical and language models described in the first aspect.
[0022] Compared with the prior art, the beneficial effects of this application are:
[0023] This application uses the Jacobian partial differential structure of the price update equation as the constraint anchor point to nonlinearly couple the semantic space of the large language model with the physical space of the numerical simulation, completely eliminating false price collapses and computational overflows caused by semantic drift in long-cycle simulations. This application uses gradient direction projection to pull back the over-limit sentiment factors, which can better preserve the micro-heterogeneous sentiment oscillations of the large language model than hard truncation, ensuring the realism of the simulation narrative while constraining the numerical values. This application introduces the exponentially decaying drift residual eigenvalue as a semantic divergence monitoring index, giving the simulation system a quantifiable and traceable endogenous fault-tolerant mechanism. Attached Figure Description
[0024] Figure 1 This is a schematic diagram of the modules of the computer simulation optimization system based on the collaboration of numerical and language models in this application;
[0025] Figure 2 This is a schematic diagram illustrating the steps of the computer simulation optimization method based on the collaboration of numerical and language models proposed in this application. Detailed Implementation
[0026] The technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components described and shown in the accompanying drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but only to illustrate selected embodiments of this application.
[0027] Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items. Therefore, once an item has been defined in one figure, it does not need to be further defined and explained in subsequent figures. The terms first, second, etc. are only used to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0028] In the existing field of multi-agent socio-economic simulation, the four-layer combined architecture engine is based on the following framework: the macro layer is responsible for solving DSGE numerical equilibrium, the market layer is responsible for multi-factor asset price formation, the narrative layer is responsible for news generation and sentiment output of the large language model, and the agent layer is responsible for heterogeneous decision-making. Within the smallest time unit of simulation, Bar Tick, deterministic clearing is achieved through a unified price update equation. The engine also uses a double-layer nested clock (Bar Tick is responsible for price updates, news generation and agent decision-making, while Macro Tick is responsible for DSGE solving, central bank decision-making and macro factor updates) to ensure the consistent progress of multi-frequency variables. All time attributes are derived from a single global Bar counter, eliminating the drift of multiple clocks.
[0029] The standard information flow design of this architecture involves the output of a large language model carrying a sentiment factor with semantic polarity information. This sentiment factor is directly substituted into the price equation in the form of a sentiment_score field in structured JSON, and constraints are imposed based on the static constant coefficients β and η in the equation. However, the generation mechanism of the large language model is essentially a random sampling process based on the conditional probability distribution of tokens. Its output, in the closed loop of "event → news → sentiment → event" formed by the coupling of the narrative layer and the agent layer, will produce a unidirectional cumulative semantic drift that is unrelated to the macro-equilibrium fundamentals. This causes the actual value range of the sentiment factor to gradually escape the range of static coefficient constraints.
[0030] In multi-agent simulation sandbox scenarios for long-term complex derivatives such as snowball products with knock-out clauses, under long-term conditions spanning tens to hundreds of daily macro ticks, the sentiment-driven term and stochastic volatility multiplier in the price equation will undergo exponential numerical distortion, triggering false price collapses or liquidity deadlock calculation overflows. This causes the 8-stage transactional tick pipeline (Begin Snapshot → Perception → Reinterpretation → Decision → Resolution → Effect Apply → Commit / Rollback → Render) to frequently trigger rollbacks during the Commit phase, causing the simulation engine to completely lose its dynamic self-consistency and repeatability under critical long-term conditions.
[0031] To address the aforementioned shortcomings, this invention completely abandons the traditional approach of setting absolute static thresholds on the large language model side. It innovatively uses the partial differential mathematical structure of the price update equation itself as a dynamic constraint anchor point to construct a numerical-semantic collaborative constraint mechanism based on Jacobi manifold projection. By quantifying the historical cumulative drift residual of the large language model narrative and the local evolution gradient of the current state of the equation, without disrupting the micro-heterogeneous emotional oscillations under normal operating conditions, it implements a minimally destructive projection pullback of the over-limit emotional factors along the gradient normal direction. This enables the simulation engine to maintain the intrinsic ability of dynamic self-consistency and computational stability under long-term operating conditions, realizing the nonlinear reverse constraint logic of using the derivative stress of the downstream partial differential equation to inversely constrain the semantic distribution of the upstream large language model.
[0032] Therefore, such as Figure 1 As shown, this application provides a computer simulation optimization system based on the collaboration of numerical and language models, including the following modules:
[0033] The sequence acquisition module is used to synchronously acquire the emotion factor sequence generated by the preset language model within a preset time window, as well as the macro factor sequence corresponding to each time node within the preset time window.
[0034] The feature extraction module is used to obtain the drift residual feature value of the emotion factor sequence relative to the macro factor sequence based on a preset decay weight factor;
[0035] The boundary generation module is used to obtain the macroeconomic factors at the current time point and substitute them into the preset price update equation. Under the condition of satisfying the preset numerical constraints, it reversely solves the allowable boundary for the output data of the preset language model.
[0036] The gradient extraction module is used to obtain the initial sentiment factor output by the preset language model at the current time node, and to obtain the local evolution gradient for the initial sentiment factor in combination with the price update equation.
[0037] The sequence correction module is used to perform projection pullback processing on the initial emotion factor to the allowable boundary based on the local evolution gradient when the absolute value of the drift residual feature value is greater than a preset higher-order threshold, so as to obtain a corrected emotion factor.
[0038] The simulation output module is used to obtain the net excess demand that characterizes the micro-level supply and demand deviation of the global interactive environment. The modified sentiment factor and the net excess demand are substituted into the price update equation to output the asset price at the current time node, and the asset price is used as the simulation benchmark parameter for the next time node.
[0039] In another implementation, such as Figure 2As shown, this application also provides a computer simulation optimization method based on the collaboration of numerical and language models, including the following steps:
[0040] Synchronously acquire the emotion factor sequence generated by the preset language model within the preset time window, as well as the macro factor sequence corresponding to each time node within the preset time window;
[0041] The drift residual characteristic value of the emotion factor sequence relative to the macro factor sequence is obtained based on a preset decay weighting factor;
[0042] Obtain the macroeconomic factors at the current time point and substitute them into the preset price update equation. Under the condition of satisfying the preset numerical constraints, solve in reverse the allowable boundary for the output data of the preset language model.
[0043] Obtain the initial sentiment factor output by the preset language model at the current time point, and combine it with the price update equation to obtain the local evolution gradient for the initial sentiment factor;
[0044] When the absolute value of the drift residual feature value is greater than the preset higher-order threshold, the initial emotion factor is projected back to the allowable boundary based on the local evolution gradient to obtain the corrected emotion factor.
[0045] The net excess demand, which characterizes the micro-level supply and demand deviation of the global interactive environment, is obtained. The modified sentiment factor and the net excess demand are substituted into the price update equation to output the asset price at the current time point, and this price is used as the simulation benchmark parameter for the next time point.
[0046] I. Synchronous acquisition of emotional factor sequences and macroeconomic factor sequences;
[0047] The input for this step is the historical state records of the past W Bar Ticks stored in the transaction snapshot log, and the output is a sequence of sentiment factors strictly aligned to time nodes. With macroeconomic factor sequences By establishing a dual-track time-synchronous acquisition framework, the probabilistic semantic output of the large language model and the DSGE numerical equalization solution are aligned under a unified global Bar counter timestamp, eliminating data timing deviations under multiple clock frequencies and providing a historical dataset with a complete time consistency foundation for subsequent drift quantization.
[0048] The emotion factor described in this invention does not refer to a subjective human psychological state, but rather to structured floating-point numerical data, used to represent semantic polarity and intensity, output by a large language model after natural language processing of the input text stream. Specifically, in the Reinterpretation phase of each Bar Tick, the narrative layer inputs the current macro-event and news text into the large language model. After model inference, it outputs structured JSON, where the `sentiment_score` field is the numerical carrier of the emotion factor, and its numerical domain is typically normalized to [value missing]. The range indicates that positive values represent a tendency toward market optimism, while negative values represent a tendency toward market pessimism. The larger the absolute value, the more significant the semantic polarity.
[0049] The macroeconomic factor described in this invention refers to the environmental scalar output by the macroeconomic layer DSGE operator after numerical partial differential equation solution and allocated to the underlying memory register. Its physical meaning corresponds to the macroeconomic factor-driven returns of various assets under the current macroeconomic cycle. The system writes the global transaction snapshot after completing the equilibrium solution in each Macro Tick, so that the market layer and the agent layer can read it in the corresponding Bar Tick interval.
[0050] At the start of each Bar Tick, the sequence acquisition module of this invention, based on the current global Bar counter, reads the status records of the past W time nodes in batches from the transaction snapshot log in the form of a sliding time window, extracts the sentiment factor value and the corresponding macro factor value from each record, and indexes them by time step. from arrive The data is arranged sequentially, assembled into an ordered dual-channel historical data sequence, and then passed to the feature extraction module.
[0051] The value of the preset time window W is preset during the system initialization phase based on the typical macro fluctuation cycle of the specific derivative product. It is usually set to cover the total number of Bar Ticks corresponding to one or more complete Macro Ticks, so as to ensure that the drift residual can fully represent the historical inertial divergence trend of the narrative layer.
[0052] The design of the aforementioned dual-track data acquisition framework fully utilizes the snapshot mechanism of the ACID transactional Tick pipeline at each Begin Snapshot stage to capture the global world state (ensuring the atomicity and consistency of historical data for both types of sequences). It also ensures strict alignment of the dual-track timelines through a unified global Bar counter, fundamentally eliminating the risk of mismatched timestamps between the sentiment factor sequence and the macro factor sequence due to multiple clock drifts. This provides repeatable, traceable, and high-quality input data for the subsequent calculation of drift residuals.
[0053] II. Calculation of drift residual eigenvalues;
[0054] The input to this step is the emotion factor sequence and the macro factor sequence obtained in step one, and the output is the scalar drift residual eigenvalue. By accumulating the exponentially decaying weighted deviations of emotional factors and macroeconomic factors at each historical node, the irrational narrative inertia divergence generated by the narrative layer of the large language model within the sliding time window is quantified into a single physical scalar that can be precisely measured by a computer. This gives the previously untraceable cumulative trend of the large language model's black-box output a quantifiable and comparable mathematical representation.
[0055] This step introduces an exponential decay mechanism, assigning higher weights to recent time points through a decaying weighting factor, while retaining long-term memory of historical drift trends. The calculation results can respond instantly to anomalies in the current state and also smoothly filter out single random noise. The calculation relationship of its drift residual characteristic values is as follows:
[0056] ;
[0057] in, These are the characteristic values of the drift residual; This represents the total number of time nodes within the preset time window. The time step represents the distance from the current time node. Historical distance, Corresponding to the most recent Bar Tick, Corresponds to the furthest Bar Tick; The preset basic attenuation constant has a range of values. The larger the value, the faster the historical distant memory decays; For time step The sentiment factors generated by the large language model at the corresponding historical nodes; These are the macroeconomic factors corresponding to the same historical point in time.
[0058] The physical meaning is the exponentially decaying weighted cumulative deviation of the large language model's sentiment output relative to the macroeconomic fundamental equilibrium benchmark over the recent W computational cycles. Specifically, in Under normal operating conditions, the drift residual eigenvalues reflect the legitimate multi-agent heterogeneous emotional oscillations. The system does not trigger any intervention, ensuring the narrative realism and the integrity of the emergent features in the simulation.
[0059] when This indicates that the narrative is experiencing a systemic optimistic drift that is disconnected from macroeconomic fundamentals, typically manifested as panic buying by multiple agents driven by the central bank's easing narrative; when This indicates that the narrative layer is falling into an irrational spiral of pessimism and panic, corresponding to a closed narrative loop of stampede-like sell-offs formed by multiple agents driven by a series of bad news.
[0060] The design of the above calculation formula reflects a precise balance between two time levels: decay index This ensures that the more recent the Bar Tick, the better. The greater the contribution, the more timely the reflection of the latest developments in the current narrative; and the historical window The cumulative summation ensures that a single random emotional fluctuation will not easily trigger the intervention mechanism, avoiding false positives and negative impacts on legitimate, heterogeneous emotional oscillations. Together, these two mechanisms form a historical semantic monitor that balances timely response with robust noise resistance. In practical configurations, The value should be calibrated based on the typical sustained volatility cycle of the derivative: for high-frequency scenarios with shorter volatility cycles, the value can be appropriately increased. (Accelerates the forgetting of distant history), but reduces it for long-term, macro-narrative scenarios. (To preserve a longer historical memory).
[0061] III. Reverse solution of the allowable boundary;
[0062] The input for this step is the macroeconomic factor at the current time point. Simulation baseline parameters output at the previous time point and preset overflow protection extreme values The output is the dynamic tolerance boundary of the large language model at the current time point. By assigning the expected output on the left side of the price equation as the overflow prevention extreme value, and dynamically calculating the limit value of the allowed input sentiment factor under the current macroeconomic fundamental constraints through algebraic inverse solution, the allowable boundary fluctuates dynamically with the real-time changes in macroeconomic fundamentals, thus constructing an absolutely safe mathematical protection network that adjusts synchronously with the macroeconomic gravitational field.
[0063] Specifically, preset overflow protection extreme values Pre-configured according to risk control rules during system initialization, this limit restricts the legal output range of asset prices (e.g., set to 130% of the simulation baseline parameter) to ensure that price increases within any single bar tick do not trigger system-wide circuit breakers. The system directly assigns the expected output of the price update equation to this value. The simulation baseline parameters from the previous time point and current macroeconomic factors Substitute the corresponding parameter bits into the equation, and simultaneously use the stochastic volatility residuals already obtained at the current node. Substitute the estimated net excess demand of the intelligent body into the corresponding parameter bits.
[0064] While maintaining computational balance on both sides of the equation, the sentiment factor variable is treated as the sole unknown and algebraically solved in reverse. Since the price update equation is an analytically differentiable exponential structure with a natural constant as its base, taking the natural logarithm of both sides transforms the exponential solution into a linear algebraic operation, achieving constant time complexity. The maximum permissible value of the emotion factor that can be obtained precisely under the condition of not triggering the overflow prevention constraint is used as the allowable boundary. Output and pass it to subsequent steps.
[0065] Taking the exponential price equation used in this invention as an example, After assigning values to the left side of the equation, taking the natural logarithm of both sides transforms the exponential solution into a linear operation, where the sentiment factor takes a positive value (i.e., ...). Under typical operating conditions, the analytical expression of the allowable boundary satisfies the following relationship:
[0066] ;
[0067] in, Characterizing the natural logarithm; in the molecule The logarithmic representation of the upper limit of the price increase; The denominator represents the linear equivalent impact coefficient of sentiment factors on the price equation at the current volatility level. The above analytical expression clearly reveals the dependence of the allowable boundary on each parameter: the smaller the numerator (smaller spillover margin or higher macroeconomic factors), and the larger the denominator (stronger sentiment sensitivity coefficient), the stronger the allowable boundary. The smaller the value, the more constrained the space of emotion factors that can be input into a large language model.
[0068] In the physical sense of a multi-agent simulation system, this boundary value represents the dynamic limit that the sentiment factor output by the large language model must not exceed, mathematically, within the current fundamental gravitational field determined by the macro-level DSGE equilibrium solution, with the constraint that market prices do not trigger a system-level circuit breaker. This boundary value is adjusted synchronously with the real-time updates of macroeconomic factors within each Bar Tick: when the macroeconomic fundamentals are favorable, A higher level of liquidity narrows the net margin available for sentiment factors in the molecule, and correspondingly reduces the allowable margin; when macroeconomic fundamentals are weak, The lower margin allows for a wider molecular margin and a corresponding increase in the allowable boundary, thus realizing a deep coupling physical mechanism for the automatic adjustment of the semantic safety domain by the macroscopic factor gravitational field.
[0069] IV. Extraction of local evolution gradient;
[0070] The input for this step is the simulation baseline parameters output from the previous time node. Macroeconomic factors at the current time point Stochastic volatility residuals generated at the market layer The initial sentiment factor output by this node of the large language model The output is a scalar local evolution gradient. By calculating the partial differential analytical expression of asset prices with respect to the initial sentiment factor in the price update equation, the absolute value of the destructive force of a unit sentiment fluctuation on the price system under the current spatiotemporal slice is measured in real time. This provides dynamic damping weights for projection pullback processing, reconstructing the price equation from a passive data-receiving black-box calculator into an active defense system with real-time vulnerability perception capabilities.
[0071] The stochastic volatility residual value described in this invention The data is not generated by a large language model, but rather by the market layer of the simulation engine performing numerical simulations based on the Heston stochastic volatility model within each Bar Tick. It represents the white noise random perturbation component of the underlying market. Its generation mechanism is strictly decoupled from the sentiment factors of the narrative layer, adhering to the principle of responsibility boundary that numerical methods are responsible for simulating the stochastic volatility process in the four-layer architecture. The market layer completes this process in the Begin Snapshot phase of each Bar Tick. A transaction snapshot is generated and written to the current node for this step to read.
[0072] The system retrieves the partial differential analytical expression of the price update equation with respect to the independent variable of the sentiment factor from the underlying computation graph, and then... , , as well as Substituting the values and taking the derivative, the partial differential relationship of its local evolution gradient is as follows:
[0073] ;
[0074] Since the price update equation is an exponential algebraic structure, according to the chain rule, in the initial sentiment factor... The partial derivative at point can be solved in constant time complexity. The exact internal calculations yielded the following engineering calculation relationships:
[0075] ;
[0076] in, For local evolution gradient; These are the simulation baseline parameters output at the previous time point; Characterized by natural constants An exponential function with base 0; Macroeconomic factors at the current point in time; The preset emotional sensitivity weight value; Initial emotional factor; This is the preset volatility amplification factor; This represents the absolute value of the initial emotion factor. This represents the stochastic volatility residual value at the current time point. The preset flow impact weight value; This represents the net excess demand at the current point in time. The sign function of the initial emotion factor, taking values of , or .
[0077] The above expansion reveals macroeconomic factors The role of the environmental amplifier in gradient calculation: Because the chain rule for the exponential function preserves the complete exponential term (i.e., the asset price itself in the current state), macroeconomic factors... As a global environment variable, it is firmly nested within the exponential component of the gradient, determining the local curvature of the high-dimensional manifold at the current coordinate point.
[0078] When macroeconomic factors are at high levels (such as during a period of macroeconomic boom), the gradient value The index base itself has been amplified, resulting in a geometric increase. This means that even a small disturbance in the sentiment factor can have a strong destructive effect on prices. The system will therefore impose a severe damping penalty on excessive sentiment. Conversely, when macroeconomic factors are at a low level (such as during a recession), the gradient value is relatively small, and the system's tolerance for sentiment fluctuations is correspondingly increased. This achieves a deep physical coupling where macroeconomic fundamentals determine the current vulnerability of the system. This is also a fundamental technical breakthrough of this invention compared to traditional static threshold methods at the level of large model-numerical collaborative control.
[0079] Furthermore, the system extracts the current local evolution gradient. Then, the historical local evolution gradient of the previous time point retained by the system is extracted. The difference between the two is calculated to obtain the second-order acceleration of the evolution gradient, which characterizes the rate of change of vulnerability in the equation. The calculation relationship is as follows:
[0080] ;
[0081] in, For evolutionary gradient second-order acceleration; This represents the local evolution gradient at the current time point; The historical local evolution gradient of the previous time point is extracted by the system from the global state data stream. The global state data stream that is written to the current time node.
[0082] V. Correcting the projection pullback of emotional factors;
[0083] The input for this step is the drift residual characteristic value. Preset higher-order thresholds Permissible boundaries Local evolution gradient And the initial sentiment factor output by this node of the large language model. The output is a modified sentiment factor. By using bi-branch conditional logic, the original heterogeneous output of the large language model is fully preserved during normal small emotional fluctuations. Gradient direction projection is only activated to pull back the values when the accumulated drift actually exceeds the higher-order threshold. This pulls the out-of-bounds values back into the allowable manifold in a way that minimizes disruption, fundamentally solving the technical defect of traditional static hard truncation that destroys the continuity of system dynamics due to non-differentiability.
[0084] This step performs the following conditional branching process to determine the modified emotion factor. When the absolute value of the drift residual characteristic value is less than or equal to the preset higher-order threshold, i.e. The large language model's current narrative is determined to be within the normal fluctuation range tolerable by macroeconomic fundamentals. The heterogeneous emotional differences among multiple agents constitute a legitimate source of emergent features in the simulation. The current value of the initial emotional factor is retained as the modified emotional factor, and no intervention is triggered.
[0085] ;
[0086] When the absolute value of the drift residual feature value is greater than the preset higher-order threshold, i.e. The system determines that the large language model has suffered a severe narrative derailment, and activates the projection pull-back mechanism. Based on the initial emotion factor... The numerical dimensions represented construct a continuous mapping space, with the allowable boundary as the basis. Delineate the domain of legal numerical sets within the continuous mapping space. ;
[0087] The current value of the initial sentiment factor is extracted as the starting point for optimization. Along the function gradient direction determined by the local evolution gradient, a mapping vector with the shortest Euclidean distance is calculated to the boundary of the numerical set domain. The target value at the point where the mapping vector coincides with the boundary of the numerical set domain is used as the modified sentiment factor. The corresponding optimization relationship is as follows:
[0088] ;
[0089] in, To correct emotional factors; For the allowable boundary The defined domain of legal numerical values; Let A be any numerical point within the continuous mapping space; Initial emotional factor; This is the square of the Euclidean distance. Since... and All points within All are in the following positions In the same continuous mapping space constructed by numerical dimensions, both are numerical objects of the same dimension, and the Euclidean distance operation is strictly legal algebraically, ultimately determining... That is, the distance within the legal domain. The nearest boundary point.
[0090] In engineering implementation, the above projection optimization relationship can be efficiently solved in constant time complexity using an equivalent method of gradient direction damping subtraction. The engineering calculation relationship is as follows:
[0091] ;
[0092] in, This is the projection convergence step size, used to control the convergence amplitude of the pull-back operation; The local evolution gradient obtained in step four acts as the damping penalty weight in this step. The larger the value, the more critical and fragile the system is, and the heavier the corresponding damping torque and the greater the pull-back force. The overflow difference of the initial sentiment factor exceeding the allowable boundary, when This value is zero when the boundary is not exceeded, ensuring that emotional data under normal operating conditions is not interfered with; The sign function ensures that the pullback direction is consistent with the positive or negative direction of the initial emotion factor, preventing directional pullback errors.
[0093] The physical essence of the equivalence between the engineering calculation formula and the argmin projection relationship lies in the fact that performing the shortest distance pullback along the gradient normal direction is equivalent to the influence rate along the partial derivative in the high-dimensional emotion feature space. The gradient back projection, used as a damping weight, ensures that the modified sentiment factor maintains analytical continuity after being substituted into the price equation, and the price curve will not have non-differentiable breakpoints. This is fundamentally superior to the shortcomings of traditional hard truncation, which causes numerical derivative jumps and destroys the continuity of the equation manifold at the cutoff point.
[0094] Specifically, traditional hard truncation is equivalent to applying a discontinuous mapping with zero gradient in the feature space. Substituting this into the equation results in an artificial inflection point in the price series at the truncation boundary, causing subsequent Bar Tick gradient calculations to fail and leading to positive feedback instability. In contrast, the gradient projection pullback mapping of this invention is continuously differentiable throughout the real domain, ensuring the smooth evolution of the simulation trajectory over time. Furthermore, because... It carries dynamic information about macroeconomic fundamentals, and the strength of the projection pullback will automatically increase during periods of high macroeconomic volatility and automatically relax during periods of macroeconomic stability, thus realizing the automatic linkage between the constraint strength of the large language model and the vulnerability of macroeconomic fundamentals.
[0095] VI. Atomized clearing submission of the price update equation;
[0096] The input for this step is the modified emotion factor output from step five. The set of buy and sell instructions generated by the interactions of each intelligent agent within the current time node, and the simulation baseline parameters output from the previous time node. Current macroeconomic factors and stochastic volatility residuals The output is the final asset price at the current time point after safe clearing. It is then recorded in a global state snapshot as a simulation baseline parameter for the next time node.
[0097] By substituting the sentiment factor modified by Jacobi constraints and the net excess demand summed from the micro-decision of multi-agent agents into the unified price equation, and performing deterministic Walrasian clearing under the ACID transaction guarantee of the transaction coordinator, a precise coordination and secure implementation between the physical laws of the digital world (deterministic clearing under numerical equation constraints) and the free will of multi-agent agents (LLM-driven narratives, expectations, and behaviors) is achieved.
[0098] First, the system obtains the buy and sell orders output by each agent within the current time node after performing interactive calculations based on local state constraints (including position limits, capital constraints, and convex optimization position strategies). It then performs a traversal and summation calculation on the number of buy orders and sell orders for all agents, and uses the difference between the sums as the net excess demand characterizing the micro-level supply and demand deviation in the global interactive environment. The calculation relationship is as follows:
[0099] ;
[0100] in, This represents the net excess demand at the current time point; a positive value indicates excess net buying demand in the entire market, while a negative value indicates excess net selling pressure. The total number of agents in the system; For traversal index; For the first The number of buy orders executed by each agent; For the first Number of sell orders executed by each agent. Net excess demand. It is the final physical implementation of the multi-agent layer, from the role semantics and expected narrative given by LLM to the actual trading actions driven by the real ledger, subject to the dual constraints of capital constraints and position optimization. It fully preserves the real sum of the micro decisions of thousands of heterogeneous agents, and together with the semantically constrained emotional factors, it is substituted into the price equation to ensure that the physical laws of the digital world are not arbitrarily penetrated by the illusion of the big language model.
[0101] The modified emotion factor With the aforementioned net excess demand Substituting all the values into the price update equation, performing Walrasian clearing calculations, and outputting the asset price at the current time point, the underlying calculation rules satisfy the following formula:
[0102] ;
[0103] in, The asset price cleared at the current time point is used as the input benchmark for the next time point to achieve iterative recursion; The simulation baseline parameters output at the previous time node are used as the simulation baseline parameters at the current time node. Characterized by natural constants An exponential function with base 0;
[0104] For the current time point, the macroeconomic factors correspond to the macroeconomic factor-driven returns output by the macroeconomic layer DSGE solution, representing the deterministic impact of macroeconomic fundamentals on prices. The preset emotional sensitivity weight value controls the linear driving force of the emotional factor on the price. The modified sentiment factor in step five represents the semantic impact of the narrative layer on prices (ensuring that it does not trigger a numerical explosion). The preset volatility amplification factor reflects the nonlinear coupling effect that the larger the absolute value of the sentiment factor, the stronger the amplification of the underlying random volatility.
[0105] To correct the absolute value of the emotion factor; The stochastic volatility residuals generated for the Heston SV model at the market level represent the white noise floor of the market microstructure. The preset liquidity shock weight value corresponds to the liquidity depth of a specific asset's order book; The net excess demand at the current time point represents the Walrasian micro-clearing impact of the multi-agent behavioral layer on prices.
[0106] It should be noted that each term within the exponential function of the price update equation undergoes dimensionless mapping with dimension alignment at the data flow level. Specifically: the sentiment-sensitive weight value... The physical characteristics satisfy the mapping transformation from emotion score to logarithmic return, which is used to eliminate the evaluation score dimension of the modified emotion factor;
[0107] The liquidity shock weight value It satisfies the characteristics of price shocks, and its physical dimension is the reciprocal of the measurement dimension of the net excess demand, so as to cancel out the market entity dimension of the net excess demand in the multiplication operation; thereby ensuring that all the terms inside the exponential function of the price update equation are uniformly converged and represented as dimensionless asset logarithmic return contribution terms, and have completely consistent dimensions in mathematical operations and computer underlying data flow.
[0108] The four index terms mentioned above correspond to macroeconomic factor-driven returns, sentiment factor-driven shocks, stochastic volatility residuals (nonlinear terms amplified by sentiment), and clearing shocks driven by net excess demand of intelligent agents, respectively. They unify numerical factors, narrative factors, and behavioral factors into the same equation structure, achieving deterministic fusion and coordinated clearing of the three types of physical forces.
[0109] The transaction coordinator will in the Effect Apply phase Atoms are written to the global world state and recorded in the global state snapshot as the simulation baseline parameter for the next time node, driving the iteration of the next Bar Tick; any unrecoverable error triggers a rollback to the snapshot before this Tick, ensuring that the simulation state is not contaminated by single point of failure, and the global clearing result satisfies the atomicity and durability requirements of ACID transaction properties, ensuring that the simulation trajectory is completely repeatable.
[0110] Furthermore, after outputting the asset price at the current time point, the system reads the evolution gradient second-order acceleration written into the global state data stream in step four. Compare it with a preset evolutionary critical threshold Compare:
[0111] when When it is determined that the fragility of the current system's equations is changing rapidly (such as sudden changes in macroeconomic factors or a sharp surge in market volatility), the system will... The adaptive time-domain forgetting rate is output after calculation using preset mapping rules. Based on the adaptive time-domain forgetting rate The preset basic attenuation constant in the preset attenuation weight factor initially generated at the next time node is numerically overwritten and replaced. The preset attenuation weight factor after numerical overwriting and replacement is passed to the next time node for subsequent calculation of drift residual characteristic value in step two, so as to realize dynamic adaptation of drift monitoring time domain memory.
[0112] The preset mapping rule aims to force the second-order acceleration of the evolutionary gradient, which may diverge nonlinearly, to converge and be mapped to a valid weight adjustment coefficient, thereby ensuring the numerical stability during the underlying clock advance. This preset mapping rule is implemented through a mapping function pre-configured in memory, and its specific mapping formula satisfies:
[0113] ;
[0114] In the formula, This represents the adaptive time-domain forgetting rate output at the current time point; and These represent the pre-defined lower and upper limits of the forgetting rate (which can be 0 and 0.95, respectively). This represents the second-order acceleration of the evolution gradient; This indicates a preset evolutionary critical threshold; This represents the preset mapping sensitivity gain constant.
[0115] The numerical overwrite and replacement process includes: at the end of the iteration calculation cycle at the current time node, the central computing unit of the simulation engine calls the preset basic decay constant in memory by default, performs prior decay recursive calculation, and generates a prior decay weight factor for the next time node. and the Initially written to the pre-allocated first memory register address.
[0116] If the system detects that the preceding steps have triggered a state exceeding a preset evolutionary critical threshold, the control unit immediately issues a state bus interrupt command. The computation unit receives the adaptive time-domain forgetting rate. and read from the address of the first memory register Perform dynamic hedging operations to generate the target attenuation weighting factor. ;
[0117] ;
[0118] The control unit sends an overwrite command to the underlying data bus, which will generate the target attenuation weighting factor. A forced write is performed to the address of the first memory register. This write operation directly overwrites and erases the previously resident prior decay weight factor at the physical level. When the simulation global clock advances to the next time node and executes the step of obtaining the drift residual characteristic value, it directly points to the first memory register address to read data. Subsequent modules directly obtain and apply the data incorporating the latest forgetting rate. .
[0119] when At the same time, the original preset basic attenuation constant is maintained to ensure that the system does not experience unnecessary parameter fluctuations under stable operating conditions. The above mechanism enables the simulation system to automatically shorten the forgetting window and improve response sensitivity when the market conditions deteriorate rapidly, and to extend the memory window and smooth out short-term noise when the system is stable. This forms a complete adaptive closed loop for dynamically adjusting the drift monitoring sensitivity of the equation vulnerability, further enhancing the robustness of the multi-agent simulation engine during periods of dramatic macro-cyclical changes.
[0120] Through the above technical solutions, the present invention can achieve the following technical effects:
[0121] 1) In response to the shortcomings of existing technologies, where semantic drift generated by large language models breaks through the static constant coefficient constraint, leading to exponential numerical distortion of the emotion-driven term and the random volatility multiplier, this invention constructs a numerical-semantic dynamic constraint mechanism. Using the partial differential mathematical structure of the price update equation itself as the constraint anchor point, the excess emotion factor is accurately pulled back to the allowable manifold boundary through gradient direction damping deduction. This completely eliminates the false price collapse and liquidity deadlock calculation overflow caused by semantic drift in long-cycle simulations, and significantly extends the continuous, uninterrupted operation lifecycle of the multi-agent simulation engine.
[0122] 2) To address the shortcomings of traditional static hard truncation in existing technologies, which disrupts the heterogeneous emotional oscillations of large language models due to non-differentiability and leads to the loss of emergent features in simulation, this invention replaces hard truncation with gradient-direction shortest-distance projection pullback. The projection operation is a continuously differentiable mathematical mapping, which, while constraining the numerical values, maximizes the preservation of the analytical continuity of the price curve after substituting the modified emotional factor into the equation, and in... Under normal operating conditions, the micro-heterogeneous emotional output of the large language model is fully preserved, enabling multi-agent simulation to achieve a precise balance between numerical stability and narrative realism.
[0123] 3) In view of the shortcomings of existing technologies, such as the lack of historical semantic divergence monitoring methods, which leads to the inability to detect the cumulative loss of control of the black box output of large language models in a timely manner, this invention introduces a historical semantic divergence quantification mechanism with exponential decay weighted drift residual as the core. This gives the simulation system the ability to trace the narrative history inertia of the large language model within each Bar Tick, so that the triggering and intervention of semantic loss of control have a rigorous mathematical basis and eliminate the risk of untraceability of the black box output of the large language model.
[0124] 4) In view of the shortcomings of existing technologies, such as the failure of constraints due to the lag of static threshold when macroeconomic fundamental conditions change, this invention solves the allowable boundary by dynamically and inversely solving the allowable boundary at each time point, so that the safety net fluctuates synchronously with the real-time changes of macroeconomic factors. This realizes the deep coupling physical mechanism of the semantic safety domain of the adaptive constraint of macroeconomic fundamental gravitational field, and eliminates the fundamental problem of the protection lag of static threshold when the market state changes abruptly.
[0125] 5) Furthermore, this invention uses an adaptive time-domain forgetting rate update mechanism driven by the second-order acceleration of the evolutionary gradient to automatically adjust the length of the drift monitoring time-domain memory according to the rate of change of the vulnerability of the equation. This improves the response sensitivity during periods of macroscopic upheaval and reduces noise interference during periods of stability, forming a complete multi-level adaptive protection system. This significantly improves the continuous operation reliability and simulation result reproducibility of the multi-agent simulation engine in demanding scenarios such as long-term complex financial derivatives.
[0126] In another embodiment, this application also provides a computer storage medium storing computer-executable instructions, which, when executed, implement the aforementioned computer simulation optimization system based on the collaboration of numerical and language models.
[0127] The above embodiments are only used to illustrate the technical methods of this application and are not intended to limit it. Although this application has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of this application without departing from the spirit and scope of the technical methods of this application.
Claims
1. A computer simulation optimization system based on the collaboration of numerical and language models, characterized in that, Includes the following modules: The sequence acquisition module is used to synchronously acquire the emotion factor sequence generated by the preset language model within a preset time window, as well as the macro factor sequence corresponding to each time node within the preset time window. The feature extraction module is used to obtain the drift residual feature value of the emotion factor sequence relative to the macro factor sequence based on a preset decay weight factor; The boundary generation module is used to obtain the macroeconomic factors at the current time point and substitute them into the preset price update equation. Under the condition of satisfying the preset numerical constraints, it reversely solves the allowable boundary for the output data of the preset language model. The gradient extraction module is used to obtain the initial sentiment factor output by the preset language model at the current time node, and to obtain the local evolution gradient for the initial sentiment factor in combination with the price update equation. The sequence correction module is used to perform projection pullback processing on the initial emotion factor to the allowable boundary based on the local evolution gradient when the absolute value of the drift residual feature value is greater than a preset higher-order threshold, so as to obtain a corrected emotion factor. The simulation output module is used to obtain the net excess demand that characterizes the micro-level supply and demand deviation of the global interactive environment. The modified sentiment factor and the net excess demand are substituted into the price update equation to output the asset price at the current time node, and the asset price is used as the simulation benchmark parameter for the next time node.
2. The computer simulation optimization system based on the collaboration of numerical and language models according to claim 1, characterized in that, The process of obtaining drift residual eigenvalues includes: Obtain the emotional factor sequence and the macro factor sequence at the same time node within a preset time window, and perform a difference calculation on the two to obtain the characteristic deviation value at the corresponding time node. The emotional factor sequence and the time step of each time point in the macro factor sequence from the current time point are compared. Multiply by the preset base attenuation constant Then take the negative exponent to obtain the preset decay weight factor at the corresponding time node; The feature deviation values at each time point are multiplied with their preset attenuation weight factor, and the product results at each time point are summed to output the corresponding drift residual feature value D. ; in, This indicates the total number of time points within the preset time window. and These represent time steps of 1 and 2 respectively. The corresponding emotional factors and macroeconomic factors at the time point.
3. The computer simulation optimization system based on the collaboration of numerical and language models according to claim 1, characterized in that, The process of reverse-engineering to find the allowable boundary includes: Extract the simulation baseline parameters output by the system at the previous time node, and substitute them together with the macroeconomic factors at the current time node into the price update equation. Assign the expected output result of the price update equation to the preset anti-overflow extreme value. While maintaining the computational balance on both sides of the price update equation, the variable representing the output data of the preset language model is treated as the only unknown and an algebraic inverse solution is performed to obtain the maximum input value under the condition that it is not greater than the preset anti-overflow extreme value, and this value is used as the allowable boundary.
4. The computer simulation optimization system based on the collaboration of numerical and language models according to claim 3, characterized in that, The process of obtaining the local evolution gradient includes: Obtain the partial differential analytical expression of the asset price dependent variable with respect to the sentiment factor independent variable in the price update equation. Substitute the simulation baseline parameters output by the system at the previous time node, the macroeconomic factors at the current time node, and the initial sentiment factors into the partial differential analytical expression to perform differentiation and output the local evolution gradient.
5. The computer simulation optimization system based on the collaboration of numerical and language models according to claim 4, further comprising, after obtaining the local evolution gradient: Extract the historical local evolution gradient of the previous time node retained by the system, perform difference calculation on the local evolution gradient and the historical local evolution gradient to obtain the second-order acceleration of the evolution gradient of the two, and write it into the global state data stream of the current time node.
6. The computer simulation optimization system based on the collaboration of numerical and language models according to claim 1, characterized in that, The process of obtaining modified emotion factors includes: When the absolute value of the drift residual feature value is less than or equal to a preset higher-order threshold, the current value of the initial emotion factor is directly assigned as the modified emotion factor. When the absolute value of the drift residual eigenvalue is greater than a preset higher-order threshold, a continuous mapping space is constructed based on the numerical dimension of the initial emotion factor representation, and a numerical set domain is delineated within the continuous mapping space based on the allowable boundary. ; Extract the current value of the initial emotion factor in the continuous mapping space. And using this as the starting point for optimization, along the normal vector direction parallel to the local evolution gradient, calculate the mapping vector with the shortest Euclidean distance to the boundary of the numerical set domain. Extract the target value at the boundary where the mapping vector coincides with the domain of the numerical set, and use it as a modified sentiment factor. ,in, Let be any numerical point within the continuous mapping space.
7. The computer simulation optimization system based on the collaboration of numerical and language models according to claim 1, characterized in that, The process of outputting the asset price at the current time point includes: Obtain the number of buy orders executed by each agent within the system within a preset time window. Quantity of sell orders Perform a traversal summation calculation on all agents, and use the difference between the sums as the net excess demand at the current time point. ; ; Where N represents the total number of agents, i is the traversal index, and the net excess demand is combined with the modified sentiment factor. Substitute the values into the price update equation and output the asset price at the current time point. And use it as the simulation baseline parameter for the next time node; ; in, This represents the simulation baseline parameter at the current time point. , These represent the macroeconomic factors at the current time point and the pre-acquired stochastic volatility residual value, respectively. , , These represent the preset emotional sensitivity weight value, volatility amplification coefficient, and liquidity shock weight value, respectively.
8. The computer simulation optimization system based on the collaboration of numerical and language models according to claim 5, after outputting the asset price at the current time point, further includes: When the second-order acceleration of the evolutionary gradient is greater than a preset evolutionary critical threshold, the second-order acceleration of the evolutionary gradient is used to calculate and output an adaptive temporal forgetting rate through a preset mapping rule. Based on the adaptive time-domain forgetting rate, the preset decay weight factor initially generated at the next time node is numerically overwritten and replaced. The preset decay weight factor after numerical overwriting and replacement is then passed to the next time node to perform the step of obtaining drift residual feature values.
9. A computer simulation optimization method based on the synergy of numerical and language models, characterized in that, Includes the following steps: Synchronously acquire the emotion factor sequence generated by the preset language model within the preset time window, as well as the macro factor sequence corresponding to each time node within the preset time window; The drift residual characteristic value of the emotion factor sequence relative to the macro factor sequence is obtained based on a preset decay weighting factor; Obtain the macroeconomic factors at the current time point and substitute them into the preset price update equation. Under the condition of satisfying the preset numerical constraints, solve in reverse the allowable boundary for the output data of the preset language model. Obtain the initial sentiment factor output by the preset language model at the current time point, and combine it with the price update equation to obtain the local evolution gradient for the initial sentiment factor; When the absolute value of the drift residual feature value is greater than the preset higher-order threshold, the initial emotion factor is projected back to the allowable boundary based on the local evolution gradient to obtain the corrected emotion factor. The net excess demand, which characterizes the micro-level supply and demand deviation of the global interactive environment, is obtained. The modified sentiment factor and the net excess demand are substituted into the price update equation to output the asset price at the current time point, and this price is used as the simulation benchmark parameter for the next time point.
10. A computer storage medium storing computer-executable instructions, characterized in that, When the computer-executable instructions are executed, they implement the computer simulation optimization system based on the collaboration of numerical and language models as described in any one of claims 1-8.
