Prediction time coding method based on large language model prior
Through the forecast time coding method based on the priori of large language model, the problem of difficult to capture medium- and long-term trends and periodic changes in marine meteorological forecasts is solved, and efficient and accurate forecasts of ocean state variables are achieved, reducing system complexity and cost.
Patent Information
- Application Number
- CN202510180907.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2045-02-19
AI Technical Summary
The prior art is difficult to effectively capture long-term trends and complex periodic changes in marine meteorological forecasting, and the multi-model forecasting method leads to an increase in the number of models, an increase in training and maintenance costs, and an increase in system complexity.
The prediction time coding method based on the priori of the large language model is adopted, and time embedding and model parameters are optimized through the decomposition and encoding of time features, the construction of principal component embedding, and the integration and mapping of time embedding to achieve efficient forecasting of ocean state variables.
It improves forecast accuracy, reduces error accumulation, reduces model training and maintenance costs, enhances time feature expression capabilities and model generalization capabilities, and improves the overall efficiency and reliability of the forecast system.
Smart Images

Figure CN119669745A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of marine meteorology technology, and in particular, relates to a forecast time coding method based on a priori large language models. Background Art
[0002] In the field of meteorology and oceanography, continuous weather or ocean forecasting is of great significance for disaster warning, resource management, and environmental protection. With the development of artificial intelligence technology, forecasting models based on deep learning have gradually become a research hotspot. However, how to efficiently reuse a single artificial intelligence model to achieve continuous and stable weather or ocean forecasts still faces many technical challenges.
[0003] The advantage of the autoregressive forecasting method is that the model structure is relatively simple and can better capture the time dependency in the short term. However, since each step of the prediction depends on the result of the previous step, the error gradually accumulates. In addition, the autoregressive model is difficult to capture long-term trends and complex periodic changes, which limits its application effect in continuous forecasting. Therefore, although the autoregressive method performs well in short-term forecasting, it has obvious shortcomings in achieving continuous forecasting. In order to overcome the limitations of the autoregressive forecasting method, a multi-model forecasting method is proposed. Represented by the Xihe ocean state variable forecasting model, this method establishes independent forecasting models for different forecast days. This method can optimize model parameters for different time scales, thereby improving the accuracy and stability of the forecast to a certain extent. However, the multi-model forecasting method also has significant defects. First, an independent model is established for each forecast period, which leads to a significant increase in the number of overall models, which in turn leads to a sharp increase in training and maintenance costs. Secondly, the parameters and structures of different models vary greatly, which increases the complexity of the system.
[0004] In recent years, researchers have explored the use of time coding technology to achieve continuous forecasting of a single model. LangYa proposed a forecasting method based on forecast time coding. By taking time information as an important input of the model, this method solves the error accumulation problem of the autoregressive method to a certain extent. However, it lacks effective feature expression when dealing with long-term periodic changes, and it is difficult to capture long-term trends and complex periodic laws. In addition, for nonlinear changes at different time scales, the fusion of multi-scale features is not fully considered, resulting in poor performance of the model when dealing with multi-scale dynamic processes.
[0005] At present, common temporal information encoding methods mainly include fixed frequency encoding and learning encoding. The fixed frequency encoding method captures periodic change characteristics by mapping temporal information into a high-dimensional space. However, it performs poorly when dealing with non-periodic and long-term trend changes. The learning encoding method autonomously learns the representation of temporal features through machine learning techniques such as neural networks. However, such methods often rely on large amounts of data and computing resources. In addition, existing temporal encoding methods lack an effective fusion mechanism when dealing with features of different time scales, resulting in unstable performance of the model when dealing with multi-scale dynamic processes. Summary of the invention
[0006] The purpose of the present invention is to propose a prediction time coding method based on a large language model prior to make up for the shortcomings of the prior art.
[0007] In order to achieve the above object, the specific technical solution adopted by the present invention is:
[0008] A prediction time coding method based on a large language model prior comprises the following steps: S1: Decomposition and coding of temporal characteristics: The temporal information of the acquired ocean state variables is decomposed according to different time scales (year, quarter, month, day) and coded separately to capture its periodicity and nonlinear variation patterns; S2: Construction of principal component embedding: for year Due to the lack of obvious periodicity and the inability to enumerate future years, the principal component analysis (PCA) method is used to construct a learnable principal component embedding. S3: Integration and mapping of time embedding: The embedding vectors of different time scales are integrated to form a complete time embedding E(t, τ), and dimension mapping is performed through a multi-layer perceptron (MLP) to adapt to the input requirements of the forecast model; S4: Model training and optimization: Based on the constructed time embedding, the forecast model is trained to achieve short-term forecast of ocean state variables; the time embedding and model parameters are optimized simultaneously during the training process to improve the forecast accuracy; S5: Forecast future ocean state variables using the trained forecast model and complete temporal embedding.
[0009] Furthermore, the S1 specifically includes: S1-1: Decompose the forecast time into multiple time scales: year is marked as Y, month is marked as M, day is marked as D, and the number of days of forecast backward reasoning is marked as ; Among them, years are used to capture long-term trends, quarters and months are used to reflect medium-term cyclical changes, and days are used for short-term nonlinear fluctuations; S1-2: Periodic change law coding: S1-21: Cyclic changes of years, quarters, and months: For years, quarters, and months, since they have obvious cyclical changes, discrete learnable Embedding vectors are used to represent them. Specifically, the month ( ) and day ( ) is mapped to the corresponding discrete Embedding space and its vector representation is learned through a neural network; S1-21: Nonlinear variation of days: Number of days ( ) has strong nonlinear characteristics, so it needs to be encoded by a nonlinear function to better capture its dynamic change characteristics.
[0010] Furthermore, in S2: S2-1: Perform principal component analysis on the ocean state variable data over the years and extract The main components ( , i=1,…,10), these principal components can effectively represent the main changing trends of year characteristics; S2-2: Calculate weight coefficients: Use a large language model (LLM) with prior knowledge, specifically the Llama3.1-8B model fine-tuned by instructions, to generate the year The corresponding weight coefficient ; This process is achieved by dimensional mapping the contextual semantic embedding generated by LLM through a multilayer perceptron (MLP): ; Among them, the LLM model generates contextual semantic embedding by inputting the prompt word "Global Ocean Status in XXX" to ensure the semantic richness and accuracy of the year feature; S2-3: Construction of year embedding: Linearly combine the principal component embedding with the weight coefficient to obtain the embedding representation of the year: At the same time, ensure that the weight coefficients meet the normalization conditions: .
[0011] Further, the S3 includes: S3-1: Integration of Embedding Vectors: Embedding Year , month embed , days embedded and forecast duration embedding Perform vector concatenation (⊕) and addition to obtain the complete temporal embedding representation: ; Where K is the maximum number of days into the future that the forecast model is required to forecast; S3-2: Dimension Mapping: Use a multi-layer perceptron (MLP) to further dimensionally map the integrated time embedding to match the input dimension requirements of the forecast model; specifically, MLP maps the high-dimensional embedding vector to the feature space required by the forecast model through several layers of fully connected neural networks: ; The time embedding features after dimension mapping can be directly added to the convolutional neural network or the attention mechanism neural network as the "initial moment-interval time" joint feature information introduced into the forecasting system.
[0012] Further, the S4 includes: S4-1: Collect and organize historical ocean state variable data, and divide them into training sets, validation sets, and test sets in chronological order to ensure the continuity and integrity of the data; S4-2: Design model architecture: Choose a neural network architecture suitable for time series forecasting, such as Long Short-Term Memory (LSTM), Gated Recurrent Unit (GRU) or Transformer model. The model input includes the constructed time embedding E(t, τ) and the corresponding historical state variables; S4-3: Loss function setting: Use mean square error (MSE) or other loss functions suitable for regression tasks to measure the difference between the predicted result and the true value; Optimization algorithm selection: Use gradient descent method and its variants (such as Adam optimizer) to update parameters to ensure efficient convergence of the model; Hyperparameter tuning: Use cross-validation and grid search methods to adjust hyperparameters such as learning rate, batch size, and number of network layers to optimize model performance; S4-4: Optimization of temporal embedding: During the model training process, the temporal embedding E(t, τ) is used as part of the model input, and its parameters (including the Embedding vector and MLP weights) are optimized together with the model parameters to achieve a high degree of coupling between temporal features and forecasting tasks.
[0013] Furthermore, in S5: S5-1: Forecast input preparation: Based on the current time and forecast duration, construct the corresponding time embedding E(t, τ), including the encoding of year, quarter, month, day and forecast duration.
[0014] S5-2: Forecast model reasoning: The constructed time embedding E(t, τ) and the corresponding historical state variables are input into the forecast model for forward propagation to generate the forecast results of the ocean state variables at future moments.
[0015] S5-3: Result verification and optimization: Error analysis and verification of forecast results to ensure the accuracy and reliability of forecasts. Based on the feedback results, further optimize model parameters and time embedding methods to improve forecast performance.
[0016] S5-4: Practical application deployment: Integrate the forecast model into the actual weather or ocean forecast system to provide real-time forecast services for disaster warning, resource management, environmental protection and other fields.
[0017] Compared with the prior art, the present invention has the following beneficial effects: The present invention achieves efficient forecasting of persistent weather or ocean conditions using a single artificial intelligence model by optimizing the time embedding method: (1) The periodic and nonlinear changes of ocean state variables at different time scales are systematically encoded into time embedding to improve the expression ability of time features. Multi-level embedding vectors are used to organically integrate multi-dimensional time information such as years, quarters, months and days. By introducing time encoding technology, a single model can efficiently handle multi-period forecasting tasks, reduce the number of models and training costs, and improve the overall efficiency and scalability of the forecasting system. The unified time encoding method enables a model to cope with a variety of forecasting needs from short-term to long-term, simplify the system architecture, and improve resource utilization.
[0018] (2) Utilize the prior knowledge of the large language model to optimize the extraction and mapping process of temporal features, improve the quality and efficiency of temporal embedding, transform temporal information into contextual semantic embedding, and achieve accurate expression and efficient use of temporal features.
[0019] (3) Improve the accuracy and reliability of long-term forecasts. By optimizing the encoding of time information, the cumulative effect of errors can be reduced to meet the actual needs of continuous forecasts. This enables the model to better understand and predict long-term trends and complex cyclical changes, and improves the credibility and stability of forecast results.
[0020] (4) Improve the generalization and adaptability of the model. Through comprehensive encoding of multi-scale temporal features, the adaptability of the model in different temporal dynamic processes is enhanced, and the generalization of the model is improved, so that it can maintain efficient forecasting performance in a changing actual environment. Multi-dimensional temporal feature expression can meet the forecasting needs of different regions and different time scales.
[0021] The present invention can improve forecast accuracy and reduce error accumulation; reduce model training and maintenance costs; enhance the ability to express temporal features and improve model generalization; improve the ease of operation and practicality of the forecast system; optimize resource utilization and save energy; and improve the reliability and stability of the forecast system. Based on experimental data and practical application feedback, the present invention has a wide range of promotion value and can be applied to weather and ocean forecast systems worldwide to meet different regions and different forecasting needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is the overall flow chart of the present invention.
[0023] Figure 2 This is a processing flow chart of Example 2. DETAILED DESCRIPTION
[0024] The technical solution of the present invention is further described below in conjunction with embodiments.
[0025] The following embodiments need to solve the following technical problems: (1) Effectively reduce the error accumulation in long-term forecasts. By improving the construction method of time embedding, optimizing the encoding of time information, reducing the accumulation of errors in the prediction process, and fundamentally improving the accuracy and reliability of long-term forecasts. Specifically, using the large language model prior to encode time information in a more refined and multi-dimensional manner, ensure that the expression of time features at different time scales is more comprehensive and accurate, thereby effectively suppressing the gradual amplification of errors.
[0026] (2) Reduce model training and maintenance costs. Develop a technology that can handle multi-period forecasts in a single model, avoiding the need to build separate models for different forecast days, thereby significantly reducing overall training and maintenance costs and improving the scalability and practicality of the model. Through a unified time coding method, a single model can flexibly respond to the needs of different forecast periods, reduce the number of models, simplify the system architecture, and reduce resource consumption.
[0027] (3) Enhance the ability to express multi-scale temporal features. The periodic and nonlinear changes of ocean state variables at different time scales (such as years, quarters, months, and days) are systematically encoded into time embedding to improve the model's ability to capture multi-scale dynamic processes and enhance the model's generalization and adaptability. Through multi-level and multi-dimensional time encoding, the model can simultaneously understand and process the laws of change at different time scales, thereby improving the comprehensiveness and accuracy of forecasts.
[0028] (4) Improve the efficiency and effectiveness of temporal feature encoding. Use large language model priors and multi-layer perceptrons to efficiently extract and map temporal features, optimize the expression of temporal embedding, achieve efficient and comprehensive temporal information encoding, and improve the overall prediction performance of the model. By introducing advanced natural language processing models as a priori knowledge source of temporal information, the semantic understanding and expression capabilities of temporal features are improved, thereby enhancing the performance of the model in complex temporal dynamics.
[0029] Embodiment 1: A prediction time coding method based on large language model priors, such as Figure 2 As shown, it is used to more intuitively show the specific implementation steps of the present invention: S1: Decomposition and coding of temporal characteristics: The temporal information of the acquired ocean state variables is decomposed according to different time scales (year, quarter, month, day) and coded separately to capture its periodicity and nonlinear variation patterns; specifically, it includes: S1-1: Decompose the forecast time into multiple time scales: year is marked as Y, month is marked as M, day is marked as D, and the number of days of forecast backward reasoning is marked as ; Among them, years are used to capture long-term trends, quarters and months are used to reflect medium-term cyclical changes, and days are used for short-term nonlinear fluctuations; S1-2: Periodic change law coding: S1-21: Cyclic changes of years, quarters, and months: For years, quarters, and months, since they have obvious cyclical changes, discrete learnable Embedding vectors are used to represent them. Specifically, the month ( ) and day ( ) is mapped to the corresponding discrete Embedding space and its vector representation is learned through a neural network; S1-21: Nonlinear variation of days: Number of days ( ) has strong nonlinear characteristics, so it needs to be encoded by a nonlinear function to better capture its dynamic change characteristics.
[0030] The S1 step needs to fully consider the mutual influence between different time scales to ensure the independence and complementarity of each time feature. The encoding method should be learnable and be able to adaptively adjust the embedding vector through training data. By decomposing and encoding the features of different time scales, the dynamic changes of ocean state variables at multiple scales can be fully captured, providing rich time information for subsequent time embedding integration.
[0031] S2: Construction of principal component embedding: for year Due to the lack of obvious periodicity and the inability to enumerate future years, the principal component analysis (PCA) method is used to construct a learnable principal component embedding; specifically, it includes: S2-1: Perform principal component analysis on the ocean state variable data over the years and extract The main components ( , i=1,…,10), these principal components can effectively represent the main changing trends of year characteristics; S2-2: Calculate weight coefficients: Use a large language model (LLM) with prior knowledge, specifically the Llama3.1-8B model fine-tuned by instructions, to generate the year The corresponding weight coefficient ; This process is achieved by dimensional mapping the contextual semantic embedding generated by LLM through a multilayer perceptron (MLP): ; Among them, the LLM model generates contextual semantic embedding by inputting the prompt word "Global Ocean Status in XXX" to ensure the semantic richness and accuracy of the year feature; S2-3: Construction of year embedding: Linearly combine the principal component embedding with the weight coefficient to obtain the embedding representation of the year: At the same time, ensure that the weight coefficients meet the normalization conditions: .
[0032] The principal component analysis in step S2 needs to be based on sufficient historical data to ensure that the extracted principal components can fully reflect the characteristics of the year. The LLM model needs to be fine-tuned with sufficient instructions to accurately generate the contextual semantic embedding corresponding to the year. Through the construction of principal component embedding, the complex change pattern of the year can be effectively represented, which makes up for the shortcomings of traditional periodic coding methods in dealing with long-term trends and improves the expression ability of time embedding.
[0033] S3: Integration and mapping of time embedding: Integrate the embedding vectors of different time scales to form a complete time embedding E(t, τ), and perform dimension mapping through a multi-layer perceptron (MLP) to meet the input requirements of the forecast model; specifically, it includes: S3-1: Integration of Embedding Vectors: Embedding Year , month embed , days embedded and forecast duration embedding Perform vector concatenation (⊕) and addition to obtain the complete temporal embedding representation: ; Where K is the maximum number of days into the future that the forecast model is required to forecast; S3-2: Dimension Mapping: Use a multi-layer perceptron (MLP) to further dimensionally map the integrated time embedding to match the input dimension requirements of the forecast model; specifically, MLP maps the high-dimensional embedding vector to the feature space required by the forecast model through several layers of fully connected neural networks: ; The time embedding features after dimension mapping can be directly added to the convolutional neural network or the attention mechanism neural network as the "initial moment-interval time" joint feature information introduced into the forecasting system.
[0034] In the S3 step, the embedding vectors of each time scale must have the same dimension or achieve dimension matching through appropriate linear transformation. The MLP structure needs to be optimized to ensure the efficiency and accuracy of the embedding mapping. By integrating the embedding vectors of different time scales and performing dimension mapping, a comprehensive temporal feature representation suitable for the forecast model is formed, which improves the model's understanding and prediction capabilities of multi-scale temporal dynamics.
[0035] S4: Model training and optimization: Based on the constructed time embedding, the forecast model is trained to achieve short-term forecast of ocean state variables; the time embedding and model parameters are optimized during the training process to improve the forecast accuracy; specifically, it includes: S4-1: Collect and organize historical ocean state variable data, and divide them into training sets, validation sets, and test sets in chronological order to ensure the continuity and integrity of the data; S4-2: Design model architecture: Choose a neural network architecture suitable for time series forecasting, such as Long Short-Term Memory (LSTM), Gated Recurrent Unit (GRU) or Transformer model. The model input includes the constructed time embedding E(t, τ) and the corresponding historical state variables; S4-3: Loss function setting: Use mean square error (MSE) or other loss functions suitable for regression tasks to measure the difference between the predicted result and the true value; Optimization algorithm selection: Use gradient descent method and its variants (such as Adam optimizer) to update parameters to ensure efficient convergence of the model; Hyperparameter tuning: Use cross-validation and grid search methods to adjust hyperparameters such as learning rate, batch size, and number of network layers to optimize model performance; S4-4: Optimization of temporal embedding: During the model training process, the temporal embedding E(t, τ) is used as part of the model input, and its parameters (including the Embedding vector and MLP weights) are optimized together with the model parameters to achieve a high degree of coupling between temporal features and forecasting tasks.
[0036] In step S4, sufficient training data is provided to cover the changing rules of different time scales; a suitable model architecture can make full use of the multi-dimensional information embedded in time. This step improves the forecast model's ability to understand time characteristics and prediction accuracy through training and optimization, and realizes accurate short-term forecasting of ocean state variables.
[0037] S5: Forecast future ocean state variables using the trained forecast model and complete time embedding; specifically: S5-1: Forecast input preparation: Based on the current time and forecast duration, construct the corresponding time embedding E(t, τ), including the encoding of year, quarter, month, day and forecast duration.
[0038] S5-2: Forecast model reasoning: The constructed time embedding E(t, τ) and the corresponding historical state variables are input into the forecast model for forward propagation to generate the forecast results of the ocean state variables at future moments.
[0039] S5-3: Result verification and optimization: Error analysis and verification of forecast results to ensure the accuracy and reliability of forecasts. Based on the feedback results, further optimize model parameters and time embedding methods to improve forecast performance.
[0040] S5-4: Practical application deployment: Integrate the forecast model into the actual weather or ocean forecast system to provide real-time forecast services for disaster warning, resource management, environmental protection and other fields.
[0041] In the above step S5: the forecast system needs to have real-time data input and processing capabilities to ensure the timeliness of the forecast results. The forecast results need to be strictly verified and calibrated to ensure their application value. This step generates accurate forecast results and applies them to actual scenarios to improve the research and application effects of meteorological and marine sciences and help support decision-making in related fields.
[0042] The above steps form an organic process chain in the entire technical solution. The steps are interrelated and mutually supportive, and together achieve the goal of the forecast time coding method based on the large language model prior: the decomposition and encoding of time features provide a multi-scale time information basis for the subsequent embedding construction. The construction of principal component embedding specifically solves the complexity of year features and improves the expressive power of time embedding. The integration and mapping of time embedding organically integrate multi-scale time features to form a comprehensive time embedding suitable for the forecast model. Model training and optimization ensure that the forecast model can make full use of time embedding and achieve high-precision forecasting through continuous adjustment and optimization. The generation and application of forecast results transform the expected effects of the technical solution into actual results, providing strong support for meteorological and oceanographic sciences.
[0043] Embodiment 2: This embodiment uses the ocean and atmosphere reanalysis data at a given time point as the time information input of the time embedding model, and a single inference generates the GLORYS12 ocean reanalysis data at a future time point (1-7 days) as output. The temporal resolution of GLORYS12 data is 1 day, the spatial resolution is 1 / 12°, and the forecast variables include seawater velocities U, V, sea surface height, sea temperature, and seawater salinity. Based on the ocean state variables on November 3, 2023, the forecast for the next 7 days is made. The process of the forecast task is as follows: Figure 2 As shown: S110 Enter the current time and forecast duration: First, the system needs to obtain the current time (January 1, 2023) and the forecast duration specified by the user (for example, the next 10 days). The user can enter this time information through the interface, or complete this step by automatically obtaining the current date and forecast requirements.
[0044] Enter the current time: November 03, 2023; Enter the forecast duration: 7 days.
[0045] S120 Extract the current year, month, date, and forecast duration: The system extracts specific time features from the input current time (January 1, 2023), including year, month, and date information, and also extracts the forecast duration: Year (t_Y): 2023; Month (t_M): November; Date (t_D): 03; Forecast duration (τ): 7 days.
[0046] S130 Constructing the encoding of year, month, date and forecast duration: Based on the extracted time features, the system starts to construct a time embedding vector. The specific time encoding method is as follows: Year (t_Y) encoding: For the year, the principal component analysis method is used to generate 10 principal component embedding vectors, and the multi-layer perceptron (MLP) mapping is used to represent the characteristics of 2023. The linear combination of each principal component vector represents the characteristics of the year.
[0047] Month (t_M) encoding: For the month (November), a discrete learnable Embedding vector representation is used to map January to a vector of fixed dimension.
[0048] Date (t_D) encoding: For the date (03), a discrete learnable Embedding vector is also used to map the 1st to a vector of fixed dimension.
[0049] Forecast duration (τ) encoding: The forecast duration (7 days) is represented by a discretized Embedding vector. Since the forecast duration is an integer (τ=7), its corresponding vector is obtained through training.
[0050] S140 outputs the time embedding vector and adds it to the ocean state variable characteristics: After constructing the complete time embedding vector, the system combines it with the historical observation data of the ocean state variables (such as sea surface temperature, sea surface height, etc.) as the input of the model. The specific operations are as follows: Input ocean state variables: The system obtains the ocean state variable data corresponding to the current time (November 03, 2023), such as sea surface temperature (SST), etc.
[0051] Fusion of time embedding and state variables: Add the previously constructed time embedding vector E(t, τ) to the characteristic data of the ocean state variables (such as SST, etc.) to form a new feature vector as the input of the deep neural network (MLP).
[0052] In this way, the model can take into account both the periodic changes in the time dimension (such as seasonality and annual cycles) and the dynamic changes in ocean state variables. Then, this fused feature vector will be input into the deep neural network to predict the ocean state variables for the next 10 days.
[0053] In the long-term forecast, the traditional autoregressive forecasting method (such as Pangu model) is prone to the gradual accumulation of errors because each step of the forecast depends on the result of the previous step, which affects the reliability and accuracy of the forecast. However, the present invention systematically encodes the periodicity and nonlinear change rules of years, quarters, months and days through multi-scale time embedding, which enhances the model's ability to capture long-term trends and complex dynamics. After experimental verification, the following evaluation indicators are passed: (1) Mean Squared Error (MSE): The long-term forecast MSE of the present invention is reduced by about 20% compared with the traditional autoregressive method.
[0054] (2) Mean Absolute Error (MAE): The MAE of the present invention is reduced in multiple forecast periods, with an average reduction of 15%.
[0055] (3) Coefficient of Determination (R²): The R² value of the present invention in long-term forecasting increased by 10 percentage points, indicating that the model's ability to explain data variation has been significantly enhanced.
[0056] The multi-model forecasting method requires the establishment of independent forecasting models for different forecast days, resulting in high training and maintenance costs and high system complexity. However, the present invention uses a unified time encoding method to enable a single model to handle multi-period forecasting tasks, significantly reducing the number of models and training resource requirements. After experimental verification, the following evaluation indicators are passed: (1) Number of models: Compared with the multi-model forecasting method, the present invention only requires one forecasting model, reducing the number of models by about 90%.
[0057] (2) Training time: The time required to train a single model is reduced by 50% compared to the multi-model approach. For example, the time required to train multiple models per day is reduced to only half the time.
[0058] (3) Computational resource consumption: The total computing resource consumption of the present invention under the forecasting task is reduced by 40%, effectively saving computing costs. Existing time encoding methods have deficiencies in multi-scale feature fusion and long-term trend capture, which limits the generalization ability and adaptability of the model. The present invention uses a large language model prior (such as Llama3.1-8B) to generate high-quality contextual semantic embeddings, and effectively characterizes year features through principal component analysis, ensuring the comprehensive expression of time features at different scales. After experimental verification, the following evaluation indicators are passed: (1) Cross-regional forecasting performance: In forecasting experiments in different geographical regions, the R² value of the proposed method increased by 12% on average, showing strong generalization ability.
[0059] (2) Stability across time periods: The model’s forecast performance in different years, quarters, and months is stable, and the standard deviation is reduced by 8%, indicating that the model’s adaptability to different time periods is enhanced.
[0060] (3) Transfer learning performance: In the forecasting task of migrating to a new area or a new time period, the forecasting accuracy of the proposed method is improved by 15%, demonstrating its good generalization ability.
[0061] The multi-model forecasting method requires independent operations for different forecast days, which increases the system's operational complexity and the user's difficulty. However, the present invention achieves a high degree of coupling between time features and forecast models by optimizing the construction and integration process of time embedding, making the operation process of the forecasting system simpler. After experimental verification, the following evaluation indicators are passed: (1) User operation steps: The method of the present invention simplifies the user operation steps from the original multiple steps to a single step, reducing the operation complexity by about 70%.
[0062] (2) System integration time: The integration time of the forecast system was shortened from two weeks to one week, significantly improving the deployment efficiency of the system.
[0063] (3) User satisfaction survey: In actual applications, users' scores on the ease of operation of the method of the present invention increased by an average of 20%, with good feedback.
[0064] The multi-model forecasting method consumes high computing resources and energy when processing multi-period forecasting tasks, which is not conducive to building a green and efficient forecasting system. However, the present invention uses the multi-period forecasting capability of a single model. The method of the present invention not only reduces the number of models, but also optimizes the utilization efficiency of computing resources. After experimental verification, the following evaluation indicators are used: (1) Energy consumption (kWh): The total energy consumption of the proposed method under the forecasting task is reduced by 40%, which meets the requirements of green computing.
[0065] (2) Computing resource utilization: By optimizing the model structure and time embedding, the computing resource utilization of the proposed method is improved by 30%, achieving more efficient resource allocation.
[0066] (3) Carbon emissions: With the reduction of energy consumption, the corresponding carbon emissions are reduced by about 35%, which is conducive to environmental protection and sustainable development. When faced with complex time dynamics, the stability and consistency of the forecast results of traditional forecasting methods are poor, affecting the overall reliability of the system. The present invention enhances the forecast model's understanding and prediction capabilities of complex time dynamics through systematic time feature encoding and dimensional mapping of multi-layer perceptrons, thereby improving the overall reliability and stability of the forecast system. After experimental verification, the following evaluation indicators are passed: (1) Consistency of forecast results: In different time periods and different forecast tasks, the consistency of forecast results of the present invention is improved by 15%, reducing forecast fluctuations.
[0067] (2) Stability test: In repeated experiments, the standard deviation of the prediction error of the present invention was reduced by 10%, indicating that the prediction results are more stable.
[0068] (3) Failure rate: The failure rate of the forecasting system during long-term operation has been reduced from the original 5% to 2%, significantly improving the reliability of the system.
[0069] The performance of existing forecasting methods in practical applications is uneven, lacking extensive experimental verification and application case support. The method of the present invention has been extensively experimentally verified in multiple actual forecasting scenarios, showing excellent performance and broad application prospects. After experimental verification, it passed the following evaluation indicators: (1) Forecast accuracy: In an ocean temperature forecast experiment in a coastal area, the forecast accuracy of the method of the present invention reached over 95%, while that of the traditional autoregressive method was only 80%.
[0070] (2) Feedback from practical applications: The present invention has been successfully applied in multiple meteorological and ocean forecasting systems, with user satisfaction ratings reaching 90%, demonstrating good practical application effects.
[0071] Finally, although this specification is described according to implementation methods, not every implementation method contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
Claims
1. A prediction time coding method based on a large language model prior, characterized in that: The steps include: S1: Decomposition and encoding of temporal characteristics: The temporal information of the acquired ocean state variables is decomposed according to different time scales and encoded respectively; S2: Construction of principal component embedding: for year The features of the main component analysis (PCA) method are used to construct a learnable principal component embedding. S3: Integration and mapping of time embedding: The embedding vectors of different time scales are integrated to form a complete time embedding E(t, τ), and the dimensions are mapped through a multi-layer perceptron MLP to meet the input requirements of the forecast model; S4: Model training and optimization: Based on the constructed time embedding, the forecast model is trained to achieve short-term forecast of ocean state variables; During the training process, both time embedding and model parameters are optimized to improve forecast accuracy; S5: Forecast future ocean state variables using the trained forecast model and complete temporal embedding.
2. The prediction time coding method according to claim 1, characterized in that: The S1 specifically includes: S1-1: Decompose the forecast time into multiple time scales: year is marked as Y, month is marked as M, day is marked as D, and the number of days of forecast backward reasoning is marked as ; Among them, years are used to capture long-term trends, quarters and months are used to reflect medium-term cyclical changes, and days are used for short-term nonlinear fluctuations; S1-2: Periodic change law coding: S1-21: Cyclic changes of year, quarter, and month: For year, quarter, and month, discrete learnable Embedding vectors are used to represent them. ) and day ( ) is mapped to the corresponding discrete Embedding space and its vector representation is learned through a neural network; S1-21: Nonlinear variation of days: Number of days ( ) has nonlinear characteristics and needs to be encoded by a nonlinear function.
3. The prediction time encoding method according to claim 1, characterized in that: In S2: S2-1: Perform principal component analysis on the ocean state variable data over the years and extract The main components ( , i=1,…,10), used to indicate the changing trend of year characteristics; S2-2: Calculate weight coefficients: Generate the year using a large language model LLM with prior knowledge The corresponding weight coefficient ; This process is achieved by dimensional mapping the contextual semantic embedding generated by LLM through a multi-layer perceptron MLP: ; Among them, the LLM model generates contextual semantic embedding by inputting the prompt word "Global Ocean Status in XXX"; S2-3: Construction of year embedding: Linearly combine the principal component embedding with the weight coefficient to obtain the embedding representation of the year: At the same time, ensure that the weight coefficients meet the normalization conditions: 。 4. The prediction time encoding method according to claim 1, characterized in that: The S3 includes: S3-1: Integration of Embedding Vectors: Embedding Year , month embed , days embedded and forecast duration embedding Perform vector concatenation (⊕) and addition to obtain the complete temporal embedding representation: ; Where K is the maximum number of days into the future that the forecast model is required to forecast; S3-2: Dimension Mapping: Use a multi-layer perceptron (MLP) to further dimensionally map the integrated time embedding. MLP maps the high-dimensional embedding vector to the feature space required by the prediction model through several layers of fully connected neural networks: ; The time embedding features after dimension mapping are added to the convolutional neural network or the attention mechanism neural network as the "initial moment-interval time" joint feature information introduced into the forecasting system.
5. The prediction time encoding method according to claim 1, characterized in that: The S4 includes: S4-1: Collect and organize historical ocean state variable data, and divide them into training sets, validation sets, and test sets in chronological order to ensure the continuity and integrity of the data; S4-2: Design model architecture: Select a neural network architecture suitable for time series forecasting for model construction. The model input includes the constructed time embedding E(t, τ) and the corresponding historical state variables; S4-3: Loss function setting: Use mean square error (MSE) or other loss functions suitable for regression tasks to measure the difference between the predicted result and the true value; Optimization algorithm selection: Use gradient descent method and its variants to update parameters to ensure efficient convergence of the model; Hyperparameter tuning: Use cross-validation and grid search methods to adjust hyperparameters such as learning rate, batch size, and number of network layers to optimize model performance; S4-4: Optimization of temporal embedding: During the model training process, the temporal embedding E(t, τ) is used as part of the model input, and its parameters are optimized together with the model parameters to achieve a high degree of coupling between temporal features and forecasting tasks.
6. The prediction time encoding method according to claim 1, characterized in that: In S5: S5-1: Forecast input preparation: Based on the current time and forecast duration, construct the corresponding time embedding E(t, τ), including the encoding of year, quarter, month, day and forecast duration; S5-2: Forecast model reasoning: Input the constructed time embedding E(t, τ) and the corresponding historical state variables into the forecast model, perform forward propagation, and generate the forecast results of ocean state variables at future moments; S5-3: Result verification and optimization: Error analysis and verification of forecast results to ensure the accuracy and reliability of forecasts; based on the feedback results, further optimize model parameters and time embedding methods to improve forecast performance; S5-4: Practical application deployment: Integrate the forecast model into the actual weather or ocean forecast system to provide real-time forecast services.
Citation Information
Patent Citations
STEOF-LSTM-based marine environment element prediction method
CN113297801A
Long-time-scale sea surface temperature intelligent forecasting method
CN117114168A
Bimodal forged information detection method based on large language model
CN118171235A
New energy generation power prediction optimization system and method based on AI large model technology
CN118249314A
New energy meteorological large model construction method and device and power prediction method
CN118332937A