Counterfactual Policy Learning Reframes How SGLT2 Inhibitors Could Be Matched to Patients

A new preprint from Hungarian investigators takes a familiar diabetes drug class and asks a harder question: which patients are most likely to benefit from SGLT2 inhibitors, and how can that be estimated from ordinary clinical records rather than a tightly controlled trial? The work centers on observational data from electronic health records and builds a counterfactual structural causal model designed to estimate individual treatment effects. In practical terms, the project tries to move beyond average benefit and toward patient-specific treatment selection, where metabolic status, comorbidity burden, and downstream diagnostic patterns can shape the expected value of therapy.

The clinical rationale is straightforward. SGLT2 inhibitors have established metabolic and cardiovascular benefits, but those benefits do not land evenly across every patient profile. In a busy diabetes clinic, two people with similar hemoglobin A1c values may face very different trajectories because of renal disease, heart failure risk, or a broader cardiometabolic phenotype. A policy model built to estimate counterfactual outcomes is meant to capture that heterogeneity instead of flattening it into one average effect.

Structural Causal Modeling Meets Routine Care Data

The framework relies on a counterfactual structural causal model with a Gumbel-Max sampling mechanism. That choice is not cosmetic. Gumbel-Max sampling gives the model a way to represent stochastic treatment assignment while preserving differentiability, which matters when the goal is not only to predict what happened, but to learn how a different treatment decision could have changed the future diagnostic course. The model also assumes counterfactual stability, a condition that allows the system to reason about how outcomes would shift under alternative prescribing decisions using the observational record as its basis.

The study defines optimal treatment by maximizing the counterfactual value of future diagnostic outcomes. That moves the question from “what was prescribed” to “what would have been the better choice under a given patient state.” In a disease such as type 2 diabetes, where care is distributed across glycemic, renal, cardiovascular, and metabolic endpoints, this kind of policy framing is clinically intuitive. A drug may look modest if judged only by one laboratory marker, yet appear more valuable when the downstream pattern of diagnoses is included.

The investigators evaluated the approach with a doubly robust value estimator. In causal inference, doubly robust methods are useful because they can reduce dependence on either the outcome model or the treatment model alone. Here, the evaluation strategy supports the central claim of the work: the learned policy produced higher predicted treatment value than real-world prescriptions across diagnostic categories, and it did so in a way that identified subpopulations in which SGLT2 inhibitors appeared to offer superior outcomes.

Predicted Value Diverged From Real-World Prescribing

The most important result is a separation between the learned counterfactual policy and observed prescribing practice. Across diagnostic categories, the model outperformed real-world prescriptions in predicted treatment value. That does not mean actual care was poor; it means routine prescribing did not always align with the individualized treatment path the model judged optimal. For clinicians, the implication is immediate: standard prescribing habits can miss hidden responder groups, especially when treatment effects are heterogeneous and the patient population spans multiple comorbid states.

A one-size-fits-all approach breaks down when the endpoint is not a single biomarker but a sequence of future diagnoses.

The study does not provide a bedside algorithm ready for deployment, and it should not be treated as a directive for practice. It does, however, illustrate why SGLT2 inhibitors have become such an important test case for causal machine learning. Their benefits extend beyond glucose lowering into cardiovascular and metabolic domains, which makes them a natural target for models that attempt to estimate downstream value rather than isolated lab change. If a patient’s future risk profile is dominated by cardiorenal events, the decision calculus may differ sharply from that of a patient whose main issue is glycemic control without major comorbidity.

Why This Approach Fits SGLT2 Inhibitors Particularly Well

The biological appeal of the drug class strengthens the modeling strategy. SGLT2 inhibitors alter renal glucose handling, natriuresis, and hemodynamic load, and those mechanisms can influence a wide range of clinical outcomes beyond hyperglycemia alone. A treatment class with pleiotropic effects is exactly where average treatment effects can be misleading. Some patients may experience substantial downstream benefit because their baseline risk is concentrated in organs touched by the drug’s mechanism; others may show less gain if their dominant clinical problem sits elsewhere.

This is also where observational data become both powerful and fragile. Routine records carry the signal of day-to-day medicine, but they also carry confounding by indication, prescribing preference, and incomplete measurement. The counterfactual SCM is built to address that problem, yet the quality of the resulting policy still depends on the richness of the data, the validity of the causal assumptions, and the extent to which the electronic record captures the patient state that truly shaped the prescribing decision.

The preprint’s authors used retrospective anonymized clinical records collected as a by-product of routine care between 2000 and 2021, with ethics approval from Hungarian oversight bodies. The dataset itself is not publicly available because of the governing ethical approvals, though access may be requested from the corresponding author. Those details matter because they frame the work as a secondary analysis of real-world care rather than a prospective intervention trial.

What Clinicians Should Take From the Model, and What They Should Not

The main clinical message is not that an algorithm should replace prescribing judgment. It is that individualized treatment effects can be estimated from longitudinal records in a way that may surface patients who are better candidates for SGLT2 inhibitors than current practice reveals. In diabetes care, that matters because therapeutic choices increasingly hinge on risk enrichment, comorbidity clustering, and the likelihood of benefit across several organ systems at once.

The current preprint remains a methods paper, not a clinical outcomes trial. Its performance is reported in predicted treatment value, not in prospective patient benefit after algorithm-guided prescribing. It also depends on assumptions common to causal inference, including stable counterfactual behavior and adequate capture of relevant covariates in the electronic record. Those assumptions are central to interpretation, especially when the model is intended to guide therapy selection in complex patients with type 2 diabetes and related conditions.

For now, the work functions as a proof of concept for counterfactual policy learning in metabolic disease. Its broader significance lies in showing that machine learning can be used not just to classify patients, but to reason about which treatment choice would likely serve them best. The next step is whether these individualized policy recommendations can be validated prospectively against hard clinical endpoints, rather than only against retrospective value estimates derived from routine care data.


Reporting by Dr. A. Nikhil Krishnan, MBBS for Medicine World Foundation, with additional data provided by medRxiv (Clinical Preprints).