DIETS: Diabetic Insulin Management System in Everyday Life

Extracted source text · arXiv 2411.12812

%%
%% This is file `sample-sigconf.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% samples.dtx  (with options: `sigconf')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from sample-sigconf.tex.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file samples.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%
%%
%% Commands for TeXCount
%TC:macro \cite [option:text,text]
%TC:macro \citep [option:text,text]
%TC:macro \citet [option:text,text]
%TC:envir table 0 1
%TC:envir table* 0 1
%TC:envir tabular [ignore] word
%TC:envir displaymath 0 word
%TC:envir math 0 word
%TC:envir comment 0 0
%%
%%
%% The first command in your LaTeX source must be the \documentclass
%% command.
%% 
%% For submission and review of your manuscript please change the
%% command to \documentclass[manuscript, screen, review]{acmart}.
%%
%% When submitting camera ready or to TAPS, please change the command
%% to \documentclass[sigconf]{acmart} or whichever template is required
%% for your publication.
%%
%%
%\documentclass[sigconf]{acmart}
\documentclass[sigconf,authorversion,nonacm,10pt]{acmart}

%%
%% \BibTeX command to typeset BibTeX logo in the docs
\AtBeginDocument{%
  \providecommand\BibTeX{{%
    Bib\TeX}}}

%% Rights management information.  This information is sent to you
%% when you complete the rights form.  These commands have SAMPLE
%% values in them; it is your responsibility as an author to replace
%% the commands and values with those provided to you when you
%% complete the rights form.
\setcopyright{acmlicensed}
\copyrightyear{2018}
\acmYear{2018}
\acmDOI{XXXXXXX.XXXXXXX}

%% These commands are for a PROCEEDINGS abstract or paper.
\acmConference[Conference acronym 'XX]{Make sure to enter the correct
  conference title from your rights confirmation emai}{June 03--05,
  2018}{Woodstock, NY}
%%
%%  Uncomment \acmBooktitle if the title of the proceedings is different
%%  from ``Proceedings of ...''!
%%
%%\acmBooktitle{Woodstock '18: ACM Symposium on Neural Gaze Detection,
%%  June 03--05, 2018, Woodstock, NY}
\acmISBN{978-1-4503-XXXX-X/18/06}


%%
%% Submission ID.
%% Use this when submitting an article to a sponsored event. You'll
%% receive a unique submission ID from the organizers
%% of the event, and this ID should be used as the parameter to this command.
%%\acmSubmissionID{123-A56-BU3}

%%
%% For managing citations, it is recommended to use bibliography
%% files in BibTeX format.
%%
%% You can then either use BibTeX with the ACM-Reference-Format style,
%% or BibLaTeX with the acmnumeric or acmauthoryear sytles, that include
%% support for advanced citation of software artefact from the
%% biblatex-software package, also separately available on CTAN.
%%
%% Look at the sample-*-biblatex.tex files for templates showcasing
%% the biblatex styles.
%%

%%
%% The majority of ACM publications use numbered citations and
%% references.  The command \citestyle{authoryear} switches to the
%% "author year" style.
%%
%% If you are preparing content for an event
%% sponsored by ACM SIGGRAPH, you must use the "author year" style of
%% citations and references.
%% Uncommenting
%% the next command will enable that style.
%%\citestyle{acmauthoryear}

% \documentclass{article}
\usepackage{graphicx}  % 用于插入图片的包
\usepackage{caption}
\usepackage{multirow}
%%
%% end of the preamble, start of the body of the document source.
\begin{document}

%%
%% The "title" command has an optional parameter,
%% allowing the author to define a "short title" to be used in page headers.
% \title{DIETS: Diabetic Insulin managEment System with Transformers}
\title{DIETS: Diabetic Insulin Management System in Everyday Life}

%%
%% The "author" command and its associated commands are used to define
%% the authors and their affiliations.
%% Of note is the shared affiliation of the first two authors, and the
%% "authornote" and "authornotemark" commands
%% used to denote shared contribution to the research.
% \author{Ben Trovato}
% \authornote{Both authors contributed equally to this research.}
% \email{trovato@corporation.com}
% \orcid{1234-5678-9012}
% \author{G.K.M. Tobin}
% \authornotemark[1]
% \email{webmaster@marysville-ohio.com}
% \affiliation{%
%   \institution{Institute for Clarity in Documentation}
%   \streetaddress{P.O. Box 1212}
%   \city{Dublin}
%   \state{Ohio}
%   \country{USA}
%   \postcode{43017-6221}
% }

% \author{Julius P. Kumquat}
% \affiliation{%
%   \institution{The Kumquat Consortium}
%   \city{New York}
%   \country{USA}}
% \email{jpkumquat@consortium.net}

\author{Zeng, Hanyu}
\email{Haz207@pitt.edu}
\authornotemark[1]
\affiliation{%
  \institution{University of Pittsburgh}
  \city{Pittsburgh}
  \state{Pennsylvania}
  \country{USA}
  \postcode{15213}
}
\author{Ji, Hui}
\email{huj16@pitt.edu}
\authornotemark[1]
\affiliation{%
  \institution{University of Pittsburgh}
  \city{Pittsburgh}
  \state{Pennsylvania}
  \country{USA}
  \postcode{15213}
}
\author{Zhou, Pengfei}
\email{pengfeizhou@pitt.edu}
\authornotemark[1]
\affiliation{%
  \institution{University of Pittsburgh}
  \city{Pittsburgh}
  \state{Pennsylvania}
  \country{USA}
  \postcode{15213}
}


%%
%% By default, the full list of authors will be used in the page
%% headers. Often, this list is too long, and will overlap
%% other information printed in the page headers. This command allows
%% the author to define a more concise list
%% of authors' names for this purpose.
% \renewcommand{\shortauthors}{Trovato et al.}
\renewcommand{\shortauthors}{Anonymous}


%%
%% The abstract is a short summary of the work to be presented in the
%% article.
\begin{abstract}
People with diabetes need insulin delivery to effectively manage their blood glucose levels, especially after meals, because their bodies either do not produce enough insulin or cannot fully utilize it. Accurate insulin delivery starts with estimating the nutrients in meals and is followed by developing a detailed, personalized insulin injection strategy. These tasks are particularly challenging in daily life, especially without professional guidance. Existing solutions usually assume the prior knowledge of nutrients in meals and primarily rely on feedback from professional clinicians or simulators to develop Reinforcement Learning-based models for insulin management, leading to extensive consumption of medical resources and difficulties in adapting the models to new patients due to individual differences.
In this paper, we propose DIETS, a novel diabetic insulin management framework built on the transformer architecture, to help people with diabetes effectively manage insulin delivery in everyday life. Specifically, DIETS tailors a Large Language Model (LLM) to estimate the nutrients in meals and employs a titration model to generate recommended insulin injection strategies, which are further validated by a glucose prediction model to prevent potential risks of hyperglycemia or hypoglycemia.
DIETS has been extensively evaluated on three public datasets, and the results show it achieves superior performance in providing effective insulin delivery recommendation to control blood glucose levels. 

\end{abstract}

%%
%% The code below is generated by the tool at http://dl.acm.org/ccs.cfm.
%% Please copy and paste the code instead of the example below.
%%
% \begin{CCSXML}
% <ccs2012>
%  <concept>
%   <concept_id>00000000.0000000.0000000</concept_id>
%   <concept_desc>Do Not Use This Code, Generate the Correct Terms for Your Paper</concept_desc>
%   <concept_significance>500</concept_significance>
%  </concept>
%  <concept>
%   <concept_id>00000000.00000000.00000000</concept_id>
%   <concept_desc>Do Not Use This Code, Generate the Correct Terms for Your Paper</concept_desc>
%   <concept_significance>300</concept_significance>
%  </concept>
%  <concept>
%   <concept_id>00000000.00000000.00000000</concept_id>
%   <concept_desc>Do Not Use This Code, Generate the Correct Terms for Your Paper</concept_desc>
%   <concept_significance>100</concept_significance>
%  </concept>
%  <concept>
%   <concept_id>00000000.00000000.00000000</concept_id>
%   <concept_desc>Do Not Use This Code, Generate the Correct Terms for Your Paper</concept_desc>
%   <concept_significance>100</concept_significance>
%  </concept>
% </ccs2012>
% \end{CCSXML}

% \ccsdesc[500]{Do Not Use This Code~Generate the Correct Terms for Your Paper}
% \ccsdesc[300]{Do Not Use This Code~Generate the Correct Terms for Your Paper}
% \ccsdesc{Do Not Use This Code~Generate the Correct Terms for Your Paper}
% \ccsdesc[100]{Do Not Use This Code~Generate the Correct Terms for Your Paper}

%%
%% Keywords. The author(s) should pick words that accurately describe
%% the work being presented. Separate the keywords with commas.
% \keywords{Do, Not, Us, This, Code, Put, the, Correct, Terms, for,
%   Your, Paper}
%% A "teaser" image appears between the author and affiliation
%% information and the body of the document, and typically spans the
%% page.


% \received{20 February 2007}
% \received[revised]{12 March 2009}
% \received[accepted]{5 June 2009}

%%
%% This command processes the author and affiliation and title
%% information and builds the first part of the formatted document.
\maketitle

\section{Introduction}
\label{sect:introduction}

Diabetes is emerging as one of the most significant global epidemics, affecting over 10\% of the adult population, with this number on the rise \cite{zimmet2017diabetes}. The high blood glucose level is primarily due to autoimmune destruction of insulin-producing $\beta$ cells or the development of insulin resistance. This necessitates sophisticated insulin therapy regimens that mimic the body's natural insulin release, involving continuous basal secretion complemented by larger bolus doses during meals to regulate glucose levels \cite{jaloli2024basal, cescon2020using}.
As illustrated in Figure \ref{Diabetes}, an appropriate insulin delivery strategy is primarily determined by the patient's dietary intake, individual insulin sensitivity, and the regulation of the endocrine system \cite{american20216, rodbard2011glycemic}.
For example, high-carbohydrate meals demand rapid insulin administration, while meals rich in proteins and fats require slower, more prolonged insulin infusions due to delayed glucose metabolism \cite{evert2020factors}. 
Effective delivery strategy determination requires a deep understanding and analysis of both clinical and nutritional sciences, highlighting the indispensable role of professional expertise. 

Accurate insulin delivery begins with estimating the nutrients in a patient's meal and is followed by developing a detailed titration strategy based on the patient's endocrine system.
These two tasks, however, are non-trivial in practice. First, analyzing the nutrients in meals necessitates a deep understanding of nutritional science and access to a comprehensive nutrition knowledge base to accurately quantify the various nutrients in the consumed food.
Second, understanding how these nutrients affect blood glucose levels and the role of insulin in the endocrine system in regulating these levels are crucial. However, the complexity of the human endocrine system make it difficult to precisely quantify the relationship between insulin and glucose, and variations in physiological conditions over time and across individuals further complicate the task for non-professionals to determine the appropriate insulin dosage.
For most patients, continuous access to professional medical guidance for insulin administration is impractical, making precise insulin titration in everyday life a critical and daunting task.

\begin{figure}
    \centering
    \includegraphics[width=0.46\textwidth]{Diabetes.pdf}
    \caption{Insulin delivery for people with diabetes.}
    \label{Diabetes}
\end{figure}

Existing approaches struggle to effectively address these two tasks in everyday situations. 
For the first task, unsupervised learning models are used to analyze the textual nutritional data \cite{ispirova2020p,ispirova2024msgen}, but they fail to handle unstructured patient descriptions. Thus most research works either assume having prior knowledge about the nutrients of the patient's meals \cite{brown2018first, silva2022real} or require the patient to adhere to a predefined set of food intake \cite{emerson2023offline,jaloli2024basal}. However, in everyday life scenarios, such assumptions and requirements are impractical, leaving patients to rely largely on their own rough estimates, which is usually inaccurate due to the variability in daily meals and the absence of professional guidance.
For the second task, the widespread adoption of Continuous Glucose Monitoring (CGM) systems \cite{CGM, ahmadi2009wireless} has catalyzed the development of data-driven approaches, which generally fall into two categories: traditional control theory based approaches and AI-driven methods. Traditional approaches, such as Model Predictive Control (MPC) and Proportional-Integral-Derivative (PID), use real time CGM data to adjust insulin injections \cite{el2009review}. However, the significant inherent delay (e.g., 30 minutes \cite{galloway1981factors}) in insulin's impact on blood glucose levels makes it hard to control glucose levels using control theory based approaches, often resulting in hyperglycemia. 
%These models typically lack the complexity needed to accurately decipher the intricate dynamics between insulin and glucose. 
Consequently, more sophisticated AI methods, particularly Reinforcement Learning (RL), have been introduced \cite{wang2023optimized,yu2021reinforcement,yau2023reinforcement}, where professional clinicians assess and provide feedback to guide the model's decisions, allowing the model to develop professional decision-making skills. However, these approaches consume extensive medical resources and struggle with adapting the model to new patients due to individual differences among patients \cite{wexler2022patient}. 
%Some other RL approaches rely on feedback from simulators during training, which reduced the authority \cite{emerson2023offline,jaloli2024basal}.

This paper is motivated by an essential question: \textit{Is it possible to achieve accurate blood glucose control for people with diabetes in everyday life without the need of expert supervision?}
To achieve this goal, in this paper, we propose a novel \textbf{D}iabetic \textbf{I}nsulin manag\textbf{E}men\textbf{T} \textbf{S}ystem designed to provide precise and safe insulin titration for people with diabetes in everyday life. DIETS consists of three main modules as shown in Figure \ref{system}: dietary analysis, insulin delivery strategy determination, and glucose prediction with re-titration capabilities. 
Patients input the description of their past and projected dietary intake, based on which a tailored Large Language Model (LLM) estimates the nutrients, including calories, carbohydrates, proteins, and fats. 
This nutritional information, along with the expected glucose levels and the other essential information such as the patient's prior insulin injections and basic personal information, are fed into the insulin delivery strategy determination module to generate recommended dosages for a forthcoming period. 
These recommendations are then evaluated by the glucose prediction model to ensure the proposed insulin strategies are safe. If potential risks of hyperglycemia or hypoglycemia are detected, a tailored LLM re-evaluates the situation to generate revised insulin strategies, which undergo another round of risk assessment in the glucose prediction model until a sufficiently safe insulin dosing plan is established.

