Source-linked AI summary

From Prediction to Intervention: Personalized Meal-Level Glucose Regulation via an LLM Agent

Mingyu Huang, Weiqing Min, Ying Jin, Yilin Wang, Shuqiang Jiang

arXiv:2608.13581v1cs.HCcs.AIcs.LG

TL;DR

Personalized glucose regulation is difficult because identical meals can produce substantially different postprandial responses, while generic approaches lack dynamic physiological feedback. The paper combines individualized glucose prediction with an LLM meal-optimization agent, improving prediction accuracy and reducing glucose excursions across multiple public datasets.

  • Problem

    Postprandial glucose responses vary substantially across individuals, while existing generic, heuristic, and glycemic-index-based approaches lack true personalization and dynamic physiological feedback.

  • Method

    The framework combines physiology-aware glucose prediction with an LLM agent that iteratively optimizes meals using subject-specific predicted responses as feedback.

  • Results

    Across multiple public real-world datasets, the method improves PPGR prediction accuracy and reduces glucose excursions, including RMSE from 20.03 to 13.24 and incremental PPGR-curve area from 170.31 to 142.69.

  • Takeaways & Limitations

    The study supports framing personalized glucose regulation as a unified prediction–intervention problem linking subject-specific prediction with meal-level dietary decisions.

  • Takeaways & Limitations

    The optimized meal plans are evaluated through predicted glucose responses rather than prospective human intervention studies, so real-world validation remains necessary.

Abstract

from arXiv · show

Personalized glucose regulation remains a central yet unresolved challenge in precision nutrition, as postprandial glucose response varies substantially across individuals. Existing approaches based on glycemic indices fail to adequately account for such heterogeneity and lack the mechanism to dynamically adjust meals based on personal physiological feedback. In this context, recent advances in LLM-based agents offer a promising direction, as they enable context-aware reasoning and iterative refinement. Inspired by this, we propose a physio-feedback agentic loop, a unified system that integrates individualized absorption modeling with dietary intervention to regulate glucose response. Specifically, we develop a Physiology-Aware Glucose Predictor to model individualized absorption dynamics through a learnable Temporal Physiological Absorption Decay Module. We then construct a Prediction-Driven Two-Stage Meal Optimization Agent that iteratively refines real-world meals using predicted outcomes as explicit feedback. Through extensive experiments on multiple public datasets, we demonstrate that our method not only improves prediction accuracy but also effectively reduces glucose excursions. To the best of our knowledge, this paper marks the first step in integrating physiological learning with an LLM-based agent for personalized glucose regulation.

1 Introduction

Personalized postprandial glucose regulation is needed because identical meals produce substantially different responses across individuals, while glycemic-index and heuristic approaches remain generic and static. The paper addresses this with physiology-aware prediction and prediction-guided, meal-level optimization through an LLM agent, improving prediction accuracy and reducing glucose excursions.

  • Motivation: Identical meals produce substantially different postprandial glucose responses across individuals, so population-level glycemic indices cannot adequately support glucose control.The variation reflects differences in physiology, lifestyle, and metabolic state, motivating individualized strategies.
  • Limitations of Existing Approaches: Existing dietary recommendation and meal-planning methods rely mainly on heuristic rules and glycemic indices, operating statically and remaining largely agnostic to individual glucose dynamics.Continuous glucose monitoring enables fine-grained observation of glucose dynamics and prediction from diet, physical, and medication records.
  • Proposed Framework: The proposed system unifies subject-specific PPGR prediction with meal-level dietary decision making through an LLM agent that supports constraint-aware, multi-step refinement.It updates interventions using predicted outcomes as feedback rather than relying only on generic reasoning.
  • Proposed Framework: PAGP models individualized food and medication absorption with a learnable Temporal Physiological Absorption Decay Module, while PD-2SMO iteratively optimizes real-world meals using predicted PPGRs as feedback.The integrated method combines physiology-aware prediction with prediction-guided iterative meal optimization.
  • Results: 20.03 to 13.24 in RMSE on the typical Shanghai T2DM dataset, while incremental area under the PPGR curve decreased from 170.31 to 142.69 on the BIG IDEAS dataset relative to the baseline.Experiments across multiple public real-world datasets evaluated both PPGR prediction accuracy and regulation performance.

