Typhoon wave prediction method and system based on domain adaptive large language model
By performing patch extraction, numerical embedding, and multimodal alignment on Hsig time-series data, and combining physical constraints and historical information, the problem of continuity and discreteness gap in typhoon wave prediction by large language models was solved, achieving efficient and accurate typhoon wave prediction and extreme event assessment.
Patent Information
- Application Number
- CN202610052366.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-15
- Publication Date
- 2026-05-05
AI Technical Summary
Existing technologies struggle to effectively bridge the gap between the continuity and discreteness of large language models and ocean time-series data, resulting in semantic gaps and insufficient physical consistency, making it impossible to accurately predict the multivariate nonstationarity of typhoon waves.
By performing patch extraction, numerical embedding, and discrete tokenization on the effective wave height (Hsig) time series data, a prompt sequence containing physical constraints and historical typhoon wave information is generated. Domain knowledge is used to guide the attention mechanism for multimodal alignment, and continuous Hsig prediction values are generated through sparse cross-period sampling and dimensional mapping.
It achieves efficient and accurate prediction of typhoon waves, ensuring physical consistency and long-term extrapolation capabilities, and supports error analysis and risk assessment for extreme events.
Smart Images

Figure CN121980177A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of marine disaster prediction and artificial intelligence technology, specifically relating to a typhoon wave prediction method and system based on a domain-adaptive large language model. Background Technology
[0002] Typhoons pose a threat to coastal areas. As climate change exacerbates the frequency and intensity of typhoons, accurate and timely forecasting of typhoon-induced Hsig (significant wave height) is crucial for disaster mitigation, marine engineering, and sustainable coastal management.
[0003] Traditional numerical models, such as nearshore wave simulation models for wave propagation and advanced circulation models for storm surge simulation, simulate physical processes by solving complex partial differential equations. These models provide interpretable insights into wave dynamics and storm surge propagation, but face significant limitations. The inherent nonlinearity of wave mechanisms, combined with multi-scale interactions such as wind, ocean currents, and topography, leads to computational demands exceeding real-time operational requirements. For example, a high-resolution grid simulation of the Zhejiang coast requires more than 58 hours of operation on a high-performance computing cluster. Furthermore, these models are sensitive to input uncertainties, such as wind field errors in weather forecasts, which can cause data distribution shifts and reduce long-term predictability during extreme events.
[0004] Recent advances in artificial intelligence, particularly large language models, have revolutionized time series prediction by capturing nonlinear patterns through end-to-end learning from massive historical datasets. Pre-trained on discrete text corpora, large language models exhibit emerging reasoning capabilities, bridging semantic understanding and sequential data. However, their application to continuous-valued marine time series data is hampered by a fundamental modal gap: the discrete token embeddings of large language models do not match the continuous numerical properties of variables such as Hsig. This discrepancy manifests as three key challenges: representational mismatch leads to the loss of numerical continuity during tokenization; semantic gaps lack explicit domain context to ensure physical consistency; and task adaptation requires aligning multivariate non-stationary predictions to address typhoon scenarios. Summary of the Invention
[0005] To address the issues of representation mismatch, semantic gaps and lack of physical consistency caused by the difference between continuous Hsig time-series data and discrete token modalities, as well as the need for alignment of multivariate non-stationary typhoon prediction for task adaptation, this invention proposes a typhoon wave prediction method and system based on a domain-adaptive large language model.
[0006] A typhoon wave prediction method based on a domain-adaptive large language model, as described in this invention, includes the following steps:
[0007] Step 1: Patch extraction, numerical embedding, and discrete tokenization are performed on the effective wave height Hsig time series data to bridge continuous wave data and discrete token modes.
[0008] Step 2: Generate a prompt sequence containing physical constraints and historical typhoon wave information. By introducing domain knowledge to guide the attention mechanism, the spatiotemporal context of the model is provided.
[0009] Step 3: Align the discrete tokens obtained in Step 1 with the hint sequence generated in Step 2 in a multimodal manner, and generate a unified fused embedding by fusing the patch embedding and hint embedding through the reprogramming layer.
[0010] Step four: Based on the fusion embedding generated in step three, sparse cross-period sampling is used to decouple trend and periodicity, and feature compression of the input sequence is achieved.
[0011] Step 5: Perform dimension mapping on the fused features processed in Step 4. By adjusting the dimensions of the sampled features to match the preset prediction window, the spatial expressiveness of the features is enhanced.
[0012] Step 6: Based on the fusion features mapped in Step 5, extract the prediction window portion, generate continuous Hsig prediction values, and support long-period extrapolation.
[0013] Step 7: Based on the predicted sequence derived in Step 6, perform Hsig prediction and extreme event assessment, reverse the predicted sequence to the original scale, and perform error analysis and risk assessment of extreme events based on preset thresholds.
[0014] A typhoon wave prediction system based on a domain-adaptive large language model, as described in this invention, includes:
[0015] The input embedding module is used to perform patch extraction, numerical embedding, and discrete tokenization processing on the significant wave height Hsig time series data to bridge continuous wave data and discrete token modes.
[0016] The prompt generation module is used to generate prompt sequences containing physical constraints and historical typhoon wave information. By introducing domain knowledge to guide the attention mechanism, it provides the model with spatiotemporal context.
[0017] The reprogramming layer is used to perform multimodal alignment between the discrete tokens output by the input embedding module and the prompt sequence output by the prompt generation module, and to fuse the patch embedding and the prompt embedding to generate a unified fused embedding.
[0018] The large language model processing module is used to fuse and embed the output of the reprogramming layer, employing sparse cross-period sampling to decouple trends and periodicity, and to achieve feature compression of the input sequence.
[0019] The feature enhancement module is used to perform dimension mapping on the fused features compressed by the large language model processing module. By adjusting the dimension of the sampled features to match the preset prediction window, the spatial expressive power of the features is enhanced.
[0020] The time series model processing module is used to extract the prediction window portion from the fused features mapped by the feature enhancement module, generate continuous Hsig prediction values, and support long-period extrapolation.
[0021] The task execution module is used to perform Hsig prediction and extreme event assessment on the predicted sequence output by the time series model processing module, reverse the predicted sequence to the original scale, and perform error analysis and risk assessment of extreme events based on preset thresholds.
[0022] This invention is based on the Time-LLM framework. It achieves alignment between numerical patches and hint embeddings by reprogramming the fusion layer, injects physical constraints into the large language model for time series prediction in the marine domain, ensures physical consistency of the output, and integrates an interpretable evaluation module to achieve efficient Hsig prediction. Attached Figure Description
[0023] Figure 1 A flowchart illustrating the architecture of a typhoon wave prediction system based on a domain-adaptive large language model.
[0024] Figure 2 Example diagram of the model structure of a typhoon wave prediction system based on a domain-adaptive large language model;
[0025] Figure 3 Explanatory analysis diagrams for SHAP, including waterfall diagrams and bee colony diagrams; Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the embodiments described herein are for illustrative purposes only and are not intended to limit the invention.
[0027] The typhoon wave prediction method based on a domain-adaptive large language model provided in this application includes the following steps:
[0028] Step 1 involves patch extraction, numerical embedding, and discrete tokenization of the Hsig time series data. This step involves patch embedding and standardization of the Hsig time series data to bridge continuous wave data with discrete token modes.
[0029] Step 2: Generate a cue sequence containing physical constraints and historical typhoon wave information. By introducing domain-specific knowledge to guide the attention mechanism, the spatiotemporal context of the model is provided.
[0030] Step 3: Merge the patch embedding and the hint embedding by performing multimodal alignment between the discrete tokens obtained in Step 1 and the hint sequence generated in Step 2 to generate a unified fused embedding.
[0031] Step four involves processing the fusion embedding, specifically employing sparse cross-period sampling to decouple trends and periodicity, and to achieve feature compression of the input sequence.
[0032] Step 5: Perform dimensional mapping on the fused features. By adjusting the dimensions of the sampled features to match the preset prediction window, the spatial expressiveness of the features is enhanced.
[0033] Step 6: Derive the prediction sequence, extract the prediction components based on the mapped features, generate continuous Hsig prediction values and support long-term extrapolation requirements.
[0034] Step 7: Perform Hsig prediction and extreme event assessment, reverse the predicted sequence to the original scale, and perform error analysis and risk assessment of extreme events based on preset thresholds.
[0035] In some embodiments, step one involves patch extraction, numerical embedding, and discrete tokenization of the Hsig time series data, specifically including:
[0036] First, a reversible instance standardization method is used to standardize the multivariate inputs, including Hsig, lagged Hsig, wind speed, and daily markers, so that the data mean is zero and the standard deviation is a unit value, in order to eliminate non-stationarity and support inverse recovery. On this basis, the standardized Hsig time series data is divided into continuous overlapping patches of length 96 (which can be adjusted up or down as needed in long-range forecasting) to capture short-term wave cycles.
[0037] Subsequently, each patch is mapped to a 128-dimensional embedding space using a multilayer perceptron, and the embedding is quantized into discrete tokens of size 10,000 using vector quantization to minimize quantization error and preserve information integrity.
[0038] Preferably, the patch embedding layer uses a patch division with a step size of 8.
[0039] Preferably, patch extraction employs an overlapping step size to cover local dynamics and maintains gradient smoothness through residual connections.
[0040] Preferably, the numerical embedding employs a two-layer feedforward network with ReLU activation to capture hierarchical patterns and adapt to multivariate inputs.
[0041] In some embodiments, in step two, based on the Hsig time-series data processed in step one, a prompt sequence containing physical constraints and historical typhoon wave information is generated, specifically including:
[0042] The Hsig input statistics are extracted as the basic input, including minimum, maximum, median, lag, trend and quantile. On this basis, physical terms are constructed to describe shallow water continuity equations such as water depth change balance and wind-driven flux divergence. At the same time, context terms are constructed including typhoon metadata such as path and maximum wind speed. The enhanced prompts are tokenized using a tokenizer to form a connection sequence, thereby injecting physical consistency constraints and enhancing the domain semantics of the prompts.
[0043] Preferably, the lag values are used to calculate the top_k value via fast Fourier transform to capture periodic dependencies.
[0044] Preferably, the prompt sequence length is fixed at 50 tokens, and semantic alignment is enforced by cosine similarity (threshold > 0.85) in the embedding space.
[0045] Preferably, the cue sequence utilizes historical typhoon archives to generate event-specific descriptions, including peak event patterns, to provide causal guidance and improve forecast robustness.
[0046] Preferably, the historical typhoon data comes from the records of the China Meteorological Administration, including events from 2017 to 2025. The regional topography and forced asymmetry are represented in a structured manner, and a knowledge graph is constructed, including nodes as paths and events, and edges as peak associations.
[0047] Preferably, the quantile of the Hsig input statistics is the 95th quantile, calculated by the quantile function or approximated by the empirical cumulative distribution function, to highlight extreme tail features.
[0048] In some embodiments, in step three, the discrete token obtained in step one is fused with the prompt sequence generated in step two, specifically including:
[0049] The discrete tokens are projected to a query, and the token embeddings are mapped from 128 dimensions to a multi-head key-value space through a linear layer to generate a query vector. Simultaneously, the cue sequence is projected to a key-value space through a linear layer to generate key and value vectors. Based on this, an attention score is calculated through a multi-head attention mechanism, which is to use the dot product of the query and the key, normalized by softmax, and then weighted into a value vector. The weighted sum is then used to generate a fused embedding through the output projection layer, thereby achieving cross-modal alignment between the tokens and the cue.
[0050] Preferably, the multi-head attention mechanism includes 8-head parallel computation and an attention dropout rate of 0.1 to prevent overfitting and improve generalization ability.
[0051] Preferably, the query projection is a linear layer from the embedding dimension to d_keys multiplied by n_heads to accommodate multi-head parallel computation.
[0052] Preferably, the key-value projection is a linear layer from the hint dimension to d_keys multiplied by n_heads to ensure that the key-value space is consistent with the query.
[0053] In some embodiments, in step four, sparse cross-period sampling processing is performed based on the fused embedding generated in step three, specifically including:
[0054] The signal is decomposed into frequency components using Fourier transform to identify the dominant daily and semi-daily cycles. Based on this, the trend component is extracted by low-pass filtering. 20% of the data points are retained by subsampling with a quantile threshold of 0.8, thereby decoupling the trend from the periodicity and compressing the sequence by 70% to emphasize non-periodic driving and reduce computational overhead.
[0055] Preferably, sparse sampling employs a random dropout rate of 0.1 during training and determinism during inference to ensure repeatability.
[0056] Preferably, the sampling index is based on maximizing trend variance to prioritize aperiodic drivers such as typhoon asymmetric forcing.
[0057] In some embodiments, in step five, based on the fused features processed in step four, dimensional mapping is performed on the fused features, specifically including:
[0058] The feature is flattened starting from the penultimate dimension to compress the sequence dimension. Then, a linear layer is used to map the feature to the prediction window dimension to adjust the feature shape and match the requirements of downstream tasks.
[0059] Preferably, the linear layer is from nf to pred_len with a dropout rate of 0.1 to achieve dimension transformation and introduce regularization.
[0060] Preferably, the dimension mapping is integrated with Huber loss optimization with a threshold of 1.0 to improve robustness to outliers.
[0061] Preferably, Huber loss optimization incorporates a physical constraint integral term with a weighting coefficient of 0.1 to force the output to conform to physical conservation.
[0062] In some embodiments, in step six, the predicted sequence is derived based on the fused features mapped in step five, specifically including:
[0063] The prediction window portion is extracted from the fused features, and an Hsig prediction sequence is generated based on it. Zero-padding pre-prediction is supported, which means that the prediction label sequence is padded with zero values to expand the input length, thereby achieving long-term prediction. The prediction is performed by an autoregressive decoder, combined with inverse vector quantization to recover continuous values.
[0064] Preferably, the prediction sequence supports 720 steps of extrapolation to cover the entire cycle of typhoon events.
[0065] Preferably, the extraction employs inverse normalization to restore the original scale and ensure prediction consistency.
[0066] In some embodiments, in step seven, based on the predicted sequence derived in step six, Hsig prediction and extreme event assessment are performed, specifically including:
[0067] The predicted sequence is inversely normalized, and the original units are restored using a scaler fitted to the dataset. The mean absolute error of extreme events is then calculated on this basis to quantify the accuracy of extreme event predictions. Inference is generated using zero-sample autoregression and combined with an ensemble average of 5 cue variants to reduce variance by 8%.
[0068] Preferably, the extreme event threshold can be calculated using the 95th quantile through an empirical cumulative distribution function or a quantile function to ensure that the threshold adapts to the distribution of different buoy sites.
[0069] Preferably, an integrated SHAP gradient attribution is performed to calculate feature importance based on attention weights, in order to reveal the model's decision-making process.
[0070] Preferably, SHAP attribution includes the calculation of the contribution values of lag Hsig and day markers to assess the impact of key inputs.
[0071] Preferably, the SHAP gradient attribution calculation includes a contribution decomposition of the model output minus the expected value to provide interpretable feature attribution.
[0072] Preferably, the physical constraints of the prompt generation module include shallow water equation continuity and momentum equation to ensure physical consistency of the prediction.
[0073] Preferably, the continuity of the shallow water equation is constrained by the continuity of the water level and velocity field to maintain mass conservation.
[0074] Preferably, the momentum equation includes a velocity vector and a wind stress term to simulate wind-driven dynamics.
[0075] Based on the same concept as the above method, this application also provides a typhoon wave prediction system based on a domain-adaptive large language model, including: an input embedding module, a prompt generation module, a reprogramming layer, a large language model processing module, a feature enhancement module, a time series model processing module, and a task execution module.
[0076] The input embedding module is used to perform patch embedding and standardization processing on Hsig time series data.
[0077] In some embodiments, the input embedding module standardizes the Hsig time series data so that the mean is zero and the standard deviation is a unit value, and divides the Hsig time series data into consecutive overlapping patches with a patch length of 96 (which can be adjusted up or down as needed in long-range forecasting).
[0078] Preferably, the standardization process employs a reversible instance standardization method to support subsequent reverse recovery and preserve data distribution characteristics.
[0079] Preferably, the input embedding module further includes a patch embedding layer for mapping the Hsig sequence to the embedding space.
[0080] Preferably, the patch embedding layer uses a patch division with a step size of 8.
[0081] The prompt generation module is used to generate a prompt sequence that includes physical constraints and historical typhoon wave information.
[0082] In some embodiments, the prompt generation module enhances the initial description, generates a prompt sequence, extracts Hsig input statistics including minimum, maximum, median, lag, trend and quantile, constructs a prompt template based on physical constraints and historical typhoon wave information, including shallow water equation continuity and momentum equation as well as historical typhoon paths and peak event patterns, and tokenizes the enhanced prompts using a tokenizer.
[0083] Preferably, the lag value is used to calculate the top_k value through a fast Fourier transform.
[0084] Preferably, the prompt generation module uses historical typhoon data to generate a context description, including the path and event patterns where Hsig is greater than a threshold.
[0085] Preferably, a knowledge graph is constructed from historical typhoon data, with nodes representing paths and events, and edges representing peak associations.
[0086] Preferably, the quantile of the Hsig input statistics is the 95th quantile, calculated by the quantile function or approximated by the empirical cumulative distribution function, to highlight extreme tail features.
[0087] The reprogramming layer is used to merge patch embedding with prompt embedding.
[0088] In some embodiments, the reprogramming layer performs query projection on the patch embedding and key-value projection on the cue embedding. It calculates the attention score through a multi-head attention mechanism, that is, it uses the dot product of the query and the key, normalized by softmax, and then performs a weighted summation. The output projection layer is used to generate the fused embedding, thereby achieving cross-modal alignment between the patch and the cue.
[0089] Preferably, the multi-head attention mechanism includes an attention dropout rate of 0.1.
[0090] Preferably, the query projection is a linear layer from d_model to d_keys multiplied by n_heads.
[0091] Preferably, the key-value projection is a linear layer from d_llm to d_keys multiplied by n_heads.
[0092] The large language model processing module is used to handle fused embeddings.
[0093] In some embodiments, the large language model processing module is based on the Time-LLM architecture, utilizes LoRA fine-tuning to process fusion embeddings, mines sequence features, and achieves zero-sample extrapolation.
[0094] Preferably, LoRA fine-tuning is applied to the GPT2 model with 6 hidden layers and 768 dimensions.
[0095] The feature enhancement module is used to perform dimensional mapping on the fused features.
[0096] In some embodiments, the feature enhancement module flattens the fused features, starting from the penultimate dimension, and maps them to the prediction window dimension using a linear layer.
[0097] Preferably, the feature enhancement module further includes a dropout layer for regularizing the fused features.
[0098] Preferably, the linear layers range from nf to pred_len, with a dropout rate of 0.1.
[0099] Preferably, the feature enhancement module integrates Huber loss optimization with a threshold of 1.0.
[0100] Preferably, the Huber loss optimization incorporates a physical constraint integral term with a weighting coefficient of 0.1.
[0101] The time series model processing module is used to derive the predicted sequence.
[0102] In some embodiments, the time series model processing module extracts the prediction window portion from the fused features to generate the Hsig prediction sequence, supporting zero-filling pre-preparation.
[0103] Preferably, the predicted label sequence is pre-filled with zero values before zero-filling.
[0104] Preferably, the predicted sequence supports 720 steps of extrapolation.
[0105] Preferably, the extraction is performed using a Normalize denorm in reverse processing.
[0106] The task execution module is used to perform Hsig prediction and extreme event assessment.
[0107] In some embodiments, the task execution module inversely normalizes the prediction sequence and calculates the mean absolute error of extreme events.
[0108] Preferably, the extreme event threshold can be calculated using the 95th quantile through an empirical cumulative distribution function or a quantile function to ensure that the threshold adapts to the distribution of different buoy sites.
[0109] Preferably, inverse normalization uses a standard scaler fitted to the training set.
[0110] Preferably, the task execution module integrates SHAP gradient attribution and calculates feature importance based on attention weights.
[0111] Preferably, SHAP attribution includes the calculation of the contribution values of hysteresis Hsig and day markers.
[0112] Preferably, the SHAP gradient attribution calculation includes a contribution decomposition of the model output minus the expected value.
[0113] Preferably, the physical constraints of the prompt generation module include the shallow water equation continuity and the momentum equation.
[0114] Preferably, the continuity of the shallow water equation is constrained by the continuity of the water level and velocity field.
[0115] Preferably, the momentum equation includes a velocity vector and a wind stress term.
[0116] Example 1 Data Preparation
[0117] This embodiment provides the preparation process for Hsig time-series data, used to train a typhoon wave prediction system based on a domain-adaptive large language model. The data comes from eight buoy stations in Zhejiang Province, spanning from 2017 to 2025, with a total sample size of approximately 80,000. Hsig values are recorded hourly.
[0118] The input embedding module is used to perform patch embedding and standardization on Hsig time series data. Its working principle is to eliminate non-stationarity by standardization and divide the sequence into patches to capture local patterns.
[0119] First, the data is cleaned to remove missing values and outliers. Outliers are defined as Hsig values less than 0.1 meters or greater than 10 meters, with a proportion of less than 2%. Then, a reversible instance standardization method is used to standardize the Hsig time-series data, ensuring a mean of zero and a unit standard deviation. This method standardizes the data by calculating the mean and variance, facilitating subsequent inverse recovery. The formula is as follows:
[0120]
[0121] in, This represents Hsig time series data. and These are the mean and variance, respectively. and For trainable parameters, To prevent division by zero by small constants, the standardized Hsig time series data are merged into a univariate sequence pool. Sample time points are selected based on time boundary-based training, validation, and testing splits to avoid sampling bias. The formula is as follows:
[0122]
[0123]
[0124]
[0125] The sequence is further divided into consecutive overlapping patches of length 16, each patch capturing local temporal patterns, such as diurnal cyclical fluctuations. Auxiliary variables, including wind speed, wind direction, and atmospheric pressure, are extracted from the European Medium-Range Weather Forecasts, Fifth Reanalysis (ERT) data to ensure multivariate consistency. Extreme events comprise 20% of the sample, including events with peak Hsig thresholds, such as Typhoon Gaemi in 2024 and Typhoon Khanun in 2023, to enhance the model's robustness to non-stationary dynamics. The preprocessed dataset is divided into a 70% training set, a 15% validation set, and a 15% test set, stored in CSV format for easy loading into the input embedding module.
[0126] like Figure 1 As shown in the figure, this diagram illustrates the overall workflow framework of a typhoon wave prediction system based on a domain-adaptive large language model (LLM) in disaster response. Given an input time series, it is first segmented and embedded through ① fragmentation and ② a customized embedding layer. ③ Subsequently, these fragment embeddings are reprogrammed using condensed text prototypes to achieve alignment between the two modalities. To enhance the reasoning capability of the large language model (LLM), ④ additional cue prefixes are added to the input to guide the transformation of input fragments. ⑤ Finally, the fragments output by the LLM are projected to generate the final prediction result.
[0127] Example 2 Model Training
[0128] This embodiment describes the training process of a typhoon wave prediction system based on a domain-adaptive large language model. It uses the Time-LLM architecture as a base and performs LoRA fine-tuning to adapt to the marine domain. The training environment is Python 3.10, equipped with an NVIDIA A100 graphics processor, with a batch size of 32 and a learning rate of 1e-4.
[0129] The prompt generation module generates prompt sequences that include physical constraints and historical typhoon wave information. Its working principle is to extract input statistics and construct templates to inject domain context.
[0130] First, a pre-trained GPT2 model is loaded as the core of the large language model processing module, with the parameter size compressed to less than 1000. The prompt generation module constructs a graph structure from an external knowledge database, enhances the initial description using a word segmenter, and generates prompt sequences. It extracts Hsig input statistics, including minimum, maximum, median, lag values, trend, and quantiles. Based on physical constraints and historical typhoon wave information, it constructs prompt templates, including shallow water equation continuity and momentum equations, as well as historical typhoon paths and peak event patterns. The lag value is calculated using a Fast Fourier Transform (FFT) to obtain the top_k value, with the formula:
[0131]
[0132]
[0133]
[0134]
[0135]
[0136]
[0137] The trend is calculated as follows:
[0138]
[0139] The enhanced prompts are tokenized using a tokenizer to generate:
[0140]
[0141] The reprogramming layer's role is to fuse patch embeddings and cue embeddings. Its working principle is to achieve cross-modal alignment through a multi-head attention mechanism. The patch embedding layer maps the Hsig sequence to the embedding space, generates `enc_out`, calculates attention scores through query projection and key-value projection, performs a weighted summation, and uses the output projection layer to generate the fused embedding. The formula is as follows:
[0142]
[0143]
[0144]
[0145]
[0146]
[0147]
[0148]
[0149] The multi-head attention mechanism includes an attention dropout rate of 0.1.
[0150] The large language model processing module handles fusion embeddings, and its working principle is to mine sequence features using an LLM backbone. The fusion embeddings are input into the GPT2 model to generate...
[0151]
[0152] Supports zero-sample extrapolation.
[0153] The feature enhancement module performs dimensional mapping on the fused features. Its working principle involves flattening and linearly mapping to match the prediction window. The fused features are flattened, starting from the penultimate dimension, and mapped to the prediction window dimension using a linear layer, as shown in the formula:
[0154]
[0155]
[0156]
[0157] The feature enhancement module further includes a dropout layer for regularizing the fused features.
[0158] The feature enhancement module is optimized using the Huber loss function with a threshold of 1.0. Combined with physical constraints, the total loss weight coefficient is 0.1, as shown in the formula.
[0159]
[0160] The training iterations were performed for 200 epochs using the AdamW optimizer with a weight decay of 0.01.
[0161] like Figure 2As shown in the figure, this diagram illustrates the overall process of the model architecture for a typhoon wave prediction system based on a domain-adaptive large language model, used for Hsig prediction. Part (a) describes patch extraction and RevIN normalization (input is univariate time-series data, B=8, seq_len=24, pred_len=24), including overlapping patch extraction to capture local patterns; part (b) demonstrates the mechanism for cross-attention reprojection to GPT2, injecting physical cues to achieve modality alignment; part (c) represents the decoder block with zero-padding future input and output projections, supporting zero-sample extrapolation; solid arrows represent the main data flow, and dashed arrows represent sparse cross-period sampling. This diagram explains how continuous Hsig data and discrete LLM tokens are bridged through patch layers, multi-head attention, and physical constraint cues to ensure physical consistency and efficient training.
[0162] Example 3 Predictive Application
[0163] This embodiment demonstrates the application of a typhoon wave prediction system based on a domain-adaptive large language model in short- and long-term prediction and extreme event detection, and is tested on the test set of the Zhejiang Province buoy dataset.
[0164] The temporal model processing module derives the prediction sequence. Its working principle involves extracting a prediction window from the fused features to generate an Hsig sequence. Short-term prediction targets a 96-step horizon, taking the most recent historical Hsig sequence as input and outputting a prediction curve. Long-term prediction extends to 720 steps. The temporal model processing module extracts the prediction window from the fused features to generate the Hsig prediction sequence, supporting zero-padded pre-preparation, which fills the prediction label sequence with zero values.
[0165] The task execution module performs Hsig prediction and extreme event assessment. Its working principle involves inverse standardization of the output and calculation of threshold error. At the Wenzhou Dongtou station, it calculates the scaled mean square error and mean absolute error, corresponding to the physical root mean square error. Extreme event detection focuses on extreme events (defined as Hsig values greater than the adopted quantile threshold), and the conditional mean absolute error is calculated. The task execution module inverse standardizes the predicted sequence, using a standard scaler fitted to the training set, with the formula:
[0166]
[0167] The mean absolute error for extreme events (defined as Hsig greater than the adopted quantile threshold) is calculated using the following formula:
[0168]
[0169]
[0170] in Calculated dynamically using the quantile function.
[0171] For example, in the case of Typhoon Gaemi, the peak value Hsig 5.5-meter offset and subsequent peak attenuation offset were calculated. Cross-site generalization testing was performed, training at Zhujiajian station and testing at Wenzhou Dongtou and Dongji stations, calculating the mean squared error. The prediction model supports zero-sample extrapolation, requiring no real labels, with inference time in the sub-second range.
[0172] Multi-site average performance calculations show that the system calculates indicators across all eight buoys, with the lowest mean square error and mean absolute error calculated at the Wenzhou Dongtou station. Extrapolated indicators are calculated using a forward-looking model variant. These processes confirm the system's practicality in real-time coastal warnings.
[0173] Example 4: Explanatory Analysis
[0174] This embodiment describes the interpretive analysis process of a typhoon wave prediction system based on a domain-adaptive large language model. Gradient basis attribution is applied to attention weights to reveal feature dynamics. The analysis environment is Python 3.10, integrating SHAP library version 0.45.0, and approximately 48 samples are used in the test subset.
[0175] The task execution module performs SHAP analysis, which works by calculating feature importance based on attention weights. SHAP analysis first calculates the attention gradient, identifies the lag Hsig and time markers (e.g., hours) as the dominant influencing factors for the daily cycle, and then calculates the SHAP value. The bee swarm graph calculation is positively dependent on the daily cycle peak hour; a SHAP greater than 0.5 reflects tidal amplification, while a negative dependency on non-typhoon workdays reduces noise. The scatter plot calculation shows an Hsig greater than 5 meters of saturation, indicating the model's conservatism in unknown extremes.
[0176] The waterfall plot decomposes the prediction for the Gaemi peak event, calculating the cumulative contribution attributable to physical cues such as the continuity of the shallow water equation and the momentum equation, ensuring mass conservation and mitigating non-physical inrushes such as predicted water levels greater than 8 meters. It also attempts to compute interactions of local features, prompting predictions to move towards physical limits and reducing violations such as negative water level contrasts with baselines. These visualization calculations build trust and reveal biases, such as insufficient emphasis on topography due to univariate settings, guiding refinement.
[0177] like Figure 3As shown, this figure illustrates the interpretive analysis results of SHAP, including the waterfall plot on the left (for the predictive decomposition of f(x)=1.211, highlighting the positive / negative contributions of features such as wind speed, wind direction, and hysteresis Hsig, e.g., wind speed of 3.9 m / s contributes +0.0505) and the bee swarm plot on the right (feature importance distribution, showing the impact of wave height, wind speed, and pressure on the model output; SHAP values range from -1.0 to +1.5, with high values indicating strong positive correlations). This figure explains the model's decision-making process, such as the conservative predictive role of hysteresis wave height on extreme events (negative SHAP values indicate suppression of overestimation), and how physical cues improve interpretability and ensure the robustness of predictions in Typhoon Gaemi.
[0178] In scenarios with low data generalization, the root mean square error of the transfer is calculated, and the SHAP value calculation highlights the mitigation of distribution offsets, such as the variance between a bay mouth and an open coastline. In extreme settings, gradient amplification is calculated to indicate its impact. These processes confirm the system's robustness and pinpoint its operational deployment potential.
[0179] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A typhoon wave prediction method based on a domain-adaptive large language model, characterized in that, Includes the following steps: Step 1: Patch extraction, numerical embedding, and discrete tokenization are performed on the effective wave height Hsig time series data to bridge continuous wave data and discrete token modes. Step 2: Generate a prompt sequence containing physical constraints and historical typhoon wave information. By introducing domain knowledge to guide the attention mechanism, the spatiotemporal context of the model is provided. Step 3: Align the discrete tokens obtained in Step 1 with the hint sequence generated in Step 2 in a multimodal manner, and generate a unified fused embedding by fusing the patch embedding and hint embedding through the reprogramming layer. Step four: Based on the fusion embedding generated in step three, sparse cross-period sampling is used to decouple trend and periodicity, and feature compression of the input sequence is achieved. Step 5: Perform dimension mapping on the fused features processed in Step 4. By adjusting the dimensions of the sampled features to match the preset prediction window, the spatial expressiveness of the features is enhanced. Step 6: Based on the fusion features mapped in Step 5, extract the prediction window portion, generate continuous Hsig prediction values, and support long-period extrapolation. Step 7: Based on the predicted sequence derived in Step 6, perform Hsig prediction and extreme event assessment, reverse the predicted sequence to the original scale, and perform error analysis and risk assessment of extreme events based on preset thresholds.
2. The method according to claim 1, characterized in that, The patch extraction described in step one uses a continuous overlapping partition with a length of 16 and a step size of 8, and the data mean is zero and the standard deviation is a unit value through reversible instance standardization.
3. The method according to claim 1 or 2, characterized in that, The prompt sequence described in step two is constructed by extracting the minimum, maximum, median, lag, trend and quantile of the Hsig input statistics, and coupling them with the shallow water equation continuity, momentum equation and historical typhoon path and peak event patterns.
4. The method according to claim 3, characterized in that, The lag value is obtained by calculating the top_k value using Fast Fourier Transform. The historical typhoon data is organized in the form of a knowledge graph, where nodes represent paths and events, and edges represent peak associations.
5. The method according to claim 1, characterized in that, Step 3 utilizes the reprogramming layer to embed and map the patch into the multi-head key-value space through linear query projection, and calculates the attention score through the multi-head attention mechanism to achieve cross-modal alignment of tokens and hints.
6. The method according to claim 5, characterized in that, The multi-head attention uses 8 heads in parallel, with an attention dropout rate of 0.
1. The query, key, and value projection dimensions are consistent and implemented in a linear layer.
7. The method according to claim 1, characterized in that, Step four describes sparse cross-cycle sampling that identifies the dominant daily and semi-daily cycles through Fourier transform and retains 20% of the data points by subsampling with a 0.8 quantile threshold, thereby decoupling the trend from the periodicity and compressing the sequence by 70%.
8. The method according to claim 1, characterized in that, Step 5 describes a dimension mapping process that flattens the data starting from the penultimate dimension and maps the features to the prediction window dimension through a linear layer. The mapping process incorporates regularization with a dropout rate of 0.
1.
9. The method according to claim 1, characterized in that, The predicted sequence described in step six pre-padding the label sequence with zeros and supports 720-step zero-sample extrapolation. The extraction process uses inverse normalization to restore the original scale and ensure prediction consistency.
10. A typhoon wave prediction system based on a domain-adaptive large language model, characterized in that, include: The input embedding module is used to perform patch extraction, numerical embedding, and discrete tokenization processing on the significant wave height Hsig time series data to bridge continuous wave data and discrete token modes. The prompt generation module is used to generate prompt sequences containing physical constraints and historical typhoon wave information. By introducing domain knowledge to guide the attention mechanism, it provides the model with spatiotemporal context. The reprogramming layer is used to perform multimodal alignment between the discrete tokens output by the input embedding module and the prompt sequence output by the prompt generation module, and to fuse the patch embedding and the prompt embedding to generate a unified fused embedding. The large language model processing module is used to fuse and embed the output of the reprogramming layer, employing sparse cross-period sampling to decouple trends and periodicity, and to achieve feature compression of the input sequence. The feature enhancement module is used to perform dimension mapping on the fused features compressed by the large language model processing module. By adjusting the dimension of the sampled features to match the preset prediction window, the spatial expressive power of the features is enhanced. The time series model processing module is used to extract the prediction window portion from the fused features mapped by the feature enhancement module, generate continuous Hsig prediction values, and support long-period extrapolation. The task execution module is used to perform Hsig prediction and extreme event assessment on the predicted sequence output by the time series model processing module, reverse the predicted sequence to the original scale, and perform error analysis and risk assessment of extreme events based on preset thresholds.