\begin{figure}
    \centering
    \includegraphics[width=0.45\textwidth]{overview.pdf}
    \caption{The system workflow of DIETS.}
    \label{system}
\end{figure}

DIETS has the following advantages.
First, DIETS employs a two-stage training process, where a foundation system is developed using data records in public datasets in the first stage and the model is fine-tuned with minimal inputs from the individual patient in the second stage. By doing so, DIETS is able to be easily adapted to different individuals while maintaining high performance.
Second, unlike traditional AI models, LLMs possess deeper and broader knowledge bases. We adapt the LLM with in-context learning \cite{Dong2024InContextLearning} to perform accurate dietary nutrition analysis and significantly reduce patients' reliance on professionals.
Third, unlike previous works that rely on expert feedback to make decisions, the insulin delivery strategy determination module learns solely from the patient's glycemic data on how insulin and glucose levels influence each other. We train the model using all data in the records by including the records where the glucose levels are out of the safe range. By doing so, the transformer-based model is able to better capture the relationship and interactions between insulin and blood glucose.
Forth, the glucose prediction component posses as a safety mechanism that predicts whether the recommended dosing strategy will lead to unsafe glucose fluctuations and re-titration if there is a risk of hazardous events. 
%Different from existing methods, such as LSTM and CNN \cite{aliberti2019multi, li2019convolutional}, our approach tailors predictions more fitful to individual patient circumstances based on the extracted personalized information.

 
We evaluate DIETS' performance on three public clinical datasets \cite{zhao2023chinese, marling2020ohiot1dm}. 
As DIETS is the first comprehensive framework that spans the entire process of insulin management in everyday life, including nutrient estimation, and insulin delivery determination and glucose prediction, we compare the performance of individual modules used in DIETS with related existing solutions, respectively.
Specifically, first, we experiment with different LLMs for the dietary analysis. All tailored LLMs show promising results, with GPT-4o \cite{gpt4o2024} and Mistral-22B \cite{jiang2024mixtral} achieving marginally superior performance, which is much better than existing methods.
Second, we compare the quality of the insulin delivery strategies determined by DIETS with those from the latest state-of-the-art (SOTA) solution. As all SOTA solutions assume prior knowledge about the nutrients of the patient’s meals, we use the nutrient estimation from our dietary analysis module as inputs for all models. The experiments demonstrate that DIETS produces the most effective insulin delivery strategies, achieving at least 50\% reduction in the mean absolute error.
Third, we compare the performance of the blood glucose prediction model with SOTA models in the literature, and DIETS also achieves the best performance, reducing the mean error by more than 25\%.


Our main contributions are summarized as follows:
\begin{itemize}
\item We introduce the first comprehensive insulin management framework, DIETS, for people with diabetes in everyday life without the need of expert supervision. DIETS enables patients to receive effective insulin delivery recommendations, which are verified by a protection mechanism.
\item DIETS innovates across different modules within the framework. By utilizing a tailored LLM for dietary analysis, patients can obtain accurate nutrient estimation from simple descriptions of their meals, which significantly reduces the need for professional intervention. With minimal personal data to fine-tune the system, our strategy model is capable of determining safe and precise injection recommendations. The proposed glucose prediction model incorporates a deeper analysis of individual patient information to provide customized glucose forecasts, and re-titrate when potential hazards are predicted.
\item We conduct extensive experiments to evaluate DIETS on three public datasets. The results suggest that DIETS outperforms SOTA models in all modules, demonstrating its superior performance in these critical aspects of diabetes management.
\end{itemize}




\section{Background and Motivation}
\label{sect:background}

\subsection{Diabetes}
\label{subsect:diabetes}
Diabetes has become a major global epidemic, affecting 10.5\% of adults aged 20-79 affected worldwide, totaling 537 million individuals \cite{zimmet2017diabetes}. Projections suggest that these numbers will increase to 643 million by 2030 and 783 million by 2045 \cite{kumar2024prevalence}. Diabetes is not only prevalent but also a serious health threat, causing an estimated 6.7 million deaths in 2021 alone.
The condition is categorized into two main types: Type 1 and Type 2. Type 1 diabetes (T1D) is an autoimmune metabolic disorder characterized by the destruction of $\beta$ cells, leading to insufficient insulin production and resultant hyperglycemia \cite{katsarou2017type}. In contrast, Type 2 diabetes (T2D) initially involves normal insulin production, but patients develop resistance to it over time, causing glucose levels to rise dangerously high. Such elevated glucose levels can be toxic, potentially leading to serious complications including diabetic retinopathy, neuropathy, cardiovascular diseases, and limb loss \cite{dhatariya2020diabetic}.
Given these severe complications, it is crucial to manage diabetes carefully. One aspect of such management is insulin dosing. Improper insulin dosing can lead to blood glucose instability \cite{chin2021effects} and hypoglycemia, which can cause some other severe complications even immediate death  \cite{frier2011hypoglycemia,kalra2013hypoglycemia}. These critical risks underscore the importance of meticulous glycemic management for people with diabetes.


\subsection{Insulin Delivery}
\label{subsect:insulin_delivery}
Insulin delivery is typically administered through basal-bolus therapy. Basal insulin, which is usually stable, balances the blood sugar fluctuations caused by the daily metabolic (during fasting) process. In contrast, blood glucose fluctuations caused by ingested nutrients are mainly adjusted by bolus insulin supplementation \cite{king2005basal}.
Carbohydrates, proteins, and fats are key nutrients that impact blood glucose levels. Carbohydrates are the primary drivers of blood glucose fluctuations \cite{deeb2017accurate}, as they are quickly metabolized into glucose. Proteins and fats, however, have a more gradual effect. Specifically, proteins can induce blood glucose changes 2-5 hours post-meal by affecting hormone secretion \cite{lowe2008flexible, dafne2002training, diabetes1993effect}, while fats slow the metabolic breakdown of carbohydrates, moderating blood glucose rises and delaying peaks until 3-5 hours after eating \cite{paterson2015role}.
Standard short-acting insulin, which peaks between 80-120 minutes after injection, may not adequately address the extended blood glucose elevations caused by high-protein and high-fat meals \cite{wong2021ultra}. Considering these nuances, insulin pumps with square or dual wave functions allow for prolonged insulin delivery, aligning insulin activity with delayed glucose rises from different types of meals \cite{heinemann2009insulin}, thereby helping to prevent postprandial hyperglycemia.
This understanding motivates us to customize insulin delivery strategies based on meal composition.
Instead of a one-time injection dosage guidance, we may need to provide a long-term injection strategy recommendation, which can give patients adequate psychological preconception and make the injection more smooth.


\subsection{Commercial Insulin Delivery System}
\label{subsect:commercial_insulin_delivery}
The commercial automated insulin delivery (AID) system (Figure \ref{Diabetes}), such as the Omnipod 5 \cite{Omnipod5}, typically consists of an insulin pump, a CGM, and a control theory based algorithm \cite{nwokolo2023artificial} running on smartphones. The CGM measures the glucose concentration every 5-10 minutes. The smartphone, using a control theory-based algorithm, calculates the required insulin dosage and adjusts the insulin pump delivery through a subcutaneous tube accordingly. Due to the lack of nutrient intake estimation and the significant inherent delay in insulin's impact on blood glucose levels, which is approximately 30 minutes \cite{galloway1981factors}, AID is far from perfect even though it made a positive impact on diabetes management. 


\subsection{Motivation}
\label{subsect:motivation}

To develop a robust blood glucose management system to help people with diabetes in everyday life, two key tasks must be addressed: accurately estimating the nutrients in meals and determining effective and safe insulin dosages tailored to the individual patient's condition.

First, accurate nutrient estimation is typically a task for professionals, given its requirement for a vast nutritional knowledge base which poses a challenge for ordinary patients. Large language models (LLMs) represent a significant advancement in artificial intelligence \cite{achiam2023gpt,team2023gemini,touvron2023llama}. They are trained on trillions of language tokens, amassing extensive knowledge bases that enable them to understand and process natural language effectively. With billion-level parameters, these models possess profound analytical and inferential capabilities in natural language tasks. We may tailor LLMs with simple in-context learning methods  \cite{Dong2024InContextLearning} to adapt them to accurately estimate nutrients from the patient's unstructured dietary descriptions.

Second, recent studies have applied Reinforcement learning (RL) \cite{kaelbling1996reinforcement} based models for blood glucose control \cite{wang2023optimized, jaloli2024basal,emerson2023offline} utilizing iterative feedback from professionals to refine decision-making capabilities. These RL models are typically trained within simulators \cite{jaloli2024basal,emerson2023offline} to circumvent the ethical and practical challenges associated with conducting direct experiments within the human body \cite{griesdale2009intensive}. However, these simulators often fall short in capturing the full complexity of human physiological responses, which limits the realism and applicability of the feedback used for training. A data-driven method introduced in \cite{wang2023optimized} involves real-world data records from hospitalized patients, where decisions made by RL models are evaluated by experienced clinicians. While this method enables the immediate application of insights generated by RL, it heavily depends on the availability of experienced medical personnel for supervision. This dependence creates a bottleneck, limiting the method's scalability and generalizability, hindering its widespread adoption in everyday life. Instead, we focus on developing AI models to understand the relationship between insulin injections and blood glucose fluctuations, based on which the model can mimic human physiological responses to enable more accurate insulin administration for a target glucose level.

Additionally, severe fluctuations such as hyperglycemia and hypoglycemia have serious health implications, necessitating an additional glucose prediction component as a safety measure to prevent potential risks. However, current glucose prediction solutions \cite{li2019convolutional, yang2023short} overlook the personalized information of individuals, resulting in unstable performance in predicting blood glucose levels. To achieve accurate prediction, we need to incorporate patient-specific data to tailor the model for different individuals.

% \label{sect:DIETS_design}
% \begin{figure*}
%     \centering
%     \includegraphics[width=0.9\textwidth]{variance.pdf}
%     \caption{The overview structure of DIETS for training and inference.}
%     \label{i}
% \end{figure*}

\section{DIETS Design}
\label{sect:DIETS_design}
\begin{figure*}
    \centering
    \includegraphics[width=0.9\textwidth]{infe_tra.pdf}
    \caption{The overview structure of DIETS for training and inference.}
    \label{infer_train}
\end{figure*}
Inspired by the mentioned motivation, in this paper, we propose a novel diabetic insulin management framework, \textbf{DIETS}, to help diabetes patients effectively manage their blood glucose levels with appropriate insulin delivery. In this section, we present the detailed design of DIETS, starting with an overview of the framework and then delving into the design of each component.


\subsection{Overview}
\label{subsect:DIETS_overiew}



As shown in Figure \ref{infer_train}, the framework includes three components, i.e., dietary analysis module, 
insulin delivery determination module, and glucose prediction and re-titration module.
DIETS focuses on the bolus insulin injections because basal insulin dosages are relatively stable, and easy to manage based on long-term physiological conditions. 
%At the same time, bolus insulin can also work as the complement of basal insulin.
The dietary analysis module takes the input of descriptions of the consumed meal provided by the patient. Using a tailored LLM, it derives the nutritional information of the meal such as calorie content, carbohydrate, protein, and fat. This nutritional data is then utilized by the insulin delivery determination module to develop insulin injection strategies. Instead of one-dose injection, this module determines a multi-dose insulin injection strategy which spans the next 2 hours.
Following the determination, the glucose prediction and re-titration module is employed to forecast future glucose levels in conjunction with the administered insulin dosage, preventing the occurrence of serious events such as hyperglycemia and hypoglycemia. If a potential risk is identified, the system will generate a new titration recommendation until the proposed injection regimen is deemed safe. 


\subsection{Data Normalization and Segmentation}\label{dp}
Before conducting analysis, a series of data pre-processing steps are necessary. To keep it consistent with the CGM, most data are sampled every 15 minutes, including dietary intake, blood glucose levels, insulin injections, and anti-diabetic drug intake. All types of data are normalized to uniform units: insulin doses in insulin units ($IU$)\footnote{1 insulin unit ($IU$) = 0.01 $mL$.}, blood glucose in milligrams per deciliter ($mg/dl$), nutrient and anti-diabetic drug intake in grams ($g$), and energy in calories ($cal$). Following normalization, all time-series data are concatenated into a single data-trace. We employ a sliding window of width $m$ to segment the data trace into discrete clips $B_i$ comprising $B_1, B_2, ..., B_m$. Any missing values in these segments were filled with zeros. Each data clip contained data from $m$ time points, where the initial $n$ points were categorized as 'previous' data and the remaining $m-n$ points as 'future' data. Future insulin injection data and glucose levels are masked during training of the titration and glucose prediction model and used as labels. 



% The model observed other information while training. Additionally, bolus injection data from the previous 24 hours were also compiled as input for model training.

% Except for time-series data, the patient's basic information, namely intake antiglycemic drugs, basal insulin injections, and the patient's basic information, BMI, weight, height, age at diagnosis, age, smoking or not (0 or 1), drinking or not (0 or 1), and type of diabetes (1 or 2), are also input into the model.


\subsection{Dietary Analysis}
The dietary analysis module provides nutritional content estimation for the following insulin delivery determination module and glucose prediction and re-titration module.
The dietary analysis module processes patient-provided dietary descriptions through a Large Language Model (LLM). We tailored the LLM using in-context learning with a specifically designed prompt to learn to analyze the nutrient content of consumed diets for subsequent insulin titration. The LLM's robust few-shot learning capabilities allow it to effectively parse and interpret unstructured dietary descriptions, which traditional NLP models may find challenging due to variable text lengths and formats. An appropriately crafted prompt enhances the model’s accuracy by assigning the LLM the role of nutritionist and detailing the analysis task with a focus on outputting structured data for easy integration into subsequent processes. 
Figure \ref{prompt} illustrates a prompt instance when tailoring the LLM into the role of a nutritionist. We include the following components in the prompt to fine-tune the LLM: role play instruction, task description, structure requirement on the output format, reasoning guidance on how  to estimate the nutrients, structure regularization, and a one-shot example.


