The same meal can send one person's blood sugar soaring and leave another's nearly flat. The best-known systems that predict an individual's response to a meal personalize once, at the start. They take a stool sample for gut-microbiome sequencing, record a week or two of continuous glucose monitor (CGM) readings, and then freeze that profile into a meal-recommendation engine. Clinical risk modeling has shown repeatedly that one-time snapshots lose their predictive value as a patient's physiology changes. We propose to replace the frozen, expensive profile with a cheap one that is refreshed every week from the CGM data the patient already produces. The refreshed profile feeds a gradient-boosted additive model, a sum of per-feature curves built from many small decision trees, so a clinician can read each feature's contribution directly.
The core idea fits in two sentences. Each week, we fit a small physiological glucose model to the patient's recent meals. This yields a few interpretable numbers: how insulin-sensitive they currently are, how fast glucose clears on its own, and their resting glucose level. These numbers enter a glass-box boosted model of next week's meal responses as person-level features that interact with meal composition. The research question is whether this rolling, mechanistic profile can match or beat a static baseline profile (including microbiome data, where available), whether it tracks physiological drift that a frozen profile misses, and whether it explains predictions in units clinicians already use.
Core Claim
The evidence that personalization matters is strong. The randomized pilot of personalized postprandial-targeting diets (Rein et al.) reports that carbohydrate counting explains about 18% of the variance in meal-time glucose spikes. Their model, using clinical and microbiome features, explains 46%. The earlier Personalized Nutrition Project reached a 0.7–0.77 correlation between predicted and measured responses across 800 people (The Gut Microbiome and Individual-Specific Responses to Diet). These papers motivate the work, and they also define its limits. Both personalize from a static pre-intervention profile, and both depend on stool sequencing that is costly and slow. The same review attributes only 6.4% of glucose-response variance in PREDICT1 to the microbiome. Much of what personalization captures may therefore be current physiological state, which CGM data can estimate.
Two lines of work show why a static profile is structurally weak. Intensive-care models peak in accuracy only after the first day (Meiring et al.). In surgery, intraoperative trajectories add the most value precisely in patients a preoperative score called low-risk: AUROC rises by 0.223 in the lowest tertile (Beyond Thresholds). In metabolism, CGM curve shapes from an oral glucose tolerance test reveal muscle insulin resistance that HbA1c misses (Prediction of metabolic subphenotypes). These results suggest, but do not prove, that metabolic state drifts on clinically relevant timescales.
Our specific claim is stronger than "rolling beats static." A mechanistically parameterized rolling profile should do three things better than a rolling profile of raw glucose summaries. It should separate the person from the meal, so a week of high-carbohydrate eating is not mistaken for low insulin sensitivity. It should extrapolate more sensibly to meal sizes the person has not recently eaten. And it should produce explanations that obey basic physiology, such as more carbohydrate never lowering the predicted spike. If raw summaries match it on all three, the mechanistic ingredient is unnecessary, and we will report that.
Research Program
The method has two components.
The weekly profile. The method supplier is the Keto-Med mechanistic autoencoder (Interpretable Mechanistic Representations for Meal-level Glycemic Control in the Wild). That paper replaces a neural decoder with the Bergman minimal model, a three-parameter differential equation for glucose and remote insulin action. Its latent space recovers insulin sensitivity $S_I$, glucose effectiveness $S_G$ and basal glucose $G_b$. In two dimensions, these separate type 2 diabetes from prediabetes for 29 of 33 people. We keep the equation but drop the deep encoder.
For each logged meal, we fit $(S_I, S_G, G_b)$ and a meal-appearance timing offset by penalized least squares. The fit is shrunk toward a population prior, which absorbs the logging-time errors that paper documents. We then summarize a person's trailing seven days as a precision-weighted average of the per-meal estimates, together with its spread.
The fit uses only meals strictly before the meal being predicted. These parameters are "effective" values fitted from glucose alone, not clamp-measured physiology. Where gold-standard phenotyping exists, as in the Stanford cohort of the subphenotype paper, we will check their rank correlation with measured insulin resistance rather than assume it.
The glass-box predictor. This is an Explainable Boosting Machine (EBM). It fits one boosted curve per feature plus a small set of pairwise interaction surfaces. We use the Boulevard-regularized variant from Statistical Inference for Explainable Boosting Machines, which averages trees rather than summing them. That paper proves convergence to a kernel ridge regression and gives closed-form confidence bands on each curve, but only for static tabular data. We extend it by making some inputs time-indexed person-state estimates. The model is
$$\hat{y}_{m} = \beta_0 + \sum_j f_j(x_{m,j}) + \sum_{(j,k)} f_{jk}(x_{m,j}, z_{p(m),k}),$$
where $\hat{y}_m$ is the predicted incremental area under the glucose curve for meal $m$ over two hours. The $x_{m,j}$ are that meal's features: carbohydrate, fiber, fat, protein and time of day. The $z_{p(m),k}$ are the rolling profile of the person $p(m)$ who ate it. The $f$ are boosted shape functions.
The meal-by-person surfaces $f_{jk}$ carry the personalization. One example is the carbohydrate effect as a function of current insulin sensitivity. We constrain the carbohydrate curve to be monotone non-decreasing. This borrows the ordinal causal-ranking idea of Hybrid2 Neural ODE Causal Modeling, which found unconstrained Transformers at chance on "which meal raises glucose more" questions. We implement that idea as a split constraint in the trees rather than as a loss on a neural ODE.
The clinical readout. The explanation a clinician sees is a single sentence with a confidence band. An example: "this meal is predicted to spike more than last month because your fitted insulin sensitivity fell by a third." This compresses a changing explanation into one weekly number, addressing the cognitive-overload problem the research file raises for continuously updating attributions.
Baselines
The naive reference is the carbohydrate-only predictor: a one-feature monotone boosted curve of response against logged carbohydrate. It mirrors the carbohydrate-counting comparator in Rein et al., which reported about 18% variance explained on their cohort. A second naive reference is the person's own mean response over the past week, with no meal information. This baseline tests whether anything beyond "this person spikes a lot" is being learned.
The strongest existing personalization approach is the static-profile boosted model in the style of the Personalized Nutrition Project. It is an unconstrained gradient-boosted tree model (LightGBM) on meal features plus baseline person features, fixed at the end of a one- or two-week profiling window. The baseline features are demographics, BMI, fasting glucose and the first-window CGM summaries. Microbiome features are included only where available. Its published figures are a 0.7–0.77 predicted-versus-measured correlation on 800 people (The Gut Microbiome and Individual-Specific Responses to Diet) and 46% variance explained in a 23-person type 2 diabetes cohort (Rein et al.). Those cohorts are not among the datasets we can run on, so these numbers serve as context, not a head-to-head target. For Keto-Med and CGMacros specifically, no reported meal-response prediction result was found on Lacuna. We will therefore reimplement this baseline ourselves on identical splits.
The strongest sequence-model competitor is a Temporal Fusion Transformer, an attention-based forecaster that ingests the raw CGM and meal stream. We choose it over the state-space model of SSM-CGM because the TFT is the reference that paper itself beat. SSM-CGM reports only a 2–7% reduction in mean absolute error relative to the TFT on AI-READI, with no absolute value found on Lacuna. Where code permits, we will also run SSM-CGM itself.
Two ablations isolate the key ingredient. The first, and most important, swaps the mechanistic profile for a rolling empirical profile. This uses the same trailing window, the same EBM and the same constraints, with person features replaced by raw summaries: mean meal response, mean peak, time-to-peak, and response per gram of carbohydrate. The second keeps the mechanistic profile but freezes it at week one.
All models receive the same features, the same splits and an equal hyperparameter search budget of 100 configurations, selected on a temporally held-out validation week. Beating the static baseline means a statistically significant reduction in meal-response RMSE on held-out later weeks, judged by a person-level paired bootstrap. Beating the empirical ablation means either lower error or the same error with fewer constraint violations and better extrapolation on the stress tests below.
Why not just…?
Why not just add rolling empirical CGM summaries to XGBoost? This is the real threat. It may capture most of the drift signal at zero modeling cost. The empirical ablation exists to settle it. Our argument for the mechanistic profile is not raw accuracy but confounding: a week of large meals inflates "mean response" without any change in the person. We test this directly by stratifying held-out weeks by how much a person's meal mix changed from the previous week. If empirical summaries match the mechanistic profile even in high-change weeks and in carbohydrate-extrapolation tests, we will recommend the simpler method and report the mechanistic layer as an interpretability convenience only.
Why not just use a sequence model on the raw stream? Sequence models can absorb drift implicitly. However, Hybrid2 Neural ODE Causal Modeling found unconstrained Transformers and S4D models at 60–80% error when ranking which intervention raises glucose more. GlucoBench found simple linear and ARIMA models often winning on small cohorts. Keto-Med has 33 people and CGMacros is similar in scale. The TFT baseline and our causal-ranking test measure both accuracy and sanity on the same data.
Why not just fit a per-person linear model or a mixed-effects model? A random-slope regression of response on carbohydrate per person is transparent and already "personal." Its slopes, however, are static unless re-fit, and it cannot express nonlinear carbohydrate–fiber–fat interactions. Rein et al. found such interactions mattered: the nonlinear model explained 46% versus about 18% for linear counting. We include a rolling-window mixed model as a further comparator. If it matches the EBM, nonlinearity is not earning its place.
Why not just keep the microbiome profile? Sequencing is the gold-standard input in this literature, and we cannot dismiss it. Its cost, turnaround time and one-time nature are exactly what we aim to remove. Most of our datasets lack stool data. The honest claim we can test is narrower: whether rolling CGM profiles close the gap between "no personalization" and published microbiome-based figures. If access to a cohort with stool data becomes possible, the head-to-head comparison is the obvious next step.
Proposed Experiments
The primary testbed is Keto-Med: 964 meal-response curves from 33 people with prediabetes or type 2 diabetes in a ketogenic-versus-Mediterranean crossover (Interpretable Mechanistic Representations). The diet switch is a built-in physiological shift. We profile people in the first phase and predict meals in the second. The decisive drift check plots held-out error against weeks since profiling for the frozen and rolling variants. The static-decay hypothesis predicts that the gap widens after the switch. If it does not widen, metabolic state is more stable than the clinical-risk analogy suggests, and the static approach is vindicated for this horizon.
CGMacros, whose meal annotations trained the meal detector in SSM-CGM, provides a second cohort with better macronutrient labels. The GlucoBench datasets (GlucoBench) supply an out-of-distribution check on forecasting. There we predict one-hour glucose rather than meal-level area, and compare against GlucoBench's reported Weinstock Transformer RMSE of 13.22, using their exact protocol.
The splits are within-person temporal for the main results. A leave-one-person-out cold-start condition gives a new person only the population prior plus one week of meals.
The primary outcomes are RMSE and Pearson correlation of two-hour incremental area under the curve. Secondary outcomes are peak glucose error, and calibration of the Boulevard confidence bands, measured as empirical coverage of nominal 90% intervals on held-out meals.
We add two stress tests. The extrapolation test holds out each person's top-decile-carbohydrate meals from training weeks and predicts them. The causal-ranking test, adapted from Hybrid2 Neural ODE Causal Modeling, asks each model which of two counterfactual carbohydrate doses yields the higher spike for the same person and week, with the correct answer fixed by physiology.
The overall result is decisive if three things hold. The rolling mechanistic EBM must beat the frozen-profile variant after the diet switch. It must match or beat the empirical-summary ablation in high meal-mix-change weeks and on extrapolation. And it must reach near-zero ranking error where the TFT does not. If only the first holds, the publishable finding is simply that metabolic personalization should be refreshed, and empirical summaries suffice to do it.
References
- Effects of personalized diets by prediction of glycemic responses on glycemic control and metabolic health in newly diagnosed T2DM: a randomized dietary intervention pilot trial
- The Gut Microbiome and Individual-Specific Responses to Diet
- Optimal intensive care outcome prediction over time using machine learning
- Beyond Thresholds: Learning Perioperative Risk from Intraoperative Physiological Trajectories
- Prediction of metabolic subphenotypes of type 2 diabetes via continuous glucose monitoring and machine learning
- Interpretable Mechanistic Representations for Meal-level Glycemic Control in the Wild
- Statistical Inference for Explainable Boosting Machines
- Hybrid2 Neural ODE Causal Modeling and an Application to Glycemic Response
- SSM-CGM: Interpretable State-Space Forecasting Model of Continuous Glucose Monitoring for Personalized Diabetes Management
- GlucoBench: Curated List of Continuous Glucose Monitoring Datasets with Prediction Benchmarks