- The paper introduces a counterfactual-guided framework combining CGM-derived context and LLM-based retrieval to generate personalized meal recommendations for hyperglycemia prevention.
- It employs LightGBM for glucose prediction and a differentiable counterfactual optimization to minimize meal adjustments while satisfying nutritional and glycemic constraints.
- Expert evaluations reveal that iterative LLM prompt refinement significantly enhances the realism, usability, and clinical suitability of the recommended meals.
Introduction
MetaPlate advances the landscape of personalized nutrition by addressing the critical challenge of postprandial hyperglycemia management in healthy adults. Traditional dietary recommendation systems commonly provide static, generic guidance or require substantial user input, lacking adaptive, physiologically-grounded interventions. Recent CGM-based machine learning frameworks focus on glycemic prediction in isolation, offering limited actionable decision support. MetaPlate fills this gap by systematically integrating multimodal physiological context, predictive glucose modeling, counterfactual (CF) optimization, and LLM-driven retrieval-augmented generation (RAG) to generate user-specific, actionable meal recommendations that target glycemic control.
Figure 1: MetaPlate system overview, showing (1) multi-sensor data acquisition, (2) contextual and nutritional feature engineering and prediction, (3) counterfactual optimization for meal adjustment, and (4) LLM-RAG mapping from macronutrient constraints to human-interpretable meal recommendations.
Methodology
Data Acquisition and Processing
The MetaPlate dataset is based on 13 healthy adults, monitored under free-living conditions using Dexcom G6 Pro CGM sensors, Embrace Plus wearables, and smartphone meal logs. Each participant provided approximately ten days of multimodal data, including minute-level physiological traces, activity measurements, and nutritional intake. Preprocessing included temporal alignment, imputation of sensor dropouts, aggregation of temporally clustered meal entries, and feature extraction capturing statistical and trend information from a two-hour pre-meal window.
For model robustness, an external laboratory-controlled dataset (MealMeter) was integrated, increasing the training set and enabling cross-contextual model generalization despite device modality mismatches.
Postprandial Glucose Prediction
Glucose forecasting is modeled as a supervised regression problem. Contextual features and planned meal macronutrient vectors are concatenated and input into a predictive function fθ​, trained to minimize mean squared error of 2-hour postprandial glucose peak estimation. Multiple linear, ensemble, and tree-based regressors (e.g., LightGBM, XGBoost, Elastic Net) were compared, with LightGBM demonstrating superior performance both in pure predictive metrics and as the foundation for downstream counterfactual optimization.
Counterfactual Optimization for Meal Adjustment
MetaPlate frames meal recommendation as a constrained CF optimization problem: given a user’s current context x and intended meal m0​ with fθ​(x,m0​)>τ (the glycemic threshold), the system seeks a minimally-adjusted meal m∗ such that fθ​(x,m∗)≤τ and m∗ remains feasible with respect to nutritional, practical, and clinical constraints.
A differentiable, target-aware loss function penalizes both glycemic violations and excessive deviation from the original meal, with additional constraints to avoid unrealistic macronutrient manipulations (e.g., forbidding carbohydrate increases). Differential evolution efficiently searches this action space.
MetaPlate’s CF engine outperforms classic baseline algorithms (Wachter, DiCE) in both constraint validity and solution plausibility, delivering more frequent target-satisfying and minimal modifications.
LLM-Based Retrieval-Augmented Meal Generation
CF-optimized macronutrient targets are mapped into real meal recommendations using a LLM-based RAG module. Candidate food items are retrieved from the USDA FoodData Central database to match the optimized macronutrient profile. LLMs (Gemma 4 26B, GPT-5.4, Llama 3.3 70B, Kimi K2 Instruct) then generate human-readable meal descriptions, enforcing constraints for balance, portion realism, and variety.
Figure 2: LLM performance comparison—normalized accuracy (lower RMSE), glycemic consistency, and food-item diversity across Gemma 4 26B, GPT-5.4, Llama 3.3 70B, and Kimi K2 Instruct.
Gemma 4 26B demonstrates the lowest RMSE for all macronutrients and the highest glycemic consistency, whereas Kimi K2 Instruct leads in recommendation diversity. Strict prompt engineering and expert-in-the-loop iteration further enhance output plausibility, moving generated meals from snack-like, clinically suspect outputs toward balanced, actionable recommendations.
Expert-In-The-Loop Evaluation and Prompt Refinement
Registered dietitians assessed MetaPlate meal recommendations in iterative expert-review cycles, focusing on glycemic appropriateness, nutritional alignment, coherence, and practical usability. The evaluation protocol employed both case-level and system-level Likert ratings, exposing early structural, quantitative, and practical deficiencies in initial LLM outputs. Prompt redesign, focusing on meal structural constraints and clinical realism (rather than pure macronutrient matching), produced marked improvements in all assessed dimensions.
Figure 3: Expert evaluation scores (Likert scale) for meal outputs before and after LLM prompt refinement, demonstrating pronounced improvements in portion suitability, recommendation likelihood, usability, and trustworthiness.
Numerical Results and Claims
- Glucose Forecasting: LightGBM achieves an RMSE of 17.56 mg/dL, with superior performance in post-optimization meal recommendation quality.
- Counterfactual Validity: MetaPlate achieves a CF validity of 0.660, substantially exceeding Wachter (0.540) and DiCE (0.500), with lower (L1​, L2​)-distance from original meal vectors and competitive sparsity in number of features changed.
- LLM Meal Mapping: Gemma 4 26B exhibits the smallest carbohydrate, protein, and fat RMSE (all < 0.21, normalized scale), with glycemic consistency at 0.70—the highest among compared LLMs. Kimi K2 Instruct attains the highest food-item diversity (1.105).
- Expert Evaluation: Prompt refinement raises expert ratings for portion suitability from 4.88 to 7.67, nutritional alignment from 5.38 to 7.97, and recommendation likelihood from 3.45 to 7.10, demonstrating quantifiable improvement in real-world acceptability and practicality.
Implications and Future Trajectories
MetaPlate’s synthesis of CGM-derived physiological context, counterfactual optimization, and LLM-mediated practical translation addresses several bottlenecks in next-generation personalized nutrition. Notably, it shows that high-fidelity individualized intervention is feasible with minimal user burden and robust, lightweight modeling pipelines.
Key practical implications include the system’s potential deployment as a real-time dietary DSS (Decision Support System) for early intervention in glycemic dysregulation—even before onset of metabolic disease. The hybrid approach proves also that domain expertise and expert-centered design remain fundamental for deploying LLM-based systems in healthcare, where unconstrained generation may otherwise yield clinically implausible outputs.
Anticipated research directions include scaling MetaPlate to broader populations, incorporating food-availability and preference constraints, generalizing to commodity wearable platforms, and validating clinical effectiveness via intervention studies. Enhancing LLM controllability, incorporating formal meal verification modules, and advancing personalized retraining of predictive and generative modules are also critical paths for increasing system robustness and trustworthiness.
Conclusion
MetaPlate introduces a rigorously-structured, counterfactual-guided pipeline for personalized nutrition that combines multimodal sensing, predictive modeling, optimization-based intervention, and human-aligned LLM recommendations. Numerical and expert-validated evidence indicates that MetaPlate yields actionable, interpretable, and clinically plausible meal recommendations, with substantial improvements over prior systems in both quantitative targets and real-world usability. The framework sets a foundation for principled, scalable AI-based dietary guidance for glycemic management and future metabolic health interventions.