Summary
Influenza-like illness (ILI) remains a persistent global health challenge, necessitating accurate forecasting tools for timely public health response. This study systematically benchmarks fine-tuned large language models (LLMs), e.g., Llama2 and GPT2, for influenza surveillance forecasting in data-limited time-series settings. We develop a lightweight fine-tuning framework that adapts pre-trained LLMs using compact embedding and prediction layers and evaluate it on seven weekly aggregated real-world surveillance datasets. Despite sample sizes of only ∼523 time points per region and the absence of cloud-based data transfer, fine-tuned LLMs consistently outperform SARIMA, LSTM, PatchTST, CoVTransformer, FEDformer, Time-LLM, and GPT4TS in both accuracy and stability, especially for long-term forecasts across diverse geographic settings. Even in zero-shot settings, pre-trained LLMs capture broad epidemic trends with performance comparable to SARIMA. These findings establish fine-tuned LLMs as efficient and robust forecasting tools suitable for privacy-sensitive, data-scarce public health applications.
Keywords: influenza-like illness, large language models, data-limited learning, fine-tuning, influenza forecasting, zero-shot forecasting, time-series forecasting, public health surveillance
Graphical abstract

Highlights
-
•
We develop a lightweight fine-tuning framework for LLM-based influenza forecasting
-
•
Compact trainable layers adapt pre-trained LLMs to limited surveillance data
-
•
Fine-tuned LLMs improve forecasting accuracy and stability
-
•
LLM-based forecasting supports privacy-sensitive and data-scarce public health deployment
Motivation
Accurate forecasting of influenza-like illness is essential for timely surveillance, resource allocation, and public health decision-making. Existing statistical and deep learning methods remain challenged by limited weekly surveillance data, regional heterogeneity, and privacy or computational constraints, while large language models offer an opportunity to leverage pre-trained sequential representations. This study aims to explore the adaptation of pre-trained large language models for influenza forecasting in data-limited surveillance settings.
Accurate influenza-like illness forecasting is essential for timely public health response but is often limited by scarce and privacy-sensitive surveillance data. Li et al. show that lightweight fine-tuning adapts pre-trained large language models to provide accurate and stable forecasts across diverse real-world surveillance datasets.
Introduction
Influenza-like illness (ILI) remains a significant public health challenge, causing widespread illness and straining healthcare systems worldwide. Each year, seasonal influenza leads to an estimated one billion cases and 290,000 to 650,000 respiratory-related deaths globally.1 Influenza forecasting, the prediction of future influenza trends based on historical data, supports public health decision-making by providing early warnings, guiding resource allocation, and enabling timely interventions to reduce the societal burden of influenza.
Influenza forecasting has been extensively studied.2,3 Traditional statistical models, such as the seasonal autoregressive integrated moving average (SARIMA),4 remain widely used due to their strong theoretical foundation and effectiveness in simple, linear time series settings.5 However, these models struggle with nonlinear, non-stationary patterns and perform poorly for long-term forecasts, limiting their utility for seasonal influenza planning.6 Machine learning and deep learning models, including long short-term memory (LSTM)7 networks and Transformer-based models,8 have been increasingly adopted for capturing complex temporal dynamics and long-term dependencies,9,10,11,12,13,14,15 including recent architectures such as CoVTransformer10 and FEDformer.11 However, their reliance on large-scale datasets presents challenges for influenza forecasting, where datasets are often small-scale and typically consist of weekly summary reports.2 This mismatch highlights the need for forecasting models that can learn from limited data, capture complex epidemic dynamics,16 and operate locally to uphold data privacy.
The rapid evolution of large language models (LLMs) has transformed natural language processing and now extends to complex tasks beyond textual analysis. Recent studies demonstrate the emerging potential of LLMs in public health research, including detecting RNA viruses,17 predicting inpatient and intensive care unit mortality,18 leveraging multilingual social media analytics for emergency public health decision-making,19 enhancing health care communication,20 and medical question answering.21 In time-series forecasting, pioneering works such as Time-LLM22 and GPT4TS23 provide early evidence that LLMs perform effectively in both fine-tuned and zero-shot settings, using ILI data as illustrative case studies. Conceptually, LLMs are well suited for ILI forecasting. Self-attention can model multi-scale, long-range temporal dependencies, and pretraining is hypothesized to yield generalizable temporal representations that may improve data efficiency. However, their application in influenza forecasting remains limited, underscoring the need for systematic exploration and rigorous validation.
To address these challenges, this study presents a fine-tuning framework for pre-trained LLMs, namely Llama2 and GPT2, designed for influenza activity forecasting. The task is formulated as a multi-step time series forecasting problem, where historical data from the preceding 52 weeks are used to predict influenza activity over the following 13 weeks. To adapt LLMs for this task, we design a domain-specific architecture adapted to the characteristics of influenza surveillance data. Relative to existing LLM-based forecasting approaches that update Transformer backbones (e.g., GPT4TS), the architecture introduces an adapter layer to transform the learned sequence representation before the prediction layer outputs a 13-week prediction vector. Fine-tuning updates only the embedding and prediction layers, while keeping the transformer blocks of the pre-trained LLMs frozen. Training uses a sliding window to generate overlapping patches, capturing both short- and long-term dependencies. We evaluate this framework against SARIMA, LSTM, PatchTST,9 CoVTransformer, FEDformer, Time-LLM, and GPT4TS on seven real-world datasets, where fine-tuned LLMs consistently outperform all baselines. Their accuracy and robustness, especially in long-term forecasts, demonstrate their practicality for deployment in data-limited and privacy-sensitive public health environments.
Results
Fine-tuning framework overview and evaluation setup
The fine-tuning framework (Figure 1) begins by partitioning the input dataset into non-overlapping training, validation, and testing subsets. A one-step sliding window approach is applied to the training data to generate overlapping input-output pairs. This design ensures that each time point appears in multiple temporal contexts, enhancing the model’s ability to capture both transient fluctuations and persistent trends in influenza activity. Each input instance comprises a 52-week sequence of normalized influenza metrics, which are transformed via a temporal embedding module into a dense representation suitable for integration with pre-trained LLMs. The core LLM backbone—either Llama2 or GPT2—remains frozen during training, preserving its general-purpose learned representations. Fine-tuning is restricted to the custom embedding layer and the task-specific adapter and forecasting layers, which map the LLM-derived representation into a 13-step prediction vector. Given the limited size of influenza surveillance series, this parameter-efficient strategy mitigates overfitting risks and reduces computational burden while allowing for effective domain adaptation.
Figure 1.

Fine-tuning architecture for LLMs
The input time series is segmented into overlapping patches for independent training and evaluation. Each patch is normalized and embedded before being passed through frozen transformer blocks of a pre-trained LLM. Fine-tuning is limited to the embedding, fully connected, and prediction layers (highlighted in red), where the fully connected layer functions as an adapter layer, enabling task adaptation from limited data points while preserving the model’s general knowledge.
Model performance is assessed on the held-out test subset using a suite of evaluation metrics, including standard error metrics to quantify prediction accuracy and Spearman and Pearson correlation coefficients to evaluate trend agreement. For benchmarking, the framework is applied across seven real-world datasets collected between 2010 and 2020 (Figure S1), enabling a systematic evaluation of model generalizability and forecasting accuracy under diverse epidemiological conditions. The fine-tuned LLMs are benchmarked against classical and state-of-the-art baselines, including SARIMA, LSTM, PatchTST, CoVTransformer, FEDformer, Time-LLM, and GPT4TS (see Methods).
Case study on the 13-week forecast from October 2019 to January 2020
The analysis centers on the ILI positive rate in Chongqing, China for the 13-week period preceding the COVID-19 outbreak, a case study selected to demonstrate the model’s practical utility in real-world forecasting. Here, the ILI positive rate denotes the weekly percentage of laboratory-tested respiratory specimens that are influenza positive. Fine-tuned Llama2 achieves the closest alignment with observed values, yielding the lowest mean absolute error (MAE) (Figure 2). It accurately predicts the first 10 out of 13 weeks, with notable deviations only in the second week, whereas other models exhibit larger errors, particularly during the fourth and ninth weeks. Across multiple evaluation metrics—including mean squared error (MSE), mean absolute percentage error (MAPE), symmetric mean absolute percentage error (SMAPE), and Spearman correlation—the fine-tuned Llama2 consistently outperforms alternative models (Table S1). Complementing this, fine-tuned GPT2 achieves the highest trend agreement as measured by Pearson correlation (Table S1). These findings underscore the predictive advantages of fine-tuned Llama2 and GPT2 in influenza forecasting, offering superior accuracy and temporal consistency relative to benchmark methods.
Figure 2.

