Abstract
Deep learning models achieve state-of-the-art results in predicting blood glucose trajectories, with a wide range of architectures being proposed. However, the adaptation of such models in clinical practice is slow, largely due to the lack of uncertainty quantification of provided predictions. In this work, we propose to model the future glucose trajectory conditioned on the past as an infinite mixture of basis distributions (i.e., Gaussian, Laplace, etc.). This change allows us to learn the uncertainty and predict more accurately in the cases when the trajectory has a heterogeneous or multi-modal distribution. To estimate the parameters of the predictive distribution, we utilize the Transformer architecture. We empirically demonstrate the superiority of our method over existing state-of-the-art techniques both in terms of accuracy and uncertainty on the synthetic and benchmark glucose data sets.
Introduction
Predicting blood glucose levels is a high-stakes task where accuracy can prevent life-threatening emergencies. While deep learning has improved prediction accuracy, most models operate as "black boxes," providing point estimates without quantifying uncertainty. Standard models often minimize Mean Squared Error (MSE), which implicitly assumes a symmetric, single-peaked Gaussian distribution for future outcomes. However, glucose trajectories are non-linear and frequently multi-modal—for instance, a patient's glucose might spike following a meal or remain stable if they skip it. A single "average" prediction in such scenarios is often clinically misleading.
Methodology: Infinite Mixture Models and Transformers
To address these limitations, the authors introduce Gluformer, which models the future as an Infinite Mixture Model (IMM). Instead of a single distribution, the model represents the future as a mixture of basis distributions (e.g., Gaussian or Laplace), allowing it to capture complex, multi-peaked scenarios.
The framework utilizes a modified Transformer architecture to handle long-term dependencies in time-series data. To make the IMM computationally feasible, the researchers employ Monte Carlo integration via Bernoulli dropout. By performing multiple stochastic forward passes, the network generates samples from the infinite mixture. Finally, a copula-based approach is used to combine individual time-point predictions into a coherent joint distribution for the entire trajectory.
Experimental Results
The model was evaluated on synthetic data designed to mimic "fork-in-the-road" scenarios and a benchmark Continuous Glucose Monitor (CGM) dataset from 38 subjects.
Performance Benchmarking
Gluformer demonstrates state-of-the-art accuracy, particularly in predicting critical clinical events like hypoglycemia and hyperglycemia. On the CGM benchmark, the IMM variant achieved an Average Percentage Error (APE) of 7.78 for a 60-minute forecast window.
As shown in the results, Gluformer (IMM) significantly outperforms traditional models like ARIMA and modern architectures like the Temporal Fusion Transformer (TFT) in terms of log-likelihood and event-specific accuracy.
Discussion and Conclusion
A key strength of Gluformer is its calibration. For a model to be clinically useful, its confidence intervals must be reliable; if a model claims 95% confidence, it should be correct 95% of the time. The researchers found that Gluformer achieves near-perfect alignment with the ideal calibration line across various horizons.
While the current model uses an independence copula—assuming errors at different time steps are independent—future work aims to implement more sophisticated copulas to capture temporal error correlations. Additionally, integrating external features like carbohydrate intake and physical activity could further refine the predictive power of the mixture components. By providing both accuracy and reliable uncertainty estimates, Gluformer represents a significant step toward the safe clinical adoption of deep learning in diabetes management.
Summary updated