2 Related Work

Prior work has shifted PPGR prediction toward personalized, physiology-aware modeling, while glucose regulation research has largely emphasized automated pharmacological intervention. Machine learning and Medical Digital Twins address personalization and physiological interpretability, but dietary lifestyle intervention remains a distinct regulation direction.

  • Personalized PPGR Prediction: PPGR prediction has evolved from population-based to personalized models because responses reflect interactions among diet, microbiome, and host physiology.Individual variation in responses to specific macronutrients motivates subject-specific modeling.
  • Physiology-Aware Modeling: Machine learning models identify metabolic subphenotypes, but pure data-driven approaches often lack physiological interpretability; Medical Digital Twins integrate physiological knowledge with data-driven predictions.The Medical Digital Twin paradigm is presented as a way to bridge this interpretability gap.
  • Glucose Regulation: Glucose regulation research has extensively studied Artificial Pancreas systems using clinical, fuzzy-logic, and machine-learning models to automate insulin delivery for PPGR regulation.These systems regulate glucose through pharmacological intervention, contrasting with dietary lifestyle intervention.

3 Methods

The method couples individualized glucose prediction with prediction-guided meal optimization. PAGP models long- and short-term glucose dynamics with physiological absorption representations, while PD-2SMO iteratively refines meals under feasibility constraints.

  • 3.1 Personalized Glucose Prediction: PAGP predicts future glucose trajectories from personal CGM, dietary, activity, and medication data using multi-timescale, event-driven, and physiology-constrained modeling.Its design also integrates dietary semantics with structured physiological signals.
  • 3.1 Personalized Glucose Prediction: VMD separates historical glucose into low- and high-frequency components, which are modeled independently and reconstructed into the final glucose prediction.The low-frequency branch uses an LSTM for long-term trends, while the high-frequency branch focuses on rapid event-driven responses.
  • 3.1 Personalized Glucose Prediction: TPADM uses Hovorka-derived absorption dynamics with individual learnable decay and magnitude parameters to model dietary and medication effects over time.The residual absorption state is initialized after distant prior-meal absorption has subsided, and discrete meal events are represented as impulses.
  • 3.2 Meal Optimization Agent: PD-2SMO uses a distribution-first, substitution-on-demand strategy to optimize meals while preserving real-world dietary feasibility.The agent treats PPGR prediction as iterative optimization guidance.
  • 3.2 Meal Optimization Agent: Stage 1 adjusts existing component proportions under ±10% energy deviation and fixed ingredient, seasoning, and spice constraints before terminating if improvement is achieved.Stage 2 permits minimal substitution from a small candidate pool only when distribution-level adjustment fails.
  • 3.2 Meal Optimization Agent: OPRO generates candidate meals from PAGP feedback, filters infeasible candidates, and uses a memory buffer of strong candidates and failures to guide subsequent prompts.The loop ends when the optimization target is met or the evaluation budget is exhausted.

4 Experimental Evaluation

The evaluation spans heterogeneous glucose datasets and personalized 120-minute postprandial forecasting, showing that PAGP improves prediction accuracy while PD-2SMO reduces meal-level glucose exposure and excursions. Ablations further support the contributions of physiology-aware modeling, semantic dietary encoding, ingredient substitution, and iterative optimization.

  • Datasets and protocol: Experiments use four multimodal datasets spanning healthy, prediabetic, Type 1 diabetes, and Type 2 diabetes populations, with dietary, CGM, medication, insulin, and activity information.The datasets are Shanghai T1DM, Shanghai T2DM, CGMacros, and BIG IDEAS.
  • Prediction setup: PAGP forecasts postprandial glucose over 120 minutes using personalized pretraining, fine-tuning, and held-out individual evaluation, compared fairly with LSTM, GluNet, GlucoNet, and GluFormer.Performance is assessed primarily with per-individual averaged RMSE and additionally with R2.
  • Prediction results: PAGP achieves the lowest RMSE on all benchmark datasets, reducing RMSE from 12.94 to 10.39 on IDEAS versus GluFormer.It also achieves RMSE values of 11.39 on CGMacros, 16.97 on Shanghai T1, and 13.24 on Shanghai T2DM, compared with GluFormer (16.91) on CGMacros.
  • Ablation studies: Removing either PAGP’s dietary semantic encoder or TPADM degrades forecasting, while removing ingredient substitution or the iterative OPRO loop degrades meal optimization.The full optimization model achieves the best performance across datasets and metrics; without OPRO, iAUC rises from 121.95 to 174.35 on Shanghai T1DM and from 137.09 to 161.58 on Shanghai T2DM.
  • Meal optimization results: PD-2SMO consistently reduces postprandial glucose exposure and peak excursions versus original meals and baseline strategies across four datasets.It decreases iAUC from 214.78 to 142.69 on BIG IDEAS and from 163.67 to 137.09 on Shanghai T2DM, while also outperforming the ReAct agent.

