Is It the Meal or the Metabolism? Prior Sensitivity of Glucose Phenotypes Inferred from Wearables

A large glucose spike after a meal has two competing explanations. Either the person ate more carbohydrate than they logged, or their body clears glucose poorly because insulin sensitivity is low. Continuous glucose monitors, which are skin sensors that read glucose every five minutes, record the spike but cannot say which explanation is true. Recent models infer physiological parameters such as insulin sensitivity from these messy real-world recordings and report that the parameters separate type 2 diabetes from pre-diabetes remarkably well. Those models also treat the true carbohydrate intake as unknown. When two unknowns can trade off against each other to produce the same curve, the data cannot settle how much of the spike belongs to each. The choice falls to the prior, meaning the modeller's assumption about plausible values before seeing any data. So the clinical signal may partly reflect that assumption rather than the patient.

We propose to measure this directly and to build an inference method that reports it routinely. The central claim is testable. Summaries of a person's glucose swings that a model predicts, such as mean excursion amplitude or day-to-day differences, should be insensitive to the prior, because the sensor data pin down the trajectory. The physiological parameters behind those swings, insulin sensitivity above all, should be sensitive to the prior on how much people under-report their meals. If that holds, published disease stratification from wearable glucose data needs a stated robustness region: the range of prior assumptions over which the clinical conclusion survives. We will compute that region with an amortized inference network that takes the prior itself as an input.

Core Claim and What Is New

The closest work is Interpretable Mechanistic Representations for Meal-level Glycemic Control in the Wild. It encodes glucose curves and meal logs with a recurrent network and maps the result to the parameters of the Bergman minimal model, a three-equation ordinary differential equation for glucose and insulin action. The parameters are insulin sensitivity $S_I$, glucose effectiveness $S_G$ and basal glucose $G_b$. The model decodes by integrating that equation, and it treats effective carbohydrate intake as a latent variable. On the Keto-Med cohort (33 people, 964 post-meal curves), a linear boundary on $(S_I, G_b)$ separated 29 of 33 subjects by diagnosis, and clustering reached normalized mutual information up to 4x that of standard glucose features. That paper motivates this proposal. It uses a fixed standard-normal latent prior and runs no sensitivity analysis. Its latent carbohydrate variable is exactly the variable that can absorb or release explanatory credit from $S_I$.

Two further lines of work supply methods for this proposal. Detecting and diagnosing prior and likelihood sensitivity with power-scaling perturbs a fitted posterior by raising the prior to a power $\alpha$ and reweights existing draws with importance sampling instead of refitting. It flags sensitivity when the cumulative Jensen–Shannon distance between base and perturbed posteriors reaches at least 0.05. Imprecise Bayesian Neural Networks and Credal Bayesian Deep Learning replace a single prior with a credal set, the convex hull of a few extreme priors, and train one network per extreme point. Applied to the UVa-Padova type 1 diabetes simulator, they reduced time outside safe glucose limits by up to 5.5% over standard Bayesian baselines.

Our proposal differs from each. Power-scaling only sharpens or flattens a prior and cannot shift its location. The prior that matters here is a location question: what fraction of carbohydrate goes unlogged. The credal work uses black-box networks on simulated data and never looks at the physiological parameters or at standard variability indices. It also pays one full training run per extreme prior.

What is new here is an empirical finding and a method. The finding is a map, on real data, of which inferred glucose quantities are driven by the data and which are driven by the prior. The method is a prior-conditioned amortized encoder. It is trained over a family of priors, so the posterior under any prior in a credal set can be read off at test time without retraining.

Research Program

The generative model follows the mechanistic paper. For each meal curve, latent physiology $(S_I, S_G, G_b)$ and a latent effective carbohydrate load $c$ produce a glucose trajectory through Euler integration of the Bergman model. Sensor readings add noise. We make the prior explicit and parameterized by hyperparameters $\lambda$. These include the mean and spread of the log-ratio between true and logged carbohydrate, $\log(c/c_{\text{logged}}) \sim \mathcal{N}(\mu_c, \sigma_c^2)$, and the location and scale of a population prior on $\log S_I$. A physiologically plausible box of $\lambda$ values defines the credal set.

The encoder receives the glucose curve, the meal log and $\lambda$, and outputs an approximate posterior $q(\theta, c \mid x, \lambda)$. Training draws $\lambda$ at random from the box for each minibatch and maximizes the usual evidence lower bound under that $\lambda$. This is the one ingredient the prior literature lacks: a single network that represents the whole map from prior to posterior. At test time, sweeping $\lambda$ costs one forward pass per setting. Taking the extremes over the box gives lower and upper bounds on any quantity of interest, in the spirit of the credal bounds but at roughly the cost of one training run.

For each posterior we compute two families of quantities. The first is the physiological parameters and the downstream diagnostic separation, reusing the linear boundary on $(S_I, G_b)$ and clustering. The second is posterior-predictive variability indices, computed with the definitions in iglu: mean amplitude of glycemic excursions (MAGE), CONGA, MODD, coefficient of variation, and the low and high blood glucose risk indices. The sensitivity of each quantity is the cumulative Jensen–Shannon distance between its distribution under base and perturbed priors, with the same 0.05 threshold used in the power-scaling paper. The distance is reported as a function of $\lambda$ so that the region where the diagnosis is stable can be drawn explicitly.

We also check that the amortized posterior is faithful, since it could be wrong in a way that hides sensitivity. On a subset of Keto-Med meals we fit the same non-amortized model with Markov chain Monte Carlo in Stan at a grid of $\lambda$ values. We then compare posterior means and intervals against the conditioned encoder's outputs.

Baselines

