Integrating adaptive human behavior into epidemic models with large language models
Authors: Yicheng Mao, Haoyang Li, Rob Deardon, Hongru Du
Organizations: Department of Mathematics and Statistics, University of Calgary, University Drive NW, Calgary, T2N 1N4, Canada · Department of Systems & Information Engineering, University of Virginia, Charlottesville, VA, USA · Faculty of Veterinary Medicine, University of Calgary, University Drive NW, Calgary, T2N 1N4, Canada
Infectious disease transmission is shaped by patterns of human interaction, which adapt as epidemic conditions change. Capturing these context-dependent behaviors remains a fundamental challenge for epidemic models. Here, we recast this challenge by using large language models (LLMs) to represent adaptive human behavior within mechanistic epidemic models. We operationalize this idea through Generative Adaptive Behavioral Layer for Epidemics (GABLE), which adapts LLMs to infer behavioral responses to epidemic and policy conditions and translates them into age-structured contact matrices coupled to a mechanistic epidemic model. Applied to COVID-19 in France, GABLE reproduced responses in population mixing and age-specific contact structures that remained epidemiologically informative. In short-term forecasting, LLM-generated contact matrices outperformed mobility-driven matrices derived from real-world mobility data, with the largest gains at longer horizons. GABLE also extends beyond forecasting to prospective policy evaluation by projecting behavioral and epidemic responses to candidate interventions before implementation. When supplied with subsequently implemented policies, GABLE reproduced epidemic trajectories and generated distinct responses to alternative policy timing and composition. By leveraging LLMs as a flexible behavioral layer, GABLE provides a framework for coupling context-sensitive behavioral generation with epidemic dynamics.
Figures & tables
Figure 1: Overview of GABLE framework. ( a ) The proposed framework couples an LLM-based behavioral layer with a mechanistic compartmental epidemic model through a time-varying contact matrix. The LLM-based behavioral layer takes pre-pandemic contacts with policy and epidemic conditions and uses the LLM to determine how baseline contacts are changed under the current context. These behavioral responses are aggregated into an age-structured contact matrix, which governs the mechanistic epidemic model. The resulting epidemic outcomes are then fed back to the behavioral layer to update subsequent contacts, forming a dynamic behavior–disease feedback loop. ( b-d ) The proposed framework supports three complementary tasks. ( b ) Retrospective reconstruction: historical policy and epidemic conditions are used to generate time-varying contacts, and the coupled model is fitted to the observed epidemic trajectory. ( c ) Short-term forecasting: policies are held fixed and enable rolling forecasts in which future contacts and epidemic outcomes evolve through the coupled behavior–disease system. ( d ) Prospective scenario modeling: alternative future policies are used to project and compare downstream epidemic outcomes.
Figure 2: GABLE generates adaptive and age-specific contact patterns. ( a ) Population-weighted mean number of daily contacts per person from March 2020 to July 2021 for the three LLMs and the mobility-driven matrices. The horizontal dotted line denotes the pre-pandemic baseline. Shaded intervals denote the three national lockdowns, and the vertical dashed line identifies the week beginning 9 November 2020. ( b ) Weekly Oxford COVID-19 government policy stringency index. ( c ) Mean daily contacts per person among children aged 0–10 years, adolescents aged 11–18 years, adults aged 19–64 years, and seniors aged 65 years or older. Horizontal dotted lines denote the corresponding pre-pandemic values. Vertical axis limits differ among age groups. ( d ) Weekly population contact intensity plotted against the stringency index. Lines show ordinary least-squares fits, and annotations report Pearson correlation coefficients. ( e ) Reciprocity-corrected contact matrices for all five matrix configurations in the week beginning 9 November 2020, during the second national lockdown. Matrix entries are daily contacts per person and share a common color scale.
Figure 3: Retrospective reconstruction of hospital admissions using the five contact-matrix configurations. ( a ) Time-varying correcting factor, piecewise constant over the calibration windows. A value of one indicates no additional rescaling of matrix contact intensity. Shaded intervals denote the three national lockdowns. ( b ) Distribution of the correcting factor across fitted weeks. The factor is piecewise constant within each calibration window. Horizontal bars denote medians, and the dashed line marks a correcting factor of one. ( c ) Observed and simulated daily hospital admissions overall and by age group. Lines show ensemble medians over 100 stochastic realizations, and points show SI-VIC observations. ( d ) Difference between simulated and observed cumulative admissions over the full study period, overall and by age group. Boxes show distributions across stochastic realizations, center lines denote medians, boxes span the interquartile range, and whiskers extend to 1.5 times the interquartile range. The horizontal dashed line denotes zero difference. Percentage labels report the median cumulative bias relative to the observed total for the corresponding age group.
Figure 4: Real-time forecasts from rolling origins during the second epidemic wave. ( a ) Observed daily hospital admissions and selected four-week projections from the GABLE and mobility-driven matrix configurations, summed over age groups. Points show daily observations and the black line shows their seven-day moving average. Lines show predictive medians; darker and lighter bands show the 50% and 95% prediction intervals, respectively. Open symbols mark forecast origins. ( b ) Corresponding projections by age group. Shading in a and b denotes the second national lockdown. ( c ) Ratio of projected to retrospectively generated contact intensity by forecast horizon. Origins are classified by the four-week change in stringency index as tightening, limited change, or relaxation. Lines show means and bands show interquartile ranges. ( d ) Mean weighted interval score by forecast horizon. ( e ) Mean 95% prediction-interval coverage; the dashed line denotes the nominal level. ( f ) GABLE’s WIS relative to each reference method, overall and by age group. Values below one favor GABLE.
Figure 5: Policy-conditioned and counterfactual projections at the imposition and relaxation of the second national lockdown. Vertical dashed lines mark the branch points, and shading marks the four-week projection windows. ( a , b ) Observed daily hospital admissions and ensemble-median projections under six policy scenarios. The gray band is the interquartile range of the factual-policy projection. ( c , d ) Aggregate contact intensity under the corresponding scenarios. ( e , f ) Mean four-week age-specific contact change relative to the factual scenario. Numbers below scenario labels are mean Oxford stringency indices; panel titles give the factual values. ( g ) Four-week cumulative admission change versus aggregate contact change, relative to the factual scenario. Symbols distinguish branch points, colors distinguish scenarios, and the dashed line is a least-squares fit. ( h ) Age-specific changes under school closure. Bars show contact intensity and open symbols show cumulative admissions; parentheses give the pre-pandemic share of contacts occurring at school.
Figure S1 : Structure of the transmission model. ( a ) Compartments and transitions within one age class, one viral strain, and one vaccination stratum. Susceptible individuals ( S ) acquire strain v at rate λiv(t) and enter the latent state ( E ). Individuals progress from the presymptomatic state ( Ip ) to asymptomatic ( Ias ), pauci-symptomatic ( Ips ), mildly symptomatic ( Ims ), or severely symptomatic ( Iss ) infection according to age- and strain-specific probabilities. Only severe cases enter the hospital pathway, passing through a waiting state ( W ) that represents the delay between symptom onset and hospital admission. The transition from W to H corresponds to the daily hospital admissions used for model calibration. Rate symbols and parameter values are given in Table S2 . ( b ) Strain strata. Susceptible individuals acquire either the Wuhan-like strain ( w ) or the Alpha variant ( A ), progress through the compartment structure shown in ( a ) (dashed arrows), and share a common recovered state because recovery from either strain confers cross-immunity. ( c ) Vaccination strata. The compartment structure in ( a ) is replicated across vaccination levels. Transitions between dose levels follow the observed vaccination schedule for adults and seniors. Vaccination modifies susceptibility, transmissibility, symptom probability, and disease severity (Table S3 ).
Figure S2 : Structural comparison of LLM and mobility-driven contact matrices. ( a ) Element-wise comparisons of the adult–senior matrix block for GPT-4o mini, Gemini 2.5 Flash, and Grok 3 mini. Each point represents one reciprocity-corrected matrix element in one matched week. Filled and open symbols denote within- and between-group contacts, respectively. Both axes are logarithmic; dashed lines indicate equality with the mobility-driven matrix. Annotations report slopes from regressions constrained through the origin ( b ) and Pearson correlations ( r ). ( b ) Corresponding comparisons for matrix elements involving children or adolescents. ( c ) Weekly distributions of the within-group contact fraction by participant age group and matrix configuration. Boxes span the interquartile range, center lines denote medians, and whiskers extend to 1.5 times the interquartile range. Diamonds show the static pre-pandemic values. ( d ) Median age-specific contact intensity relative to the mobility-driven matrices across matched weeks. Values below and above one indicate lower and higher contact intensity, respectively.
Figure S3 : Validation under the factual policy scenario across 13 rolling origins. ( a ) Observed daily hospital admissions and four-week projections when the policy levels subsequently implemented are supplied for each target week, while future admissions remain unavailable. ( b ) Relative error by forecast horizon. Horizontal bars denote means, and annotations report mean absolute relative error.
Figure S4 : Sensitivity of generated contact patterns and epidemiological performance to epidemic-context information. GPT-4o mini was evaluated under three information conditions: the masked baseline used in the main analysis, deeper masking that additionally removes the country identity and replaces numerical epidemic counts with qualitative descriptions, and full disclosure that explicitly identifies COVID-19, France, and the calendar week. (a) Weekly aggregate daily contacts per person generated under the three conditions. The dotted horizontal line indicates the pre-pandemic contact level; shaded intervals denote the three national lockdowns. (b) Age-structured contact matrices in the week beginning 9 November 2020, under baseline, deeper masking, and full disclosure. (c) Distribution of calibration correcting factors across retrospective calibration windows. (d) Cumulative hospitalization bias in the retrospective evaluation; labels report the corresponding mean bias. (e) Weighted interval score by forecast horizon. (f) Empirical coverage of the 95% prediction intervals by forecast horizon; the dashed horizontal line marks nominal 95% coverage.
Setting
Policy levels at week t
Duration counter
Epidemic block
Retrospective
observed at t
observed run ending at t
cases and deaths at t
Forecast from origin o
observed at o
run at o , extended by t−o
admissions to t−1 , simulated after o
Policy-conditioned
observed at t
observed run ending at t
admissions to t−1 , simulated after o
Counterfactual
scenario table at t
run on the scenario path
admissions to t−1 , simulated after o
Table S1 : Fields of the system message that differ between settings . All other content is identical throughout.
Parameter
Value
Source
Latent period, 1/σ
3.7 days
[ 46 ]
Presymptomatic period, 1/θ
1.5 days
[ 26 ]
Infectious period, 1/γ
2.0 days
[ 12 ]
Waiting time for hospitalization, 1/ω
3.0 days
[ 10 , 59 ]
Time in hospital, 1/κ
14.0 days
[ 10 ]
Probability asymptomatic, pas
0.4
[ 47 ]
Table S2 : Natural-history and clinical parameters of the transmission model. Values apply to both strains except where a strain is named. The asymptomatic probability is the same for all ages and both strains.
Vaccine effect
One dose
Two doses
Source
Against infection
0.60
0.95
[ 16 , 34 , 67 ]
Against onward transmission given infection
0.15
0.68
[ 23 ]
Against symptomatic disease
0.70
0.97
[ 16 , 34 ]
Against severe disease
0.80
0.975
[ 16 , 34 ]
Table S3 : Vaccine effectiveness by dose level, applied equally to both strains. The values are for the Pfizer vaccine. Dose roll-out follows the administered-dose record [ 66 ] , and the maximum coverage among adults and seniors is 0.99.
Origin
Target
Δ SI
Impact
Indicators that moved
26 Oct 2020
23 Nov 2020
15.6
+131%
schools, workplaces, public events, internal movement
12 Oct 2020
9 Nov 2020
33.1
+120%
schools, workplaces, public events, stay-at-home, internal movement
19 Oct 2020
16 Nov 2020
29.2
+46%
schools, workplaces, public events, internal movement
23 Nov 2020
21 Dec 2020
−13.8
−31%
workplaces, internal movement
14 Sep 2020
12 Oct 2020
−3.0
+25%
schools, internal movement
7 Dec 2020
4 Jan 2021
−11.1
−15%
internal movement
Table S4 : Candidate branch points, ranked by the simulated impact of the policy change observed over the window. Origins and targets are identified by the Monday of the corresponding week; the target is four weeks after the origin. Δ SI is the change in the tracker’s average stringency index between the origin and the target week.
Lockdown branch , levels in force at the branch 1∣2∣1∣4∣0∣2∣0
Scenario
2 Nov
9 Nov
16 Nov
23 Nov
Factual
2∣3∣2∣4∣0∣2∣2
2∣3∣2∣4∣0∣2∣2
2∣3∣2∣4∣0∣2∣2
2∣3∣2∣4∣0∣2∣2
No change
1∣2∣1∣4∣0∣2∣0
1∣2∣1∣4∣0∣2∣0
1∣2∣1∣4∣0∣2∣0
1∣2∣1∣4∣0∣2∣0
Delayed 1 wk
1∣2∣1∣4∣0∣2∣0
2∣3∣2∣4∣0∣2∣2
2∣3∣2∣4∣0∣2∣2
2∣3∣2∣4∣0∣2∣2
Delayed 2 wk
1∣2∣1∣4∣0∣2∣0
1∣2∣1∣4∣0∣2∣0
2∣3∣2∣4∣0∣2∣2
2∣3∣2∣4∣0∣2∣2
Maximum
3∣3∣2∣4∣2∣3∣2
3∣3∣2∣4∣2∣3∣2
3∣3∣2∣4∣2∣3∣2
3∣3∣2∣4∣2∣3∣2
Table S5 : Scenario level tables. Each cell lists the seven tracker levels for that week, in the order C1–C7: schools, workplaces, public events, gatherings, public transport, stay-at-home, and internal movement. Column headers give the Monday of each projected week; the first projected week begins one week after the branch.
Epidemic forecasting predicts disease incidence, outbreaks, and healthcare burden across time and regions to guide surveillance and public-health decisions.
Big Data Institute, Li Ka Shing Center for Health Information and Discovery, University of Oxford, Oxford, United Kingdom · Leverhulme Centre for Demographic Science, Nuffield Department of Population Health, University of Oxford, Oxford, United Kingdom · Pandemic Sciences Institute, Nuffield Department of Medicine, University of Oxford, Oxford, United Kingdom +3
Division of Epidemiology and Biostatistics, School of Public Health, University of Illinois at Chicago, 1603 W. Taylor St., Chicago, IL, USA · Program for Experimental and Theoretical Modeling, Division of Hepatology, Department of Medicine, Loyola University Chicago, Maywood, IL 60153, USA