Papers
Topics
Authors
Recent
Search
2000 character limit reached

MetaPlate: Counterfactual-Guided RAG-LLM Tool for Personalized Food Recommendation and Hyperglycemia Prevention

Published 8 Jun 2026 in cs.IR, cs.AI, and cs.HC | (2606.10120v1)

Abstract: Postprandial hyperglycemia is a key risk factor for metabolic disorders; however, existing dietary guidance is often static, impractical, and insufficiently personalized, providing recommendations that are difficult to follow or not impactful. While recent advances leverage continuous glucose monitoring (CGM) and machine learning to predict glycemic responses, these approaches are largely predictive and lack actionable guidance. Moreover, recommendation systems are often misaligned with user goals and require extensive input. We present MetaPlate, a counterfactual explanation (CF) guided, context-aware decision-support framework that generates personalized meal recommendations to mitigate postprandial glucose excursions in healthy adults. MetaPlate integrates multimodal data, including CGM readings, wearable-derived physiological signals, and user-provided meal inputs from $25$ individuals to model pre-meal context. A machine learning model predicts glucose response, while a CF optimization module adjusts meal composition modifying macronutrient amounts to maintain glucose levels within a target range ($\leq 140$ mg/dL). An LLM-based retrieval-augmented generation (RAG) layer enhances interpretability by producing human-readable recommendations using constrained search of the USDA food database. We evaluate MetaPlate via a structured expert-in-the-loop assessment with registered dietitians (RDs), comparing performance before and after prompt refinement. Results show improvements in meal realism, portion suitability, and recommendation likelihood, with expert feedback indicating a shift from clinically implausible outputs to actionable, contextually appropriate recommendations. Our findings emphasize the importance of domain knowledge and structured constraints in LLM-driven systems and highlight the potential of MetaPlate as a real-time personalized dietary decision-support tool.

Summary

  • 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.

MetaPlate: Counterfactual-Guided RAG-LLM for Personalized Meal Recommendation and Hyperglycemia Prevention

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

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θf_\theta, 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\mathbf{x} and intended meal m0\mathbf{m}_0 with fθ(x,m0)>τf_\theta(\mathbf{x}, \mathbf{m}_0) > \tau (the glycemic threshold), the system seeks a minimally-adjusted meal m∗\mathbf{m}^* such that fθ(x,m∗)≤τf_\theta(\mathbf{x}, \mathbf{m}^*) \leq \tau and m∗\mathbf{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

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

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 (L1L_1, L2L_2)-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.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 2 tweets with 3 likes about this paper.