blood sugar prediction

Personalizing blood sugar prediction with a custom AI trained on 115 days of data

115 days of personal CGM data, plus a synthetic training set representing 19,200 years of simulated diabetes, and the result is a 31,253-parameter transformer that predicts blood sugar two hours ahead.

3 min readMachine Learning
Personalizing blood sugar prediction with a custom AI trained on 115 days of data
I have trained a model to predict my blood sugar [P]

Personalizing an AI model with your own health data sounds futuristic, but it is already happening, and the implications for how we think about spreadsheets, data, and decision-making are immediate. A developer recently trained a custom 31,253-parameter transformer on 115 days of continuous glucose monitor data, using synthetic data from a million simulated patients as a foundation. The result is a model that predicts blood sugar two hours ahead, fills in missing readings, and even learns to infer time of day from past glucose patterns alone. This is not a lab experiment. The code is public, the model runs on a phone, and the approach mirrors techniques we have seen applied to other domains, like how AI agents can learn from yesterday's mistakes to fix today's bugs or how developers fine-tune LLMs on a budget using methods like LoRA. The pattern is the same: pretrain on scale, adapt on personal data, deploy on a device.

What matters here is not the novelty of transformers or LoRA, those are established tools. What matters is the shift in ownership. Traditional spreadsheets force you to fit your data into rigid rows and columns. This project does the opposite: it fits the model to your life. The developer fed it insulin doses, carbohydrate estimates, and glycemic index values, all approximate inputs that reflect real-world messiness. The model handles the ambiguity. It predicts risk using Kovatchev risk-space and a combination of loss functions designed to balance accuracy with timing. The result is a tool that adapts to how you actually live, not how a clinical protocol assumes you should.

Yet the honest admission in this story is the one worth highlighting: the model is still worse than the person at predicting hypoglycemia in the next thirty minutes. That is a concrete, specific gap. It tells us that personalization is not magic. It requires human judgment as the benchmark, not the crutch. The developer's own intuition, built from 115 days of lived experience, outperforms the transformer on the most critical short-term prediction. That should give every spreadsheet user pause. AI can augment your decisions, but it cannot replace the pattern recognition you develop by paying attention to your own data over time.

The takeaway is direct: personal AI models are becoming accessible, but their value depends on how honestly you evaluate their limits. If you are building a custom model for your workflow, whether for health, finance, or operations, test it against your own judgment first. The developer published the source code and the results side by side. That is the standard to follow. Do not ask whether the model is better than a published benchmark. Ask whether it is better than you.

From Machine Learning

I have trained a custom 31,253 parameter encoder-only transformer on a pregenerated synthetic CGM dataset and fitted it to my own personal data using LoRA. It is competitive among other published models. I used 115 days of CGM data, of which 80 was used for training the adapter and 35 for testing. The model began with a pretraining stage where it consumed ~19,200 CGM-years worth of synthetic data, consisting of 1 million simulated type 1 diabetics at 7 days each. The simulator is designed to aid in counterfactual reasoning, but I don't yet have a benchmark to test these capabilities…

Read the original at Machine Learning