Case study of forecasting ILI trends in Chongqing, China (October 2019–January 2020)
Using a 52-week observation window (November 2018–September 2019), each model predicts ILI positive rates for the following 13 weeks. The inset highlights the prediction accuracy of each model during the forecast period. Green-shaded regions denote time points where fine-tuned Llama2 closely aligns with the ground truth while other models deviate substantially. Orange-shaded regions indicate time points with large deviations. Among the nine models—fine-tuned Llama2, fine-tuned GPT2, SARIMA, LSTM, PatchTST, CoVTransformer, FEDformer, Time-LLM, and GPT4TS—fine-tuned Llama2 achieves the lowest MAE and highest overall accuracy.
Comprehensive benchmarking of fine-tuned LLMs on multi-regional influenza datasets
To evaluate forecasting performance more broadly, a systematic evaluation is conducted using a sliding-window approach, where a 52-week observation window is advanced weekly to predict the following 13 weeks across each testing subset (see Methods). Fine-tuned Llama2 and GPT2 consistently outperform other models across the seven real-world datasets. In terms of MAE, the two models rank first in five of the seven datasets. Specifically, fine-tuned Llama2 yields the lowest MAE in two ILI positive rate datasets from Northern China and Chongqing, while fine-tuned GPT2 performs best on ILI positive rate and ILI case datasets from Southern China and on ILI cases from Northern China. Among the remaining datasets, GPT4TS achieves the best MAE on the ILI positive rate dataset from the United States, and FEDformer achieves the best MAE on the ILI case dataset from Chongqing (Figure 3A). Evaluation using additional error metrics—MSE, MAPE, and SMAPE—further reinforces the superior performance of fine-tuned Llama2 and GPT2. While alternative models achieve top performance in a limited number of dataset-specific contexts, their performance is less consistent across metrics and datasets (Table S2). To assess the stability of ranking-based summaries, rankings were aggregated across seven datasets and four error metrics (28 dataset-metric combinations; 56 top-2 positions per run), and the full pipeline was repeated over 10 random seeds (see Methods). Fine-tuned Llama2 shows significantly higher median top-1 and top-2 ranking counts than each baseline, with increases in the median top-1 count of at least 4.5 and in the median top-2 count of at least 8.0 (Holm-Bonferroni, adjusted p ≤ 0.0005) (Figures 3B and 3C; Table S3). Fine-tuned GPT2 increases top-1 counts, whereas top-2 differences relative to the strongest baselines (e.g., FEDformer and GPT4TS) are smaller and not statistically significant (Figures 3B and 3C; Table S3). Per-run counts are provided in Table S4. These results indicate that the aggregate ranking advantage, particularly for fine-tuned Llama2, is not driven by a single random-seed run. When compared with additional two widely used Transformer-based models, Autoformer24 and Informer,25 fine-tuned Llama2 and GPT2 retained the strongest aggregate performance (Table S2). Similar results were observed when benchmarking fine-tuned LLMs against LSTM variants with varying hidden dimensions (STAR Methods, Model selection; Figure S2).
Figure 3.

Benchmarking predictive performance across seven geographically distinct datasets
(A) MAE comparisons for ILI positive rates (top row, four datasets) and ILI case counts (bottom row, three datasets), with the best and second-best models highlighted in red and blue.
(B) Number of first-place rankings per run (top-1), aggregated over 28 dataset-metric combinations across four error metrics (MAE, MSE, MAPE, and SMAPE).
(C) Total number of first- and second-place rankings per run (top-2), aggregated over the same 28 dataset-metric combinations. (B and C) report 10 repeated runs with different random seeds for learning-based methods; each dot denotes one run. Boxplots show the median (center line) and interquartile range (box), with whiskers extending to 1.5 × IQR. Statistics: one-sided Mann-Whitney U test, Holm-Bonferroni adjusted p values: ∗ ∗∗padj < 0.001, ∗∗padj < 0.01, ∗padj < 0.05; NS, not significant.
To further investigate the generalization of fine-tuned LLMs, we assessed forecasting performance under major epidemiological shifts using US ILI positive rates (2011–2023). Models were trained on pre-COVID data and evaluated on the COVID-disrupted and recovery periods of the same series (Figure 4A). During the disruption period, performance degraded for all models, particularly in correlation and relative-error metrics, yet fine-tuned GPT2 and Llama2 were comparatively more stable. In the recovery period, as ILI positivity returned toward pre-pandemic levels, performance improved across all models, with fine-tuned Llama2 leading on all six metrics (STAR Methods, evaluation during the COVID-19 pandemic; Figure 4B). These findings indicate that fine-tuned LLMs maintain greater robustness across disrupted and recovery phases under pandemic-related distributional shifts.
Figure 4.

Model performance across pre-COVID, COVID-disrupted, and recovery periods in US influenza data (2011–2023)
(A) Weekly influenza positive rates from 2011 to 2023, color-coded by period: pre-COVID (Apr 4, 2011–Mar 23, 2020, training), COVID-disrupted (Mar 30, 2020–Nov 8, 2021, testing 1), and recovery (Nov 15, 2021–May 8, 2023, testing 2). Models were trained on pre-COVID data and evaluated on the COVID-disrupted and recovery periods.
(B) Model performance on pre-COVID (Sep 4, 2017–Mar 23, 2020), COVID-disrupted, and recovery periods. Pre-COVID (Sep 4, 2017 to Mar 23, 2020) performance uses the corresponding results from the main analysis and serves as the reference baseline. During the COVID-disrupted period, all models exhibited degraded performance, with lower correlations (Spearman ρ and Pearson r) and higher relative errors (MAPE and SMAPE), while MAE and MSE were lower because observed and predicted ILI rates approached zero. Fine-tuned LLMs (GPT2, Llama2) outperformed all baselines, achieving top rankings in trend metrics (fine-tuned GPT2) and error metrics (fine-tuned Llama2) during the COVID-disrupted period, and Llama2 achieved top ranking across all six metrics in the recovery period.
Together, these findings suggest that fine-tuned Llama2 and GPT2 are among the most accurate and reliable models in this benchmarking study, highlighting the robustness of fine-tuned LLMs in influenza forecasting.
Performance across prediction lengths
Forecasting requirements in public health vary by application. Short-term forecasts are critical for outbreak detection and immediate response, whereas long-term predictions inform resource allocation and support trend analysis. To assess consistency and robustness across these use cases, model performance is evaluated across prediction lengths ranging from 1 to 13 weeks (Figure 5). Fine-tuned Llama2 achieves the highest overall accuracy and stability, yielding the lowest MAE and MSE across all prediction horizons. While other models surpass Llama2 on certain metrics at specific prediction lengths (e.g., Time-LLM on MAPE and SMAPE and LSTM on SMAPE and Spearman correlation), these deviations are modest and do not affect the overall conclusion that Llama2 exhibits the most consistent superiority across metrics and horizons, with particularly strong and stable performance at longer prediction horizons. In contrast, SARIMA exhibits substantial variability, performing well at very short prediction lengths (week 1) but deteriorating as prediction length increases. This instability is plausibly attributed to the limitations of SARIMA’s linear assumptions, which contribute to error accumulation over time and hinder its ability to model nonlinear temporal dependencies. In contrast, LLMs are well suited to capturing such nonlinearities, supporting more stable performance across a wide range of prediction lengths. These findings highlight the advantage of fine-tuned Llama2 in delivering reliable long-term forecasts, reinforcing its utility in scenarios requiring dependable multi-week forecasts.
Figure 5.