\begin{figure}
    \centering
    \includegraphics[width=0.5\textwidth]{prompt.pdf}
    \caption{The prompt instance for dietary analysis.}
    \label{prompt}
\end{figure}


\subsection{Insulin Delivery Determination}
The Insulin Strategy Determination module aims to determine a optimal insulin dosing strategy for the patient to achieve the anticipated changes in blood glucose levels in the next 2 hours. In DIETS, we leverage the following medical records: historical blood glucose fluctuations and insulin injection data, dietary nutrient information from dietary analysis, and etc. The key is to learn the relationship and interaction between insulin and blood glucose levels.


As depicted in Figure \ref{titration_m}, the insulin strategy determination model inputs both past and projected glycemic-related information into a BiLSTM to extract temporal features. This includes nutritional intake estimations, anticipated blood glucose levels, anti-diabetic drug intake, and the projected basal insulin injection. Personal basic information is processed through a Deep Neural Network (DNN) to extract latent features. Data on basal insulin injections from the previous day, which partly represent the patient's recent physiological condition, are also considered. The outputs from these three processes are then fed into a transformer-based model. The results are structured to align with the data format of past insulin injection strategies, concatenated, and then input into a Generative Pre-trained Transformer (GPT)-like decoder \cite{yenduri2023generativepretrainedtransformercomprehensive}. Subsequently, a CNN processes these inputs sequentially to generate output results. 
%Given that our injection strategy determination model operates like a GPT-like decoder, each output result is used as an input to calculate insulin dosages for subsequent time points, enhancing the precision of insulin titration. 
The formula for this module is as follows.
\begin{align*}
X = \text{Transformer}(
    \text{concat}(
    \text{DNN}(B_I), 
    \text{BiLSTM}(B_a^{(24h)}), &\\
    \text{BiLSTM}(T_{[1,...,m]})
    )
) \\
B_{O[n+1]} = \text{CNN}(
\text{Decoder}(
    \text{concat}(
    \text{X.copy}(n), 
    B_{O[1,...,n]}))),
\end{align*}
where $X$ represents the outputs of the transformer, $B_I$ is the basic information of patients, and $B_a^{(24h)}$ is the basal injection of the last 24 hours, and $T_{[1,...,m]}$ represents the temporal glycemic information involving the glucose levels, nutrient intake, and anti-glycemic drug intake. In the second formula, $B_{O}$ is the bolus injection dosages, and $B_{O[1,...,n]}$ represents the historical bolus injection dosages, and $B_{O[n+1]}$ is the bolus injection recommended for the future.% Due to the GPT-like decoder design of the titration model, the inference of bolus insulin for any time slot necessitates the input of data from all preceding time points.



\begin{figure}
    \centering
    \includegraphics[width=0.5\textwidth]{titrationmodel.pdf}
    \caption{The structure of the titration model.}
    \label{titration_m}
\end{figure}
%The training and inference methodologies for the Insulin Strategy Determination component are distinct. 
During training, insulin dosages from the last two hours in the cropped data segments are used as labels, with all other relevant patient data serving as inputs. This training process enables the titration model to learn the effects of various insulin injection strategies on blood glucose control across endocrine systems of different patients. 
It is worth mentioning that in the training process, we also include the records where the glucose levels are out of the safe range, e.g., higher than 180 $mg/dl$ or lower than 70 $mg/dl$. By doing so, the model is able to better capture the relationship and interactions between insulin and blood glucose.
In the inference phase, patients can set their desired glucose levels for the next 2 hours, and the model uses its learned knowledge to propose an appropriate insulin injection strategy for the next 2 hours with 8 dosages (15 minutes interval).



% The architecture of the titration model integrates various data sources to optimize insulin dosing. Initially, the patient's medical record features (optionally) are concatenated with basic demographic information. This concatenated data is then processed through a dense neural layer. The resulting outputs are combined with the latent representations extracted from basal insulin injections over a preceding day by using a Bidirectional Long Short-Term Memory (BiLSTM) layer.
% Subsequently, a Transformer model is employed to extract self-attention information from the combined outputs. This method enhances the model's ability to discern relevant patterns and interactions within the data. For temporal data handling, two separate BiLSTM models are used to extract representations from patients' information, respectively, including past and expected future glucose levels, and past and future dietary and anti-diabetic drug intake.
% Next, all outputs are concatenated and copied to match each temporal sample of the previous bolus insulin injections. And those representation is input into a three-layer Transformer decoder model, which sequentially generates the hidden representations for each subsequent time interval one by one. Additionally, a convolutional 1D layer is utilized to extract local contextual information, which enhances the model's ability to interpret complex temporal patterns and neighborhood dependencies within the data, ensuring precise and context-aware insulin dosage predictions. The design of the titration model ensures comprehensive learning: it derives personalized insights from the patient's basic information and temporal information from past long-acting and basal insulin injections. Additionally, it extracts attention-based information from previous blood glucose levels and dietary data, as well as from anticipated future blood glucose levels and dietary intake. Thus, the model learns the complete information necessary for precise insulin titration, leveraging a synthesis of personal health data and temporal dynamics to optimize diabetes management. The titration model is a GPT-like decoder 
% model. So, the model generates dosages based on previous dosages and information one by one until all the dosages for the next 2 hours are generated.

% \subsubsection{Discrete Titration System}
% \noindent\textbf{Discrete Titration System}
% $2.3.3$ $Discrete$ $Titration$ $System$

% In the Discrete titration system, after the patient's dietary textual data is analyzed by the Large Language Model for nutritional content, the results are combined with other relevant information and input into the titration model. The output from the titration model first goes into a dense layer to determine whether an injection is needed. If so, the results from the titration model are then fed into a new dense layer designed to calculate the specific dosage of insulin to be administered. This structured process ensures that insulin injections are both necessary and accurately dosed according to the analyzed data. 
\subsection{Glucose Prediction and Re-titration}
This module serves as a safe guardian to prevent potential risks like hypoglycemia and hyperglycemia by predicting and re-titrating. 
Hypoglycemia generally refers to a blood glucose level that falls below the normal range of 65-70 $mg/dl$ (3.6–3.9 $mmol/l$) \cite{cryer2003hypoglycemia}. Hypoglycemia is extremely dangerous and can lead to serious conditions such as ataxia, mental confusion, speech impairments, seizures, coma, and in the most severe cases, death \cite{agrawal2022impact}. 
Hyperglycemia is defined as a fasting blood glucose level exceeding 125 $mg/dl$, or a postprandial (2 hours after meal) blood glucose level exceeding 180 $mg/dl$. If left untreated, it can lead to many serious and life-threatening complications, including damage to the eyes, kidneys, nerves, heart, and peripheral vascular system \cite{mouri2023hyperglycemia}.
% The glucose prediction and re-titration module includes the glucose prediction model and the re-titration model.


\subsubsection{Glucose Prediction}


The glucose prediction model serves to predict blood glucose concentrations. As illustrated in Figure \ref{gp}, it shares a structural resemblance with the titration model shown in Figure \ref{titration_m}; both are GPT-like decoder models but differ in the type of input information they process. In the prediction model, projected time-series data, including anticipated nutritional intake, anti-diabetic drug consumption, and the projected basal insulin injections in the time under consideration, are input into a BiLSTM layer to extract temporal features. These features are combined with patient characteristics extracted by a DNN and fed into a transformer layer. After alignment with past blood glucose data through replication and concatenation, the inputs are processed by a GPT-like decoder model. Finally, a CNN layer sequentially generates predictions for future glucose levels. The formula for the glucose prediction model is as follows.
\begin{align*}
\text{x} = \text{Transformer}(
    \text{concat}(
    \text{DNN}(B_I),
    \text{BiLSTM}(t_{[1,...,m]}))
    ) 
),
\end{align*}
\begin{align*}
G_{[n+1]} = \text{CNN}(
\text{Decoder}(
    \text{concat}(
    \text{x.copy}(n), 
    G_{[1,...,n]})
    ) 
),
\end{align*}
% In contrast, the output from the discrete insulin titration model, which provides an injection dosage for only a single time point, assumes that all other subsequent injections are zero. This output is then concatenated and inputted into the prediction model for further analysis.
where $x$ represents the outputs of the transformer, $B_I$ is the basic information of patients, and $t_{[1,...,m]}$ represents the glycemic information involving the insulin injection dosages, nutrient intake, and anti-glycemic intake. In the second formula, $G$ is the glucose level, and $G_{[1,...,n]}$ represents the glucose levels for previous time points, and $G_{[n+1]}$ is the glucose level for the next time point.


\begin{figure}
    \centering
    \includegraphics[width=0.5\textwidth]{Glycemic_Prediction.pdf}
    \caption{The structure of the hyperglycemia and hypoglycemia events detection and re-titration system.}
    \label{gp}
\end{figure}

During training, similar to the titration model, we use glucose changes over the last two hours to train this model. The actual insulin injection strategies from the preceding two hours, along with all other relevant information within the data clips, are used to predict blood glucose changes.
During inference, this model forecasts the potential glucose changes that the proposed insulin delivery strategies might induce, thereby assessing whether the strategies are sufficiently safe and rational for implementation.
The criterion for identifying potential issues involves checking whether the predicted glucose concentrations are below 70 $mg/dl$ or exceeding 180 $mg/dl$ during the forecast period. 
If a potential risk is identified, the predicted insulin dosages are referred back to do re-titration until all risks are mitigated. Otherwise, this safe insulin injection strategy is provided to the patient.


\subsubsection{Re-Titration}

A LLM is employed to facilitate the re-titration process through carefully designed prompts. In the prompt, the LLM assumes the role of a diabetes specialist. 
% The necessity for outputting an accurate answer is emphasized, and the LLM is informed of the nutritional content of the patient's last meal, the insulin dosage administered during that meal, and the observed glucose concentration variations.
The model is instructed that increased dosages may be necessary to manage hyperglycemia and reduced dosages for hypoglycemia. The prompt details the current glucose levels, recent dietary intake, anticipated insulin injections, and prediction of affected blood glucose levels. 
% Additionally, information about the patient’s dietary intake and predicted future glucose levels is provided, prompting the LLM to recommend adjustments in the re-titration.
Once the LLM's re-titration suggestions are obtained, these new dosing recommendations are input into the glucose prediction model for a subsequent round of event detection, assessing potential hyperglycemia and hypoglycemia. 
\subsection{DIETS-LSTM}
In DIETS, the decoder layers of the diet titration and glucose prediction models predominantly consist of stacked transformers, favored for their proficiency in capturing correlations between diverse types of data. This ability makes them particularly effective at learning from multimodal information when patients provide various personal details. However, when such comprehensive personal information is unavailable, transformers may not perform optimally and could introduce unnecessary complexity. We opt for LSTM layers to form the decoder layer in such scenarios to address this. This adjustment reduces model complexity and enhances accuracy. We refer to this specific configuration as DIETS-LSTM.


\subsection{Two-stage Training}

To train patient-specific models without relying on professional guidance, the titration model and glucose prediction model are trained separately, and both employ a two-phase training, as shown in Figure \ref{infer_train}.
In the first phase, we train a foundation model using public open datasets, allowing it to learn generalizable knowledge about human physiological and metabolic hormone responses. In the second phase, this foundation model is fine-tuned using a small amount of information about the patient, including the patient's basic information and few days (e.g., 3 days) historical glycemic data. 
The fine-tuning process specializes the generalizable knowledge learned to fit the specific individual’s context. During this phase, only the final dense layer of the model is fine-tuned, and other layers are frozen to preserve the knowledge acquired from the extensive datasets. 

Two-stage training ensures comprehensive learning, deriving insights from basic patient data and historical medical records in the datasets. Consequently, the model not only learns complete information necessary for precise insulin titration but also utilizes a synthesis of personal health data and temporal dynamics to enhance diabetes management, culminating in a GPT-like decoder that sequentially generates insulin dosages for the upcoming two hours based on previous dosages and patient-specific information.


\section{Experiment}
% We describe the dataset, training settings, and evaluation metrics and briefly introduce other state-of-the-art models.
\subsection{Datasets and Implementation Details}
\label{subsect:experiment_details}