The naive reference point is to compute the iglu variability indices directly from the raw sensor data and classify diagnosis from them, with no model and no prior. The mechanistic paper reports that its latent parameters beat such standard glucose features by up to 4x in normalized mutual information on Keto-Med. We rerun this feature baseline on identical subject splits. If the mechanistic advantage shrinks toward this baseline anywhere inside the plausible prior box, the prior was carrying the result.

The strongest existing method is the mechanistic variational autoencoder itself, trained with its fixed standard-normal prior. We use the same architecture, data splits and training budget, retrained from scratch. Its reported result of 29/33 subjects separated by a linear boundary on $(S_I, G_b)$ is the number to reproduce first. Beating it does not mean higher accuracy. It means showing either that the result holds with sensitivity below 0.05 across the box, which is a positive robustness certificate, or that it falls below 29/33 at identifiable plausible priors. Both are informative, and the paper states which.

The second strongest competitor, for the sensitivity question specifically, is the power-scaling workflow in the priorsense package run on the Stan fit. We give it the same grid-point posteriors and report its $\alpha$-based flags. Comparing its flags with our location-shift sweep shows whether power-scaling alone would have caught the sensitivity. We also compare against a credal ensemble in the style of the imprecise neural network work: one separately trained encoder per corner of the prior box, with equal total compute reported. This tells us whether the single conditioned encoder loses accuracy relative to per-prior training.

The ablation that isolates the key ingredient fixes $\lambda$ during training while otherwise keeping the conditioned architecture. It then evaluates at other $\lambda$ values, either by importance reweighting or by feeding in $\lambda$ the network never saw. If the conditioned encoder does not beat this ablation in agreement with the Stan grid, the conditioning buys nothing.

Why not just…?

Why not just use flat or very diffuse priors so the prior cannot matter? Diffuse priors are not neutral. The Bayesian Analysis of Complex, High-Dimensional Models: Can It Be CODA? shows that uniform priors in many dimensions put their mass near the boundaries and act as strongly informative priors. Robust Filtering and Learning in State-Space Models reports that variational updates for state-space parameters became unstable and sensitive under non-informative hyperpriors, forcing its authors to fix parameters. More concretely, a flat prior on unlogged carbohydrate lets the model explain every spike with an imaginary meal and push $S_I$ to wherever the $S_I$ prior sits. We include a diffuse corner in the prior box, so the experiments show directly what this choice does to separation.

Why not just compute MAGE and the other indices with iglu and skip latent physiology? Our own hypothesis predicts that these indices are the robust part, so this is a serious alternative for pure description. What it cannot do is attribute a swing to physiology versus behaviour. It also inherits algorithmic disagreement: Calculating the Mean Amplitude of Glycemic Excursions reports that correlations between existing MAGE programs range from r = 0.926 to 0.987. The naive baseline tests the threat directly. If raw indices classify diagnosis as well as robust-region latent parameters do, we will report that the mechanistic layer adds interpretability claims the data do not support.

Why not just run priorsense on a Stan fit and be done? This is the real threat to the method contribution, and it is why priorsense is a baseline and not a strawman. Power-scaling changes prior precision but not location, and the under-reporting question is a location shift. Importance reweighting also degrades when the perturbed posterior moves far from the base, which the method's own convergence diagnostics are designed to detect. If priorsense flags the same quantities, and the Stan grid is cheap enough on Keto-Med, the conditioned encoder is only a convenience. In that case the empirical map remains the main contribution. The encoder's case rests on scaling to larger cohorts, where running Markov chain Monte Carlo per subject and per prior is costly.

Why not blame the simplified ODE rather than the prior? The Bergman model omits exercise, stress, circadian effects and the delay-driven chaotic dynamics described in Delay-induced uncertainty in the glucose-insulin system. Misspecification can look like prior sensitivity. We separate the two with the likelihood power-scaling check from the priorsense paper, which flags likelihood-driven problems separately. We also run a synthetic check in which data are simulated from the Bergman model itself. Any carbohydrate–$S_I$ trade-off that appears there cannot be caused by misspecification.

Proposed Experiments and Decisive Checks

The primary dataset is Keto-Med, because it is the only cohort in the file with the published stratification result. Its access terms are not stated in the file and must be confirmed. Replication uses CGMacros, which has glucose aligned with annotated meal logs, and the 19-subject Hall data bundled with iglu. The Hall data have no diagnosis labels, so they test only the variability-versus-parameter sensitivity pattern.

A synthetic study comes first. Meal curves are simulated from the Bergman model with known $S_I$ and known under-reporting. We verify that the conditioned encoder recovers the true values at the correct $\lambda$ and shows the predicted trade-off at incorrect $\lambda$. Recovery is measured against ground truth, and faithfulness against the Stan grid.

The first decisive check is the sensitivity ranking. The claim survives if posterior-predictive MAGE, CONGA and MODD stay below the 0.05 distance across the plausible box while $S_I$ exceeds it. It fails if both are robust, which would mean the data identify physiology better than feared, or if both are sensitive, which would mean the trajectory itself is weakly pinned down.

The second decisive check is the robustness region of the diagnosis. We plot separation accuracy and normalized mutual information over the $(\mu_c, \sigma_c)$ plane. We report whether 29/33 holds across under-reporting assumptions a dietitian would consider plausible, and where it breaks.

The third check is external. The mechanistic paper reported that inferred $G_b$ correlated strongly with HbA1c even though HbA1c was excluded from training. We test whether that correlation, and any analogous one for $S_I$, is stable across the box. A correlation that exists only under one prior should not count as validation.

There is no reported result found on Lacuna for prior sensitivity of any glucose model. The comparison numbers available are the 29/33 separation and the 4x normalized mutual information from the mechanistic paper, and the 0.05 distance threshold from the power-scaling paper.