Benchmarking model performance across prediction lengths
Model accuracy and trend consistency are evaluated on the ILI positive rate dataset from Northern China over prediction lengths ranging from 1 to 13 weeks. Six evaluation metrics are reported: four error-based measures (MAE, MSE, MAPE, and SMAPE) and two correlation coefficients (Spearman and Pearson). Correlation coefficients are set to zero for a prediction length of one, where correlation is not defined.
Zero-shot performance of pre-trained LLMs in influenza forecasting
Given their strong zero-shot capabilities across domains, pre-trained LLMs were evaluated for influenza forecasting without exposure to training data. To ensure a fair and consistent comparison, the same experimental framework applied to fine-tuned models was used: each pre-trained model was tasked with forecasting 13-week future intervals based on 52-week historical sequences, using a sliding-window approach applied to the held-out testing subsets from each dataset.
When compared with SARIMA across seven datasets, pre-trained Llama2 and GPT2 demonstrated comparable trend alignment, with median changes in Spearman and Pearson correlations of 1.74% and −0.05%, respectively. The differences in predictive accuracy were modest, with median changes of 1.04% in MAE, 11.28% in MSE, 2.96% in MAPE, and 2.48% in SMAPE (Figure 6; Table S5). Compared to deep learning baselines such as LSTM, PatchTST, CoVTransformer, and FEDformer, as well as LLM-based time-series baselines including Time-LLM and GPT4TS, pre-trained LLMs exhibited higher trend correlations (e.g., Spearman and Pearson increases of 13.62% and 16.84% for Llama2 and 12.52% and 17.17% for GPT2) but also incurred substantially higher error rates (MAE: 82.73% and 111.59%; MSE: 196.70% and 248.39%) (Figure 6; Table S5). Relative to their fine-tuned counterparts, pre-trained LLMs continued to show stronger trend agreement (Spearman and Pearson improvements of 7.61% and 14.71% for Llama2 and 10.27% and 17.22% for GPT2), yet exhibited markedly worse predictive accuracy. This included increases in MAE (95.67% and 110.37%), MSE (240.43% and 279.68%), MAPE (55.72% and 51.28%), and SMAPE (32.58% and 12.85%) (Figure 6; Table S5).
Figure 6.