5 Conclusion

The study presents a framework that connects physiological modeling with generative artificial intelligence for precision nutrition by formulating glucose regulation as semantic generation and combinatorial optimization. Its offline results motivate prospective human trials and extensions to longitudinal nutritional and economic constraints.

  • Contributions: The framework bridges physiological modeling and generative artificial intelligence for precision nutrition.The study identifies this integration as a central contribution.
  • Contributions: Glucose regulation is formulated as a semantic generation and combinatorial optimization problem.PD-2SMO uses LLM semantic reasoning to navigate the resulting discrete action space.
  • Contributions: PD-2SMO adopts a distribution-first, substitution-second strategy for generating meal plans.
  • Future Work: Prospective human subject trials are needed to assess behavioral adherence and long-term metabolic outcomes in free-living settings.The current validation uses historical data and predictive evaluation.
  • Future Work: Future extensions will address longitudinal constraints including weekly nutritional balance and cost-effectiveness.

Limitations

The framework depends on historical CGM data and individualized training or adaptation, which may limit performance when glucose records are sparse or short-term. Rapid personalization is suggested as a future strategy to reduce this dependency.

  • Data and personalization: The framework relies on historical CGM data and individualized training or adaptation to capture personal glucose dynamics.This dependency is identified as a limitation of the proposed approach.
  • Data and personalization: Performance may be limited in cold-start scenarios with only sparse or short-term glucose records.The limitation arises because insufficient prior glucose data may hinder capturing personal glucose dynamics.
  • Future directions: Rapid personalization strategies may help mitigate the framework’s dependency on historical glucose records.This is presented as a future direction for addressing the cold-start limitation.

Ethical Considerations

The study emphasizes participant privacy, informed consent, and responsible model use while acknowledging ethical risks from its LLM-based meal optimization agent. Real-world deployment should include human review, safety filtering, and continuous monitoring.

  • Data privacy and consent: CGM datasets came from public research resources with privacy-preserving procedures, including removal of direct identifiers and de-identification.The dataset publishing website states that participants signed informed consent forms.
  • Model risks: The LLM meal optimization agent may hallucinate unsafe dietary recommendations and inherit biases across populations, diets, or cultural contexts.These risks remain possible despite the agent’s constraints and motivate clinical oversight.
  • Deployment safeguards: Real-world deployment should include human-in-the-loop review, additional safety filtering, and continuous monitoring for errors and bias.

A Experimental Detail … A.5.5 Unified Feature Schema

