Research Predictive Risk Models Glucose Monitoring & Insulin Delivery

AI framework may reduce glucose forecast errors

October 19, 2026 By Matthew Solan 6 min read
Share Share via Email Share on Facebook Share on LinkedIn Share on Twitter

An artificial intelligence framework that combines descriptions of continuous glucose monitoring patterns with similar historical glucose episodes reduced 30- and 60-minute forecasting errors compared with glucose-only models in two cohorts of patients with type 1 diabetes, according to a retrospective study published in IEEE Journal of Biomedical and Health Informatics. 

Hassan Ghasemzadeh, PhD headshot
Hassan Ghasemzadeh, PhD

Hassan Ghasemzadeh, PhD, and Shovito Barua Soumma, MS, of Arizona State University in Phoenix, developed GlyRAG, a retrieval-augmented forecasting framework. It uses a large language model (LLM) to summarize continuous glucose monitoring (CGM) trajectories, then combines those summaries with numerical glucose data and similar historical patterns to predict future glucose levels.  

“This study shows that CGM-derived context can improve glucose forecasting when used as an auxiliary representation rather than as a direct clinical decision module,” the authors wrote. 

Personalized models use glucose data alone 

The researchers evaluated GlyRAG using two datasets: OhioT1DM, which included 12 patients aged 20 to 80 years, and AZT1D, which included 25 adults aged 27 to 80 years. The newer AZT1D dataset was collected at Mayo Clinic in Scottsdale, Arizona, between December 2023 and April 2024 and included glucose and pump records under automated insulin delivery. 

The main GlyRAG configuration used only CGM data. Each input contained three hours of glucose history, with forecasts evaluated at 5, 30, and 60 minutes. GPT-4 or LLaMA-3.1 generated summaries describing trends, variability, turning points, rebounds, and plateaus. The prompt instructed the language model not to generate exact future glucose values. 

A transformer encoder combined the text and glucose representations. A retrieval module then incorporated the three most similar historical training episodes from the same patient. 

Models were trained and evaluated separately for each patient. Records were split before constructing input windows to prevent inputs or prediction targets from crossing training–test boundaries. Normalization statistics were fitted using each patient’s training data and applied unchanged to test data. Language-model summaries were generated offline and cached, and the language model was not queried during forecasting. 

Longer-horizon errors decline 

In OhioT1DM, GPT-4 GlyRAG reduced root mean square error from 13.78 with PatchTST, a glucose-only transformer comparator, to 10.61 at 30 minutes and from 23.11 to 20.22 at 60 minutes. 

In AZT1D, corresponding errors decreased from 13.42 with PatchTST to 10.11 at 30 minutes and from 22.18 to 16.10 at 60 minutes. The authors reported statistically significant improvements over PatchTST at both horizons in both datasets. 

LLaMA-3.1 GlyRAG also significantly reduced forecasting errors compared with PatchTST, although gains were smaller. Its root mean square errors were 11.63 and 22.02 at 30 and 60 minutes in OhioT1DM and 13.06 and 20.47 in AZT1D. 

Analyses separating the framework’s components indicated that language-model summaries contributed to improvement even without retrieval. Retrieval provided additional, model-dependent gains, with clearer benefits for GPT-4 and smaller or occasionally negative effects for LLaMA-3.1. Adding glucose statistics or carbohydrate and insulin event information did not consistently outperform the simpler CGM-only summaries. 

Hypoglycemia detection varies by cohort 

TimesFM, a glucose-only time-series foundation model, served as a comparator for hypoglycemia and hyperglycemia detection. At 60 minutes, GlyRAG’s hypoglycemia sensitivity was 92% vs 81% with TimesFM in OhioT1DM. In AZT1D, sensitivity was 44% vs 60%, respectively. The authors attributed GlyRAG’s lower hypoglycemia sensitivity in AZT1D than in OhioT1DM to the limited number of hypoglycemic events in AZT1D. 

Hyperglycemia sensitivity was 97% vs 92% with TimesFM in OhioT1DM and 92% vs 88% in AZT1D. 

The study had several limitations. The evaluation was retrospective and restricted to patients with type 1 diabetes. The authors called for broader validation in patients with type 2 diabetes and prediabetes. They noted that contextual information may be noisy or incomplete, the language module was not fine-tuned, and its summaries were not clinically validated explanations. GPT-4’s large-scale pretraining could contribute to its advantage over forecasting comparators. Explanation fidelity and clinician agreement were not quantified. The researchers also did not explicitly assess how forecasting performance changed with alternative summaries from the same language model or with restrictions on the temporal proximity of retrieved training windows. 

The authors added that the results provide a foundation for context-aware glucose forecasting systems. 

“With prospective validation, uncertainty estimation, and clinical safeguards, such systems may contribute to proactive and human-centered diabetes decision support,” they wrote. 

The study did not include a conflict-of-interest statement. 

Expert insight

AACE Endocrine AI invited Dr. Ghasemzadeh, a program director and professor in the School of Health Systems Transformation within the College of Health Solutions at Arizona State University, to elaborate on the study’s findings. 

Why does this study matter?  

Accurately forecasting blood glucose can allow us to anticipate abnormal events such as hyperglycemia and hypoglycemia before they occur. That creates an opportunity to intervene earlier, whether through insulin or other treatment adjustments, behavioral changes, or personalized recommendations, and potentially prevent these events altogether. Our study shows that LLMs can significantly enhance blood glucose forecasting by helping conventional prediction models make better use of the rich contextual information contained in CGM data. 

Which findings stood out?  

One of the most interesting findings was how well two complementary approaches worked together: LLM-based contextualization of CGM signals and case-based retrieval. The LLM helps transform raw glucose data into a richer representation of what is happening physiologically, while case-based retrieval identifies relevant patterns from similar historical glucose trajectories. Combining these approaches substantially improved the performance of transformer-based glucose forecasting models. 

We were also encouraged to see that case-based retrieval provided additional benefit even after incorporating LLM-based contextualization. This suggests that there is useful information not only in the current glucose trajectory but also in identifying and drawing upon similar situations that have occurred previously. In some ways, this resembles how clinicians reason by comparing a current situation with prior cases. 

How might the findings influence endocrinology clinical practice?  

The approach could ultimately be integrated into automated insulin delivery systems and other CGM-based diabetes technologies to improve the prediction of impending hyperglycemia and hypoglycemia. More accurate forecasting could allow these systems to respond earlier and more appropriately, potentially improving glucose control while reducing the day-to-day burden of diabetes management. 

There may also be benefits for clinical care. Better prediction and interpretation of glucose patterns could help clinicians identify situations most likely to lead to dysglycemia, rather than requiring them to manually review large amounts of CGM data. This could support more personalized treatment decisions and more focused, productive discussions during clinical visits. 

AACE Endocrine AI is published by Conexiant under a license arrangement with the American Association of Clinical Endocrinology, Inc. (AACE®). The ideas and opinions expressed in AACE Endocrine AI do not necessarily reflect those of Conexiant or AACE. For more information, see Policies.

Related Content