Comparative evaluation of pre-trained LLMs across trend and error metrics
Relative performance of pre-trained Llama2 (A) and GPT2 (B) when compared with traditional statistical models (SARIMA), deep learning baselines (LSTM, PatchTST, CoVTransformer, and FEDformer), additional LLM-based baselines (Time-LLM and GPT4TS), and their fine-tuned counterparts (FT_Llama2, FT_GPT2). Each cell shows the median percentage change in correlation (Spearman and Pearson) and error-based metrics (MAE, MSE, MAPE, SMAPE) across seven influenza datasets. Positive values indicate higher scores relative to the comparator.
Collectively, these results indicate that while pre-trained LLMs are capable of capturing high-level influenza trends in a zero-shot setting, fine-tuning is essential to achieve the predictive precision required for accurate and reliable ILI forecasting.
Ablation analysis of fine-tuning strategies and performance of larger LLMs
To assess the contribution of individual model components to forecasting performance, we conducted a series of ablation experiments. Ablation studies confirm that accuracy stems from the lightweight adapter design rather than sheer model size. Specifically, the number of layers utilized from pre-trained LLMs emerged as a critical factor. GPT2 achieved the best performance when using only the first 6 of its 12 layers, consistent with findings from Zhou et al.,23 while Llama2 attained optimal results with all 32 layers (STAR Methods, model selection; Figures S5 and S6). Further analysis revealed that training the adapter layers in the prediction block markedly improved forecasting accuracy, whereas retraining layer normalization and positional embeddings provided limited gains (STAR Methods, fine-tuning parameters selection; Table S6). Notably, reducing model weight precision to 8-bit preserved forecasting performance, underscoring its practical utility for deployment in resource-constrained environments (STAR Methods, fine-tuning parameters selection; Table S6). A learning rate of 10−4 was identified as optimal (STAR Methods, fine-tuning parameters selection; Table S6).
To investigate whether larger, more recent LLMs could further improve performance, we evaluated Llama3, Gemma2, and prompted-fine-tuned GPT4-o mini under the same fine-tuning architecture. In contrast, these models did not exhibit clear improvements and were frequently underperformed (Table S2). To further assess the potential of larger LLMs, Llama3 and Gemma2 were fine-tuned with more complex architectures incorporating LoRA,26 inter-layer bottleneck adapters,27 and output-level adapters with one or two layers. Across seven datasets and four error metrics, these variants improved performance for Llama3 and Gemma2, raising their top-2 rankings to at most 10, yet performance remained below that of Llama2 using the original lightweight design, which achieved at least 19 top-2 rankings (STAR Methods, evaluation of LoRA and adapter strategies; Figure S3; Table S7). These observations suggest that the limited scale of available influenza surveillance data (approximately 523 weekly observations from 2010 to 2020) may constrain the effective utilization of larger parameterized models.
Computational feasibility of fine-tuning LLMs
To assess the practicality of deploying fine-tuned LLMs in public health applications, we evaluated their computational requirements in resource-limited environments. Execution time and memory consumption were measured across multiple models (Table 1). All experiments were conducted on a Tesla T4 GPU (16 GB) using the Northern China influenza dataset. Fine-tuning the six-layer GPT2 model for 64 epochs required approximately 3.6 min, with peak memory usage of 3.08 GB on the CPU and 0.58 GB on the GPU. In comparison, Llama2 required about 24.8 min to fine-tune, with 2.93 GB of CPU memory and 12.47 GB of GPU memory, reflecting its substantially larger parameter count. Despite this increase, both models operated well within available hardware limits. Fine-tuning more recent LLMs such as Llama3 and Gemma2 was also feasible under the same architecture, albeit with moderately higher resource demands. Although these models required more time and memory than traditional deep learning approaches, their computational costs remain manageable, supporting the real-world applicability of fine-tuned LLMs for epidemic forecasting in constrained settings.
Table 1.
Training parameters and computational costs for fine-tuning LLMs and baseline models
| Model | # Tuning parameters | # Frozen parameters | Time (min) | Peak CPU Mem. (GB) | Peak GPU Mem. (GB) |
|---|---|---|---|---|---|
| GPT2 | 1.98M | 81.91M | 3.62 | 3.08 | 0.58 |
| Llama2 | 10.56M | 6.61B | 24.75 | 2.93 | 12.47 |
| Llama3 | 10.56M | 6.98B | 23.77 | 3.43 | 12.55 |
| Gemma2 | 34.9M | 8.32B | 94.77 | 3.13 | 12.20 |
| Time-LLM | 35.2M | 6.61B | 11.70 | 4.18 | 7.25 |
| GPT4TS | 1.02M | 81.1M | 3.37 | 3.11 | 0.40 |
| PatchTST | 20M | 0 | 4.07 | 3.11 | 0.59 |
| LSTM | 21.5K | 0 | 0.19 | 3.45 | 0.02 |
| CoVTransformer | 6.3K | 0.416M | 0.087 | 0.37 | 0 |
| FEDformer | 12.6M | 0 | 0.36 | 2.85 | 0.22 |
All models (GPT2, Llama2, Llama3, Gemma2, Time-LLM, GPT4TS, PatchTST, LSTM, CoVTransformer, and FEDformer) were trained on a Tesla T4 GPU. All results are reported with 64 training epochs.
Discussion
We present a systematic benchmark of fine-tuning pre-trained LLMs (e.g., Llama2 and GPT2) for influenza forecasting on seven real-world, data-limited weekly influenza surveillance time series from national and regional surveillance systems. These models effectively capture complex temporal dependencies and consistently outperform baselines across multiple error-based metrics (MAE, MSE, MAPE, and SMAPE) and trend-based metrics (Spearman and Pearson correlation coefficients), while maintaining high accuracy and stability across different prediction lengths and geographic regions, with particularly strong performance in long-term forecasts. Additionally, pre-trained LLMs in zero-shot mode perform comparably to SARIMA, indicating that even without task-specific fine-tuning, these models can effectively capture epidemic trends. These results demonstrate that state-of-the-art accuracy is attainable with modest data and without transferring sensitive records—an essential combination for clinical deployment. Collectively, these findings underscore the practicality of fine-tuned LLMs for accurate and robust influenza forecasting in real-world public health environments.
This consistent effectiveness is enabled by a streamlined and computationally lightweight fine-tuning architecture that freezes all transformer parameters in the pre-trained LLM while training only a compact embedding layer, adapter layer, and prediction layer. By isolating task-specific adaptation in a small number of trainable parameters, the design accelerates convergence while still achieving strong empirical performance. It supports efficient deployment in computationally constrained settings. It also minimizes the risk of overfitting, simplifies implementation, and facilitates reproducibility across different datasets. Moreover, it preserves the pre-trained model’s capacity to encode temporal dynamics, enabling generalization to influenza surveillance datasets that are limited in the number of available observations. Importantly, this approach allows local fine-tuning without transmitting sensitive data to third-party servers or relying on commercial APIs, which helps mitigate risks of data leakage and ensures compliance with privacy regulations—an essential consideration in public health applications.
Looking forward, LLMs hold substantial promise for supporting a broader range of public health applications beyond influenza surveillance. The field is advancing rapidly, with continuous progress in model design, pretraining frameworks, and fine-tuning strategies such as reinforcement learning. These developments, in combination with privacy-preserving deployment techniques and expanding access to health-related data, can support timely, context-aware public health responses. Applications may span outbreak detection, syndromic surveillance, health communication, and adaptive policy response, among others. Together, these trends point toward a future in which LLMs serve as scalable, privacy-conscious tools for intelligent decision support across diverse public health challenges.
Limitations of the study
Despite the promising performance of fine-tuned LLMs, several limitations remain. From the fine-tuning perspective, we applied the same lightweight architecture across all models. While this approach is effective for smaller models like GPT2 and Llama2, it is suboptimal for higher-capacity models such as Llama3 and Gemma2. More complex fine-tuning with LoRA, inter-layer adapters, and output-level adapters improved Llama3 and Gemma2 yet remained inferior to Llama2 and GPT2 under the original lightweight approach, suggesting that future work should develop data-efficient strategies tailored to larger LLMs for surveillance datasets characterized by small sample sizes—as in our influenza series. Furthermore, the influenza surveillance datasets used in this study contain only ∼523 weekly observations per region. This limited sample size reduces the statistical power to train large models effectively and may limit their ability to realize their full modeling capacity. From the data perspective, our evaluation focused primarily on 13-week forecasting windows using historical data up to early 2020, due to limited accessibility of public surveillance data. Additionally, the current approach relies solely on univariate time series inputs. Incorporating multimodal signals—such as environmental factors, population mobility, or clinical data—could further enhance forecasting performance, particularly in rapidly evolving public health contexts. We emphasize that our goal was not to claim that newer, larger foundation models are intrinsically inferior but to show that—even with scarce weekly data—compact, locally fine-tuned LLMs already surpass widely used statistical (SARIMA), deep-learning (LSTM, PatchTST, CoVTransformer, FEDformer, Autoformer, and Informer), and LLM-based time-series baselines (Time-LLM and GPT4TS). As more extensive surveillance corpora and multimodal data become available, future work should examine whether high-capacity models, equipped with advanced adapters, can translate their theoretical capacity into practical accuracy improvements.
Resource availability
Lead contact
Requests for further information and resources should be directed to and will be fulfilled by the lead contact, Dechao Tian (tiandch@mail.sysu.edu.cn).
Materials availability
This study did not generate new unique materials.
Data and code availability
-
•
Among the seven ILI datasets used in this study, five influenza virological and ILI surveillance datasets are public data and obtained from Feng et al.,5 which were collected by the National Influenza Surveillance Network in China and the US Centers for Disease Control and Prevention (CDC). These datasets cover the period from April 2011 to March 2020 and reflect influenza activity trends and positive test rates, based on over 3.7 million samples from China and over 8.3 million samples from the United States. US data covering April 2011 through May 2023 were downloaded from the US Centers for Disease Control and Prevention National, Regional, and State Level Outpatient Illness and Viral Surveillance program (https://gis.cdc.gov/grasp/fluview/fluportaldashboard.html). Additionally, two real-time weekly datasets, including influenza-positive rates and ILI case counts from January 2010 to January 2020 in Chongqing, China, are provided by the Chongqing CDC. These datasets are not publicly available but can be accessed upon reasonable request.
-
•
All original code are available at GitHub (https://github.com/licx11/LLMs4Influenza) and have been deposited at Zenodo (https://doi.org/10.5281/zenodo.20594859).
-
•
Any additional information required to reanalyze the data reported in this paper is available from the lead contact upon request.
Acknowledgments
This work was supported by the National Natural Science Foundation of China grant 12271536, the Shenzhen Sustainable Research grant KCXFZ20211020172545006, and the Shenzhen Science and Technology Program grant ZDSYS20230626091203007 to D.T.; partially supported by the NSERC grant RGPIN2022-04399 to J.D.; and supported by the Chongqing Science and Technology Bureau grant CSTC2024ycjh-bgzxm0224 and the Chongqing Science and Health Joint Medical Research Project grant 2026KWJK1002 to L.Q. Additionally, this work was supported by High-performance Computing Public Platform (Shenzhen Campus) of Sun Yat-sen University.
Author contributions
Conceptualization, D.T.; methodology, C.L., W.G., B.Z., J.D., and D.T.; software and formal analysis, C.L. and W.G.; validation and visualization, C.L., W.G., Q.Z., and Y.Z.; data curation, C.L., W.G., Q.Z., Y.Z., J.Y., and L.Q.; investigation, C.L., W.G., Q.Z., Y.Z., B.Z., J.Y., L.Q., J.D., and D.T.; writing – original draft, C.L.; writing – editing, C.L., J.D., and D.T.; writing – review, all authors; supervision, L.Q., J.D., and D.T.; funding acquisition, L.Q., J.D., and D.T.
Declaration of interests
The authors declare no competing interests.
Declaration of generative AI and AI-assisted technologies in the writing process
The authors used generative AI tools solely for language polishing and proofreading during the preparation of this manuscript.
STAR★Methods
Key resources table
| REAGENT or RESOURCE | SOURCE | IDENTIFIER |
|---|---|---|
| Deposited data | ||
| Influenza surveillance data from China and the US (2011–2020) | Feng et al.5 | https://www.nature.com/articles/s41467-021-23440-1#data-availability |
| Influenza surveillance data from the US (2011–2023) | the U.S. Centers for Disease Control and Prevention | https://gis.cdc.gov/grasp/fluview/fluportaldashboard.html |
| Chongqing influenza surveillance data | the Chongqing CDC. | These datasets are not publicly available but can be accessed upon reasonable request. |
| Software and algorithms | ||
| Fine-tuned Llama2 and GPT2 | This paper | GitHub: https://github.com/licx11/LLMs4Influenza Zenodo: https://doi.org/10.5281/zenodo.20594859 |
| Python V3.8 | Python Software Foundation | https://www.python.org/ |
| SARIMA | statsmodels | https://www.statsmodels.org/stable/generated/statsmodels.tsa.statespace.sarimax.SARIMAX.html |
| LSTM | torch.nn.LSTM | https://pytorch.org/docs/stable/generated/torch.nn.LSTM.html |
| PatchTST | Nie et al.9 | https://github.com/yuqinie98/PatchTST |
| CoVTransformer | Feng et al.10 | https://github.com/ruianke/CoVTransformer |
| FEDformer | Zhou et al.11 | GitHub - DAMO-DI-ML/ICML2022-FEDformer: Source code of ICML'22 paper: FEDformer: Frequency Enhanced Decomposed Transformer for Long-term Series Forecasting GitHub |
| Time-LLM | Jin et al.22 | https://github.com/KimMeen/Time-LLM |
| GPT4TS | Zhou et al.23 | GitHub - DAMO-DI-ML/NeurIPS2023-One-Fits-All: The official code for “One Fits All: Power General Time Series Analysis by Pretrained LM (NeurIPS 2023 Spotlight)” GitHub |
| GPT-2 | OpenAI (Hugging Face) | https://huggingface.co/openai-community/gpt2 |
| Llama2 | Meta (Hugging Face) | https://huggingface.co/meta-llama/Llama-2-7b-hf |
| Llama3 | Meta (Hugging Face) | https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct |
| Gemma-2 | Google (Kaggle) | https://www.kaggle.com/models/google/gemma-2/transformers |
Method details
Influenza data preprocessing
The input historical observational data, denoted as y1,y2, …,yT, represents the observed influenza data at each time point t. The data undergoes first-order differencing:
and 12-step seasonal differencing:
to remove trends and seasonality, which is a common practice for influenza forecasting.
The patching technique9 is applied to the preprocessed data, which is divided into overlapping patches, enabling more comprehensive model training, particularly when the sample size is limited. To improve the model’s stability and speed up convergence, the input influenza series is normalized using its mean and variance:
Here, μ is the mean and σ is the standard deviation of the influenza series.
For a fair comparison, the preprocessed data are used as the input for all models, including fine-tuned LLMs and alternative methods, ensuring consistency in evaluation and eliminating variability due to differences in data handling.
Pre-trained LLMs evaluated for influenza forecasting
Two widely used open-source pre-trained LLMs, GPT228 and Llama2,29 are extensively tested. In addition, more recent LLMs, including Llama3, Gemma2, and GPT-4o mini, are also evaluated to explore the potential for influenza forecasting. Pre-trained parameters for these models are downloaded from Hugging Face (Appendix LABEL:appendix:_llms_used_in_this_paper). The fine-tuning architecture of the LLMs, depicted in Figure 1, includes several tailored modifications to optimize their performance for influenza forecasting.
LLMs fine-tuning architecture: Embedding and padding
Despite normalization, the time-series data still differs significantly from regular text data used for LLMs. To address this, the original embedding layer of the pre-trained LLMs is replaced with a fully connected layer, leveraging linear probing to reduce computational requirements. Given that the input Y is in the form of a tensor , representing a batch of b samples with 52 time steps, the transformations are applied as follows:
First, the input Y undergoes a rearranging operation to transform its shape from to . This rearrangement ensures that the data aligns with the expected input format for subsequent operations:
Second, padding is applied along the last dimension to make the sequence length compatible with the input requirements of the following layers:
Here, s is the padded length.
Next, the padded tensor Y is unfolded into smaller local segments of length corresponding to the patch size:
This operation slices the data into patches, with p denoting the number of patches and each patch having a size of patch_size
Finally, the patches are rearranged to prepare for embedding layer:
The embedding of the input data is then computed via a linear transformation:
where H is the resulting embedding, W is the weight matrix, and B is the bias term.
LLMs fine-tuning architecture: Transformer blocks
The resulting embedding H is then fed into the transformer blocks of a pre-trained LLM. According to Zhou,23 self-attention layers and feedforward neural networks (FFN) capture most of the knowledge from pre-trained LLMs. While their approach fine-tunes the embedding, normalization, and output layers while freezing the self-attention blocks, this leaves a large number of parameters, potentially leading to inefficiencies. To address this, all parameters of the pre-trained LLMs are frozen, simplifying fine-tuning and reducing computational costs. This local fine-tuning strategy also meets data-sovereignty requirements common in public-health agencies.
LLMs fine-tuning architecture: Prediction block
In the prediction block, an adapter layer with a Leaky ReLU activation function is applied before the output layer for influenza forecasting tasks. The complete process is defined as:
where is the predicted output, representing the influenza forecasts for the next 13 weeks. H is the output from the LLM, which serves as the learned representation of the data. It captures important patterns such as trends, seasonal variations, and any other underlying temporal dependencies in the data. W1 and W2 are the weight matrices corresponding to the two layers of the fully connected network. W1 maps the input features to an intermediate space, and W2 further transforms this intermediate representation to the final output, which predicts the influenza rate. B1 and B2 are the corresponding bias terms. These biases allow the model to adjust the output independently of the input data, providing more flexibility in learning. Lastly, α is a small constant (typically α = 0.01) that controls the slope for negative values of H. The Leaky ReLU activation function ensures that the model does not completely discard negative values, allowing it to learn from negative activations while preventing issues like the vanishing gradient problem.
Final predictions are obtained by applying inverse normalization and inverse differencing to the model’s output. This architecture integrates the strengths of pre-trained LLMs with domain-specific adjustments, enabling efficient and accurate influenza forecasting.
Model training
To train and evaluate the forecasting models, we use weekly influenza time series data, including influenza positive rate and ILI data. Each sample consists of 52 past observations to predict the subsequent 13 time points. The data are split into training, validation, and test sets with a 7:1:2 ratio. We primarily present 13-step-ahead forecasting results for two representative models: a fine-tuned GPT2-backbone model using the first six hidden layers, and a fine-tuned Llama2-backbone model with all 32 hidden layers. Due to space limitations, results from additional models are provided in Table S2.
All models, except SARIMA, are trained on the training and validation sets and evaluated on the test set. The training process uses the Adam optimizer with a learning rate of 1 × 10−4 and runs for 64 epochs. The mean squared error (MSE) serves as the default loss function:
where yi is the actual value, is the predicted value, and n is the number of samples. The SARIMA model follows the configuration described by Feng et al., where the model is fitted on all data prior to the final 13 weeks and then applied to forecast these 13 weeks.5 Consequently, when evaluating models by calculating metrics, the results for other models (except SARIMA) represent the average performance on the test set (except Figure 2).
Model selection
Model configurations and fine-tuning parameters were selected based on validation-set performance and complementary sensitivity analyses. For GPT2, we followed prior findings from Zhou et al.,23 who reported that intermediate layer configurations can provide strong performance, and evaluated different numbers of GPT2 layers on the influenza positive rate dataset from Northern China. The 6-layer GPT2 configuration achieved the best overall balance across evaluation metrics and was therefore used as the default GPT2-backbone configuration. For Llama2, forecasting performance improved as the number of layers increased, without a clear saturation point across the evaluated criteria. We therefore used the full 32-layer Llama2 model as the default Llama2-backbone configuration. Complete layer-configuration results are provided in Figure S4.
To assess whether the LSTM baseline configuration affected the benchmark conclusions, we evaluated hidden dimensions around the main setting H = 50, while keeping the remaining training settings unchanged. Across datasets and evaluation metrics, changes in H had only a limited effect on LSTM performance, and all LSTM variants remained below fine-tuned GPT2 and Llama2 across dataset–metric combinations. These results support the use of H = 50 as a representative LSTM baseline configuration. Complete LSTM hidden-dimension sensitivity results are provided in Figure S2.
Fine-tuning parameters selection
In this section, we conduct ablation experiments to identify the key parameters for fine-tuning. The embedding and output layers, being randomly initialized to adapt to the new domain, are trained by default. As a baseline for comparison, we freeze all transformer blocks in the pre-trained Llama2 model. We further test two alternative configurations: (1) re-training only the layer normalization and positional embeddings (Partial Freeze), and (2) adding FC layers to the set of trainable components. The results, summrized in Table S6, indicate that adding extra FC layers provides notable benefits for influenza forecasting. With FC layers included, all correlation metrics and percentage-based error metrics (MAPE and SMAPE) consistently improve, whereas absolute-error metrics such as MAE and MSE exhibit slight increases. Moreover, performance continues to rise as the dimensionality of these FC layers grows. For instance, with an FC-512 layer, SpearmanR and PearsonR improve by 2.81% and 1.06%, respectively, while MAPE and SMAPE decrease by 23.76% and 10.93%. These findings underscore the advantages of larger fully connected layers in boosting correlation and percentage-based error metrics for influenza forecasting.
The results also indicate that re-training the layer normalization and position embeddings (Partial Freeze) provides minimal benefit. Compared to the baseline, SpearmanR and PearsonR decrease slightly by 0.24% and 0.12%, while MAE and MSE remain nearly unchanged. This limited impact may be attributed to the relatively small sample size.
Under our default model framework, we use MSE as the loss function, FP16 for model weight precision, and a learning rate of 1 × 10−4. We evaluate several alternative design choices, focusing on three aspects: loss function, model weight precision, and data normalization strategies. Specifically, we compare MSE with Smooth L1 and Weighted MSE-MAE losses, test 8-bit quantization for weights, and examine the effect of batch normalization and input standardization.
As shown in Table S6, most alternative settings result in negligible performance changes, with the exception of batch normalization, which leads to a noticeable degradation. Consequently, we maintain MSE as the default loss function, adopt a learning rate of 1 × 10−4, and exclude batch normalization and standardization in our default setup. Moreover, 8-bit quantization yields performance comparable to FP16 while substantially reducing memory consumption. These findings suggest that 8-bit precision serves as a practical alternative in resource-constrained environments without sacrificing forecast quality.
Evaluation of LoRA and adapter strategies
In addition to the lightweight fine-tuning strategy adopted in the main text, we conducted further experiments with more complex fine-tuning architectures LoRA and alternative adapter designs. Two types of adapter variants are considered.
-
1.
Inter-layer adapters: conventional bottleneck adapter layers inserted between Transformer layers, consisting of a down-projection, nonlinearity, and up-projection.
-
2.
Output-level adapters: additional fully connected layers applied after the final outputs, preserving the hidden dimensionality and acting as simple mappings. Both one and two such layers are tested.
LoRA is applied to the projection layers of Llama2, Llama3, and Gemma2. For Llama2, LoRA reduces performance (from 24 to 5 top-2 rankings), suggesting redundancy when additional low-rank parameters are introduced into a smaller model. For larger models, LoRA improves stability: Llama3 and Gemma2 increase from 0 to 9 and 2 top-2 rankings, respectively. Nevertheless, even with LoRA, their performance remains below that of Llama2 and GPT2 under the original fine-tuning framework (Table S7). Overall, while certain LoRA and adapter variants provide modest stability gains for larger models, these come at the cost of increased computational overhead (Table S8) and are not sufficient to close the gap with smaller models such as Llama2, as shown by the detailed results in Table S2.
For inter-layer adapters, adding such layers to Llama2 degrades performance compared with its baseline, suggesting that Llama2 already adapts effectively to small influenza datasets under the lightweight fine-tuning framework. In contrast, Llama3 and Gemma2 achieve improved stability with inter-layer adapters (5 and 14 top-2 rankings, respectively), though their performance remains below that of the more compact Llama2 and GPT2 (Table S7).
For output-level adapters, adding one or two fully connected layers reduces Llama2’s performance relative to its baseline, again indicating overfitting risks in limited-data settings. For larger models, output-level adapters provide moderate improvements in stability, but increasing the depth from one to two layers does not yield further benefits and in fact degrades performance (Table S7).
To illustrate these findings, Figure S3 compares the original fine-tuning, LoRA, and inter-layer adapter variants on the Northern China influenza positive rate dataset. For Llama2, both LoRA and these adapter variants result in lower correlations and higher errors compared with its baseline, while for Llama3 and Gemma2, adapters improve stability but still lag behind the smaller Llama2.
Evaluation during the COVID-19 pandemic
To further investigate generalization of fine-tuned LLMs, we evaluate model performance during the COVID-19 pandemic, when influenza transmission was substantially disrupted by mitigation measures. The analysis uses weekly ILI positive rates in U.S. influenza surveillance data from 2011 to 2023 and divides the series into three periods: Pre-COVID (April 2011–March 2020), COVID-disrupted (March 2020–November 2021, when ILI rates dropped to nearly zero), and Recovery (November 2021–May 2023, when ILI rates gradually returned to seasonal norms) (Figure 4A). Models were trained on the pre-COVID period and tested on the COVID-disrupted and recovery periods. No separate validation subset was used for this experiment. Hyperparameters follow the default settings, except that CoVTransformer was trained for 2000 epochs to improve its performance. SARIMA was excluded from this analysis because under the 13-step forecasting setup, SARIMA requires subset data from the COVID-19 period for training as the prediction window iteratively shifted, compromising a fair comparison with other models. For reference, pre-COVID performance is taken from the corresponding results in the main analysis (Figure 3) and reproduced in Figure S4B.
Relative to pre-COVID-19 pandemic performance, all models exhibited degraded performance during the COVID-disrupted period (Figure S4B), with reduced trend-based metrics (Spearman’s ρ, Pearson’s r) and increased relative errors (MAPE, SMAPE), while absolute errors (MAE and MSE) were lower due to ILI rates approaching zero. Fine-tuned LLMs remained more robust than alternative models, with fine-tuned GPT2 achieving two top rankings in the trend metrics and fine-tuned Llama2 achieving four top rankings in the error metrics. In the recovery period, performance improved across all models as ILI positivity rates increased toward pre-pandemic levels, and fine-tuned Llama2 achieved the highest performance across all six metrics. These results confirm that epidemic disruptions substantially challenge all models, yet fine-tuned LLMs exhibit comparatively greater stability and adaptability across both disrupted and recovery conditions.
Model deployment and privacy considerations
To ensure data privacy and address potential security concerns, we conducted all experiments using locally deployed LLMs. Specifically, we utilize open-source models GPT2 and Llama2, selected as representative architectures with hidden state dimensions of 768 and 4096, respectively. To accommodate differences in model architecture, we tailor the input projection layers to align the input embeddings with each model’s hidden dimensionality. These modifications are applied uniformly across all experimental settings to preserve implementation consistency and support rigorous comparative evaluation. For the proprietary GPT-4o mini model, we removed all time-related metadata from the input to prevent leakage of sensitive temporal information. However, due to the closed-source nature of GPT-4o mini, we were unable to perform detailed internal analysis as with open-source models. In response to this constraint, we designed specific prompts to guide its behavior and ensure controlled outputs. A standardized prompting format is used (see Appendix LABEL:appendix:additional_experimental_results), enabling consistent evaluation while maintaining data privacy.
Evaluation metrics
The evaluation is performed on influenza positive rate and ILI datasets, with prediction lengths set to 8 and 13 steps ahead. Six evaluation metrics are employed for a comprehensive comparison: Spearman correlation coefficient (Spearman’s ρ), Pearson correlation coefficient (Pearson’s r), MSE, MAE, MAPE, and SMAPE. The formulas for all evaluation metrics, except for MSE which has been defined previously, are given below:
where yi represents the actual values, denotes the predicted values, and are the means of the actual and predicted values respectively, di is the difference between the ranks of yi and , and n is the number of samples.
Prompt formulation for GPT4-o mini
While forecasting influenza series using GPT4-o mini, we follow the setup proposed by Gruver et al.,30 formulating the task as sequence continuation. This prompt formulation was used for both GPT4-o mini training-based forecasting and zero-shot forecasting. Each historical input window was represented as a comma-separated numerical sequence, and the model was instructed to return only the subsequent numerical values without explanatory text. The target output corresponded to the future prediction window.
The system prompt was:
You are a helpful assistant that performs time series predictions. The user will provide a sequence and you will predict the remaining sequence. The sequence is represented by decimal strings separated by commas.
The user prompt template was:
Please continue the following sequence without producing any additional text. Do not say anything like “the next terms in the sequence are”, just return the numbers. Sequence: [historical sequence]
For training-based forecasting, each training example contained the historical sequence as the user input and the corresponding future sequence as the assistant response. During inference, GPT4-o mini received only the historical sequence, and the generated comma-separated numerical values were parsed as the forecast. For zero-shot forecasting, the same prompt format was applied without task-specific parameter updating. The same output parsing procedure was used for all GPT4-o mini forecasting experiments.
Quantification and statistical analysis
The performance of the forecasting models was evaluated using multiple complementary time-series prediction metrics, including mean absolute error (MAE), mean squared error (MSE), mean absolute percentage error (MAPE), symmetric mean absolute percentage error (SMAPE), Spearman’s rank correlation coefficient, and Pearson’s correlation coefficient. MAE, MSE, MAPE, and SMAPE were used to quantify forecasting errors, with lower values indicating better predictive accuracy. Spearman’s and Pearson’s correlation coefficients were used to assess agreement between predicted and observed temporal trends, with higher values indicating better trend consistency.
For each dataset, models were evaluated using the same chronological train-validation-test split. To assess robustness to stochasticity in learning-based training, the full benchmarking pipeline was repeated for 10 independent runs using different random seeds for all learning-based models, including fine-tuned LLMs and deep-learning baselines. SARIMA was deterministic under fixed training data and hyperparameters and therefore did not vary with random seed; its results were included as a fixed reference across runs. Unless otherwise noted, performance values are reported as the mean across independent runs. No cross-validation was performed, and no runs were excluded from analysis.
For ranking-based comparisons, models were ranked for every dataset–metric combination using four error-based metrics, including MAE, MSE, MAPE, and SMAPE, across seven influenza datasets, yielding 28 dataset–metric combinations per run. Per-run Top-1 counts were defined as the number of combinations, out of 28, on which a model ranked first. Per-run Top-2 counts were defined as the number of top-two positions, out of 56, occupied by a model within the same run.
For formal statistical support, one-sided unpaired two-sample Mann–Whitney U tests were performed across the 10 independent runs to evaluate whether fine-tuned Llama2 or GPT2 achieved higher per-run ranking counts than each baseline. For each baseline b, the two independent samples and were compared, where score denotes the per-run Top-1 count, out of 28, or Top-2 count, out of 56. Within each ranking metric, Top-1 or Top-2, p values were adjusted across baselines using the Holm–Bonferroni correction and are reported as padj. Adjusted p values below 0.05 were considered statistically significant. All performance metrics and statistical analyses were calculated in Python using the SciPy and statsmodels packages.
Published: July 23, 2026
Footnotes
Supplemental information can be found online at https://doi.org/10.1016/j.crmeth.2026.101535.
Contributor Information
Li Qi, Email: qili19812012@126.com.
Jun Ding, Email: jun.ding@mcgill.ca.
Dechao Tian, Email: tiandch@mail.sysu.edu.cn.
Supplemental information
The evaluated models include statistical, deep learning, Transformer-based, and language-model-based forecasting methods, as well as additional fine-tuning variants of Llama2, Llama3, and Gemma2. The SARIMA model is employed solely for predicting the final 13-week period from October 2019 to January 2020. To account for computational constraints, model weight precision settings are specified as follows: INT8 for fine-tuned Llama3 and fine-tuned Gemma2, FP16 for fine-tuned Llama2, and FP32 for fine-tuned GPT2. LoRA denotes low-rank adaptation applied to the projection layers; Ada denotes variants with compact adapter modules inserted between Transformer blocks; AdaFC and AdaFC2 denote variants with one or two additional fully connected layers appended after the model outputs, respectively. Abbreviations: Spe.ρ, Spearman ρ; Pea.r, Pearson r.
The values in the table represent the relative percentage changes of pre-trained Llama2 and pre-trained GPT-2 compared with baseline models and their corresponding fine-tuned counterparts. For each metric, the relative percentage change is computed as [(pre-trained model-comparison model)/comparison model]×100%.
References
- 1.Organization, W. H. Influenza (seasonal) (2025). https://www.who.int/news-room/fact-sheets/detail/influenza-(seasonal).
- 2.Reich N.G., Brooks L.C., Fox S.J., Kandula S., McGowan C.J., Moore E., Osthus D., Ray E.L., Tushar A., Yamana T.K., et al. A collaborative multiyear, multimodel assessment of seasonal influenza forecasting in the United States. Proc. Natl. Acad. Sci. USA. 2019;116:3146–3154. doi: 10.1073/pnas.1812594116. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 3.Chretien J.-P., George D., Shaman J., Chitale R.A., McKenzie F.E. Influenza forecasting in human populations: A scoping review. PLoS One. 2014;9:e94130–e94138. doi: 10.1371/journal.pone.0094130. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4.Box G.E., Jenkins G.M., Reinsel G.C., Ljung G.M. John Wiley & Sons; 2015. Time Series Analysis: Forecasting and Control. [Google Scholar]
- 5.Feng L., Zhang T., Wang Q., Xie Y., Peng Z., Zheng J., Qin Y., Zhang M., Lai S., Wang D., et al. Impact of COVID-19 outbreaks and interventions on influenza in China and the United States. Nat. Commun. 2021;12:3249. doi: 10.1038/s41467-021-23440-1. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6.Kane M.J., Price N., Scotch M., Rabinowitz P. Comparison of ARIMA and random forest time series models for prediction of avian influenza H5N1 outbreaks. BMC Bioinf. 2014;15:276–279. doi: 10.1186/1471-2105-15-276. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7.Graves A. Springer; 2012. Supervised Sequence Labelling with Recurrent Neural Networks. [Google Scholar]
- 8.Vaswani A., Shazeer N., Parmar N., Uszkoreit J., Jones L., Gomez A.N., Kaiser L.u., Polosukhin I. Attention is all you need. In: Advances in Neural Information Processing Systems. 2017;30 [Google Scholar]
- 9.Nie Y., Nguyen N.H., Sinthong P., Kalagnanam J. International Conference on Learning Representations. 2023. A time series is worth 64 words: Long-term forecasting with transformers. [Google Scholar]
- 10.Feng Y., Goldberg E.E., Kupperman M., Zhang X., Lin Y., Ke R. CovTransformer: A transformer model for SARS-CoV-2 lineage frequency forecasting. Virus Evol. 2024;10 doi: 10.1093/ve/veae086. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 11.Zhou T., Ma Z., Wen Q., Wang X., Sun L., Jin R. Fedformer: Frequency enhanced decomposed transformer for long-term series forecasting. In: Chaudhuri K., Jegelka S., Song L., Szepesvári C., Niu G., Sabato S., editors. Proceedings of the 39th International Conference on Machine Learning, 162. PMLR; 2022. p. 27268–27286.
- 12.Yang L., Li G., Yang J., Zhang T., Du J., Liu T., Zhang X., Han X., Li W., Ma L., et al. Deep-learning model for influenza prediction from multisource heterogeneous data in a megacity: model development and evaluation. J. Med. Internet Res. 2023;25 doi: 10.2196/44238. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 13.Athanasiou M., Fragkozidis G., Zarkogianni K., Nikita K.S. Long short-term memory–based prediction of the spread of influenza-like illness leveraging surveillance, weather, and twitter data: Model development and validation. J. Med. Internet Res. 2023;25 doi: 10.2196/42519. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 14.Jung S., Moon J., Park S., Hwang E. Self-attention-based deep learning network for regional influenza forecasting. IEEE J. Biomed. Health Inform. 2022;26:922–933. doi: 10.1109/JBHI.2021.3093897. [DOI] [PubMed] [Google Scholar]
- 15.Santangelo O.E., Gentile V., Pizzo S., Giordano D., Cedrone F. Machine learning and prediction of infectious diseases: A systematic review. Mach. Learn. Knowl. Extr. 2023;5:175–198. [Google Scholar]
- 16.Metcalf C.J.E., Lessler J. Opportunities and challenges in modeling emerging infectious diseases. Science. 2017;357:149–152. doi: 10.1126/science.aam8335. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17.Hou X., He Y., Fang P., Mei S.-Q., Xu Z., Wu W.-C., Tian J.-H., Zhang S., Zeng Z.-Y., Gou Q.-Y., et al. Using artificial intelligence to document the hidden RNA virosphere. Cell. 2024;187:6929–6942.e16. doi: 10.1016/j.cell.2024.09.027. [DOI] [PubMed] [Google Scholar]
- 18.Renc P., Jia Y., Samir A.E., Was J., Li Q., Bates D.W., Sitek A. Zero shot health trajectory prediction using transformer. npj Digit. Med. 2024;7:256. doi: 10.1038/s41746-024-01235-0. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 19.Zhou X., Zhou J., Wang C., Xie Q., Ding K., Mao C., Liu Y., Cao Z., Chu H., Chen X., et al. A suite of large language models for public health infoveillance. npj Digit. Med. 2026;9 doi: 10.1038/s41746-026-02435-6. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 20.Raghu Subramanian C., Yang D.A., Khanna R. Enhancing health care communication with large language models—the role, challenges, and future directions. JAMA Netw. Open. 2024;7:e240347. doi: 10.1001/jamanetworkopen.2024.0347. [DOI] [PubMed] [Google Scholar]
- 21.Singhal K., Tu T., Gottweis J., Sayres R., Wulczyn E., Amin M., Hou L., Clark K., Pfohl S.R., Cole-Lewis H., et al. Toward expert-level medical question answering with large language models. Nat. Med. 2025;31:943–950. doi: 10.1038/s41591-024-03423-7. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22.Jin M., Wang S., Ma L., Chu Z., Zhang J., Shi X., Chen P.-Y., Liang Y., Li Y.-F., Pan S., et al. Time-llm: Time series forecasting by reprogramming large language models. International conference on learning representations. 2024;2024:23857–23880. [Google Scholar]
- 23.Zhou T., Niu P., wang x., Sun L., Jin R. In: Oh A., Naumann T., Globerson A., Saenko K., Hardt M., Levine S., editors. Vol. 36. 2023. One fits all: Power general time series analysis by pretrained lm; pp. 43322–43355. (Advances in Neural Information Processing Systems). [Google Scholar]
- 24.Wu H., Xu J., Wang J., Long M. Autoformer: Decomposition transformers with Auto-Correlation for long-term series forecasting. Adv. Neural Inf. Process. Syst. 2021;34:22419–22430. [Google Scholar]
- 25.Zhou H., Zhang S., Peng J., Zhang S., Li J., Xiong H., Zhang W. Informer: Beyond efficient transformer for long sequence time-series forecasting. Proc. AAAI Conf. Artif. Intell. 2021;35:11106–11115. [Google Scholar]
- 26.Hu E.J., Shen Y., Wallis P., Allen-Zhu Z., Li Y., Wang S., Wang L., Chen W. International Conference on Learning Representations. 2022. LoRA: Low-rank adaptation of large language models. [Google Scholar]
- 27.Houlsby N., Giurgiu A., Jastrzebski S., Morrone B., De Laroussilhe Q., Gesmundo A., Attariyan M., Gelly S. In: Proceedings of the 36th International Conference on Machine Learning. Chaudhuri K., Salakhutdinov R., editors. Vol. 97. PMLR; 2019. Parameter-efficient transfer learning for NLP; pp. 2790–2799. [Google Scholar]
- 28.Radford A., Wu J., Child R., Luan D., Amodei D., Sutskever I. Language models are unsupervised multitask learners. OpenAI blog. 2019;1:9. [Google Scholar]
- 29.Touvron H., Lavril T., Izacard G., Martinet X., Lachaux M.-A., Lacroix T., Rozière B., Goyal N., Hambro E., Azhar F., et al. Llama: Open and efficient foundation language models. arXiv. 2023 doi: 10.48550/arXiv.2302.13971. Preprint at. [DOI] [Google Scholar]
- 30.Gruver N., Finzi M., Qiu S., Wilson A.G. In: Advances in Neural Information Processing Systems 36. Oh A., Naumann T., Globerson A., Saenko K., Hardt M., Levine S., editors. Curran Associates, Inc.; 2023. Large Language Models Are Zero Shot Time Series Forecasters. [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
The evaluated models include statistical, deep learning, Transformer-based, and language-model-based forecasting methods, as well as additional fine-tuning variants of Llama2, Llama3, and Gemma2. The SARIMA model is employed solely for predicting the final 13-week period from October 2019 to January 2020. To account for computational constraints, model weight precision settings are specified as follows: INT8 for fine-tuned Llama3 and fine-tuned Gemma2, FP16 for fine-tuned Llama2, and FP32 for fine-tuned GPT2. LoRA denotes low-rank adaptation applied to the projection layers; Ada denotes variants with compact adapter modules inserted between Transformer blocks; AdaFC and AdaFC2 denote variants with one or two additional fully connected layers appended after the model outputs, respectively. Abbreviations: Spe.ρ, Spearman ρ; Pea.r, Pearson r.
The values in the table represent the relative percentage changes of pre-trained Llama2 and pre-trained GPT-2 compared with baseline models and their corresponding fine-tuned counterparts. For each metric, the relative percentage change is computed as [(pre-trained model-comparison model)/comparison model]×100%.
Data Availability Statement
-
•
Among the seven ILI datasets used in this study, five influenza virological and ILI surveillance datasets are public data and obtained from Feng et al.,5 which were collected by the National Influenza Surveillance Network in China and the US Centers for Disease Control and Prevention (CDC). These datasets cover the period from April 2011 to March 2020 and reflect influenza activity trends and positive test rates, based on over 3.7 million samples from China and over 8.3 million samples from the United States. US data covering April 2011 through May 2023 were downloaded from the US Centers for Disease Control and Prevention National, Regional, and State Level Outpatient Illness and Viral Surveillance program (https://gis.cdc.gov/grasp/fluview/fluportaldashboard.html). Additionally, two real-time weekly datasets, including influenza-positive rates and ILI case counts from January 2010 to January 2020 in Chongqing, China, are provided by the Chongqing CDC. These datasets are not publicly available but can be accessed upon reasonable request.
-
•
All original code are available at GitHub (https://github.com/licx11/LLMs4Influenza) and have been deposited at Zenodo (https://doi.org/10.5281/zenodo.20594859).
-
•
Any additional information required to reanalyze the data reported in this paper is available from the lead contact upon request.