The appendix specifies PAGP training, PD-2SMO inference and optimization settings, evaluation definitions, and a unified preprocessing schema across four glucose datasets. These details support consistent prediction and intervention interfaces while accommodating dataset-specific modalities and missingness.

  • A.1 PAGP Training Parameters: PAGP combines LSTM and Transformer branches with TPADM-processed dietary and medication signals and BERT-style meal-description embeddings.TPADM uses separate learnable streams for diet and medication, with 64-dimensional effect vectors and non-negative decay parameters; the Chinese BERT-base encoder has hidden size 768.
  • A.1 PAGP Training Parameters: PAGP is pretrained on same-population cohorts, fine-tuned per subject, and selected by validation RMSE with early stopping and consistent splits across ablations.The input window covers Tin = 120 minutes and predicts Tout = 120 minutes, with low- and high-frequency components assigned to the LSTM and Transformer branches.
  • A.2 PD-2SMO LLM Inference Defaults: PD-2SMO uses fixed OpenAI-compatible chat-model settings with temperature= 0.2, top_p= 0.9, max_tokens= 2048, and zero frequency and presence penalties.Each iteration makes exactly one structured-edit call; invalid JSON triggers one repair call using temperature= 0 and max_tokens= 2048.
  • A.3 PAGP Evaluation Metric / A.4 PD-2SMO Target: PAGP evaluation uses RMSE and R2, while PD-2SMO defines relative improvement between an original meal x0 and candidate meal x.The optimization target is ImpiAUC ≥10% under practical dietary constraints.
  • A.5 Dataset Preparation Details / A.5.1 Common Preprocessing Pipeline: The four datasets—CGMacros, BIG IDEAS, Shanghai T1DM, and Shanghai T2DM—are converted into a unified subject-centric format with aligned glucose trajectories and structured event features.The common pipeline aligns timestamps, cleans and imputes CGM data, constructs rolling history-and-horizon windows, and uses subject-level or chronological splits to avoid leakage.
  • A.5.2 CGMacros: CGMacros meal images are converted into English recipe-style descriptions containing dish descriptions, ingredient lists, and approximate portions when possible.The conversion uses an LLM-based captioning procedure with a vision-language model.
  • A.5.3 BIG IDEAS: BIG IDEAS is synchronized into CGM, meal, activity, and medication streams when available, with event-time normalization and minimum coverage and meal-logging constraints.Its dietary logs are written in English.
  • A.5.4 Shanghai T1DM and Shanghai T2DM / A.5.5 Unified Feature Schema: Shanghai T1DM and T2DM retain CGM, meal, and medication processing but omit exercise channels and adjust input masks because activity logs are unavailable.After preprocessing, every dataset uses fixed-length CGM history, synchronized modality-aware event sequences, and a future CGM horizon for consistent PAGP and meal-agent interfaces.

A.5.6 Data License Information · A.6 Rule-based feasibility filter formalization and implementation · B Additional Result

The paper documents dataset licensing and formalizes a deterministic feasibility filter for pruning meal candidates. The filter enforces energy, staged-edit, composition, granularity, and intervention-budget constraints, while an additional table reports PPGR regulation metrics across four datasets.

  • A.5.6 Data License Information: The datasets are used under their stated licenses and access policies for research and education, with attribution provided in the manuscript.CGMacros uses CC BY-NC-SA 4.0, BIG IDEAs Data uses the Open Data Commons Attribution License v1.0, and Shanghai T1DM and T2DM is listed with CC BY 4.0.
  • A.6 Rule-based feasibility filter formalization and implementation: The feasibility filter prunes infeasible meal candidates proposed by the optimization agent using formal meal, portion, substitution, and energy definitions.It represents the original meal as M0 and candidate meals as M, with E(d, q) denoting item-level energy and substitution indicators allowed only in Stage 2.
  • A.6 Rule-based feasibility filter formalization and implementation: Energy constraints bound deviation from baseline meal energy and cap per-edit energy changes to prevent single-step spikes.The filter applies an energy-fluctuation constraint together with a per-edit energy cap.
  • A.6 Rule-based feasibility filter formalization and implementation: Stage 1 permits only portion scaling, whereas Stage 2 permits substitutions while bounding the edit budget and preserving compatible dish classes.Compatibility classes may be defined by food groups such as staple, protein, and vegetable, or by dish roles.
  • A.6 Rule-based feasibility filter formalization and implementation: Composition constraints bound dish-group energy or weight shares and cap maximum item contributions to avoid degenerate meals dominated by one component.Groups may include staple, protein, and vegetable categories.
  • B Additional Result: Table 7 compares PPGR regulation metrics—TIR, TAR, and TBR, reported in %—over a 120-minute horizon across four datasets.The provided passage identifies the metrics, units, time horizon, and dataset count but does not include the table's numerical values.
  • A.6 Rule-based feasibility filter formalization and implementation: Portion edits use discrete realistic increments, while changed-item counts and total ℓ1 portion change constrain overall intervention magnitude.The fixed step size δq may be 10 g or 0.25 serving, and Ki limits each item's adjustment range.
  • A.6 Rule-based feasibility filter formalization and implementation: The filter is implemented as a deterministic post-processor that evaluates candidate energy, group shares, stage-specific rules, composition, granularity, and edit budgets before rejection.Candidates failing any rule are rejected; if no Stage 1 candidate is feasible, the agent proceeds according to the stated implementation logic.

