Personalized glycemic response model
Every person's blood glucose reacts differently to the same meal. Two athletes eating an identical plate of pasta can show very different glucose excursions: one barely budging, the other spiking 60 mg/dL in under 45 minutes. This is the problem of personalized nutrition: understanding what drives these individual differences, and whether machine learning can predict them without invasive measurements.
This page presents the model from Zignoli et al. (2024), a machine-learning approach trained on 3,296 real-world meal events from 927 healthy individuals wearing continuous glucose monitors (CGM) in uncontrolled settings.

The dataset
The study used data collected by Supersapiens, where participants self-reported meal timing and macronutrient content via a mobile app while wearing an Abbott Libre Sense biosensor. The CGM measured interstitial glucose every minute, capturing the full post-meal glycemic profile.
Key dataset characteristics:
- 927 individuals (666 men, 235 women), age 45.5 ± 9.4 years
- 3,296 meal events logged in free-living conditions
- No diabetes: all self-declared healthy
- Self-reported macronutrients: carbohydrates (CHO), fat (FAT), protein (PRO) in grams
Parameterizing the glycemic response
Rather than predicting a single number (e.g., the area under the curve, AUC, at 120 min), the authors fitted a bell-shaped curve to the 90-minute CGM trace after each meal. This captures the full shape of the response with just three parameters (amplitude, peak time, and width):
where
The three parameters describe the glycemic response completely:
| Parameter | Symbol | Meaning | Dataset median |
|---|---|---|---|
| Amplitude | A | Peak rise above baseline (mg/dL) | 31 mg/dL |
| Peak time | δ | Time to glucose peak (min) | 50 min |
| Width | σ | Spread of the response (min) | 18 min |
Gaussian model of the post-meal glycemic response
Each meal event is described by three parameters: amplitude A, peak time δ, and width σ. The curve is fitted to the 90-minute CGM trace after the meal. Example shown with A = 42 mg/dL, δ = 45 min, σ = 18 min.
The baseline is the average glucose in the last 5 minutes before the meal, observed from CGM. The function is fitted to each meal trace using least-squares optimization (scipy, soft L1 loss: a loss that is less sensitive to outliers than the ordinary squared error).
Predicting the response parameters from features
So far we have a way to describe any glycemic response with three numbers (A, δ, σ). The next question is: can we predict those numbers for a new meal, before measuring anything?
This is where machine learning enters. The approach is the same input-output mapping covered in Module 5 on AI and machine learning models (Training vs validationM5): select a set of measurable features, pass them through a trained model, and read off the predicted outputs.
Here the inputs are the meal composition (CHO, FAT, PRO), individual characteristics (age, body mass index (BMI), sex), and summary statistics of the CGM trace in the 24 hours and 4 hours before the meal, such as the mean, the standard deviation (SD), the time in range (TIR) and the autocorrelation (how closely the glucose trace resembles itself a few minutes later). The outputs are the three response parameters A, δ and σ.
Feature-to-parameter mapping: what goes in, what comes out
The machine-learning model takes ~30 input features and predicts the three Gaussian shape parameters.
Meal
CHO, FAT, PRO (g)
Individual
Age, BMI, Sex
CGM · 24 h
Mean, SD, TIR, Skew, Glucotype…
CGM · 4 h
Mean, SD, TIR, Autocorrelation…
XGBoost
+ linear (A)
Amplitude
mg/dL
Peak time
min
Width
min
The diagram above shows the full feature set. Notice that meal composition (CHO, FAT, PRO) accounts for only 3 of roughly 30 inputs. The dominant predictors turn out to be the pre-meal CGM history features: the 24-hour and 4-hour windows before eating capture the individual's current metabolic state far better than macronutrients alone. This is consistent with the low R² of the macronutrient-only model (below) and the stronger performance of the full XGBoost model.
Two models were trained, serving different purposes:
XGBoost (full feature set)
A gradient-boosted tree ensemble, one model per output (A, δ, σ), trained on all ~30 features listed above. Configuration: 200 trees, max depth 5, learning rate 0.01, subsampling 50%.
Performance on the held-out 20% test set (Pearson correlation r between predicted and measured values, and root-mean-square error, RMSE):
| Output | Pearson r | RMSE |
|---|---|---|
| Amplitude A | 0.48 | 13.2 ± 9.5 mg/dL |
| Peak time δ | 0.17 | 12.2 ± 9.2 min |
| Width σ | 0.19 | 3.5 ± 2.6 min |
Multi-linear regression (meal features only, interpretable)
To isolate the specific contribution of meal macronutrients to amplitude A, and to power the interactive tool below, a simpler model was also fitted using only meal composition as input:
Fitted coefficients (n = 3,926, R² = 0.14):
| Term | Coefficient | Interpretation |
|---|---|---|
| Intercept | +25.85 | Baseline amplitude at zero macronutrients |
| CHO | +0.263 | +1 g CHO → +0.26 mg/dL rise (when FAT = PRO = 0) |
| FAT | −0.108 | +1 g FAT → −0.11 mg/dL rise (when CHO = PRO = 0) |
| PRO | −0.005 | Not significant (p = 0.83) |
| CHO × PRO | −0.0014 | High PRO weakens the CHO-driven spike |
| CHO × FAT | −0.0009 | High FAT weakens the CHO-driven spike |
| PRO × FAT | +0.0008 | Small positive interaction between PRO and FAT |
Macronutrient contributions to the glycemic response
The chart below shows how each macronutrient contributes to glycemic amplitude A (equivalent to Fig. 5 of Zignoli et al. 2024). Dots are binned means from the actual dataset with the other macronutrients' effects partialled out; the curve is a polynomial fit to those means.
Contribution of each macronutrient to glycemic amplitude A. Dots = actual dataset binned means (other macronutrients partialled out). Curves = polynomial fit to those means.
Carbohydrates (CHO)
Contribution becomes positive after ~35 g and saturates above ~70–80 g.
Fat (FAT)
Near-neutral below ~20 g; increasingly negative beyond 30 g.
Protein (PRO)
Positive at very low protein (<10 g), neutral at 10–30 g, gradually negative beyond 30 g.
The key patterns below are consistent with the Shapley values (SHAP) reported in the paper. A Shapley value measures how much one input pushes a single prediction above or below the model's average prediction.
- CHO: contribution is steeply negative below ~20 g, crosses zero around 35 g, then rises rapidly up to ~70–80 g where it begins to saturate. This matches the non-linear S-shape reported in the paper, where CHO becomes the dominant driver of the glycemic spike above 40 g.
- FAT: near-neutral or slightly positive at very low intake (below 20 g), then increasingly negative beyond 30 g. FAT blunts the glycemic response and also delays and widens the peak (later peak time δ, larger σ).
- PRO: positive at very low protein (below 10 g), neutral between 10 and 30 g, and gradually negative at higher intakes. Like FAT, PRO moderates the CHO-driven spike primarily through the interaction terms (CHO×PRO), not through its main effect alone.
Interactive tool
Use the tool below to explore how changing meal composition and individual characteristics affects the predicted glycemic response curve.
- Inputs: CHO, PRO and FAT (g), age, height and weight (used to compute BMI), biological sex, and basal (pre-meal) glucose.
- Outputs: amplitude A, peak time δ, width σ, the estimated peak glucose, and the 90-minute glucose curve with its 95% prediction interval.
The amplitude A uses the multi-linear regression model above; peak time δ and width σ use simplified linear approximations from meal and individual features only.
Predicted glycemic response, 90 minutes post-meal
Shaded band = empirical 95% prediction interval (−26.5 / +37.5 mg/dL on amplitude). Asymmetric: the upper tail is wider because the model underpredicts large spikes more than it overpredicts small ones. Horizontal bracket at baseline = ±σ response width.
Meal Composition
Total energy: 480 kcal
CHO share: 42%
Individual Characteristics
Amplitude A: multi-linear regression (R²=0.14, RMSE=16.7 mg/dL). Shaded band: empirical 95% prediction interval (−26.5 / +37.5 mg/dL), computed from the 2.5th and 97.5th percentiles of training residuals (n=3,926). Asymmetric because residuals are right-skewed (skewness=0.58): the model tends to underpredict large spikes. Peak time δ and width σ: simplified linear approximations; their variance is dominated by 24h pre-meal CGM features not entered here. Curve: f(t) = A · exp(−(t−δ)² / 2σ²) + baseline (Zignoli et al. 2024).
Limitations and educational value
The model presented here is educational more than clinical. Key limitations:
- Self-reported macronutrients introduce substantial noise
- No gut microbiome, exercise, or stress data: all known to modulate glycemic response
- Intra-individual variability limits the ceiling accuracy for any model in uncontrolled settings
- Population-level trends (CHO drives spikes, FAT blunts them) do not replace personalized CGM feedback
Despite these limitations, the model:
- quantifies the relative roles of CHO, FAT, and PRO in shaping the glycemic response
- shows that combining CGM history with meal data substantially improves prediction
- looks at meal composition and the individual's state, not just at calories