\textbf{Datasets.} Our experiments are conducted on three public datasets. We use the OhioT1DM dataset \cite{marling2020ohiot1dm} and the ShanghaiT1DM and ShanghaiT2DM datasets \cite{zhao2023chinese} for evaluating the titration model and glucose prediction model in DIETS. 
For simplicity, we refer to the ShanghaiT1DM and ShanghaiT2DM datasets as ShanghaiDM dataset in the following.
The dietary analysis module is evaluated with the BOOHEE dataset\footnote{https://www.boohee.com/}. The \textbf{ShanghaiDM dataset}, introduced in 2023, encompasses data from 12 Type 1 and 100 Type 2 diabetic patients, including basic demographics like height, weight, age, sex, BMI, duration of illness, and lifestyle factors such as smoking and drinking habits. It also involves detailed medical records, consisting of parameters such as Fasting Plasma Glucose, Fasting C-peptide, 2-hour Postprandial C-peptide, Fasting Insulin, HbA1c, Glycated Albumin, repeated measurements of Total Cholesterol, HDL, LDL, Creatinine, eGFR, Uric Acid, BUN, and a Hypoglycemia indicator. Each patient's data features a 3$\sim$14-day record of blood glucose fluctuations, bolus, and basal insulin injections, textual dietary intake descriptions, and anti-glycemic drug intake, recorded every 15 minutes. 11 Patients of the T1 dataset use Novolin insulin and the rest one Type1 patient uses both Humulin and Gansulin insulin. The \textbf{OhioT1DM dataset}, released in 2018, details 8 weeks of data from 6 Type 1 diabetic patients, documenting blood glucose levels, insulin injections, estimated carbohydrate intake per meal, along with records of physical activity, work, sleep, and additional metrics such as stress, heart rate, temperature, and step count, captured every 5 minutes. All patients in the OhioT1dm dataset use Novalog insulin. The \textbf{BOOHEE dataset}, which includes nutritional content for over 4000 foods, recipes, and reviews, is utilized in our experiments primarily to assess the model's performance with home-cooking data, offering a comprehensive test of its dietary analysis capabilities in realistic settings.

\textbf{Data pre-processing.} For the ShanghaiDM dataset, we perform data cleaning such as converting textual descriptions of insulin injections into numerical values. The dataset details insulin injections administered via both subcutaneous and intravenous routes. Given that subcutaneous injections typically delay insulin absorption by about half an hour \cite{galloway1981factors}, we adjusted these data entries to align the timing effects of both administration methods. %This alignment is crucial for our experiments, where we also explore the impact of aligned versus unaligned insulin data on the results.
% For the OhioT1DM dataset, originally sampled every five minutes, we applied downsampling to record data every 15 minutes instead. For each sample, we aggregated the values of carbohydrate intake and activity data from the three samples within each 15-minute window to maintain consistency with the rest of our data-handling approaches.

\textbf{Train Setup.} All the experiments are conducted on 1 NVIDIA A100 GPU, utilizing a batch of 32. The AdamW algorithm governs the optimization process. This configuration is sustained throughout 200 epochs with 40 epochs' patience early stopping. The learning rate is set at 0.005. The distribution of data across the training, validation, and test sets is configured to be 70\%, 15\%, and 15\%, respectively.

\textbf{Models in comparison:} We compare the performance of DIETS with the following state-of-the-art models. 
\textbf{P-Nut} \cite{ispirova2020p} is a machine learning pipeline for predicting macronutrient values of foods using unsupervised learning for clustering, followed by supervised learning for regression.
\textbf{RL-DITR} \cite{wang2023optimized} is a reinforcement learning (RL) based model trained based on the professionals' instructions and case-specific feedback. It is the latest data-driven instead of simulator-trained RL model in the literature. 
\textbf{PGBTAM} \cite{yang2023short} is a short-term glucose prediction model based on the temporal multi-head attention mechanism. 
\textbf{CRNN} \cite{li2019convolutional} uses Convolutional Recurrent Neural Networks for glucose prediction. 
\textbf{P-LSTM} \cite{prendin2023importance} is a LSTM-based model for blood glucose prediction.
% \textbf{GP}: Gaussian Processing model, a regressional machine learning model \cite{cai2021bayesian}.


\subsection{Evaluation Metrics}
We evaluate model performance using Mean Absolute Error (MAE) and variance. The performance of dietary analysis, titration model, and glucose prediction model are evaluated by MAE, and the variance is used to evaluate the stability of the tailored LLM on dietary analysis task. $\text{MAE} = \frac{1}{n} \sum_{i=1}^{n} \left| y_i - \hat{y}_i \right|
$, where $n$ is the number of data, and $y_i$ is the true value for the $i$th data, and the $\hat{y}_i$ is the calculated value of the evaluated model. Variance $\sigma^2 = \frac{1}{n} \sum_{i=1}^{n} \left( x_i - \mu \right)^2$, where $n$ is the time of experiment, and $x_i$ is the calculated value of the $i$th experiment, and $\mu$ represents the mean value of $x$ in all the experiments. 


\section{Evaluation}
This section presents the experiment results. DIETS is the only comprehensive framework that spans the entire process of insulin management. Thus we compare the performance of the modules used in DIETS with related existing solutions.

\begin{figure}
    \centering
    \includegraphics[width=0.48\textwidth]{error_comparison.pdf}
    \caption{Performance of different models for the dietary analysis.}
    \label{error_llm}
\end{figure}

\subsection{Dietary Analysis}
We use the record of home-cooked dishes in the BOOHEE dataset to evaluate the capability of tailored LLMs for the dietary analysis module.
We compare the performance of several popular LLMs, including GPT-4 \cite{achiam2023gpt}, 
GPT-4o \cite{gpt4o2024}, Mistral-22B \cite{jiang2024mixtral}, Llama3 \cite{touvron2023llama}, Gemini \cite{team2023gemini} and one existing work P-Nut \cite{ispirova2020p}. ChatGPT cannot analyze the dietary in the experiment and thus is excluded from the experiment.
In the experiment, tailored LLMs are utilized to analyze the content of carbohydrates, calories, proteins, and fats in the patient's dietary intake. We use 30\% of the BOOHEE dataset to train P-Nut, and the rest 70\% is used for test.
%The results are plotted in Figure \ref{error_llm} and Figure \ref{stability}. 

Figure \ref{error_llm} compares the MAE (in gram) of the six models in estimating the content of the four nutrients in meals. Among them, Mistral-22B, GPT-4 and GPT-4o achieve similar performance with lower estimation error comparing to the other two models. These three models are all good at estimating the content of calories. On the other hand, Gemini performs worst in estimating calories while Llama3 and P-Nut are slightly better than Gemini in general but not much. We see although P-Nut is particularly trained on the dataset, it still lacks the extensive knowledge base to provide accurate analysis.
\begin{figure}
    \centering
    \includegraphics[width=0.44\textwidth]{variance.png}
    \caption{The performance stability of different LLMs.}
    \label{stability}
\end{figure}
Figure \ref{stability} reports the error variance of the nutrient estimation results of LLMs. Due to the variability where the same inputs to LLMs can generate different outputs, stability has emerged as a crucial factor to consider.
We see Llama3 achieves lower variance of the estimation error, and Mistral-22B is slightly worse but not much. The other three models, i.e., GPT-4, GPT-4o and Gemini, exhibit similar performance in terms of error variance.
In our implementation, we choose GPT-4o due to its highest estimation accuracy on nutrition estimation, which is one of the most important factors for glucose and insulin prediction.


\subsection{Performance of Insulin Delivery Strategy Determination}\label{titra_com}
We compare the performance of the titration model in DIETS with related existing models discussed in Section \ref{subsect:experiment_details} on ShanghaiDM Dataset.
The experiment setting is as follows. In the test dataset, for the given expected blood glucose levels, we examine whether the models can determine similar glucose delivery strategies with the ground-truth recorded in the dataset.
In addition to the RL-DITR, we also adapt the glucose prediction models, PGBTAM, CRNN and P-LSTM for the titration task. Some minor modifications were made to their data inputs and outputs, while preserving the original structure to maintain their capability to learn the effects of insulin on the endocrine system. These adaptations allow the models to shift their focus from predicting future blood glucose levels affected by insulin injections to calculating insulin dosages responsible for specific glucose variations. 
In other words, the model calculates the insulin dosing required to produce the observed fluctuations in blood glucose levels.
As all of these existing works assume having prior knowledge about the nutrients in meals, we use the output of our LLM-based dietary analysis module as the input for all models investigated in the experiments for comparison.
The shared inputs among all the models include historical blood glucose levels, carbohydrate intake, bolus, and basal insulin injection, and future expected blood glucose levels. 
All the models are trained with the same training set and tested on the same test set. The result is reported in Figure \ref{error_bar}(a). We tested the RL-DITR in \cite{wang2023optimized} directly in the test set, for the professional instructions from clinicians are not accessible in ShanghaiDM dataset. 

\begin{figure}
    \centering
    \includegraphics[width=0.44\textwidth]{Errorbar_titra.pdf}
    \caption{Performance of insulin delivery strategy determination on (a) ShanghaiDM dataset and (b) OhioT1DM dataset}
    \label{error_bar}
\end{figure}
% \begin{table}[!]
% \centering
% \caption{(a).Performance of insulin delivery strategy determination using different models on Shanghai Diabetic Dataset.}
% \label{mae_titra_sh}
% \begin{tabular}{cccccc}
% \hline
% \textbf{Model} & \textbf{DIETS} & \textbf{PGBTAM}  & \textbf{CRNN} & \textbf{P-LSTM} &\textbf{RL-DITR}\\ \hline
% \textbf{MAE ($IU$)} &\textbf{0.0714} & 0.2836  & 0.1477 & 0.1475&1.4174 \\ \hline
% \end{tabular}
% \end{table}


To validate the generalizability of DIETS, experiments were also conducted using the ohioT1DM dataset. Unlike the Shanghai Diabetic dataset, the ohioT1DM dataset lacks personalized patient information, creating distinct conditions for each dataset. As discussed in section 3, to achieve favorable experimental outcomes in scenarios devoid of personal information, the DIETS-LSTM model was developed as an adaptation. And the results are shown in Figure \ref{error_bar}(b). As RL-DITR requires the patient's personal details as input, such as age, gender and BMI, which are not provided by the ohioT1DM dataset, it is not included in this experiment.

% \begin{table}[!]
% \centering
% \caption{Performance of insulin delivery strategy determination using different models on ohioT1DM Dataset.}
% \label{mae_titra_ohio}
% \begin{tabular}{cccccc}
% \hline
% \textbf{Model} & \textbf{DIETS} & \textbf{PGBTAM}  & \textbf{CRNN} & \textbf{P-LSTM} &\textbf{RL-DITR}\\ \hline
% \textbf{MAE ($IU$)} &\textbf{0.1032} & 0.2065  & 0.1059 & 0.1057& \\ \hline
% \end{tabular}
% \end{table}

As the results suggest, on the Shanghai Diabetics Dataset, the DIETS achieves the best performance on determining insulin delivery strategies to reach the expected blood glucose levels. The MAE of the estimated insulin injection is 0.0641 $IU$, which is at least 50\% less than the error from all other models, and DIETS is also the most stable model among all competitors.
The RL-based model RL-DITR performs the worst. This is probably due to the poor adaptation capacity of the model. 
In the ohioT1DM dataset scenario, DIETS remained the best-performing and most stable model. However, due to the lack of personalized patient information available for customized analysis, DIETS's lead was not as pronounced compared to previous datasets.

\subsection{Performance of Glucose Prediction}
We compare the performance of the glucose forecasting model of DIETS with three state-of-the-art models mentioned in Section \ref{subsect:experiment_details}, i.e., PGBTAM, CRNN and P-LSTM. 
All models are originally designed for blood glucose prediction. 
The experiment setting is as follows.
We also evaluate models on both ShangHai Diabetic dataset and ohioT1DM Dataset.
All models are used to predict the blood glucose variations in the next 2 hours. The inputs to all models are the same, including the historical blood glucose variation, patient's basic information, and the planned insulin delivery strategies, etc.
The metric is the MAE of the predicted blood glucose value ($mg/dl$), and the results are reported in Figure \ref{error_bar_glycemic}.
As the results suggest, the glucose prediction model in DIETS achieves the best performance in glucose prediction with an average MAE of 15.91 $mg/dl$ in Shanghai Diabetic Dataset, and 19.60 $mg/dl$ in ohioT1DM Dataset, significantly outperforms SOTA models. And the DIETS is comparatively the most stable model among all competitors.


% \begin{table}[h!]
% \centering
% \caption{The performance of the blood glucose prediction using different models on Shanghai Diabetic Dataset.}
% \label{mae_glucose}
% \begin{tabular}{ccccc}
% \hline
% \textbf{Model} &\textbf{DIETS} & \textbf{PGBTAM}  & \textbf{CRNN} & \textbf{P-LSTM} \\ \hline
% \textbf{MAE ($mg/dl$)} &\textbf{15.91} & 48.90  & 21.30 & 23.95 \\ \hline
% \end{tabular}
% \end{table}
\begin{figure}
    \centering
    \includegraphics[width=0.42\textwidth]{errorbar_glucose.pdf}
    \caption{Performance of glucose prediction on (a) ShanghaiDM dataset and (b) OhioT1DM dataset.}
    \label{error_bar_glycemic}
\end{figure}


% \begin{table}[h!]
% \centering
% \caption{The performance of the blood glucose prediction using different models on ohioT1DM dataset.}
% \label{mae_glucose}
% \begin{tabular}{cccccc}
% \hline
% \textbf{Model} &\textbf{DIETS-LTSM} & \textbf{PGBTAM}  & \textbf{CRNN} & \textbf{P-LSTM} \\ \hline
% \textbf{MAE ($mg/dl$)} &\textbf{0.1032} & 48.90  & 21.30 & 23.95 \\ \hline
% \end{tabular}
% \end{table}
 
%Because the target of DIETS is to keep the glucose of patients in a safe range (70mg/dl - 180mg/dl), the error for the glucose prediction is still acceptable.


\begin{table*}[h!]
\centering
\caption{Evaluation of titration performance across various fine-tuning options and training data volumes (MAE)}.
\label{foundation}
\begin{tabular}{c|c|c|c|c|c}
\hline
\textbf{Amount of training data} & \textbf{Single} & \textbf{Foundation} & \textbf{FT-full} & \textbf{FT-CNN\&Dense} & \textbf{FT-Dense} \\ \hline
1 day   & 0.1324 & \multirow{4}{*}{0.0641} & 0.1283  & 0.1258   & \textbf{0.1254}   \\ \cline{1-2} \cline{4-6}
3 days  & 0.0758 &                          & 0.0923  & 0.0677   & \textbf{0.0598} \\ \cline{1-2} \cline{4-6}
6 days  & 0.1016 &                          & \textbf{0.0635} & 0.1180   & 0.0705   \\ \cline{1-2} \cline{4-6}
10 days & 0.0780 &                          & 0.0764  & 0.0884   & \textbf{0.0551} \\ \hline
\end{tabular}
\end{table*}

\subsection{Ablation Study on the Incorporated Features}
\label{subsect:ablation_study}

In our study, both the insulin injection strategy determination model and the glucose prediction model incorporate numerous features. Evaluating the efficiency of these features and their impact on model accuracy remains a critical consideration.
We conduct a series of experiments to investigate their impact on the effectiveness of the two models in Shanghai Diabetic Dataset. We train the two models using different groups of features and test their performances.
This approach allows us to systematically evaluate and refine the feature selection process, enhancing the overall performance and reliability of our design.
Nine groups of features are investigated in the experiments. Their configurations are as follows.



\begin{figure}
    \centering
    \includegraphics[width=0.42\textwidth]{ablationstudy.pdf}
    \caption{The impact of different features on the titraion model and glucose prediction model.}
    \label{ablation}
\end{figure}

\noindent$\bullet$\hspace{0.5em}  \textbf{G1}: Blood glucose levels, insulin injection dosages. \\
\noindent$\bullet$\hspace{0.5em}  \textbf{G2}: Features in G1, intake of carbohydrates.\\
\noindent$\bullet$\hspace{0.5em}  \textbf{G3}: Features in G2, intake of calories, proteins, and fats. \\
\noindent$\bullet$\hspace{0.5em}  \textbf{G4}: Features in G3, intake of anti-glycemic drugs.\\
\noindent$\bullet$\hspace{0.5em}  \textbf{G5}: Features in G4, basic information of patients.\\
\noindent$\bullet$\hspace{0.5em}  \textbf{G6}: Features in G4, historical 24-hour basal injection.\\
\noindent$\bullet$\hspace{0.5em}  \textbf{G7}: Features in G4, basic information of patients, historical 24-hour basal injection.\\
\noindent$\bullet$\hspace{0.5em}  \textbf{G8}: Features in G6, medical record.\\
\noindent$\bullet$\hspace{0.5em}  \textbf{G9}: Features in G7, medical record.



% \begin{figure}
%     \centering
%     \includegraphics[width=0.45\textwidth]{ablationstudy.pdf}
%     \caption{The impact of different features on the titraion model and glucose prediction model.}
%     \label{ablation}
% \end{figure}

The results are plotted in Figure \ref{ablation}.
We see the features have different impact on the two models. 
For the titration model, the feature group G7 and G9 achieve a comparable performance, which is better than other groups. Although the model gets slightly improved with the addition of medical records of patients in G9, accessing medical records typically requires hospital visits and medical examinations, posing a significant barrier to data collection and complicating the use of the DIETS framework for patients with limited access to healthcare. 
For the glucose prediction model, the feature group G5 achieves the best performance, which indicates the effectiveness of the individual's basic information.
Consequently, we utilize features from G7 as the model inputs for the insulin titration model, and features in G5 for the glucose prediction model.



\subsection{Impact of Personalized Fine-tuning}
In DIETS, we employ two-stage training process to develop personalized titration model for each individual. In this section, we investigate the impact of different fine-tuning alternatives on the final model performance. 
We compared the performance of the following models.


\noindent$\bullet$\hspace{0.5em}  \textbf{Single}: The titration model is only trained by the data of the individual, without using public datasets.\\
\noindent$\bullet$\hspace{0.5em}  \textbf{Foundation}: The foundation model trained in the first stage. No fine-tuning is applied.\\
\noindent$\bullet$\hspace{0.5em}  \textbf{FT-full}: The titration model is fine-tuned from the foundation model. During the fine-tuning process, all the parameters in the DIETS are trainable.\\
\noindent$\bullet$\hspace{0.5em}  \textbf{FT-CNN\&Dense}: The titration model is fine-tuned from the foundation model. During the fine-tuning process, only the parameters in the Convid 1d layer and dense layer are trainable.\\
\noindent$\bullet$\hspace{0.5em}  \textbf{FT-Dense}: The titration model is fine-tuned from the foundation model. During the fine-tuning process, only the parameters in the dense layer are trainable.


In this experiment, we also investigate the impact of different amounts of training data. We train the above models using three subsets of public datasets, i.e., 1-day, 3-day, 6-day, and 10-day dataset, and the results are summarized in Table \ref{foundation}.
The results reveal that model performance does not strongly correlate with the volume of training data; notably, three days of data are sufficient for training DIETS. 
The Single model without public datasets cannot perform well with all four training datasets.
FT-Dense model performs the best with 1-day, 3-day and 10-day training data. FT-full model performs best with the 6-day training data, which is slightly better than FT-Dense model. The result suggest that completely fine-tuning the model in the second-stage would hinder the model performance. 
In comparison, only fine-tuning the dense layer of the foundation model achieves the best performance. In comparison with the foundation model, it advised that personalized models be trained using at least three days of a patient's glycemic data. Or the foundation model should be utilized directly to provide injection strategy recommendations.



\begin{table}[!]
\centering
\caption{Performance on Type 1 and Type 2 Diabetes.}
\label{mae_type_c}
\begin{tabular}{|c|c|c|c|c|}
\hline
\textbf{Trained by } & \textbf{Type 1} & \textbf{Type 2} & \multicolumn{2}{c|}{\textbf{Type 1 \& 2}} \\ \hline
\textbf{Tested on}& \textbf{Type 1}&\textbf{Type 2} & \textbf{Type 1} & \textbf{Type 2} \\ \hline
\textbf{MAE ($IU$)}&0.0731 & 0.0745 & 0.0635 & 0.0650 \\ \hline
\end{tabular}
\end{table}


\subsection{Performance on Type 1 and Type 2 Diabetes}
We compare the performance of the titration models on different types of diabetes. We make use of two sub-datasets, i.e., Type 1 dataset with data records from 11 people with type 1 diabetes, and Type 2 dataset with data records from 20 people with type 2 diabetes.
We train the model using three settings respectively, i.e., the Type 1 dataset, the Type 2 dataset, and both datasets. We compare the three models and report the results in Table \ref{mae_type_c}.
The test results show that when the model is trained exclusively on either Type 1 or Type 2 diabetes datasets, its performance is better for Type 1 patients compared to Type 2. This may be attributed to the greater complexity and individual variability of Type 2 diabetes. However, when the model is trained on a combined dataset of both Type 1 and Type 2 diabetes, there is an improvement in performance across both datasets. This indicates that despite their differences, there are commonalities between the two types of diabetes from which the model can learn useful insights from each other.


\subsection{Impact of Sliding Window Size }
As mentioned in Section \ref{dp}, the input data is partitioned by a sliding window, and every data clip consists of future duration and previous duration. The future duration of the input data is fixed to be 2 hours (8 time slots), while the previous duration of input data is still flexible. For example, if the sliding window size is 6 hours, then previous duration of data is 4 hours. 
To understand the impact, we compare the performance of titration models with different sliding window sizes for data partitioning, including 8 hours (32 time slots), 6 hours (24 time slots), and 4 hours (16 time slots).
The performance is reported in Table \ref{mae_time}. It is evident that the model with the biggest window size, i.e., longest input gets the lowest error. Thus in DIETS, we use the window size of 8 hours to train the titraion model and the glucose prediction model. 

\begin{table}[!]
\centering
\caption{Impact of the the sliding window size.}
\label{mae_time}
\begin{tabular}{|c|c|c|c|}
\hline
total Duration & 8 hours &6 hours & 4 hours\\ \hline
MAE($IU$) & 0.0641 & 0.0827 & 0.0724 \\ \hline
\end{tabular}
\end{table}

\subsection{Model Size and Overhead}
The titration model, with an allocated memory of 201.4 MB while inference, contains 11,233,692 parameters. The average inference time per
instance, based on 10000 inferences, is 25.4ms. The glucose prediction model contains 11,182,384 parameters, with an allocated memory of 113.1 MB. The average inference time per instance, based on 10000 inferences, is 17ms.
As for the dietary analysis module, which relys on LLM cloud servers, it does not have any memory occupation. The average time consumption for this module is 0.85s, based on 100 inferences.
Most modern smartphones like the Google Pixel 7 (Processor: Google Tensor G2, RAM: 8GB) are equipped with adequate processors and sufficient memory to effectively handle the whole diabetes management system inference.

% \subsection{Impact of Different Types of Insulin}
% As discussed in \ref{subsect:experiment_details}, 11 out of 12 type 1 diabetes patients are using Novolin R insulin as their rapid-acting insulin, while the other patient uses both Gansulin R and Humulin R insulin as his rapid-acting insulin. Besides, 20 type 2 diabetes patients all use Novolin R. To demonstrate that our model is still efficient for other types of insulin, we train the model with different types of insulin and show the performance in Table \ref{insulin}.
% \begin{table}[!]
% \centering
% \caption{Performance of the titration model on different types of insulin.}
% \label{insulin}
% \begin{tabular}{|c|c|c|c|}
% \hline
% Insulin & Gansulin &Humulin& Novolin\\\hline
% MAE($IU$)&0.000367&\textbf{0.000036}&0.0641\\ \hline
% \end{tabular}
% \end{table}
% The performance of DIETS titration on Gansulin and Humulin is much better than Novolin. We suspect that this is because all Humulin and Gansulin data are from one patient, while the Novolin data are from 11 type 1 and 20 type 2 diabetes patients. The individual differences in diabetes patients cause a large gap in the error of insulin titration.

% As we mentioned in section \ref{dp}, the dataset includes subcutaneous and intravenous insulin, exhibiting different absorption rates. 
% It causes different delay for subcutaneous insulin. In this section, we compare the performance of the titration of DIETS with and without alignment. The results are shown in table \ref{mae_delay}. The aligned model performs better, proving the delay of subcutaneous insulin and the neediness of alignment.
% \begin{table}[h!]
% \centering
% \caption{The titration performance with alignment and without alignment}
% \label{mae_delay}
% \begin{tabular}{|c|c|c|}
% \hline
% DIETS & With &Without\\
% -titration&Alignment&Alignment\\ \hline
% MAE(unit) & 0.0714 & 0.1236 \\ \hline
% \end{tabular}
% \end{table}




% \section{Discussion}
% DIETS is trained to dose insulin targeting a specific safe glucose level instead of dosing a safe dosage. Admittedly, due to this new mechanism, it is hard to compare the performance of DIETS and other mainstream RL management systems, which are trained to titrate a 'proper' injection dose. However, it is hard to tell which is more proper without real-world experiments conduction. Establishing a 'proper' dosage dataset requires adequate medical knowledge and experience in the direction of diabetes, which is not constantly available for most diabetes patients. Moreover, 'proper' is subjective, and those uncertainties also cause unnecessary health risks to patients.

% Unlike other mainstream RL management systems, DIETS can be trained without any professional guidance, which means that patients can train their own customized titration model based on accessible data, allowing DIETS to be used in more scenarios.


\section{Related Work}
\label{sect:related_work}

\textbf{Nutrient analysis}.
Most existing research on blood glucose management either assume having prior knowledge about the nutrients of the patient's meals \cite{brown2018first, silva2022real} or require the patient to adhere to a predefined set of food intake \cite{emerson2023offline,jaloli2024basal}.
Some research works \cite{ispirova2020p,ispirova2024msgen} use unsupervised learning and supervised learning NLP models to estimate nutrients. However, it is hard for those traditional NLP models to handle the unstructured and casual textual descriptions from the patients. Due to the diversity of patients and the corresponding variety in their diets, traditional NLP models often lack the extensive knowledge base to provide accurate analysis.

\textbf{Blood glucose management}.
There are two categories of works for glucose management: Traditional control theory-based methods and machine learning approaches. 
MPC-based systems use mathematical models based on inputs like glucose concentration and insulin infusion rates to adjust parameters for optimal dosing \cite{nwokolo2023artificial}.
PID-based systems, on the other hand, calculate insulin doses by assessing deviations from target glucose levels, the actual difference between current and target glucose, and the rate of glucose change \cite{nwokolo2023artificial}. 
Fuzzy logic systems are employed to replicate the decision-making processes typical of diabetes clinicians \cite{nwokolo2023artificial}. These methods, however, are generally limited to minor adjustments in basal insulin, and suffer from the significant inherent delay in insulin’s impact on blood glucose levels. 
Machine learning models, primarily the reinforcement learning (RL), have been studied for insulin titration and glucose prediction. 
Jaloli \textit{et al.}  \cite{jaloli2024basal} and Emerson \textit{et al.}  \cite{emerson2023offline} exemplify using simulators to develop RL-based systems without endangering human subjects. \cite{jaloli2024basal} utilized a multi-agent RL model for constant trial-and-error until the model learned good knowledge in insulin titration for both basal and bolus. In \cite{emerson2023offline}, an offline RL model is employed to train on the medical datasets and simulator. 
\cite{wang2023optimized} proposed a glycemic control system with the RL model where professional clinicians evaluate the feedback of the decision-making of the RL model.
However, the training of RL-based systems highly relies on the availability of the extensive feedback from professionals, which is impractical for everyday life, and they struggle with adapting the model to new patients due to individual differences among patients.

\textbf{Blood glucose prediction}.
In practice, glucose prediction is an important component for diabetes management to prevent potential risks. Existing works primarily make use of ineffective machine learning models. 
Aliberti \textit{et al.} \cite{aliberti2019multi} use LSTM networks for blood glucose prediction.
Li \textit{et al.} \cite{li2019convolutional} utilize the convolutional neural network to forecast glucose levels for simulated patient cases.
Yang \textit{et al.} \cite{yang2023short} propose a short-term prediction method of blood glucose based on temporal multi-head attention mechanism for diabetic patients. 
Cheng \textit{et al.} \cite{Cheng2024TowardSG} propose an end-to-end pipeline for short-term glucose prediction solely based on CGM time series data.
Cai \textit{et al.} \cite{cai2021bayesian} use the Gaussian process regression in blood glucose prediction.
All of those models lack the capacity of effectively predicting accurate blood glucose levels due to the lack of personalized fine-tuning.

\section{Conclusion}

We introduce DIETS, the first comprehensive insulin management framework for people with diabetes in everyday life, without the need for expert supervision. Effective insulin delivery recommendations based on dietary information analyzed by tailored LLM are developed by DIETS to control future blood glucose levels. Additionally, DIETS also incorporates a glucose prediction model to prevent potential risks of hyperglycemia or hypoglycemia. Extensive experiments on various public datasets demonstrate the effectiveness of DIETS, indicating its high potential for clinical trials.




%% The next two lines define the bibliography style to be used, and
%% the bibliography file.
\bibliographystyle{ACM-Reference-Format}
\bibliography{sample}


%%
%% If your work has an appendix, this is the place to put it.
\appendix



\end{document}
\endinput
%%
%% End of file `sample-sigconf.tex'.

%%% -*-BibTeX-*-
%%% Do NOT edit. File created by BibTeX with style
%%% ACM-Reference-Format-Journals [18-Jan-2012].

\begin{thebibliography}{55}

%%% ====================================================================
%%% NOTE TO THE USER: you can override these defaults by providing
%%% customized versions of any of these macros before the \bibliography
%%% command.  Each of them MUST provide its own final punctuation,
%%% except for \shownote{}, \showDOI{}, and \showURL{}.  The latter two
%%% do not use final punctuation, in order to avoid confusing it with
%%% the Web address.
%%%
%%% To suppress output of a particular field, define its macro to expand
%%% to an empty string, or better, \unskip, like this:
%%%
%%% \newcommand{\showDOI}[1]{\unskip}   % LaTeX syntax
%%%
%%% \def \showDOI #1{\unskip}           % plain TeX syntax
%%%
%%% ====================================================================

\ifx \showCODEN    \undefined \def \showCODEN     #1{\unskip}     \fi
\ifx \showDOI      \undefined \def \showDOI       #1{#1}\fi
\ifx \showISBNx    \undefined \def \showISBNx     #1{\unskip}     \fi
\ifx \showISBNxiii \undefined \def \showISBNxiii  #1{\unskip}     \fi
\ifx \showISSN     \undefined \def \showISSN      #1{\unskip}     \fi
\ifx \showLCCN     \undefined \def \showLCCN      #1{\unskip}     \fi
\ifx \shownote     \undefined \def \shownote      #1{#1}          \fi
\ifx \showarticletitle \undefined \def \showarticletitle #1{#1}   \fi
\ifx \showURL      \undefined \def \showURL       {\relax}        \fi
% The following commands are used for tagged output and should be
% invisible to TeX
\providecommand\bibfield[2]{#2}
\providecommand\bibinfo[2]{#2}
\providecommand\natexlab[1]{#1}
\providecommand\showeprint[2][]{arXiv:#2}

\bibitem[Achiam et~al\mbox{.}(2023)]%
        {achiam2023gpt}
\bibfield{author}{\bibinfo{person}{Josh Achiam}, \bibinfo{person}{Steven Adler}, \bibinfo{person}{Sandhini Agarwal}, \bibinfo{person}{Lama Ahmad}, \bibinfo{person}{Ilge Akkaya}, \bibinfo{person}{Florencia~Leoni Aleman}, \bibinfo{person}{Diogo Almeida}, \bibinfo{person}{Janko Altenschmidt}, \bibinfo{person}{Sam Altman}, \bibinfo{person}{Shyamal Anadkat}, {et~al\mbox{.}}} \bibinfo{year}{2023}\natexlab{}.
\newblock \showarticletitle{Gpt-4 technical report}.
\newblock \bibinfo{journal}{\emph{arXiv preprint arXiv:2303.08774}} (\bibinfo{year}{2023}).
\newblock


\bibitem[Agrawal et~al\mbox{.}(2022)]%
        {agrawal2022impact}
\bibfield{author}{\bibinfo{person}{Siddarth Agrawal}, \bibinfo{person}{Sebastian Makuch}, \bibinfo{person}{Mateusz Dr{\'o}{\.z}d{\.z}}, \bibinfo{person}{Tomasz Dudzik}, \bibinfo{person}{Igor Doma{\'n}ski}, \bibinfo{person}{Rafa{\l} Por{\k{e}}ba}, {and} \bibinfo{person}{Grzegorz Mazur}.} \bibinfo{year}{2022}\natexlab{}.
\newblock \showarticletitle{The impact of hypoglycemia on patients with diabetes mellitus: A cross-sectional analysis}.
\newblock \bibinfo{journal}{\emph{Journal of Clinical Medicine}} \bibinfo{volume}{11}, \bibinfo{number}{3} (\bibinfo{year}{2022}), \bibinfo{pages}{626}.
\newblock


\bibitem[Ahmadi and Jullien(2009)]%
        {ahmadi2009wireless}
\bibfield{author}{\bibinfo{person}{Mohammad~Mahdi Ahmadi} {and} \bibinfo{person}{Graham~A Jullien}.} \bibinfo{year}{2009}\natexlab{}.
\newblock \showarticletitle{A wireless-implantable microsystem for continuous blood glucose monitoring}.
\newblock \bibinfo{journal}{\emph{IEEE transactions on Biomedical circuits and systems}} \bibinfo{volume}{3}, \bibinfo{number}{3} (\bibinfo{year}{2009}), \bibinfo{pages}{169--180}.
\newblock


\bibitem[Aliberti et~al\mbox{.}(2019)]%
        {aliberti2019multi}
\bibfield{author}{\bibinfo{person}{Alessandro Aliberti}, \bibinfo{person}{Irene Pupillo}, \bibinfo{person}{Stefano Terna}, \bibinfo{person}{Enrico Macii}, \bibinfo{person}{Santa Di~Cataldo}, \bibinfo{person}{Edoardo Patti}, {and} \bibinfo{person}{Andrea Acquaviva}.} \bibinfo{year}{2019}\natexlab{}.
\newblock \showarticletitle{A multi-patient data-driven approach to blood glucose prediction}.
\newblock \bibinfo{journal}{\emph{IEEE Access}}  \bibinfo{volume}{7} (\bibinfo{year}{2019}), \bibinfo{pages}{69311--69325}.
\newblock


\bibitem[Association(2021)]%
        {american20216}
\bibfield{author}{\bibinfo{person}{American~Diabetes Association}.} \bibinfo{year}{2021}\natexlab{}.
\newblock \showarticletitle{6. Glycemic targets: standards of medical care in diabetes—2021}.
\newblock \bibinfo{journal}{\emph{Diabetes care}} \bibinfo{volume}{44}, \bibinfo{number}{Supplement\_1} (\bibinfo{year}{2021}), \bibinfo{pages}{S73--S84}.
\newblock


\bibitem[Brown et~al\mbox{.}(2018)]%
        {brown2018first}
\bibfield{author}{\bibinfo{person}{Sue Brown}, \bibinfo{person}{Dan Raghinaru}, \bibinfo{person}{Emma Emory}, {and} \bibinfo{person}{Boris Kovatchev}.} \bibinfo{year}{2018}\natexlab{}.
\newblock \showarticletitle{First look at Control-IQ: a new-generation automated insulin delivery system}.
\newblock \bibinfo{journal}{\emph{Diabetes Care}} \bibinfo{volume}{41}, \bibinfo{number}{12} (\bibinfo{year}{2018}), \bibinfo{pages}{2634--2636}.
\newblock


\bibitem[Cai et~al\mbox{.}(2021)]%
        {cai2021bayesian}
\bibfield{author}{\bibinfo{person}{Deheng Cai}, \bibinfo{person}{Wei Liu}, \bibinfo{person}{Linong Ji}, {and} \bibinfo{person}{Dawei Shi}.} \bibinfo{year}{2021}\natexlab{}.
\newblock \showarticletitle{Bayesian optimization assisted meal bolus decision based on Gaussian processes learning and risk-sensitive control}.
\newblock \bibinfo{journal}{\emph{Control Engineering Practice}}  \bibinfo{volume}{114} (\bibinfo{year}{2021}), \bibinfo{pages}{104881}.
\newblock


\bibitem[Cescon et~al\mbox{.}(2020)]%
        {cescon2020using}
\bibfield{author}{\bibinfo{person}{Marzia Cescon}, \bibinfo{person}{Sunil Deshpande}, \bibinfo{person}{Revital Nimri}, \bibinfo{person}{Francis~J Doyle~III}, {and} \bibinfo{person}{Eyal Dassau}.} \bibinfo{year}{2020}\natexlab{}.
\newblock \showarticletitle{Using iterative learning for insulin dosage optimization in multiple-daily-injections therapy for people with type 1 diabetes}.
\newblock \bibinfo{journal}{\emph{IEEE Transactions on Biomedical Engineering}} \bibinfo{volume}{68}, \bibinfo{number}{2} (\bibinfo{year}{2020}), \bibinfo{pages}{482--491}.
\newblock


\bibitem[Cheng et~al\mbox{.}(2024)]%
        {Cheng2024TowardSG}
\bibfield{author}{\bibinfo{person}{Ming Cheng}, \bibinfo{person}{Xingjian Diao}, \bibinfo{person}{Ziyi Zhou}, \bibinfo{person}{Yanjun Cui}, \bibinfo{person}{Wenjun Liu}, {and} \bibinfo{person}{Shitong Cheng}.} \bibinfo{year}{2024}\natexlab{}.
\newblock \showarticletitle{Toward Short-Term Glucose Prediction Solely Based on CGM Time Series}.
\newblock \bibinfo{journal}{\emph{ArXiv}}  \bibinfo{volume}{abs/2404.11924} (\bibinfo{year}{2024}).
\newblock
\urldef\tempurl%
\url{https://api.semanticscholar.org/CorpusID:269214260}
\showURL{%
\tempurl}


\bibitem[Chin-Jung et~al\mbox{.}(2021)]%
        {chin2021effects}
\bibfield{author}{\bibinfo{person}{Liu Chin-Jung}, \bibinfo{person}{Chiu Hsiao-Yean}, \bibinfo{person}{Chuang Yeu-Hui}, \bibinfo{person}{Lin Kuan-Chia}, {and} \bibinfo{person}{Huang Hui-Chuan}.} \bibinfo{year}{2021}\natexlab{}.
\newblock \showarticletitle{Effects of mobile health interventions on improving glycemic stability and quality of life in patients with type 1 diabetes: a meta-analysis}.
\newblock \bibinfo{journal}{\emph{Research in nursing \& health}} \bibinfo{volume}{44}, \bibinfo{number}{1} (\bibinfo{year}{2021}), \bibinfo{pages}{187--200}.
\newblock


\bibitem[Control and Group(1993)]%
        {diabetes1993effect}
\bibfield{author}{\bibinfo{person}{Diabetes Control} {and} \bibinfo{person}{Complications Trial~Research Group}.} \bibinfo{year}{1993}\natexlab{}.
\newblock \showarticletitle{The effect of intensive treatment of diabetes on the development and progression of long-term complications in insulin-dependent diabetes mellitus}.
\newblock \bibinfo{journal}{\emph{New England journal of medicine}} \bibinfo{volume}{329}, \bibinfo{number}{14} (\bibinfo{year}{1993}), \bibinfo{pages}{977--986}.
\newblock


\bibitem[Corporation(2018)]%
        {Omnipod5}
\bibfield{author}{\bibinfo{person}{Insulet Corporation}.} \bibinfo{year}{2018}\natexlab{}.
\newblock \bibinfo{title}{Omnipod 5 Automated Insulin Delivery System}.
\newblock \bibinfo{howpublished}{\url{https://www.omnipod.com/what-is-omnipod/omnipod-5}}.
\newblock
\newblock
\shownote{[accessed August-2024]}.


\bibitem[Cryer et~al\mbox{.}(2003)]%
        {cryer2003hypoglycemia}
\bibfield{author}{\bibinfo{person}{Philip~E Cryer}, \bibinfo{person}{Stephen~N Davis}, {and} \bibinfo{person}{Harry Shamoon}.} \bibinfo{year}{2003}\natexlab{}.
\newblock \showarticletitle{Hypoglycemia in diabetes}.
\newblock \bibinfo{journal}{\emph{Diabetes care}} \bibinfo{volume}{26}, \bibinfo{number}{6} (\bibinfo{year}{2003}), \bibinfo{pages}{1902--1912}.
\newblock


\bibitem[Deeb et~al\mbox{.}(2017)]%
        {deeb2017accurate}
\bibfield{author}{\bibinfo{person}{Asma Deeb}, \bibinfo{person}{Ahlam Al~Hajeri}, \bibinfo{person}{Iman Alhmoudi}, {and} \bibinfo{person}{Nico Nagelkerke}.} \bibinfo{year}{2017}\natexlab{}.
\newblock \showarticletitle{Accurate carbohydrate counting is an important determinant of postprandial glycemia in children and adolescents with type 1 diabetes on insulin pump therapy}.
\newblock \bibinfo{journal}{\emph{Journal of diabetes science and technology}} \bibinfo{volume}{11}, \bibinfo{number}{4} (\bibinfo{year}{2017}), \bibinfo{pages}{753--758}.
\newblock


\bibitem[Dhatariya et~al\mbox{.}(2020)]%
        {dhatariya2020diabetic}
\bibfield{author}{\bibinfo{person}{Ketan~K Dhatariya}, \bibinfo{person}{Nicole~S Glaser}, \bibinfo{person}{Ethel Codner}, {and} \bibinfo{person}{Guillermo~E Umpierrez}.} \bibinfo{year}{2020}\natexlab{}.
\newblock \showarticletitle{Diabetic ketoacidosis}.
\newblock \bibinfo{journal}{\emph{Nature Reviews Disease Primers}} \bibinfo{volume}{6}, \bibinfo{number}{1} (\bibinfo{year}{2020}), \bibinfo{pages}{40}.
\newblock


\bibitem[Dong et~al\mbox{.}(2024)]%
        {Dong2024InContextLearning}
\bibfield{author}{\bibinfo{person}{Qingxiu Dong}, \bibinfo{person}{Lei Li}, \bibinfo{person}{Damai Dai}, \bibinfo{person}{Ce Zheng}, \bibinfo{person}{Jingyuan Ma}, \bibinfo{person}{Rui Li}, \bibinfo{person}{Heming Xia}, \bibinfo{person}{Jingjing Xu}, \bibinfo{person}{Zhiyong Wu}, \bibinfo{person}{Baobao Chang}, \bibinfo{person}{Xu Sun}, \bibinfo{person}{Lei Li}, {and} \bibinfo{person}{Zhifang Sui}.} \bibinfo{year}{2024}\natexlab{}.
\newblock \showarticletitle{A Survey on In-context Learning}.
\newblock \bibinfo{journal}{\emph{arXiv preprint arXiv:2301.00234}} (\bibinfo{year}{2024}).
\newblock


\bibitem[El~Youssef et~al\mbox{.}(2009)]%
        {el2009review}
\bibfield{author}{\bibinfo{person}{Joseph El~Youssef}, \bibinfo{person}{Jessica Castle}, {and} \bibinfo{person}{W~Kenneth Ward}.} \bibinfo{year}{2009}\natexlab{}.
\newblock \showarticletitle{A review of closed-loop algorithms for glycemic control in the treatment of type 1 diabetes}.
\newblock \bibinfo{journal}{\emph{Algorithms}} \bibinfo{volume}{2}, \bibinfo{number}{1} (\bibinfo{year}{2009}), \bibinfo{pages}{518--532}.
\newblock


\bibitem[Emerson et~al\mbox{.}(2023)]%
        {emerson2023offline}
\bibfield{author}{\bibinfo{person}{Harry Emerson}, \bibinfo{person}{Matthew Guy}, {and} \bibinfo{person}{Ryan McConville}.} \bibinfo{year}{2023}\natexlab{}.
\newblock \showarticletitle{Offline reinforcement learning for safer blood glucose control in people with type 1 diabetes}.
\newblock \bibinfo{journal}{\emph{Journal of Biomedical Informatics}}  \bibinfo{volume}{142} (\bibinfo{year}{2023}), \bibinfo{pages}{104376}.
\newblock


\bibitem[Evert(2020)]%
        {evert2020factors}
\bibfield{author}{\bibinfo{person}{Alison~B Evert}.} \bibinfo{year}{2020}\natexlab{}.
\newblock \showarticletitle{Factors beyond carbohydrate to consider when determining meantime insulin doses: protein, fat, timing, and technology}.
\newblock \bibinfo{journal}{\emph{Diabetes Spectrum}} \bibinfo{volume}{33}, \bibinfo{number}{2} (\bibinfo{year}{2020}), \bibinfo{pages}{149--155}.
\newblock


\bibitem[Frier et~al\mbox{.}(2011)]%
        {frier2011hypoglycemia}
\bibfield{author}{\bibinfo{person}{Brian~M Frier}, \bibinfo{person}{Guntram Schernthaner}, {and} \bibinfo{person}{Simon~R Heller}.} \bibinfo{year}{2011}\natexlab{}.
\newblock \showarticletitle{Hypoglycemia and cardiovascular risks}.
\newblock \bibinfo{journal}{\emph{Diabetes care}} \bibinfo{volume}{34}, \bibinfo{number}{Suppl 2} (\bibinfo{year}{2011}), \bibinfo{pages}{S132}.
\newblock


\bibitem[Galloway et~al\mbox{.}(1981)]%
        {galloway1981factors}
\bibfield{author}{\bibinfo{person}{JA Galloway}, \bibinfo{person}{CT Spradlin}, \bibinfo{person}{RL Nelson}, \bibinfo{person}{SM Wentworth}, \bibinfo{person}{JA Davidson}, {and} \bibinfo{person}{JL Swarner}.} \bibinfo{year}{1981}\natexlab{}.
\newblock \showarticletitle{Factors influencing the absorption, serum insulin concentration, and blood glucose responses after injections of regular insulin and various insulin mixtures}.
\newblock \bibinfo{journal}{\emph{Diabetes Care}} \bibinfo{volume}{4}, \bibinfo{number}{3} (\bibinfo{year}{1981}), \bibinfo{pages}{366--376}.
\newblock


\bibitem[Griesdale et~al\mbox{.}(2009)]%
        {griesdale2009intensive}
\bibfield{author}{\bibinfo{person}{Donald~EG Griesdale}, \bibinfo{person}{Russell~J de Souza}, \bibinfo{person}{Rob~M van Dam}, \bibinfo{person}{Daren~K Heyland}, \bibinfo{person}{Deborah~J Cook}, \bibinfo{person}{Atul Malhotra}, \bibinfo{person}{Rupinder Dhaliwal}, \bibinfo{person}{William~R Henderson}, \bibinfo{person}{Dean~R Chittock}, \bibinfo{person}{Simon Finfer}, {et~al\mbox{.}}} \bibinfo{year}{2009}\natexlab{}.
\newblock \showarticletitle{Intensive insulin therapy and mortality among critically ill patients: a meta-analysis including NICE-SUGAR study data}.
\newblock \bibinfo{journal}{\emph{Cmaj}} \bibinfo{volume}{180}, \bibinfo{number}{8} (\bibinfo{year}{2009}), \bibinfo{pages}{821--827}.
\newblock


\bibitem[Group(2002)]%
        {dafne2002training}
\bibfield{author}{\bibinfo{person}{DAFNE~Study Group}.} \bibinfo{year}{2002}\natexlab{}.
\newblock \showarticletitle{Training in flexible, intensive insulin management to enable dietary freedom in people with type 1 diabetes: dose adjustment for normal eating (DAFNE) randomised controlled trial}.
\newblock \bibinfo{journal}{\emph{Bmj}} \bibinfo{volume}{325}, \bibinfo{number}{7367} (\bibinfo{year}{2002}), \bibinfo{pages}{746}.
\newblock


\bibitem[Heinemann(2009)]%
        {heinemann2009insulin}
\bibfield{author}{\bibinfo{person}{Lutz Heinemann}.} \bibinfo{year}{2009}\natexlab{}.
\newblock \showarticletitle{Insulin pump therapy: what is the evidence for using different types of boluses for coverage of prandial insulin requirements?}
\newblock \bibinfo{journal}{\emph{Journal of diabetes science and technology}} \bibinfo{volume}{3}, \bibinfo{number}{6} (\bibinfo{year}{2009}), \bibinfo{pages}{1490--1500}.
\newblock


\bibitem[Ispirova et~al\mbox{.}(2024)]%
        {ispirova2024msgen}
\bibfield{author}{\bibinfo{person}{Gordana Ispirova}, \bibinfo{person}{Tome Eftimov}, \bibinfo{person}{Sa{\v{s}}o D{\v{z}}eroski}, {and} \bibinfo{person}{Barbara~Korou{\v{s}}i{\'c} Seljak}.} \bibinfo{year}{2024}\natexlab{}.
\newblock \showarticletitle{MsGEN: Measuring generalization of nutrient value prediction across different recipe datasets}.
\newblock \bibinfo{journal}{\emph{Expert Systems with Applications}}  \bibinfo{volume}{237} (\bibinfo{year}{2024}), \bibinfo{pages}{121507}.
\newblock


\bibitem[Ispirova et~al\mbox{.}(2020)]%
        {ispirova2020p}
\bibfield{author}{\bibinfo{person}{Gordana Ispirova}, \bibinfo{person}{Tome Eftimov}, {and} \bibinfo{person}{Barbara Korou{\v{s}}i{\'c}~Seljak}.} \bibinfo{year}{2020}\natexlab{}.
\newblock \showarticletitle{P-nut: Predicting nutrient content from short text descriptions}.
\newblock \bibinfo{journal}{\emph{Mathematics}} \bibinfo{volume}{8}, \bibinfo{number}{10} (\bibinfo{year}{2020}), \bibinfo{pages}{1811}.
\newblock


\bibitem[Jaloli and Cescon(2024)]%
        {jaloli2024basal}
\bibfield{author}{\bibinfo{person}{Mehrad Jaloli} {and} \bibinfo{person}{Marzia Cescon}.} \bibinfo{year}{2024}\natexlab{}.
\newblock \showarticletitle{Basal-bolus advisor for type 1 diabetes (T1D) patients using multi-agent reinforcement learning (RL) methodology}.
\newblock \bibinfo{journal}{\emph{Control Engineering Practice}}  \bibinfo{volume}{142} (\bibinfo{year}{2024}), \bibinfo{pages}{105762}.
\newblock


\bibitem[Jiang et~al\mbox{.}(2024)]%
        {jiang2024mixtral}
\bibfield{author}{\bibinfo{person}{Albert~Q Jiang}, \bibinfo{person}{Alexandre Sablayrolles}, \bibinfo{person}{Antoine Roux}, \bibinfo{person}{Arthur Mensch}, \bibinfo{person}{Blanche Savary}, \bibinfo{person}{Chris Bamford}, \bibinfo{person}{Devendra~Singh Chaplot}, \bibinfo{person}{Diego de~las Casas}, \bibinfo{person}{Emma~Bou Hanna}, \bibinfo{person}{Florian Bressand}, {et~al\mbox{.}}} \bibinfo{year}{2024}\natexlab{}.
\newblock \showarticletitle{Mixtral of experts}.
\newblock \bibinfo{journal}{\emph{arXiv preprint arXiv:2401.04088}} (\bibinfo{year}{2024}).
\newblock


\bibitem[Kaelbling et~al\mbox{.}(1996)]%
        {kaelbling1996reinforcement}
\bibfield{author}{\bibinfo{person}{Leslie~Pack Kaelbling}, \bibinfo{person}{Michael~L Littman}, {and} \bibinfo{person}{Andrew~W Moore}.} \bibinfo{year}{1996}\natexlab{}.
\newblock \showarticletitle{Reinforcement learning: A survey}.
\newblock \bibinfo{journal}{\emph{Journal of artificial intelligence research}}  \bibinfo{volume}{4} (\bibinfo{year}{1996}), \bibinfo{pages}{237--285}.
\newblock


\bibitem[Kalra et~al\mbox{.}(2013)]%
        {kalra2013hypoglycemia}
\bibfield{author}{\bibinfo{person}{Sanjay Kalra}, \bibinfo{person}{Jagat~Jyoti Mukherjee}, \bibinfo{person}{Subramanium Venkataraman}, \bibinfo{person}{Ganapathi Bantwal}, \bibinfo{person}{Shehla Shaikh}, \bibinfo{person}{Banshi Saboo}, \bibinfo{person}{Ashok~Kumar Das}, {and} \bibinfo{person}{Ambady Ramachandran}.} \bibinfo{year}{2013}\natexlab{}.
\newblock \showarticletitle{Hypoglycemia: The neglected complication}.
\newblock \bibinfo{journal}{\emph{Indian journal of endocrinology and metabolism}} \bibinfo{volume}{17}, \bibinfo{number}{5} (\bibinfo{year}{2013}), \bibinfo{pages}{819--834}.
\newblock


\bibitem[Katsarou et~al\mbox{.}(2017)]%
        {katsarou2017type}
\bibfield{author}{\bibinfo{person}{Anastasia Katsarou}, \bibinfo{person}{Soffia Gudbj{\"o}rnsdottir}, \bibinfo{person}{Araz Rawshani}, \bibinfo{person}{Dana Dabelea}, \bibinfo{person}{Ezio Bonifacio}, \bibinfo{person}{Barbara~J Anderson}, \bibinfo{person}{Laura~M Jacobsen}, \bibinfo{person}{Desmond~A Schatz}, {and} \bibinfo{person}{{\AA}ke Lernmark}.} \bibinfo{year}{2017}\natexlab{}.
\newblock \showarticletitle{Type 1 diabetes mellitus}.
\newblock \bibinfo{journal}{\emph{Nature reviews Disease primers}} \bibinfo{volume}{3}, \bibinfo{number}{1} (\bibinfo{year}{2017}), \bibinfo{pages}{1--17}.
\newblock


\bibitem[King and Armstrong(2005)]%
        {king2005basal}
\bibfield{author}{\bibinfo{person}{Allen~B King} {and} \bibinfo{person}{Dana~U Armstrong}.} \bibinfo{year}{2005}\natexlab{}.
\newblock \showarticletitle{Basal bolus dosing: a clinical experience}.
\newblock \bibinfo{journal}{\emph{Current diabetes reviews}} \bibinfo{volume}{1}, \bibinfo{number}{2} (\bibinfo{year}{2005}), \bibinfo{pages}{215--220}.
\newblock


\bibitem[Kumar et~al\mbox{.}(2024)]%
        {kumar2024prevalence}
\bibfield{author}{\bibinfo{person}{Arvind Kumar}, \bibinfo{person}{Ruby Gangwar}, \bibinfo{person}{Abrar Ahmad~Zargar}, \bibinfo{person}{Ranjeet Kumar}, {and} \bibinfo{person}{Amit Sharma}.} \bibinfo{year}{2024}\natexlab{}.
\newblock \showarticletitle{Prevalence of diabetes in India: A review of IDF diabetes atlas 10th edition}.
\newblock \bibinfo{journal}{\emph{Current diabetes reviews}} \bibinfo{volume}{20}, \bibinfo{number}{1} (\bibinfo{year}{2024}), \bibinfo{pages}{105--114}.
\newblock


\bibitem[Li et~al\mbox{.}(2019)]%
        {li2019convolutional}
\bibfield{author}{\bibinfo{person}{Kezhi Li}, \bibinfo{person}{John Daniels}, \bibinfo{person}{Chengyuan Liu}, \bibinfo{person}{Pau Herrero}, {and} \bibinfo{person}{Pantelis Georgiou}.} \bibinfo{year}{2019}\natexlab{}.
\newblock \showarticletitle{Convolutional recurrent neural networks for glucose prediction}.
\newblock \bibinfo{journal}{\emph{IEEE journal of biomedical and health informatics}} \bibinfo{volume}{24}, \bibinfo{number}{2} (\bibinfo{year}{2019}), \bibinfo{pages}{603--613}.
\newblock


\bibitem[Lowe et~al\mbox{.}(2008)]%
        {lowe2008flexible}
\bibfield{author}{\bibinfo{person}{J Lowe}, \bibinfo{person}{S Linjawi}, \bibinfo{person}{M Mensch}, \bibinfo{person}{K James}, {and} \bibinfo{person}{J Attia}.} \bibinfo{year}{2008}\natexlab{}.
\newblock \showarticletitle{Flexible eating and flexible insulin dosing in patients with diabetes: results of an intensive self-management course}.
\newblock \bibinfo{journal}{\emph{Diabetes research and clinical practice}} \bibinfo{volume}{80}, \bibinfo{number}{3} (\bibinfo{year}{2008}), \bibinfo{pages}{439--443}.
\newblock


\bibitem[Marling and Bunescu(2020)]%
        {marling2020ohiot1dm}
\bibfield{author}{\bibinfo{person}{Cindy Marling} {and} \bibinfo{person}{Razvan Bunescu}.} \bibinfo{year}{2020}\natexlab{}.
\newblock \showarticletitle{The OhioT1DM dataset for blood glucose level prediction: Update 2020}. In \bibinfo{booktitle}{\emph{CEUR workshop proceedings}}, Vol.~\bibinfo{volume}{2675}. NIH Public Access, \bibinfo{pages}{71}.
\newblock


\bibitem[Mouri and Badireddy(2023)]%
        {mouri2023hyperglycemia}
\bibfield{author}{\bibinfo{person}{MIchelle Mouri} {and} \bibinfo{person}{Madhu Badireddy}.} \bibinfo{year}{2023}\natexlab{}.
\newblock \showarticletitle{Hyperglycemia}.
\newblock In \bibinfo{booktitle}{\emph{StatPearls [Internet]}}. \bibinfo{publisher}{StatPearls Publishing}.
\newblock


\bibitem[Nwokolo and Hovorka(2023)]%
        {nwokolo2023artificial}
\bibfield{author}{\bibinfo{person}{Munachiso Nwokolo} {and} \bibinfo{person}{Roman Hovorka}.} \bibinfo{year}{2023}\natexlab{}.
\newblock \showarticletitle{The artificial pancreas and type 1 diabetes}.
\newblock \bibinfo{journal}{\emph{The Journal of Clinical Endocrinology \& Metabolism}} \bibinfo{volume}{108}, \bibinfo{number}{7} (\bibinfo{year}{2023}), \bibinfo{pages}{1614--1623}.
\newblock


\bibitem[OpenAI(2024)]%
        {gpt4o2024}
\bibfield{author}{\bibinfo{person}{OpenAI}.} \bibinfo{year}{2024}\natexlab{}.
\newblock \bibinfo{booktitle}{\emph{Hello GPT-4o}}.
\newblock
\urldef\tempurl%
\url{https://openai.com/index/hello-gpt-4o/}
\showURL{%
\tempurl}


\bibitem[Paterson et~al\mbox{.}(2015)]%
        {paterson2015role}
\bibfield{author}{\bibinfo{person}{Megan Paterson}, \bibinfo{person}{Kirstine~J Bell}, \bibinfo{person}{Susan~M O’Connell}, \bibinfo{person}{Carmel~E Smart}, \bibinfo{person}{Amir Shafat}, {and} \bibinfo{person}{Bruce King}.} \bibinfo{year}{2015}\natexlab{}.
\newblock \showarticletitle{The role of dietary protein and fat in glycaemic control in type 1 diabetes: implications for intensive diabetes management}.
\newblock \bibinfo{journal}{\emph{Current diabetes reports}}  \bibinfo{volume}{15} (\bibinfo{year}{2015}), \bibinfo{pages}{1--9}.
\newblock


\bibitem[Prendin et~al\mbox{.}(2023)]%
        {prendin2023importance}
\bibfield{author}{\bibinfo{person}{Francesco Prendin}, \bibinfo{person}{Jacopo Pavan}, \bibinfo{person}{Giacomo Cappon}, \bibinfo{person}{Simone Del~Favero}, \bibinfo{person}{Giovanni Sparacino}, {and} \bibinfo{person}{Andrea Facchinetti}.} \bibinfo{year}{2023}\natexlab{}.
\newblock \showarticletitle{The importance of interpreting machine learning models for blood glucose prediction in diabetes: an analysis using SHAP}.
\newblock \bibinfo{journal}{\emph{Scientific Reports}} \bibinfo{volume}{13}, \bibinfo{number}{1} (\bibinfo{year}{2023}), \bibinfo{pages}{16865}.
\newblock


\bibitem[Rodbard(2011)]%
        {rodbard2011glycemic}
\bibfield{author}{\bibinfo{person}{David Rodbard}.} \bibinfo{year}{2011}\natexlab{}.
\newblock \bibinfo{title}{Glycemic variability: measurement and utility in clinical medicine and research—one viewpoint}.
\newblock , \bibinfo{numpages}{1077--1080}~pages.
\newblock


\bibitem[Silva et~al\mbox{.}(2022)]%
        {silva2022real}
\bibfield{author}{\bibinfo{person}{Julien~Da Silva}, \bibinfo{person}{Giuseppe Lepore}, \bibinfo{person}{Tadej Battelino}, \bibinfo{person}{Arcelia Arrieta}, \bibinfo{person}{Javier Casta{\~n}eda}, \bibinfo{person}{Benyamin Grossman}, \bibinfo{person}{John Shin}, {and} \bibinfo{person}{Ohad Cohen}.} \bibinfo{year}{2022}\natexlab{}.
\newblock \showarticletitle{Real-world performance of the MiniMed™ 780G system: first report of outcomes from 4120 users}.
\newblock \bibinfo{journal}{\emph{Diabetes Technology \& Therapeutics}} \bibinfo{volume}{24}, \bibinfo{number}{2} (\bibinfo{year}{2022}), \bibinfo{pages}{113--119}.
\newblock


\bibitem[Team et~al\mbox{.}(2023)]%
        {team2023gemini}
\bibfield{author}{\bibinfo{person}{Gemini Team}, \bibinfo{person}{Rohan Anil}, \bibinfo{person}{Sebastian Borgeaud}, \bibinfo{person}{Yonghui Wu}, \bibinfo{person}{Jean-Baptiste Alayrac}, \bibinfo{person}{Jiahui Yu}, \bibinfo{person}{Radu Soricut}, \bibinfo{person}{Johan Schalkwyk}, \bibinfo{person}{Andrew~M Dai}, \bibinfo{person}{Anja Hauth}, {et~al\mbox{.}}} \bibinfo{year}{2023}\natexlab{}.
\newblock \showarticletitle{Gemini: a family of highly capable multimodal models}.
\newblock \bibinfo{journal}{\emph{arXiv preprint arXiv:2312.11805}} (\bibinfo{year}{2023}).
\newblock


\bibitem[Touvron et~al\mbox{.}(2023)]%
        {touvron2023llama}
\bibfield{author}{\bibinfo{person}{Hugo Touvron}, \bibinfo{person}{Louis Martin}, \bibinfo{person}{Kevin Stone}, \bibinfo{person}{Peter Albert}, \bibinfo{person}{Amjad Almahairi}, \bibinfo{person}{Yasmine Babaei}, \bibinfo{person}{Nikolay Bashlykov}, \bibinfo{person}{Soumya Batra}, \bibinfo{person}{Prajjwal Bhargava}, \bibinfo{person}{Shruti Bhosale}, {et~al\mbox{.}}} \bibinfo{year}{2023}\natexlab{}.
\newblock \showarticletitle{Llama 2: Open foundation and fine-tuned chat models}.
\newblock \bibinfo{journal}{\emph{arXiv preprint arXiv:2307.09288}} (\bibinfo{year}{2023}).
\newblock


\bibitem[Wang et~al\mbox{.}(2023)]%
        {wang2023optimized}
\bibfield{author}{\bibinfo{person}{Guangyu Wang}, \bibinfo{person}{Xiaohong Liu}, \bibinfo{person}{Zhen Ying}, \bibinfo{person}{Guoxing Yang}, \bibinfo{person}{Zhiwei Chen}, \bibinfo{person}{Zhiwen Liu}, \bibinfo{person}{Min Zhang}, \bibinfo{person}{Hongmei Yan}, \bibinfo{person}{Yuxing Lu}, \bibinfo{person}{Yuanxu Gao}, {et~al\mbox{.}}} \bibinfo{year}{2023}\natexlab{}.
\newblock \showarticletitle{Optimized glycemic control of type 2 diabetes with reinforcement learning: a proof-of-concept trial}.
\newblock \bibinfo{journal}{\emph{Nature Medicine}} \bibinfo{volume}{29}, \bibinfo{number}{10} (\bibinfo{year}{2023}), \bibinfo{pages}{2633--2642}.
\newblock


\bibitem[Wexler(2022)]%
        {wexler2022patient}
\bibfield{author}{\bibinfo{person}{Deborah~J Wexler}.} \bibinfo{year}{2022}\natexlab{}.
\newblock \showarticletitle{Patient education: Type 2 diabetes: Insulin treatment (Beyond the Basics)}.
\newblock \bibinfo{journal}{\emph{UpToDate}} (\bibinfo{year}{2022}).
\newblock


\bibitem[Wong and Kroon(2021)]%
        {wong2021ultra}
\bibfield{author}{\bibinfo{person}{Eva~Y Wong} {and} \bibinfo{person}{Lisa Kroon}.} \bibinfo{year}{2021}\natexlab{}.
\newblock \showarticletitle{Ultra-rapid-acting insulins: how fast is really needed?}
\newblock \bibinfo{journal}{\emph{Clinical Diabetes}} \bibinfo{volume}{39}, \bibinfo{number}{4} (\bibinfo{year}{2021}), \bibinfo{pages}{415--423}.
\newblock


\bibitem[Wong(2023)]%
        {CGM}
\bibfield{author}{\bibinfo{person}{Jenise~C. Wong}.} \bibinfo{year}{2023}\natexlab{}.
\newblock \bibinfo{title}{Continuous Glucose Monitoring}.
\newblock \bibinfo{howpublished}{\url{https://www.niddk.nih.gov/health-information/diabetes/overview/managing-diabetes/continuous-glucose-monitoring}}.
\newblock
\newblock
\shownote{[accessed August-2024]}.


\bibitem[Yang et~al\mbox{.}(2023)]%
        {yang2023short}
\bibfield{author}{\bibinfo{person}{Guanci Yang}, \bibinfo{person}{Saisai Liu}, \bibinfo{person}{Yang Li}, {and} \bibinfo{person}{Ling He}.} \bibinfo{year}{2023}\natexlab{}.
\newblock \showarticletitle{Short-term prediction method of blood glucose based on temporal multi-head attention mechanism for diabetic patients}.
\newblock \bibinfo{journal}{\emph{Biomedical Signal Processing and Control}}  \bibinfo{volume}{82} (\bibinfo{year}{2023}), \bibinfo{pages}{104552}.
\newblock


\bibitem[Yau et~al\mbox{.}(2023)]%
        {yau2023reinforcement}
\bibfield{author}{\bibinfo{person}{Kok-Lim~Alvin Yau}, \bibinfo{person}{Yung-Wey Chong}, \bibinfo{person}{Xiumei Fan}, \bibinfo{person}{Celimuge Wu}, \bibinfo{person}{Yasir Saleem}, {and} \bibinfo{person}{Phei-Ching Lim}.} \bibinfo{year}{2023}\natexlab{}.
\newblock \showarticletitle{Reinforcement learning models and algorithms for diabetes management}.
\newblock \bibinfo{journal}{\emph{IEEE Access}}  \bibinfo{volume}{11} (\bibinfo{year}{2023}), \bibinfo{pages}{28391--28415}.
\newblock


\bibitem[Yenduri et~al\mbox{.}(2023)]%
        {yenduri2023generativepretrainedtransformercomprehensive}
\bibfield{author}{\bibinfo{person}{Gokul Yenduri}, \bibinfo{person}{Ramalingam M}, \bibinfo{person}{Chemmalar~Selvi G}, \bibinfo{person}{Supriya Y}, \bibinfo{person}{Gautam Srivastava}, \bibinfo{person}{Praveen Kumar~Reddy Maddikunta}, \bibinfo{person}{Deepti~Raj G}, \bibinfo{person}{Rutvij~H Jhaveri}, \bibinfo{person}{Prabadevi B}, \bibinfo{person}{Weizheng Wang}, \bibinfo{person}{Athanasios~V. Vasilakos}, {and} \bibinfo{person}{Thippa~Reddy Gadekallu}.} \bibinfo{year}{2023}\natexlab{}.
\newblock \showarticletitle{Generative Pre-trained Transformer: A Comprehensive Review on Enabling Technologies, Potential Applications, Emerging Challenges, and Future Directions}.
\newblock  (\bibinfo{year}{2023}).
\newblock
\showeprint[arxiv]{2305.10435}~[cs.CL]
\urldef\tempurl%
\url{https://arxiv.org/abs/2305.10435}
\showURL{%
\tempurl}


\bibitem[Yu et~al\mbox{.}(2021)]%
        {yu2021reinforcement}
\bibfield{author}{\bibinfo{person}{Chao Yu}, \bibinfo{person}{Jiming Liu}, \bibinfo{person}{Shamim Nemati}, {and} \bibinfo{person}{Guosheng Yin}.} \bibinfo{year}{2021}\natexlab{}.
\newblock \showarticletitle{Reinforcement learning in healthcare: A survey}.
\newblock \bibinfo{journal}{\emph{ACM Computing Surveys (CSUR)}} \bibinfo{volume}{55}, \bibinfo{number}{1} (\bibinfo{year}{2021}), \bibinfo{pages}{1--36}.
\newblock


\bibitem[Zhao et~al\mbox{.}(2023)]%
        {zhao2023chinese}
\bibfield{author}{\bibinfo{person}{Qinpei Zhao}, \bibinfo{person}{Jinhao Zhu}, \bibinfo{person}{Xuan Shen}, \bibinfo{person}{Chuwen Lin}, \bibinfo{person}{Yinjia Zhang}, \bibinfo{person}{Yuxiang Liang}, \bibinfo{person}{Baige Cao}, \bibinfo{person}{Jiangfeng Li}, \bibinfo{person}{Xiang Liu}, \bibinfo{person}{Weixiong Rao}, {et~al\mbox{.}}} \bibinfo{year}{2023}\natexlab{}.
\newblock \showarticletitle{Chinese diabetes datasets for data-driven machine learning}.
\newblock \bibinfo{journal}{\emph{Scientific Data}} \bibinfo{volume}{10}, \bibinfo{number}{1} (\bibinfo{year}{2023}), \bibinfo{pages}{35}.
\newblock


\bibitem[Zimmet(2017)]%
        {zimmet2017diabetes}
\bibfield{author}{\bibinfo{person}{Paul~Z Zimmet}.} \bibinfo{year}{2017}\natexlab{}.
\newblock \showarticletitle{Diabetes and its drivers: the largest epidemic in human history?}
\newblock \bibinfo{journal}{\emph{Clinical diabetes and endocrinology}}  \bibinfo{volume}{3} (\bibinfo{year}{2017}), \bibinfo{pages}{1--8}.
\newblock


\end{thebibliography}