# US 2026/0083909 A1 · System and method for calculating an insulin dosing function

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2026/0083909 A1
- Document ID: US20260083909A1
- Status: Published application
- Kind: A1
- Application number: 19/335,674
- Filed: 2025-09-22
- Published: 2026-03-26
- Earliest claimed: 2024-09-20
- Assignees: University of Virginia Patent Foundation
- Applicants: University of Virginia Patent Foundation
- Inventors: Anas El Fathi; Marc D. Breton; Elliott C. Pryor; Ali Tavasoli; Heman Shakeri
- Web page: https://patentgrep.com/patent/US20260083909A1

## CPC

- A61M 5/1723: {using feedback of body parameters, e.g. blood sugar or pressure}
- G06N 3/045: Combinations of networks
- G06N 3/092: Reinforcement learning
- G16H 20/17: delivered via infusion or injection
- G16H 50/20: for computer-aided diagnosis, e.g. based on medical expert systems
- A61M 2230/201: Glucose concentration
- A61M: DEVICES FOR INTRODUCING MEDIA INTO, OR ONTO, THE BODY (introducing media into or onto the bodies of animals A61D7/00; means for inserting tampons A61F13/26; devices for administering food or medicines orally A61J; containers for collecting, storing or administering blood or medical fluids A61J1/05); DEVICES FOR TRANSDUCING BODY MEDIA OR FOR TAKING MEDIA FROM THE BODY (surgery A61B; chemical aspects of surgical articles A61L); DEVICES FOR PRODUCING OR ENDING SLEEP OR STUPOR {(Electrotherapy, e.g. producing anaesthesia by the use of alternating or intermittent currents A61N1/36021)}
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G16H: HEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA

## Abstract

A reinforcement learning process with self attention is used for insulin dosing decisions in an automated medical system. The State-Action-Reward-Next State (SARS) sequence is used. The state represents the current condition, including recent continuous glucose monitoring readings, insulin doses, meal information, and potentially other relevant factors like time of day or physical activity levels. Based on this state, the agent takes an action by deciding on an insulin dose. It then receives a reward, a numerical value quantifying the quality of the action, based on resulting glucose levels and their proximity to the target range. This leads to a new state, and the process repeats. Through this iterative process, the algorithm updates the neural network weights, allowing the agent to learn which actions lead to better outcomes in different states.

## Claims

### Claim 1

A computer implemented method of estimating a universal function for calculating an insulin dose for a subject, the method comprising:
using a computer comprising a processor connected to computer memory storing software to implement computer readable instructions that perform steps comprising:
retrieving raw data of sets comprising a number (N) of observations comprising glucose levels, insulin doses, and carbohydrate intake estimates collected from a population of subjects over a selected time period;
applying the raw data to a reinforcement learning (RL) neural network comprising self-attention subroutines by performing additional steps comprising:
pre-processing the raw data;
segmenting the raw data with a sliding window function;
saving, in the computer memory, a state matrix of the raw data by rearranging segmented raw data to align periodic events within the raw data, identified across the population, as a time series of neural network data;
calculating an encoded state matrix by applying the state matrix to an encoder component of the RL neural network, wherein the encoder component applies at least one self-attention layer to the state matrix;
passing the encoded state matrix to an actor component and a value component programmed as subroutines of the RL neural network;
wherein the actor component defines a function to estimate a current bolus dose of insulin (BN) that is a suggested action to take for a proposed carbohydrate intake (MN); and
wherein the value component assigns a qualitative value to the suggested action by calculating a reward function using a target glucose value and a calculated glucose value that will result from the suggested action;
iteratively evaluating the reward function to maximize the reward function; and
selecting a suggested action corresponding to a maximum reward value as a recommended bolus dose of insulin.

### Claim 2 (depends on 1)

The computer implemented method of claim 1, wherein the pre-processing comprises normalizing the raw data and/or applying a decay function to the raw data.

### Claim 3 (depends on 1)

The computer implemented method of claim 1, wherein applying at least one self-attention layer to the state matrix comprises saving a last hidden state matrix from the encoder component as the encoded state matrix.

### Claim 4 (depends on 1)

The computer implemented method of claim 1, wherein segmenting the raw data comprises saving slices of the data, wherein the slices of the data comprise multiple observations from the raw data corresponding to a window size and a stride size used to segment the raw data.

### Claim 5 (depends on 4)

The computer implemented method of claim 4, wherein the slices of the data comprise related observations selected from glucose levels, insulin doses, or carbohydrate intake estimates.

### Claim 6 (depends on 4)

The computer implemented method of claim 4, wherein respective slices of related observations are matched as sequence elements, and the sequence elements are combined into a sequence of length (L) having rows that comprise sequence elements comprising the related observations selected from glucose levels, insulin doses, or carbohydrate intake estimates.

### Claim 7 (depends on 4)

The computer implemented method of claim 4, wherein the actor component calculates the function, with the sequence in the state matrix of N observations over the time period, BN=f(M˜N, G˜N, H1:N-1), wherein H1:N is the complete data set of the encoded state matrix.

### Claim 8 (depends on 7)

The computer implemented method of claim 7, wherein the complete data set H1:N comprises insulin I equal to BN+UN, where BN is an agent suggested action and UN is any additional insulin delivered at tN, including the delivered basal insulin.

### Claim 9

A computer implemented method of estimating a universal function for calculating an insulin dose for a subject, the method comprising:
using a computer comprising a processor connected to computer memory storing software to implement computer readable instructions that perform steps comprising:
retrieving raw data of sets comprising a number (N) of observations comprising glucose levels and at least one of insulin doses or carbohydrate intake estimates collected from a population of subjects over a selected time period;
applying the raw data to a reinforcement learning (RL) neural network comprising self-attention subroutines by performing additional steps comprising:
pre-processing the raw data;
segmenting the raw data with a sliding window function;
saving, in the computer memory, a state matrix of the raw data by rearranging segmented raw data to align periodic events within the raw data, identified across the population, as a time series of neural network data;
calculating an encoded state matrix by applying the state matrix to an encoder component of the RL neural network, wherein the encoder component applies at least one self-attention layer to the state matrix;
passing the encoded state matrix to an actor component and a value component programmed as subroutines of the RL neural network;
wherein the actor component defines a function to estimate a current bolus dose of insulin (BN) that is a suggested action to take for a subject; and
wherein the value component assigns a qualitative value to the suggested action by calculating a reward function using a target glucose value and a calculated glucose value that will result from the suggested action;
iteratively evaluating the reward function to maximize the reward function; and
selecting a suggested action corresponding to a maximum reward value as a recommended bolus dose of insulin.

### Claim 10 (depends on 9)

A computer implemented method according to claim 9, wherein the raw data sets comprise glucose levels and insulin doses in the absence of carbohydrate intake estimates, and the suggested action is application of an automated bolus that delivers selected boluses of additional insulin to compensate for glucose increases.

### Claim 11 (depends on 9)

A computer implemented method according to claim 9, wherein the raw data sets comprise glucose levels in the absence of insulin doses and carbohydrate intake estimates, and the suggested action is application of an automated bolus that delivers a fixed bolus of additional insulin to compensate for glucose increases.