B.1 PD-2SMO Constraint Analysis

PD-2SMO’s calorie constraint substantially improves recipe rationality across all evaluated datasets. The results indicate that explicit calorie and ratio restrictions are critical for producing coherent and nutritionally reasonable meal combinations.

  • Calorie Constraint: Removing the calorie constraint reduces reasonable recipe combinations from 91.34% to 74.86% on BIG IDEAS, 90.27% to 73.97% on CGMacros, 96.49% to 79.25% on Shanghai T1DM, and 97.81% to 83.03% on Shanghai T2DM.Recipe rationality is assessed by an LLM-based evaluator judging whether generated meal plans are nutritionally and logically reasonable.
  • Constraint Dependence: The agent critically depends on structured dietary constraints rather than relying solely on LLM generation capabilities.The constraints guide the optimization process through explicit calorie and ratio restrictions.
  • Constraint Dependence: Without explicit calorie and ratio restrictions, generated meal combinations may be diverse but are significantly less coherent and nutritionally reasonable.This degradation is based on LLM-based evaluation of recipe rationality.

B.2 Post-Optimization Time in Range Result · C Pseudo-code: PD-2SMO · D Pseudo-code: the ReAct Agent for Personalized Glucose Regulation

The paper evaluates post-optimization glucose control using time-in-range metrics and specifies PD-2SMO alongside a ReAct baseline for iterative meal regulation. PD-2SMO uses staged candidate-set optimization, whereas ReAct edits meals through typed actions under shared simulation, feasibility, and budget constraints.

  • B.2 Post-Optimization Time in Range Result: PD-2SMO increases TIR while reducing TAR and TBR versus original meals and the ReAct baseline over a 120-minute horizon.TIR, TAR, and TBR are calculated within an 80–180 mg/dL glucose range.
  • C Pseudo-code: PD-2SMO: PD-2SMO initializes baseline metrics, generates candidate meals, filters infeasible proposals, simulates valid candidates, and returns selected tiers when the regulation threshold is reached.Its pseudocode uses a DIST stage followed by iterative memory updates under simulation-call budget B.
  • C Pseudo-code: PD-2SMO: PD-2SMO and ReAct maintain evaluated-proposal memory and a simulation-call counter, with both operating under budget B and returning the best available meal when optimization stops.The ReAct loop can terminate through STOP, budget exhaustion, or reaching the shared regulation threshold.
  • D Pseudo-code: the ReAct Agent for Personalized Glucose Regulation: The ReAct baseline uses the same inputs and simulator interface as PD-2SMO but omits two-stage DIST→SUB optimization and candidate-set evaluation.It instead performs one loop that iteratively edits meals through discrete tool-like actions using prediction feedback.
  • D Pseudo-code: the ReAct Agent for Personalized Glucose Regulation: Both agents receive meal, medication, exercise, historical CGM, and dietary-constraint information, while the personalized predictor simulates each proposal’s 120-minute glucose trajectory and summary metrics.The ReAct description explicitly states that the simulator is the environment interface.
  • D Pseudo-code: the ReAct Agent for Personalized Glucose Regulation: At each ReAct iteration, the LLM samples a typed action, executes it on the current proposal, applies rule-based feasibility filtering, and records invalid edits as failures.Available actions include portion adjustment, ingredient substitution, meal recomposition, and STOP.
  • D Pseudo-code: the ReAct Agent for Personalized Glucose Regulation: The ReAct baseline terminates on STOP, exhausted budget, or attainment of the same regulation threshold used by PD-2SMO.The threshold is evaluated relative to baseline metrics obtained by simulating the original meal x0.
Loading 2608.13581v1…