An unmanned aerial vehicle-oriented closed-loop feedback time series prediction method and training method
Patent Information
- Application Number
- CN202611096390.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-23
- Publication Date
- 2026-10-30
AI Technical Summary
本发明的方法通过引入残差估计器作为闭环观测器,基于历史残差序列预估轨迹偏差补偿项并注入初步预测结果,形成闭环反馈机制,能够主动抑制预测误差的累积与轨迹漂移,显著提高长期预测的准确性。
Smart Images

Figure CN123012406A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and data processing technology, and in particular to a closed-loop feedback time series prediction method and training method for unmanned aerial vehicles (UAVs). Background Technology
[0002] Time series forecasting plays a crucial role in data-driven decision-making scenarios such as UAV status monitoring, power load, weather, and traffic flow. In recent years, researchers have begun to utilize large language models for time series analysis, treating continuous time series data as labeled sequences and performing generative forecasts through pre-trained models.
[0003] Standard large language models employ a teacher-forced mechanism during training, meaning they are trained by inputting real historical values at each step. However, during inference, the model operates in an open-loop autoregressive mode, recursively consuming its own generated outputs to predict subsequent steps. Due to the difference in input distribution between training and inference, this exposure bias causes prediction errors to propagate and amplify continuously in the feedback loop. Therefore, over long prediction periods, small errors generated by the model can create a "snowball effect," causing the prediction trajectory to irreversibly deviate from the true data manifold, resulting in a significant decrease in the reliability of long-term predictions.
[0004] Therefore, there is an urgent need to provide a technical solution to address the above problems. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides a closed-loop feedback time series prediction method and training method for unmanned aerial vehicles (UAVs).
[0006] In a first aspect, the present invention provides a closed-loop feedback time series prediction method for unmanned aerial vehicles (UAVs), which forms a closed-loop feedback in the autoregressive prediction process to suppress the accumulation of prediction errors and trajectory drift of UAV state parameters. The technical solution of this method is as follows: The historical time-series data of the drone's state is projected from the time-series space to the feature space of a large language model with frozen parameters through an embedding layer to obtain contextual features used to drive the reasoning of the controlled object; the contextual features in the first time step only include the feature representation of the historical time-series data, and in subsequent time steps, they also include the calibration prediction results of the previous time step as feedback correction information. Using the large language model with the frozen parameters as the controlled object, the uncalibrated prediction output of the current time step is generated based on the context features, and mapped back to the time series space through the projection layer to obtain the preliminary prediction result characterizing the open-loop response of the controlled object. Using the residual estimator as a closed-loop observer, the potential error state of the current time step is inferred based on the estimated residual sequence stored in the historical time steps, and the trajectory deviation compensation term used to offset the accumulation of errors is estimated; the estimated residual sequence characterizes the accumulation and propagation dynamics of historical prediction errors; The trajectory deviation compensation term is injected as a feedback correction signal into the preliminary prediction result to obtain a calibrated prediction result that suppresses the accumulation of error at the current time step. This result is then fed back into the context features as the state input for the next time step, enabling the controlled object to perform reasoning based on the context containing feedback correction information at the next time step, thus forming a closed-loop feedback prediction process.
[0007] The beneficial effects of the closed-loop feedback time series prediction method for unmanned aerial vehicles (UAVs) of the present invention are as follows: The method of this invention introduces a residual estimator as a closed-loop observer, predicts the trajectory deviation compensation term based on the historical residual sequence and injects the preliminary prediction results to form a closed-loop feedback mechanism, which can actively suppress the accumulation of prediction errors and trajectory drift, and significantly improve the accuracy of long-term prediction.
[0008] Based on the above scheme, the closed-loop feedback time series prediction method for UAVs of the present invention can be further improved as follows.
[0009] In one alternative approach, the step of projecting the historical time-series data of the UAV's state from the time-series space to the feature space of a large language model with frozen parameters through an embedding layer to obtain contextual features for driving reasoning of the controlled object includes: The historical time series data of the drone status is divided into a sequence of non-overlapping tiles according to a preset fixed length L, wherein each tile contains data segments of L consecutive time points; if there are less than L time points at the end, zero-value padding is used to complete the tile. The embedding layer projects each tile from the time series space to the large language model feature space of the frozen parameters to obtain tile feature vectors, and then concatenates the tile feature vectors in time order to obtain the context features.
[0010] In the above-mentioned alternative methods, by segmenting historical time series data into non-overlapping tile sequences, the calibration prediction results can be back-injected into the context features in units of tiles, providing a structured recursive input unit for the closed-loop feedback prediction process, thereby effectively controlling the length of context features and computational overhead while maintaining prediction coherence.
[0011] In an alternative approach, the contextual features are further included as a context window management step before being input into the large language model of the frozen parameters: When the number of tiles contained in the context features exceeds the preset maximum window length K, only the feature vectors of the K most recent tiles in time are retained, and the feature vectors of earlier tiles are discarded, so as to limit the computational overhead while maintaining the ability to maintain long-term dependencies.
[0012] Among the above-mentioned optional methods, context window management, while preserving recent historical information to maintain prediction accuracy, avoids the infinite growth of context features as the number of prediction steps increases, thereby ensuring the computational efficiency and memory controllability of the inference process.
[0013] In one alternative approach, when the embedding layer projects each tile, it further adds time step position encoding to the projection result so that the context features retain the temporal order information between different tiles.
[0014] In the above-mentioned alternative methods, by adding time step position encoding, the large language model with frozen parameters can perceive the temporal sequence relationship between different tiles, thereby more accurately capturing the time dependency pattern in the time series data and improving prediction accuracy.
[0015] In one alternative approach, the trajectory deviation compensation term is injected as a feedback correction signal into the preliminary prediction result using a linear addition method, i.e., the calibrated prediction result = the preliminary prediction result + the trajectory deviation compensation term, in order to avoid introducing additional fusion parameters that could lead to training instability or overfitting.
[0016] Among the above-mentioned alternative methods, by using linear addition for feedback fusion, error compensation is achieved while avoiding the introduction of additional learnable parameters, thereby reducing training complexity and improving the stability and generalization ability of the closed-loop feedback prediction process.
[0017] In one alternative approach, the residual estimator includes a recursive feature extraction structure and an output mapping layer; The recursive feature extraction structure is used to perform time-series modeling on the estimated residual sequence stored in the historical time steps, extract the propagation and accumulation features of error in the time dimension, and obtain the error feature representation; the recursive feature extraction structure is implemented using a recurrent neural network or a temporal convolutional network; The output mapping layer is a fully connected layer used to map the error feature representation into the trajectory deviation compensation term.
[0018] Among the above-mentioned optional methods, by performing time-series modeling on the estimated residual sequence through a recursive feature extraction structure, it is possible to effectively capture the propagation and accumulation patterns of historical prediction errors in the time dimension, thereby accurately predicting the trajectory deviation compensation term required for the current time step and improving the accuracy and effectiveness of closed-loop feedback compensation.
[0019] Secondly, this invention provides a training method for a UAV time series prediction model, used to train the embedding layer, projection layer, and residual estimator used in the method described above. The technical solution of this method is as follows: The method includes: a first stage and a second stage; The first stage includes: All parameters of the residual estimator are frozen, a teacher-forced strategy is adopted, and the context features corresponding to the historical real map tiles are used as the input of the controlled object. The embedding layer and the projection layer are jointly trained, and local Lipschitz constraint regularization is applied to the projection layer to control the ratio of the output change amplitude of the projection layer to the input change amplitude, thereby ensuring the stability of the closed-loop feedback prediction process. The second phase includes: The parameters of the embedding layer and projection layer after the first stage of training are frozen, and the autoregressive rolling mode is switched. The difference between the historical real map tiles and the preliminary prediction results output by the controlled object through the projection layer in the current time step is used as a supervision signal to train the residual estimator, so that it learns how to accurately predict the current trajectory deviation compensation term based on the estimated residual sequence stored in the historical time step.
[0020] The present invention provides a training method for a time series prediction model for unmanned aerial vehicles (UAVs), the beneficial effects of which are as follows: The method of this invention adopts a two-stage decoupled training strategy. First, the controlled object is stabilized (the embedding layer and projection layer are trained and local Lipschitz constraints are applied to ensure the stability of the closed-loop system). Then, the residual estimator is trained separately on the basis of the stabilized controlled object to learn the dynamic compensation of the error. This avoids the training non-stationarity problem caused by joint optimization and ensures the controllability and prediction accuracy of the closed-loop system.
[0021] Based on the above scheme, the training method for UAV time series prediction model of the present invention can be further improved as follows.
[0022] In one alternative approach, applying local Lipschitz constraint regularization to the projection layer includes: During training, a Gaussian noise vector with the same dimension as the latent output is added to the latent output of the projection layer; wherein, when adding the Gaussian noise vector to the latent output of the projection layer, the Gaussian noise vector is sampled independently and uses the same intensity range between different training samples and between different time steps of the same training sample; Calculate the difference norm between the projection layer output vectors before and after adding noise, and calculate the ratio of this difference norm to the norm of the Gaussian noise vector. Subtract the preset upper limit of the Lipschitz constant from the ratio. If the difference is positive, the square of the difference is taken as the regularization loss term. If the difference is zero or negative, the regularization loss term is zero. The regularization loss term is used to constrain the sensitivity of the projection layer and prevent the error from being amplified in the closed loop.
[0023] In the above-mentioned optional methods, local Lipschitz constraints are applied by noise perturbation regularization, making the output of the projection layer insensitive to small perturbations in the input, thereby ensuring the local stability of the controlled object and providing theoretical support for the bounded error control of the subsequent closed-loop feedback prediction process.
[0024] In one alternative approach, the step of jointly training the embedding layer and the projection layer includes: Construct the total loss function for the first stage; the total loss function is composed of the regularization loss term and the time series reconstruction loss term constructed from the error between the initial prediction results based on historical real tiles and the projection layer output; The embedding layer and the projection layer are jointly trained by minimizing the total loss function.
[0025] In the above-mentioned alternative approaches, by combining the time series reconstruction loss with the Lipschitz regularization loss, the sensitivity of the projection layer is constrained while ensuring prediction accuracy, thus achieving a balance between feature alignment and system stability.
[0026] In one alternative approach, the step of training the residual estimator includes: Construct a target loss function; the target loss function uses the error between the true residual at the current time step and the trajectory deviation compensation term output by the residual estimator as the residual estimation loss term; wherein, the true residual at the current time step is defined as the difference between the historical true map patch and the preliminary prediction result output by the controlled object through the projection layer at the current time step; The residual estimator is optimized by minimizing the objective loss function so that it learns the systematic deviation dynamics of the frozen controlled object.
[0027] In the above-mentioned optional methods, by training the residual estimator with the real residual as the supervision signal based on the frozen controlled object, the residual estimator can accurately learn the systematic deviation dynamics of the controlled object, thereby enabling the trajectory deviation compensation term to be accurately predicted based on the estimated residual sequence during the inference stage, and achieving effective dynamic error cancellation.
[0028] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0029] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 This is a flowchart illustrating an embodiment of a closed-loop feedback time series prediction method for unmanned aerial vehicles (UAVs) according to the present invention. Figure 2 This is a schematic diagram illustrating the structure and data flow interaction of the embedding layer, large language model, projection layer, and residual estimator of the present invention. Figure 3 This is a flowchart illustrating an embodiment of a training method for a time series prediction model for unmanned aerial vehicles (UAVs) according to the present invention. Detailed Implementation
[0030] Exemplary embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein. The embedding layer, projection layer, residual estimator, and large language model described in this invention are all implemented as computer software programs and run on a processor, collectively constituting the core algorithm modules of the overall time series prediction system.
[0031] It should be noted that the following embodiments use general time series prediction as an example for illustration, but the method described in this invention is directly applicable to time series prediction tasks of UAV systems, including but not limited to closed-loop prediction of state parameters such as flight trajectory, battery voltage, IMU attitude, and motor temperature. In each embodiment, "historical time series data" and "prediction results" refer to the aforementioned UAV state parameters.
[0032] For ease of understanding, such as Figure 2 As shown, the embedding layer, the large language model with frozen parameters, the projection layer, and the residual estimator involved in this invention have the following structure and interconnections: Embedding layer: Connected before the input of the large language model with frozen parameters, it is a standalone, trainable fully connected or convolutional network. Its input is segmented time-series patches (each patch containing data from L consecutive time points). Its function is to map the segmented time-series patches to a feature space that the large language model can understand. Its output is a fixed-dimensional patch feature vector, which has the same dimension as the input of the large language model. It is important to note that the embedding layer is not an internal layer of the large language model, but rather an externally added adaptation module.
[0033] Large Language Model: Located between the embedding and projection layers. It is a pre-trained language model (e.g., GPT, LLaMA) whose parameters are frozen during prediction and training without any updates. This model receives contextual features from the temporal concatenation of tile feature vectors output from the embedding layer and extracts temporal features based on a self-attention mechanism, outputting uncalibrated predicted features. In this method, the large language model acts as the controlled object, providing the ability to infer temporal patterns.
[0034] Projection layer: Connected after the output of the large language model. It is an independent, trainable neural network (e.g., a fully connected network). Its input is the current-step feature from the uncalibrated predicted features output by the large language model, and its output is a vector with the same dimension as the input patch, i.e., the preliminary prediction result. The role of the projection layer is to map the feature representation of the large language model back to the original time series space to obtain the preliminary prediction result. It should be noted that the projection layer is also an externally added adaptation module.
[0035] Residual estimator: A lightweight neural network module independent of the large language model, containing a recursive feature extraction structure (e.g., a recurrent neural network or a temporal convolutional network) and an output mapping layer (e.g., an output fully connected layer). Its input receives a sequence of estimated residuals stored in historical time steps (each estimated residual is defined as the difference between the initial prediction and the calibrated prediction at that time step), and its output generates a trajectory deviation compensation term for the current time step, with the same dimension as the initial prediction.
[0036] It should be noted that the interaction between modules is as follows: the embedding layer and the projection layer are connected to the input and output sides of the large language model, respectively, forming a bidirectional mapping between the time series space and the feature space. At each prediction time step, data flows sequentially through the embedding layer, the large language model, and the projection layer to obtain a preliminary prediction result. The residual estimator is connected in parallel to the output side of the projection layer, and its output compensation term is linearly added to the preliminary prediction result output by the projection layer to obtain a calibrated prediction result. This calibrated prediction result is fed back into the input context features of the embedding layer (concatenated with historical real tiles or previous calibrated prediction tiles) as input for the next time step, forming a closed-loop prediction circuit.
[0037] The historical estimated residual sequence is automatically maintained and updated internally by the system and is not an external input. After each prediction time step, the estimated residual for the current step is calculated based on the preliminary prediction result and the calibration prediction result, and this residual is appended to the historical estimated residual sequence for use by the residual estimator in subsequent time steps.
[0038] The calibration prediction results are divided into two paths: the first path is output as the final prediction value; the second path is fed back to the input of the embedding layer, and is spliced with the historical real map tiles or the previous calibration prediction map tiles to form new context features, which are used for prediction in the next time step, thus forming a complete closed-loop prediction circuit.
[0039] It is important to emphasize that the embedding layer, projection layer, and residual estimator are all modules independent of the large language model. The parameters of the large language model remain completely frozen throughout the entire training and prediction process. These four modules together constitute a holistic closed-loop prediction system. From an implementation perspective, the embedding layer, projection layer, and residual estimator each have their own trainable parameters, which can be saved and loaded independently, similar to a pre-adaptor and post-corrector customized for the large language model.
[0040] Example 1: This embodiment provides a closed-loop feedback time series forecasting method for unmanned aerial vehicles (UAVs), used to form closed-loop feedback during the autoregressive forecasting process to suppress the accumulation of prediction errors and trajectory drift of UAV state parameters. This method reformulates the traditional open-loop autoregressive generation process as a closed-loop control system, where a large linguistic model of frozen parameters acts as the controlled object, and the residual estimator acts as the closed-loop observer. The error compensation signal estimated by the observer is injected into the output of the controlled object through the feedback loop, thereby actively suppressing the propagation and amplification of errors at each prediction time step.
[0041] Figure 1 A flowchart illustrating an embodiment of the method is shown, such as... Figure 1 As shown, it includes the following steps: S100. The historical time series data of the drone's state is projected from the time series space to the feature space of the large language model with frozen parameters through the embedding layer to obtain the context features used to drive the reasoning of the controlled object.
[0042] It's important to clarify the temporal logic behind the context features. In the first time step, the context features only include feature representations of historical time-series data, meaning they are constructed solely from real observation data projected through the embedding layer. The historical time-series data of the UAV state may include, but is not limited to: UAV flight trajectory coordinate sequences, battery voltage sampling sequences, IMU attitude angle sequences, and power motor temperature sequences, depending on the prediction mission objective. However, in subsequent time steps, the context features, in addition to containing feature representations of historical data, also include the calibration prediction results from previous time steps as feedback correction information. This is the key temporal logic for closing the closed loop: the prediction output of each time step, after calibration, is injected back into the input state of the next time step, enabling the controlled object to perceive the deviation correction information of previous predictions during subsequent inference, rather than relying solely on historical real data or uncorrected original predictions.
[0043] The contextual features generated in step S100 serve as the input state of the controlled object (i.e., the large language model with frozen parameters). This state encodes historical observation information and calibration prediction results fed back from previous time steps, enabling the controlled object to perform inference under closed-loop conditions.
[0044] S200. Using the large language model with the frozen parameters as the controlled object, generate the uncalibrated prediction output of the current time step based on the context features, and map it back to the time series space through the projection layer to obtain the preliminary prediction result characterizing the open-loop response of the controlled object.
[0045] It's important to note that "frozen parameters" means that the pre-trained weights of the large language model remain unchanged throughout the prediction process, without any fine-tuning or updates. As a representative model in deep learning, the large language model itself does not directly output time-series values. Instead, based on the self-learning capability of the pre-trained model, it outputs a representation vector in a high-dimensional feature space. The embedding layer is responsible for mapping the original time-series data from the low-dimensional time-series space to a feature space that the large language model can understand. The projection layer is responsible for mapping the feature representation output by the large language model back to the time-series space, obtaining predicted values with actual physical meaning. Therefore, the embedding and projection layers constitute a two-way bridge between the time-series space and the feature space of the large language model, while the large language model ontology acts as a fixed-parameter inference engine, performing forward computation only based on the input contextual features.
[0046] In step S200, the large language model with frozen parameters generates an open-loop response, i.e., a preliminary prediction result, based on contextual features. This prediction result has not undergone any feedback correction and is generated entirely by the reasoning ability of the large language model itself. In the closed-loop architecture of this embodiment, the preliminary prediction result serves as an intermediate product and will subsequently be corrected by the compensation term output by the residual estimator.
[0047] S300: Using the residual estimator as a closed-loop observer, the potential error state of the current time step is inferred based on the estimated residual sequence stored in the historical time steps, and the trajectory deviation compensation term used to offset the accumulation of errors is estimated.
[0048] It's important to note that the input to the residual estimator is the estimated residual sequence, not the true residual sequence. During the inference phase, the future true time series values are unknown, therefore the true residual (i.e., the difference between the initial prediction and the actual value) cannot be calculated. The residual estimator can only infer the possible error state at the current time step based on the estimated residuals accumulated in historical time steps—that is, the deviations between the initial predictions and the calibrated predictions in previous time steps. The estimated residual sequence characterizes the dynamics of the accumulation and propagation of historical prediction errors; it records the generation, propagation, and accumulation of errors over time.
[0049] In this embodiment, the actual prediction error at the current time step is not directly observable (because the true value is unknown), but the estimated residuals of historical time steps are available. By performing time-series modeling on the historical estimated residual sequence, the residual estimator infers the potential error state at the current time step and predicts a trajectory deviation compensation term accordingly to offset the impending prediction error.
[0050] S400. The trajectory deviation compensation term is injected as a feedback correction signal into the preliminary prediction result to obtain a calibration prediction result that suppresses the accumulation of error at the current time step, and is fed back into the context features as the state input for the next time step, so that the controlled object can perform reasoning based on the context containing feedback correction information in the next time step, forming a closed-loop feedback prediction process.
[0051] It should be noted that the injection operation fuses the compensation term estimated in step S300 with the preliminary prediction result generated in step S200. The physical meaning of the compensation term is an estimate of the open-loop response deviation of the controlled object. If the residual estimator determines that the preliminary prediction result at the current time step may have a positive deviation, the compensation term is negative, and the injected value lowers the predicted value; otherwise, a positive value is injected to raise the predicted value. Through this additive correction mechanism, the calibrated prediction result has a smaller error accumulation effect compared to the preliminary prediction result.
[0052] The subsequent process of feeding back the calibration prediction results completes the physical closure of the feedback loop. The calibration prediction results are injected back into the context features, replacing or appending the original historical information, and becoming part of the input for the next time step. Thus, when the controlled object infers at the next time step, its context features already contain the feedback-corrected prediction information from the previous time step, rather than the uncorrected original prediction. This design allows errors to be observed and compensated at every time step, rather than allowing errors to accumulate continuously in the autoregressive loop as in an open-loop system.
[0053] The overall processing procedure is as follows: Step S100 generates contextual features; Step S200 generates a preliminary prediction result based on these features; Step S300 outputs a compensation term based on the historical estimated residual sequence; Step S400 adds the compensation term to the preliminary prediction result to obtain a calibrated prediction result, and feeds this calibrated prediction result back into the contextual features of Step S100 for inference in the next time step. This process is repeated to form a closed-loop feedback prediction process. It can be understood that steps S100 to S400 are executed sequentially, and the calibrated prediction result output in Step S400 is used as part of the contextual features of Step S100 in the next time step, thus achieving a closed-loop connection between the steps.
[0054] To more intuitively understand the closed-loop iterative process, a simplified mathematical notation example is given below.
[0055] Let the contextual features of time step t be C. t The large language model with frozen parameters is g θ The projection layer is f head The residual estimator is r ψ At time step t, the controlled object is based on contextual features C. t-1 Generate uncalibrated prediction output (i.e., in the following formula) Preliminary prediction results are obtained after mapping through the projection layer. The residual estimator is based on historical estimated residual sequences. Predicted trajectory deviation compensation item , This includes residual information obtained before the current time step. The calibration prediction result is... Subsequently, the prediction results were calibrated. The feedback is incorporated into the context features, forming the updated context features C. t This is used for inference at the next time step t+1. At the first time step t=1, the context feature C0 consists only of historical real data and does not contain any calibrated prediction results. Starting from t=2, C... t-1 It includes the calibration prediction results of the preceding time steps, and the closed loop is officially closed.
[0056] Through the closed-loop feedback prediction process comprised of the aforementioned multiple steps, this embodiment transforms the disadvantage of passively absorbing error accumulation in traditional open-loop autoregressive prediction into the advantage of actively observing and compensating for errors in a closed-loop control system. The large language model with frozen parameters retains its powerful temporal pattern recognition capability and cross-domain generalization potential, while the lightweight residual estimator, acting as a closed-loop observer, achieves active and stable control of the predicted trajectory with minimal additional computational overhead. Working together, without modifying the pre-trained weights of the large language model, it significantly suppresses error accumulation and trajectory drift problems in long-term prediction. This closed-loop prediction process can be directly used for state parameter prediction in UAV flight control, such as performing long-term, high-precision simulations of flight trajectories in the absence of real-time GPS signals.
[0057] Example 2: This embodiment, based on Embodiment 1, further elaborates on the construction process of context features in step S100. Specifically, this embodiment focuses on how to transform raw historical time series data into structured recursive input units suitable for closed-loop feedback prediction, involving three complementary technical aspects: tile segmentation, context window management, and time step position encoding.
[0058] First, regarding tile segmentation. In step S100, the historical time-series data of the UAV state is projected from the time-series space to the feature space of the large language model with frozen parameters through an embedding layer to obtain contextual features for driving the reasoning of the controlled object. This process specifically includes the following sub-steps: The historical time series data of the drone status is divided into a sequence of non-overlapping tiles according to a preset fixed length L, wherein each tile contains data segments of L consecutive time points; if there are less than L time points at the end, zero-value padding is used to complete the tile. The embedding layer projects each tile from the time series space to the large language model feature space of the frozen parameters to obtain tile feature vectors, and then concatenates the tile feature vectors in time order to obtain the context features.
[0059] It is important to understand the supporting relationship between tile segmentation and the closed-loop feedback mechanism. In the closed-loop feedback prediction process described in Example 1, the calibration prediction result generated at each time step needs to be fed back into the context features of the next time step to close the loop. If feedback is performed on a per-time-point basis, the length of the context features will increase linearly with the number of prediction steps, and the semantic information carried by the prediction value at a single time point is limited, which is not conducive to effective contextual reasoning in large language models. However, by using tiles as the basic unit, the calibration prediction result is fed back into the context features on a tile-by-tile basis, providing a structured recursive input unit for the closed-loop feedback prediction process. This means that each tile participates in the construction and updating of context features as a whole, ensuring that the amount of information in each feedback is sufficiently rich, while reducing the growth rate of the context feature length by a factor of L.
[0060] The selection of the tile length L needs to be determined based on the data sampling period and forecasting requirements in the actual application scenario. Taking the power load forecasting scenario as an example, if the data sampling period is 1 hour, then L can be 8, meaning each tile covers an 8-hour time span, which roughly corresponds to a work shift or a complete electricity consumption period. If the data sampling period is 15 minutes, then L can be 16 or 32 to cover a similar physical time span. In the meteorological data forecasting scenario, if the sampling period is 6 hours, L can be 4, allowing each tile to cover a one-day time span. This embodiment does not impose specific limitations on this; the value of L can be flexibly adjusted according to the periodicity of the data and the forecasting step size. For cases where there are fewer than L time points at the end, zero-value padding is used to ensure that all tiles have a uniform dimension, facilitating batch projection processing by the embedding layer.
[0061] Secondly, regarding context window management, the context features, before being input into the large language model of the frozen parameters, also include a context window management step: When the number of tiles contained in the context features exceeds the preset maximum window length K, only the feature vectors of the K most recent tiles in time are retained, and the feature vectors of earlier tiles are discarded, so as to limit the computational overhead while maintaining the ability to maintain long-term dependencies.
[0062] It's important to note that context window management has clear technical significance. In closed-loop feedback prediction, as the prediction time step progresses, the number of tiles accumulated in the context features continuously increases. This includes both the initial historical true tiles and the calibration prediction tiles generated and fed back from subsequent time steps. Without constraints, the length of the context features will grow indefinitely, leading to a continuous increase in the inference latency of the controlled object (the large language model with frozen parameters) and a sustained increase in computational resource consumption. Context window management, by setting a maximum window length K, constrains the length of the context features within a controllable range. This maintains the ability to handle long-term dependencies while limiting computational overhead, preventing the infinite growth of the context from increasing the inference latency of the controlled object. This design can be understood as retaining only the recent state information most relevant to the current dynamics, discarding long-term historical influences that have decayed to negligible levels.
[0063] The maximum window length K also needs to be determined based on the specific application scenario. In the power load forecasting scenario, if L=8 (each tile covers 8 hours), K can be set to 16, meaning that the context features can retain a maximum of 16 tiles, covering 128 hours (approximately 5 days) of historical information, which is sufficient to capture the weekly cycle pattern of power load. In the traffic flow forecasting scenario, if the data sampling period is 5 minutes and L=12 (each tile covers 1 hour), K can be set to 24, covering 24 hours of historical information, which is sufficient to capture the daily cycle pattern. The larger the value of K, the richer the historical information the model can refer to, but the greater the computational cost; the smaller the value of K, the higher the computational efficiency, but the longer-term dependent information may be lost. In practical applications, a trade-off adjustment can be made based on hardware resources and prediction accuracy requirements.
[0064] Secondly, regarding the time step position encoding, the embedding layer further incorporates time step position encoding into the projection result when projecting each tile, so that the context features retain the temporal order information between different tiles.
[0065] It's important to note that the necessity of positional encoding stems from the inherent characteristics of large language models with frozen parameters. Large language models are based on a self-attention mechanism, whose core operation is the weighted aggregation of feature vectors at each position in the input sequence. The attention weights are calculated through the inner product of these feature vectors. This means that without positional encoding, large language models cannot distinguish between two content-similar patches that differ in temporal location. For example, a load patch at 8 AM on Monday and a load patch at 8 AM on Tuesday might be very close in the feature space, but their positions and contextual meanings in the time series are different. Large language models with frozen parameters are not aware of patch order; positional encoding enables them to distinguish patches at different time steps.
[0066] There are several ways to implement positional encoding. One implementation uses sine-cosine positional encoding, which calculates a set of sine and cosine function values for each tile's time step index and adds these values as a positional encoding vector to the tile's feature vector. The advantage of this approach is that it requires no additional training parameters and can naturally generalize to sequence lengths not seen during training. Another implementation uses learnable positional encoding, which assigns a trainable encoding vector to each possible time step position and optimizes it along with other parameters during training. Regardless of the specific implementation, the core function of positional encoding is to provide temporal order information between tiles for a large language model with frozen parameters, enabling it to distinguish tiles at different time steps and capture temporal dependency patterns in time series data.
[0067] In summary, the three technical aspects of tile segmentation, context window management, and time step position encoding work together to construct a structured recursive input unit for the closed-loop feedback prediction process. Tile segmentation determines the basic granularity of the input, enabling the calibration prediction results to be reinjected into the context features on a tile-by-tile basis; context window management controls the upper limit of the length of context features, ensuring the controllability of inference efficiency; and time step position encoding endows the large language model with frozen parameters with the ability to perceive temporal order, enabling it to effectively utilize temporal information in the context for inference. These three aspects work together to provide a stable and efficient input foundation for the closed-loop feedback prediction process described in Example 1, rather than a simple data preprocessing operation.
[0068] Example 3: This embodiment, based on Embodiment 1, further focuses on the injection method of the feedback correction signal in step S400. In the closed-loop feedback prediction process described in Embodiment 1, after the trajectory deviation compensation term is estimated by the residual estimator in step S300, this compensation term needs to be fused with the preliminary prediction result generated in step S200 to obtain the calibration prediction result. This embodiment elaborates on the specific implementation method and technical considerations of this fusion operation.
[0069] In step S400, the trajectory deviation compensation term is injected as a feedback correction signal into the preliminary prediction result using a linear addition method, that is, the calibrated prediction result = the preliminary prediction result + the trajectory deviation compensation term, in order to avoid introducing additional fusion parameters that could lead to training instability or overfitting.
[0070] Understandably, in mathematical notation, let the preliminary prediction result at time step t be... The trajectory deviation compensation term output by the residual estimator is Then the calibration prediction result This operation is performed once at each prediction time step. The computation is simple and does not involve any learnable parameters or complex nonlinear transformations.
[0071] It's important to understand why this embodiment chooses linear addition as the feedback injection method, rather than other fusion strategies commonly used in neural networks. The following comparative analysis of three candidate schemes illustrates the technical rationale and advantages of linear addition: The first candidate approach is gated fusion. The core idea of gated fusion is to learn a fusion weight or gating coefficient, for example, through a small neural network or a learnable scalar parameter α, to proportionally mix the initial prediction and the compensation term. t =α· t +(1-α)·Δp t or more complex forms t =σ(g)· t +(1-σ(g))·Δp t Here, σ is the sigmoid function, and g is a learnable gating parameter. This scheme appears flexible, capable of adaptively determining the contribution of the compensation term based on context, but it suffers from serious drawbacks in the closed-loop autoregressive scenario of this invention. Specifically, the additional learnable parameters (such as α or g) introduced by gating fusion create a coupling effect with the parameters of the residual estimator. During training, the residual estimator needs to learn how to predict the trajectory deviation compensation term, while the gating parameter simultaneously learns how to adjust the contribution ratio of the compensation term; their optimization objectives are interdependent and mutually influential. When the output of the residual estimator changes, the optimal value of the gating parameter also changes, and vice versa. This coupling leads to a highly non-stationary optimization landscape during training, with gradient signals oscillating between the two modules, making training difficult to converge or converge to a suboptimal solution. Especially in the closed-loop autoregressive scenario, the fusion result of the current time step affects the input state of the next time step, and errors propagate through feedback loops. Small fluctuations in the gating parameter may be amplified step by step, further exacerbating the instability of training.
[0072] The second candidate approach is attention fusion. Attention fusion calculates the attention weights between the initial prediction and the compensation term, and then fuses them in a weighted aggregation manner. For example, it can... t and Δp tThe query and key-value pairs are used as the attention mechanism, respectively, and the fusion weights are calculated through scaled dot product attention. This approach is more expressive and can capture more complex interactions between the two. However, attention fusion has two main problems. First, the attention mechanism has a large computational cost, involving matrix multiplication and softmax normalization operations. In the architecture of this invention, the large language model itself already contains multiple layers of self-attention mechanisms. Introducing additional attention operations in the feedback injection stage will significantly increase the computational latency of each prediction time step. Considering that time series prediction tasks often have high real-time requirements (such as power load prediction requiring minute or even second-level response), this additional computational cost is detrimental. Second, and more importantly, the parameters of the large language model are frozen throughout the prediction process, and its feature space is fixed. The additional attention mechanism introduces new learnable parameters and new feature transformations, which may disrupt the consistency of the large language model's feature space. That is, there may be a semantic gap between the feature space mapped to by the projection layer and the feature space operated on by the attention fusion layer, leading to a deterioration in the fusion effect.
[0073] The third candidate scheme is linear addition, which is adopted in this embodiment. Linear addition is a parameter-free hard fusion method that directly injects the trajectory deviation compensation term as an additive correction signal into the preliminary prediction result. This method has the following significant advantages. First, linear addition does not introduce any additional learnable parameters, completely avoiding the training non-stationarity problem caused by parameter coupling in gated fusion. The training objective of the residual estimator becomes pure and clear; it only needs to learn how to accurately predict the trajectory deviation compensation term, without needing to adapt to a dynamically changing fusion weight at the same time. Second, the computational overhead of linear addition is extremely low, involving only one vector addition operation, which does not have a perceptible impact on inference latency, ensuring the efficiency of the closed-loop feedback prediction process. Third, and most importantly, linear addition has a very clear physical meaning. In the closed-loop control architecture of this invention, the residual estimator acts as a closed-loop observer, and its output trajectory deviation compensation term is essentially an estimate of the open-loop response deviation of the controlled object, that is, an estimate of the expected deviation between the preliminary prediction result and the true value. If the residual estimator determines that the preliminary prediction at the current time step may have a positive bias (predicted value too high), the compensation term is negative, and its summation lowers the predicted value to offset the bias. Conversely, if it determines that a negative bias (predicted value too low) may exist, the compensation term is positive, and its summation raises the predicted value. The compensation term is an estimate of the open-loop response bias; its summation cancels it out. The physical meaning of this operation directly corresponds to the negative feedback compensation principle in control theory, without any semantic ambiguity or vagueness.
[0074] To illustrate the effect of linear addition more intuitively, a simplified numerical example is given below. Assume that in a time series prediction task, the true value at time step t should be 100.0. The preliminary prediction result generated by the controlled object (the output of a large language model with frozen parameters after a projection layer) is... t The value is 103.5, indicating a positive bias of +3.5. The residual estimator, after inferring the potential error state at the current time step based on the historical estimated residual sequence, predicts the trajectory deviation compensation term Δp. t The result is -3.2. The prediction is calibrated by linear addition. t =103.5 + (-3.2) = 100.3. It can be seen that the deviation between the calibrated predicted value 100.3 and the true value 100.0 is only 0.3, a significant reduction compared to the initial prediction deviation of 3.5. Although the compensation term -3.2 estimated by the residual estimator is not perfectly accurate (there is a 0.3 difference from the ideal compensation value -3.5), it has already offset most of the error. In subsequent time steps, the residual estimator will continue to adjust the estimated value of the compensation term based on the new estimated residual sequence, so that the error is continuously suppressed in the closed-loop circuit.
[0075] It should be noted that although this embodiment describes linear addition as the preferred solution in detail, this does not mean that other fusion methods are completely infeasible within the framework of this invention. In some scenarios where real-time requirements are not high and training data is abundant, gated fusion or attention fusion can also be considered as alternative solutions, but additional attention needs to be paid to training stability and computational overhead. This embodiment chooses linear addition as the feedback injection method as the optimal choice after comprehensively considering training stability, inference efficiency, physical interpretability, and actual prediction accuracy.
[0076] By employing a linearly additive feedback injection method, this embodiment achieves error compensation while avoiding the introduction of additional learnable parameters, thereby reducing training complexity and improving the stability and generalization ability of the closed-loop feedback prediction process. This design works in conjunction with the two-stage decoupled training strategy described in Embodiment 5: linear addition ensures that the feedback injection stage itself does not introduce new training degrees of freedom, allowing the second-stage training of the residual estimator to focus on learning the systematic deviation dynamics of the controlled object without being disturbed by the fusion parameters, thus forming a complete and self-consistent closed-loop feedback prediction technology solution.
[0077] Example 4: This embodiment, based on Embodiment 1, further focuses on the internal structure of the residual estimator in step S300. In the closed-loop feedback prediction process described in Embodiment 1, the residual estimator, as the closed-loop observer, undertakes the crucial function of inferring the potential error state of the current time step based on the historical estimated residual sequence and predicting the trajectory deviation compensation term. This embodiment elaborates on the internal composition of the residual estimator, the specific implementation methods of each component, and their design considerations.
[0078] The residual estimator includes a recursive feature extraction structure and an output mapping layer; The recursive feature extraction structure is used to perform time-series modeling on the estimated residual sequence stored in the historical time step, extract the propagation and accumulation features of error in the time dimension, and obtain the error feature representation.
[0079] It's important to clarify the meaning of the estimated residual sequence. During the inference phase, each time step generates an estimated residual, which is the deviation between the initial prediction and the calibration prediction at that time step. As the prediction process progresses, these estimated residuals accumulate in chronological order to form a sequence, denoted as ΔP. <t =[Δp1,Δp2,...,Δp t-1 ], where Δp i = i - i This sequence records the history of the deviation between the open-loop response and the final calibration output of the controlled object at each time step from the first prediction time step to the current time step. It is essentially an observable representation of the dynamics of error propagation and accumulation over time. Although the actual error is unknown, the estimated residual sequence reflects the closed-loop observer's judgment of the error state at each historical time step, and there is a temporal causal relationship between these judgments.
[0080] The core task of the recursive feature extraction structure is to extract meaningful temporal patterns from the estimated residual sequence. Error accumulation is not an isolated event but a dynamic process; that is, the magnitude and direction of the error at the current time step are closely related to the error propagation paths of previous time steps. For example, if the estimated residuals of the previous few time steps show a continuously increasing positive trend, it indicates that the controlled object may be systematically overestimating the predicted value, and this trend is likely to continue to the current time step. The recursive feature extraction structure explicitly models this temporal dependency, transforming the estimated residual sequence into a compact error feature representation vector. This vector encodes the dynamic laws of error propagation, providing an informational basis for subsequent trajectory deviation compensation terms.
[0081] The recursive feature extraction structure is implemented using a recurrent neural network or a temporal convolutional network. The specific structures and technical characteristics of these two implementation options are described below.
[0082] The first implementation option is a recurrent neural network, specifically a Long Short-Term Memory (LSTM) network or a Gated Recurrent Unit (GRU). Taking LSTM as an example, its core idea is to control the flow and retention of information over time through gating mechanisms, including forget gates, input gates, and output gates. When processing the estimated residual sequence, LSTM reads Δp1, Δp2, ..., Δp step by step. t-1 At each time step, the network updates its internal hidden state and cell state. The hidden state can be understood as a compressed memory of the error propagation history up to the current time step, while the cell state provides a long-distance transmission channel for this memory. After processing the entire estimated residual sequence, the hidden state of the last time step (or some aggregation of the hidden states of all time steps) is output as the error feature representation. A significant advantage of LSTM and GRU is their ability to capture long-sequence dependencies; even if an error pattern appeared dozens of time steps ago, its impact can still be passed to the representation at the current time step through the cell state. This is particularly important for time series forecasting tasks, as some periodic error patterns (such as daily periodic deviations in power load forecasting) may require a long time span to be fully captured.
[0083] The second implementation option is the Temporal Convolutional Network (TCN). TCNs use one-dimensional convolution operations that slide along the time dimension, expanding the receptive field layer by layer by stacking multiple convolutional layers. Unlike ordinary convolution, TCNs typically use dilated convolutions, inserting holes between elements of the convolution kernel, allowing the receptive field to grow exponentially without increasing the kernel size or the number of parameters. For example, a TCN with three dilated convolution layers, with dilation rates of 1, 2, and 4 respectively, and a kernel size of 3, can cover the receptive field of the top neuron for 16 time steps of input. Furthermore, TCNs often introduce residual connections to facilitate the training of deep networks. Compared to recurrent neural networks (RNNs), a significant advantage of TCNs is their higher parallel computation efficiency. Since the convolution operations do not depend on the computation results of the previous time step, the entire sequence can be processed simultaneously in parallel, unlike the sequential computation required by RNNs. TCNs may be a more suitable choice for scenarios requiring the processing of long estimation residual sequences or where inference latency is strictly controlled.
[0084] It's important to explain why a recursive structure is chosen for the residual estimator instead of a standard feedforward network. Standard feedforward networks (such as multilayer perceptrons) typically flatten the entire sequence into a single long vector as input when processing sequential data, then transform it through fully connected layers. This approach has two fundamental drawbacks. First, feedforward networks cannot explicitly model temporal dependencies. They treat elements at different time steps in the sequence as independent feature dimensions, implicitly learning the relationships between them through fully connected weights. This implicit learning often struggles with complex error propagation dynamics because error accumulation is a temporal dynamic process. The current error state depends on the propagation path of historical errors, and this propagation path has a clear temporal direction and causal structure, which feedforward networks struggle to capture effectively. Second, feedforward networks require a fixed input dimension. If the length of the estimated residual sequence changes (e.g., context window management leads to a different number of historical time steps being retained), the input dimension of the feedforward network needs to be adjusted accordingly, which can cause inconvenience in practical deployments. Recursive structures are naturally suited for handling variable-length sequence inputs, and their inherent temporal modeling mechanism can explicitly capture the dynamic laws of error propagation. Therefore, they are a reasonable choice for recursive feature extraction structures in residual estimators.
[0085] The second core component of the residual estimator is the output mapping layer. This fully connected layer maps the error feature representation to the trajectory deviation compensation term.
[0086] Understandably, the error feature representation is a high-dimensional vector output by the recursive feature extraction structure, encoding the dynamic information of historical error propagation. However, this vector is not directly equal to the trajectory deviation compensation term required for the current time step. The role of the output mapping layer is to complete the mapping transformation from the error feature representation space to the compensation term space.
[0087] The design consideration for using a fully connected layer in the output mapping layer is that the mapping from the error feature representation to the compensation term is a static transformation, requiring no additional temporal modeling capabilities. The recursive feature extraction structure has already completed the temporal dynamic modeling, and the output error feature representation already contains inference information about the error state at the current time step. The mapping from this representation vector to the specific compensation term value is essentially a regression problem, i.e., given a feature vector, output a corresponding compensation value (or vector). The fully connected layer can complete this mapping in a parameter-efficient manner through a set of learnable weight matrices and bias vectors. Introducing an additional temporal modeling structure here (such as adding another RNN layer) would not only increase unnecessary parameters and computational overhead but could also lead to overfitting. This is because the error feature representation is already a result of temporal modeling; performing temporal processing on it again is equivalent to redundantly transforming the already extracted temporal features, which may introduce noise instead.
[0088] To illustrate the input-output dimensions of the residual estimator more concretely, an example is given below. Assume that each patch in the time series forecasting task contains L=8 time points, and each time point has D=1 observed variables (e.g., predicting only electricity load). Then each patch can be represented as an 8-dimensional vector. Preliminary forecast results. t and calibration prediction results t Both are 8-dimensional vectors, estimating the residual Δp t It is also an 8-dimensional vector. Assuming the context window management retains historical information from the most recent K=16 tiles, the estimated residual sequence ΔP is... <t It contains a maximum of 15 8-dimensional vectors (all estimated residuals up to the current time step). The recursive feature extraction structure takes this variable-length sequence as input and outputs a fixed-dimensional error feature representation vector, for example, with dimensions of 64 or 128. The output mapping layer (fully connected layer) takes this 64-dimensional or 128-dimensional error feature representation vector and outputs an 8-dimensional trajectory deviation compensation term Δp. t Its dimensions and preliminary prediction results t They must be completely identical to ensure subsequent linear addition. It should be noted that the dimensional values mentioned above are merely examples; in practical applications, the dimensionality of the error feature representation can be flexibly adjusted based on the dimensions of the time series data, the tile length L, and the complexity of the task.
[0089] In summary, the residual estimator achieves an end-to-end mapping from historical estimated residual sequences to the current trajectory deviation compensation term through the collaborative work of the recursive feature extraction structure and the output mapping layer. The recursive feature extraction structure is responsible for temporal dynamic modeling, capturing the patterns of error propagation and accumulation; the output mapping layer is responsible for spatial mapping, transforming the results of temporal modeling into specific compensation values. These two components have clear divisions of labor and perform their respective functions, together forming the underlying implementation of the closed-loop observer. This structural design ensures both the accuracy of error state inference and the maintenance of model parameter and computational efficiency, providing a solid foundation for the stable operation of the entire closed-loop feedback prediction process.
[0090] Example 5: This embodiment provides a training method for a UAV time series prediction model, used to train the embedding layer, projection layer, and residual estimator used in the closed-loop feedback prediction method described in the preceding embodiments. Embodiments 1 to 4 detail the workflow of the inference prediction stage: a large language model with frozen parameters generates preliminary prediction results as the controlled object; the residual estimator, as a closed-loop observer, predicts trajectory deviation compensation terms; and calibration prediction results are obtained through linear addition injection to close the feedback loop. However, the parameters of these modules do not come from nothing; they require a carefully designed training process. This embodiment focuses on this training process, reconstructing it from a conventional end-to-end joint training into a two-stage decoupled training strategy. Simply put, it first stabilizes the controlled object, and then learns dynamic error compensation based on the stabilized controlled object.
[0091] Before delving into the specific steps of the training method, it's necessary to explain why a two-stage decoupled training approach is needed, rather than performing end-to-end joint optimization of all modules—the embedding layer, projection layer, and residual estimator. The answer lies in the fundamental characteristics of closed-loop control systems. With joint optimization, the parameters of the controlled object (composed of the embedding layer, a large language model with frozen parameters, and the projection layer) and the residual estimator (closed-loop observer) are updated synchronously within the same training loop. Each time the controlled object's parameters are updated, the distribution of its initial prediction changes. This means the error pattern between the initial prediction and the true value—the target the residual estimator needs to learn and predict—is also changing synchronously. Just as the residual estimator adapts to the error distribution after the previous parameter update, the next parameter update pushes the error distribution into a new form. This phenomenon is known in optimization theory as the non-stationary problem of target movement: the residual estimator's optimization objective is itself a moving target, chasing a constantly changing objective. The direct consequence is that the gradient signal oscillates between the two modules during training, the loss function is difficult to converge, and training divergence may even occur. Especially in closed-loop autoregressive scenarios, the prediction error at the current time step will affect the input state at the next time step through the feedback loop, and the impact of parameter updates will be amplified step by step, further exacerbating the instability of training.
[0092] The two-stage decoupled training strategy is designed to address this fundamental problem. Its core idea is to split the training process into two sequential, non-interfering stages: the first stage focuses on stabilizing the controlled object, ensuring that its initial predictions have predictable and stable error characteristics; the second stage, based on the frozen controlled object, allows the residual estimator (a lightweight machine learning module) to focus on learning how to compensate for these stable errors. The entire training process can be completed on the training set, and performance is evaluated using the validation set to ensure generalization ability. Since the parameters of the controlled object no longer change in the second stage, the error distribution is also fixed, and the residual estimator faces a static target, allowing training to converge smoothly and efficiently.
[0093] The specific steps of the two-stage training method are described in detail below. Figure 3 A flowchart illustrating an embodiment of the method is shown, such as... Figure 3 As shown, it includes the following steps: The method includes: a first stage A100 and a second stage A200.
[0094] The first stage A100 includes: All parameters of the residual estimator are frozen, and a teacher-forced strategy is adopted. The context features corresponding to the historical real map tiles are used as the input of the controlled object. The embedding layer and the projection layer are trained together, and local Lipschitz constraint regularization is applied to the projection layer to control the ratio of the output change amplitude of the projection layer to the input change amplitude, thereby ensuring the stability of the closed-loop feedback prediction process.
[0095] It's important to note that the first step is to freeze all parameters of the residual estimator. In this first phase, the residual estimator is not involved in training at all; its parameters remain in their initial state, and it does not generate any gradient signals. This is done to completely isolate the residual estimator from the training dynamics, ensuring that the training process of the embedding and projection layers is not disturbed by the random outputs of the residual estimator before it has converged.
[0096] Secondly, there is the teacher-enforcement strategy. Teacher-enforcement is a commonly used technique in sequence generation model training. Its core principle is that at each training time step, the model receives input entirely from real, known historical data, rather than predictions generated by the model itself in the previous time step. Specifically, in this embodiment, when training the embedding and projection layers, the tiles corresponding to each time step in the context features are real historical tiles, not preliminary or calibration predictions generated by the model itself. This differs significantly from the behavior in the inference phase, where, starting from the second time step, the context features include calibration predictions from previous time steps. The reason for using this inconsistent strategy in the first stage of training is that the parameters of the embedding and projection layers are randomly initialized in the early stages of training, resulting in poor-quality predictions. If the model were to use its own predictions as subsequent inputs at this point, these poor-quality predictions would inject errors into the context features, causing the input state in subsequent time steps to deviate significantly from the real data distribution. Errors would propagate and amplify rapidly over time, the training signal would be overwhelmed by noise, and the model would struggle to learn effective feature alignment. The teacher-enforcement strategy, by consistently providing real historical tiles as input, cuts off the propagation path of errors over time, ensuring that training at each time step is conducted under clean and accurate input conditions, thereby stabilizing the feature alignment process. In short, the teacher-enforcement strategy stabilizes feature alignment and prevents error propagation caused by inaccurate model predictions in the early stages of training.
[0097] Next is local Lipschitz constraint regularization. The role of the projection layer is to map the high-dimensional feature representation output by the large language model back to the time series space to obtain preliminary prediction results. If the projection layer is too sensitive to changes in the input, that is, small perturbations in the input feature representation can cause large fluctuations in the output prediction value, then in the closed-loop feedback prediction process, any small prediction error at any time step may be amplified by the projection layer and then propagated to the next time step through the feedback loop, forming a positive feedback amplification effect of the error, ultimately causing the prediction trajectory to diverge. The purpose of local Lipschitz constraint regularization is to limit the sensitivity of the projection layer, so that the ratio of its output change amplitude to its input change amplitude does not exceed a preset upper limit, thereby mathematically ensuring that the projection layer is a smooth mapping that does not amplify perturbations. The specific implementation of local Lipschitz constraint regularization, which may include noise perturbation, ratio calculation, and the construction of the regularization loss term, will be discussed in detail in the subsequent embodiment 6.
[0098] The overall goal of the first stage of training is to obtain a stable controlled object. The embedding layer learns how to map time-series patches to a feature space that the large language model can effectively understand, and the projection layer learns how to smoothly map the output of the large language model back to the time-series space while satisfying the local Lipschitz condition to ensure the stability of the closed-loop system. After the first stage of training, the parameters of the embedding and projection layers are fixed, and the input-output characteristics of the controlled object are also determined.
[0099] The second phase A200 includes: The parameters of the embedding layer and projection layer after the first stage of training are frozen, and the autoregressive rolling mode is switched. The difference between the historical real map tiles and the preliminary prediction results output by the controlled object through the projection layer in the current time step is used as a supervision signal to train the residual estimator, so that it learns how to accurately predict the current trajectory deviation compensation term based on the estimated residual sequence stored in the historical time step.
[0100] It's important to note that the core change in the second phase lies in the switching of the training mode, specifically from a teacher-mandated strategy to an autoregressive rolling mode. The autoregressive rolling mode means that the model gradually uses its own generated predictions as input for subsequent time steps during training, rather than always relying on historical real tiles. Specifically, at each time step in the second phase of training, the controlled object (embedding layer + large language model with frozen parameters + projection layer) generates an initial prediction based on the current context features. The residual estimator outputs a trajectory bias compensation term based on the historical estimated residual sequence. The two are linearly added to obtain a calibrated prediction result, which is then injected back into the context features for inference in the next time step. This process is completely consistent with the closed-loop feedback prediction process in the inference stage described in Example 1.
[0101] The reason for switching to autoregressive rolling mode in the second stage is that the residual estimator ultimately operates in the inference stage, which is precisely the autoregressive rolling mode—meaning the model uses its own generated calibration predictions as subsequent inputs. If the second stage still uses a teacher-forced strategy for training, the residual estimator will learn an error compensation strategy under ideal input conditions, which has a distributional bias compared to the actual situation in the inference stage. After switching to autoregressive rolling mode, the residual estimator faces the exact same closed-loop conditions during training as in the inference stage; that is, the context features contain the calibration predictions generated by the model itself, rather than the true tiles, and the estimated residual sequence is also accumulated from the model's own prediction bias. The residual estimator trained in this way can directly adapt to the real working environment of the inference stage, avoiding the distributional mismatch problem between training and inference.
[0102] The supervision signal for the second stage of training is the difference between the historical true map tiles and the preliminary prediction results; this difference is called the true residual. Since the parameters of the embedding and projection layers are frozen in the second stage, the controlled object always produces the same preliminary prediction results for a given input. Therefore, the true residual is a deterministic and repeatable signal. The training objective of the residual estimator is to minimize the difference between its output trajectory deviation compensation term and the true residual. The specific training loss function of the residual estimator will be detailed in Example 7.
[0103] Through the aforementioned two-stage decoupled training strategy, this embodiment effectively separates the learning of controlled object stabilization from the learning of dynamic error compensation. The first stage stabilizes the input-output characteristics of the controlled object; the second stage, based on the stabilized controlled object, allows the residual estimator to focus on learning error compensation. This training paradigm of stabilization before compensation fundamentally avoids the training non-stationarity problem caused by target movement in joint optimization, ensuring the convergence of the closed-loop feedback prediction system during the training phase and the prediction accuracy during the inference phase.
[0104] Example 6: This embodiment, building upon Embodiment 5, further elaborates on the specific implementation of applying local Lipshitz constraint regularization to the projection layer during the first-stage training, as well as the details of constructing the total loss function for the first stage. Embodiment 5 has already described the overall framework of the first-stage training, namely, freezing all parameters of the residual estimator, employing a teacher-forced strategy, jointly training the embedding layer and the projection layer, and applying local Lipshitz constraint regularization to the projection layer. This embodiment will delve into the internal workings of this regularization mechanism, elaborating on it from three levels: mathematical formulas, implementation principles, and parameter configuration.
[0105] First, regarding the specific implementation of noise perturbation regularization: During training, a Gaussian noise vector with the same dimension as the latent layer output is added to the latent layer output of the projection layer.
[0106] It's important to clarify the meaning of latent layer output here. A projection layer typically consists of one or more fully connected networks. Its input is a high-dimensional feature representation of the large language model, and its output is a preliminary prediction mapped back to the time series space. The latent layer output refers to the activation value of an intermediate layer within the projection layer. In a typical implementation, the projection layer can be a two-layer fully connected network. The first layer maps the large language model feature representation to an intermediate-dimensional latent space, and the second layer maps the latent representation back to the final time series output space. The latent layer output is the activation vector of this intermediate layer. Adding noise at the latent layer output, rather than at the final output of the projection layer, is chosen because the latent layer is inside the projection layer. Applying perturbation to it more effectively probes the sensitivity characteristics of the projection layer throughout the entire mapping path, rather than just the local response at the final output.
[0107] The Gaussian noise vector δ has the same dimension as the latent layer output, and each element is independently sampled from a Gaussian distribution with zero mean and σ² variance. When adding the Gaussian noise vector to the latent layer output of the projection layer, the Gaussian noise vector is sampled independently and uses the same intensity range between different training samples and between different time steps of the same training sample.
[0108] It's important to note that emphasizing independent sampling and the same intensity range is to ensure the consistency and unbiasedness of the constraints. If different training samples use noise with different intensity ranges, the magnitude of the regularization loss term will depend not only on the sensitivity characteristics of the projection layer itself but also on the differences in noise intensity. This causes the optimized signal to be contaminated by artificial differences in noise intensity, failing to accurately reflect the true Lipshitz characteristics of the projection layer. Independent sampling ensures that each perturbation is a random probe of the local sensitivity of the projection layer, and the average effect of multiple samples can approximately estimate the upper bound of the projection layer's sensitivity in various directions of the input space.
[0109] After adding noise, the difference norm between the projection layer output vectors before and after adding noise is calculated, and the ratio of the difference norm to the norm of the Gaussian noise vector is calculated.
[0110] Understandably, in mathematical notation, let the projection layer be f. head If the latent layer output is h and the Gaussian noise vector is δ, then the output of the projection layer before adding noise is f. head (h), the output of the projection layer after adding noise is f head (h+δ). The difference norm between the two is denoted as This refers to the L2 norm (Euclidean distance) of the difference between the two output vectors. The norm of the noise vector is denoted as... The ratio of the two This measures the local gain of the projection layer in the noise direction, which is the factor by which a small input perturbation is amplified or reduced at the output. If this ratio is large, it means that the projection layer is very sensitive to input perturbations, and small input changes will cause large fluctuations in the output; if this ratio is close to zero, it means that the projection layer is not sensitive to input perturbations, and the output remains stable.
[0111] Next, the ratio is subtracted from a preset upper limit κ of the Lipschitz constant. If the difference is positive, the square of the difference is taken as the regularization loss term; if the difference is zero or negative, the regularization loss term is zero. Mathematically, the regularization loss term L... lip The definition of is: ; in, This represents the expectation (i.e., averaging) of all latent layer outputs h and all randomly sampled noise vectors δ in the training batch; κ is a preset upper bound for the Lipschitz constant; (·) + This represents the positive part function. The positive part function takes the maximum value between the value within the parentheses and zero, i.e., max(0,·). In practice, this can be directly implemented using the ReLU activation function; the value within the parentheses is input into the ReLU function, and the output is the positive part value. The positive part function penalizes only cases where the local gain exceeds κ, while imposing no penalty on cases where the local gain is less than or equal to κ. This design reflects the precise intent of regularization: it does not require the local gain of the projection layer to be as small as possible (excessively small gain may cause the projection layer to lose its expressive power), but rather requires it not to exceed a preset safety upper limit κ. As long as this upper limit is met, the projection layer is considered sufficiently smooth and stable.
[0112] It should be noted that the reason for using noise perturbation to apply Lipschitz constraints, instead of directly calculating the spectral norm of the Jacobian matrix of the projection layer, is that, mathematically speaking, the local Lipschitz constant of a function f at point x is equal to its Jacobian matrix. f / The spectral norm (i.e., the maximum singular value) of x at that point. Therefore, the most direct constraint method is to calculate the Jacobian matrix of the projection layer for each input during training, find its spectral norm, and penalize the portion exceeding κ. However, in high-dimensional scenarios, this direct calculation method is extremely costly. The latent output dimension of the projection layer may reach hundreds or even thousands of dimensions, and the output dimension is correspondingly large. Calculating such a high-dimensional Jacobian matrix and performing singular value decomposition has a computational complexity of O(n^2). 3At the level of 0.5 (where n is the dimension), performing this operation on every training sample in every training step would make the training time unacceptable. The noise perturbation method, on the other hand, is a stochastic approximation that approximates the local sensitivity of the projection layer by estimating its local gain in randomly sampled noise directions. Although a single random sample can only probe the gain in one direction, over a large number of training iterations, the noise directions cover all directions of the entire input space, which can effectively constrain the sensitivity of the projection layer in all directions in a desired sense. This stochastic approximation method reduces the computational complexity from O(n^2) to O(n^2). 3 The cost is reduced to O(n), making Lipschitz constraint regularization feasible in actual training.
[0113] The regularization loss term is used to constrain the sensitivity of the projection layer, preventing errors from being amplified in the closed loop. The implications of this technique have been explained in Example 5. If the projection layer is too sensitive to input changes, even a small prediction error at any time step in the closed-loop feedback loop can be amplified through the projection layer and propagated to the next time step via the feedback loop, creating a positive feedback amplification effect that ultimately leads to prediction trajectory divergence. By constraining the local Lipschitz constant of the projection layer to below κ, it is mathematically guaranteed that the projection layer is a smooth mapping that does not amplify disturbances, thus cutting off the path of error amplification in the closed loop and providing a theoretical guarantee for the stability of the entire closed-loop feedback prediction process.
[0114] Secondly, regarding the construction of the total loss function in the first stage, the steps for jointly training the embedding layer and the projection layer include: Construct the total loss function for the first stage; the total loss function is composed of the regularization loss term and the time series reconstruction loss term constructed from the error between the initial prediction results based on historical real tiles and the projection layer output; The embedding layer and the projection layer are jointly trained by minimizing the total loss function.
[0115] Understandably, mathematically, the total loss function L1 for the first stage is defined as: ; Where N is the number of samples in the training batch; Σ t p represents the summation over all training time steps; t The historical true map tile (i.e., the true time series value at this time step); t This is the initial prediction result output by the projection layer; The L2 norm (Euclidean distance) between the actual map patch and the initial prediction result is the time series reconstruction loss term, which measures the deviation between the predicted result and the actual value of the controlled object; L lipλ is the regularization loss term mentioned above; λ is a hyperparameter that balances the two loss terms and is used to adjust the trade-off between reconstruction accuracy and projection layer smoothness.
[0116] The design of the overall loss function reflects the dual objectives of the first-stage training. On one hand, the time-series reconstruction loss term drives the embedding and projection layers to learn how to accurately map time-series data to and back into the large language model feature space, enabling the controlled object to generate preliminary predictions that are as close as possible to the true values. On the other hand, the regularization loss term constrains the sensitivity of the projection layer, ensuring that the controlled object does not become overly sensitive to input perturbations while pursuing prediction accuracy, thus guaranteeing the stability of the subsequent closed-loop feedback prediction process. There is a certain tension between these two objectives. If reconstruction accuracy is overemphasized (λ is too small), the projection layer may become highly sensitive to the input. Although the prediction error on the training set is small, the small cumulative error in the closed-loop inference stage may be amplified. If smoothness is overemphasized (λ is too large), the projection layer may become too conservative, losing its ability to respond to input changes, leading to a decrease in prediction accuracy. The role of the λ hyperparameter is to find a suitable balance point in this tension.
[0117] Regarding the example value ranges for κ and λ, in a preferred configuration, κ can be 1.0 and λ can be 0.1. The considerations for these values are explained below.
[0118] The meaning of κ=1.0 is that the local Lipschitz constant of the projection layer must not exceed 1, that is, the change in output of the projection layer in any direction at any input point does not exceed twice the change in input. From a control theory perspective, κ≤1 means that the projection layer is a non-expanding mapping, and the signal will not be amplified when passing through the projection layer, at most it will remain unchanged. This is a sufficient condition to guarantee the stability of the closed-loop system: if every link in the feedback loop is non-expanding, then the error will not diverge when propagating in the closed loop. κ=1.0 is a natural and reasonable choice, providing stability guarantees without excessively limiting the expressive power of the projection layer. Of course, the value of κ does not have to be strictly equal to 1.0. Depending on the actual application scenario, κ can be adjusted between 0.5 and 2.0. For scenarios with large data noise and extremely high requirements for prediction stability (such as high-frequency trading signals in financial indicator prediction), κ can take a smaller value (such as 0.5 or 0.8) to provide stronger stability guarantees. For scenarios with strong data regularity and extremely high prediction accuracy requirements (such as short-term forecasting in power load forecasting), κ can be taken as a slightly larger value (such as 1.2 or 1.5) to allow the projection layer to have stronger expressive power and higher prediction accuracy.
[0119] The value of λ=0.1 is chosen because of the regularization loss term L. lipThe order of magnitude of L is typically different from that of the time series reconstruction loss term. In the early stages of training, the projection layer parameters have not yet converged. lip The projection loss may be relatively large (because the projection layer is sensitive to random noise perturbations), and the reconstruction loss is also relatively large. Both will gradually decrease as training progresses. λ=0.1 means that the weight of the regularization loss term in the total loss is about one-tenth of the reconstruction loss term, which is a relatively moderate proportion—sufficient to effectively constrain the sensitivity of the projection layer without dominating the training process and causing a significant decrease in reconstruction accuracy. In actual parameter tuning, λ can be determined between 0.01 and 1.0 using a grid search based on the prediction accuracy on the validation set and the stability of closed-loop inference. If the model's prediction accuracy on the validation set is acceptable but the error diverges rapidly in closed-loop inference, it indicates insufficient stability of the projection layer, and λ should be increased appropriately. If the model's error is stable in closed-loop inference but the prediction accuracy is not ideal, it indicates that the expressive power of the projection layer is limited, and λ should be decreased appropriately.
[0120] Through the synergistic design of the aforementioned noise perturbation regularization mechanism and the total loss function, the first-stage training can ensure the prediction accuracy of the controlled object while endowing it with local Lipschitz stability. This lays a solid stability foundation for the training of the residual estimator in the second stage and the closed-loop feedback prediction process in the subsequent inference stage. This design integrates the stability conditions in control theory into the deep learning training framework through a computable stochastic approximation method, achieving an effective unification of theoretical guarantees and engineering feasibility.
[0121] Example 7: This embodiment, building upon Embodiment 5, further elaborates on the target loss function and training details of the residual estimator in the second stage of training. Embodiment 5 described the overall framework of the second stage training: freezing the parameters of the embedding and projection layers after the first stage training, switching to autoregressive rolling mode, and using the difference between historical real patches and preliminary prediction results as a supervision signal to train the residual estimator. Embodiment 6 detailed the specific implementation of local Lipschitz constraint regularization and the construction of the total loss function in the first stage. This embodiment will focus on the core of the second stage training: how the residual estimator learns the frozen systematic deviation dynamics of the controlled object through a specific loss function, thereby enabling accurate prediction of the trajectory deviation compensation term during the inference stage.
[0122] In the second phase of training the residual estimator, the steps for training the residual estimator include: Construct a target loss function; the target loss function uses the error between the true residual at the current time step and the trajectory deviation compensation term output by the residual estimator as the residual estimation loss term.
[0123] Understandably, expressed mathematically, let p be the historical true map tile at time step t. t The preliminary prediction results generated by the controlled object (embedding layer + large language model with frozen parameters + projection layer) are as follows: t The trajectory deviation compensation term output by the residual estimator is The residual estimation loss term L2 is defined as follows: ; Where N is the number of samples in the training batch; Σt represents the summation over all training time steps; Equivalent to the aforementioned trajectory deviation compensation term Δpt, This refers to the historical estimated residual sequence. The different symbols are because here they represent the sequence of estimated residual values output by the residual estimator in each preceding time step, but they are actually equivalent; ||·||2 represents the L2 norm, that is, the Euclidean distance between the differences of the vector elements; p t - t The true residual at the current time step represents the actual deviation between the preliminary prediction result and the true value of the controlled object. The residual estimation loss term L2 measures the difference between the estimated value of the residual estimator and the true residual. The smaller the difference, the more accurate the residual estimator's inference of the error state, and the closer its output compensation term is to the actual required correction amount.
[0124] It's important to note that the residual estimator is trained using L2 norm loss, rather than other common loss functions. This is because L2 norm loss directly measures the Euclidean distance between the compensation term and the true residual in the time series space, offering a clear and explicit physical meaning. The optimization objective is to make the trajectory bias compensation term output by the residual estimator geometrically approximate the true residual vector as closely as possible. Compared to mean squared error loss, L2 norm loss offers several advantages for this type of continuous value regression task.
[0125] First, the penalty for large errors by the L2 norm loss is linear rather than quadratic. This means that during closed-loop autoregressive training, the large prediction bias that occasionally occurs at a few time steps will not dominate the overall loss function on a quadratic scale. This avoids the problem of the optimization direction being overly pulled by a few abnormal samples, and enables the residual estimator to learn the systematic deviation dynamics of the controlled object under various error modes more evenly.
[0126] Secondly, the L2 norm loss maintains stylistic consistency with the linear additive mechanism of feedback injection in this scheme. As detailed in Example 3, the feedback injection uses a linear additive approach, where the calibration prediction result equals the preliminary prediction result plus the trajectory deviation compensation term. This additive linearity echoes the linear penalty characteristic of the L2 norm, ensuring mathematical consistency across all stages of the closed-loop system, from the controlled object's output and error observation to feedback compensation. This avoids the optimization landscape mismatch problem that might be introduced by mixing linear and nonlinear criteria.
[0127] Third, the gradient of L2 norm loss has a clear direction when the error is non-zero (pointing to the direction of error reduction). Although the gradient magnitude tends to be constant rather than shrinking to zero when the error is close to zero, this characteristic can be stably controlled in actual training through conventional techniques such as gradient clipping and learning rate decay. It also helps to maintain a certain optimization momentum in the later stages of training and prevent the parameters from stagnating in local optima too early.
[0128] In summary, the L2 norm loss is highly compatible with the closed-loop feedback architecture of this scheme in terms of physical interpretability, optimization equilibrium, and system style consistency.
[0129] The definition and acquisition method of the true residual need to be understood in conjunction with the specific operational mechanism of the second-stage training. The true residual at the current time step is defined as the difference between the historical true map patch and the preliminary prediction result output by the controlled object through the projection layer at the current time step.
[0130] It's important to note that in the second training phase, the parameters of the embedding and projection layers have already been trained and frozen in the first phase. This means the input-output mapping relationship of the controlled object remains constant; for any given contextual feature input, the controlled object always generates the exact same initial prediction result. Simultaneously, the second phase switches to an autoregressive rolling mode, where the model progressively uses its own generated calibration prediction results as input for subsequent time steps. This perfectly aligns with the closed-loop condition of the inference phase. At each training time step, the contextual features contain historical ground truth tiles and calibration prediction tiles from previous time steps. The controlled object generates its initial prediction result for the current time step based on these contextual features. t The historical real map patch p corresponding to this time step in the training data. t It is known. Therefore, the true residual p t - tIt can be calculated directly; it is a definite and repeatable value. This true residual reflects the actual deviation between the predicted output and the true value of the controlled object under the current context. It includes both systematic biases caused by the limitations of the controlled object's own model capabilities (such as the inherent predictive tendency of large language models for certain time-series patterns) and cumulative biases introduced by the inclusion of prior calibration predictions rather than true tiles in the context features.
[0131] It's important to note that the residual estimator learns the frozen systematic bias dynamics of the controlled object in the second stage. Because the parameters of the controlled object—the embedding and projection layers—are completely frozen in the second stage and no longer change, the error pattern of the initial prediction results generated by the controlled object is deterministic for any given input state. This means that the error propagation and accumulation patterns inherent in the true residual sequence are fixed and learnable. The task of the residual estimator is to identify this deterministic error dynamic pattern from the historical estimated residual sequences using a large number of training samples, and to learn to accurately predict the true residual that will appear at the current time step given a previous estimated residual sequence.
[0132] This is fundamentally different from the first stage of training. In the first stage, the parameters of the controlled object are constantly being updated, and the error distribution is constantly changing. The residual estimator is facing a moving target. In the second stage, the controlled object is stable, the error distribution is fixed, and the residual estimator is facing a stationary target. It can focus on and accurately learn this fixed error pattern.
[0133] This two-stage strategy of first stabilizing the controlled object and then learning error compensation fundamentally guarantees the convergence of the residual estimator training and the final compensation accuracy.
[0134] In this embodiment, the residual estimator is optimized by minimizing the objective loss function so that the residual estimator learns the systematic deviation dynamics of the frozen controlled object.
[0135] It should be noted that during training, the optimizer (such as Adam or SGD) adjusts the residual estimator parameters θ based on the residual estimation loss term L2. res The gradient is used to iteratively update the parameters of the residual estimator. Since the parameters of the embedding and projection layers are frozen, the gradient signal is not propagated back to these modules; only the parameters of the recursive feature extraction structure and the output mapping layer inside the residual estimator are updated. This parameter isolation ensures the purity of the training process. The optimization objective of the residual estimator is singular and explicit: to minimize the difference between its output compensation term and the true residual, without needing to consider any other objectives simultaneously.
[0136] To more intuitively understand the convergence process of the second-stage training, an example of training convergence is given below.
[0137] In a typical training configuration, taking electricity load forecasting as an example, the training dataset contains tens of thousands of historical load sequences, each covering a time span of several weeks to several months. At the start of the second phase of training, the parameters of the residual estimator are randomly initialized, and there is a significant gap between the output trajectory deviation compensation term and the true residual. The initial value of the residual estimation loss term L2 is relatively high, for example, between 0.5 and 1.0 (the specific value depends on the data dimensions and normalization method). As training progresses, the optimizer continuously adjusts the parameters of the residual estimator based on gradient signals, and L2 gradually decreases. In the first few hundred iterations of training, L2 decreases rapidly because the residual estimator is quickly learning the main patterns and trends in the error dynamics, such as the systematic overestimation or underestimation tendency of the controlled object during specific periods (e.g., peak electricity consumption periods). As training deepens, the rate of decrease of L2 gradually slows down, and the curve flattens out. This is because the residual estimator has captured the main patterns in the error dynamics, and the remaining residuals mainly come from random noise in the data or a very few unpredictable abnormal patterns. After training convergence, L2 stabilizes at a low value, for example, between 0.05 and 0.1, a decrease of an order of magnitude compared to the initial value. Meanwhile, the compensation accuracy of the residual estimator can be evaluated on the validation set, i.e., the calibrated prediction results can be calculated. t = t +Δp t With real tile p t The error between them, and the initial prediction results without compensation. t With real tile p t The errors between the two methods are compared. After training convergence, the error of the calibrated prediction results is typically reduced by 30% to 60% compared to the initial prediction results. The specific reduction depends on the difficulty of the prediction task and the initial accuracy of the controlled object. This comparison intuitively demonstrates the dynamic error compensation capability learned by the residual estimator. Based on the historical estimated residual sequence, it can accurately predict the upcoming prediction deviation at each prediction time step and effectively offset this deviation through additive correction, thereby significantly improving the overall accuracy of the closed-loop feedback prediction process.
[0138] It should be noted that the specific values mentioned above are for illustrative purposes only. The actual loss value and convergence speed during training are influenced by various factors, including the size and quality of the training data, the values of the tile length L and the context window length K, the network structure complexity of the residual estimator, the choice of optimizer, and the configuration of hyperparameters. In practical applications, the degree of convergence can be determined by monitoring the compensation accuracy metric on the validation set, and the learning rate can be adjusted, the number of training iterations increased, or an early stopping strategy employed to optimize the training effect as necessary.
[0139] Understandably, the application scenario for the method in this application is defined as: the search scenario during reasoning of large language models in complex reasoning tasks, specifically including automatic solution of mathematical problems, code generation and debugging, multi-step question answering, intelligent education problem-solving assistance, tool call planning, etc.
[0140] The method described in this embodiment belongs to the natural language processing technology, a key technology in artificial intelligence. It can perform subsequent search and reasoning on the content of machine question answering, and can also achieve an effective search and reasoning process for tasks such as semantic processing and machine translation. This embodiment uses a large language model to perform multi-step reasoning and generate candidate reasoning paths for natural language questions.
[0141] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A closed-loop feedback time series prediction method for unmanned aerial vehicles (UAVs), used to form closed-loop feedback in the autoregressive prediction process to suppress the accumulation of prediction errors and trajectory drift of UAV state parameters, characterized in that, include: The historical time-series data of the drone's state is projected from the time-series space to the feature space of a large language model with frozen parameters through an embedding layer to obtain contextual features used to drive the reasoning of the controlled object; the contextual features in the first time step only include the feature representation of the historical time-series data, and in subsequent time steps, they also include the calibration prediction results of the previous time step as feedback correction information. Using the large language model with the frozen parameters as the controlled object, the uncalibrated prediction output of the current time step is generated based on the context features, and mapped back to the time series space through the projection layer to obtain the preliminary prediction result characterizing the open-loop response of the controlled object. Using the residual estimator as a closed-loop observer, the potential error state of the current time step is inferred based on the estimated residual sequence stored in the historical time steps, and the trajectory deviation compensation term used to offset the accumulation of errors is estimated; the estimated residual sequence characterizes the accumulation and propagation dynamics of historical prediction errors; The trajectory deviation compensation term is injected as a feedback correction signal into the preliminary prediction result to obtain a calibrated prediction result that suppresses the accumulation of error at the current time step. This result is then fed back into the context features as the state input for the next time step, enabling the controlled object to perform reasoning based on the context including feedback correction information at the next time step, thus forming a closed-loop feedback prediction process.
2. The method according to claim 1, characterized in that, The process of projecting historical time-series data of the UAV's state from the time-series space to the feature space of a large language model with frozen parameters through an embedding layer to obtain contextual features for driving reasoning of the controlled object includes: The historical time series data of the drone status is divided into a sequence of non-overlapping tiles according to a preset fixed length L, wherein each tile includes a data segment of L consecutive time points; if there are less than L time points at the end, zero-value padding is used to complete the tile. The embedding layer projects each tile from the time series space to the large language model feature space of the frozen parameters to obtain tile feature vectors, and then concatenates the tile feature vectors in time order to obtain the context features.
3. The method according to claim 2, characterized in that, The contextual features, before being input into the large language model of the frozen parameters, also include a context window management step: When the number of tiles included in the context features exceeds the preset maximum window length K, only the feature vectors of the K tiles that are most recent in time are retained, and the feature vectors of earlier tiles are discarded, so as to limit the computational overhead while maintaining the ability to maintain long-term dependencies.
4. The method according to claim 2, characterized in that, When projecting each tile, the embedding layer further adds time step position encoding to the projection result so that the context features retain the temporal order information between different tiles.
5. The method according to claim 1, characterized in that, The trajectory deviation compensation term is injected into the preliminary prediction result as a feedback correction signal using a linear addition method, i.e., the calibrated prediction result = the preliminary prediction result + the trajectory deviation compensation term, in order to avoid introducing additional fusion parameters that could lead to training instability or overfitting.
6. The method according to claim 1, characterized in that, The residual estimator includes a recursive feature extraction structure and an output mapping layer; The recursive feature extraction structure is used to perform time-series modeling on the estimated residual sequence stored in the historical time steps, extract the propagation and accumulation features of error in the time dimension, and obtain the error feature representation; the recursive feature extraction structure is implemented using a recurrent neural network or a temporal convolutional network; The output mapping layer is a fully connected layer used to map the error feature representation into the trajectory deviation compensation term.
7. A training method for a UAV time series prediction model, used to train the embedding layer, projection layer, and residual estimator used in the method as described in any one of claims 1 to 6, characterized in that, The method includes: a first stage and a second stage; The first stage includes: All parameters of the residual estimator are frozen, a teacher-forced strategy is adopted, and the context features corresponding to the historical real map tiles are used as the input of the controlled object. The embedding layer and the projection layer are jointly trained, and local Lipschitz constraint regularization is applied to the projection layer to control the ratio of the output change amplitude of the projection layer to the input change amplitude, thereby ensuring the stability of the closed-loop feedback prediction process. The second phase includes: The parameters of the embedding layer and projection layer after the first stage of training are frozen, and the autoregressive rolling mode is switched. The difference between the historical real map tiles and the preliminary prediction results output by the controlled object through the projection layer in the current time step is used as a supervision signal to train the residual estimator, so that it learns how to accurately predict the current trajectory deviation compensation term based on the estimated residual sequence stored in the historical time step.
8. The training method according to claim 7, characterized in that, The application of local Lipschitz constraint regularization to the projection layer includes: During training, a Gaussian noise vector with the same dimension as the latent output is added to the latent output of the projection layer; wherein, when adding the Gaussian noise vector to the latent output of the projection layer, the Gaussian noise vector is sampled independently and uses the same intensity range between different training samples and between different time steps of the same training sample; Calculate the difference norm between the projection layer output vectors before and after adding noise, and calculate the ratio of this difference norm to the norm of the Gaussian noise vector. Subtract the preset upper limit of the Lipschitz constant from the ratio. If the difference is positive, the square of the difference is taken as the regularization loss term. If the difference is zero or negative, the regularization loss term is zero. The regularization loss term is used to constrain the sensitivity of the projection layer and prevent the error from being amplified in the closed loop.
9. The training method according to claim 8, characterized in that, The step of jointly training the embedding layer and the projection layer includes: Construct the total loss function for the first stage; the total loss function is composed of the regularization loss term and the time series reconstruction loss term constructed from the error between the initial prediction results based on historical real tiles and the projection layer output; The embedding layer and the projection layer are jointly trained by minimizing the total loss function.
10. The training method according to claim 7, characterized in that, The step of training the residual estimator includes: Construct a target loss function; the target loss function uses the error between the true residual at the current time step and the trajectory deviation compensation term output by the residual estimator as the residual estimation loss term; wherein, the true residual at the current time step is defined as the difference between the historical true map patch and the preliminary prediction result output by the controlled object through the projection layer at the current time step; The residual estimator is optimized by minimizing the objective loss function so that it learns the systematic deviation dynamics of the frozen controlled object.
