Reinforcement Learning Outperformed Ad Hoc rTMS Session Choices in Depression Care
Repetitive transcranial magnetic stimulation already has a place in the treatment of treatment-resistant depression, but the day-to-day choices clinicians make inside a course of care have remained underspecified. Session-level decisions about stimulation type, intensity, and laterality are often made without a firm evidence base, even as the treatment episode unfolds patient by patient. This study tested whether a reinforcement learning algorithm could learn those choices from routine clinical data and identify protocol selections linked to better symptom change at the next visit.
The dataset was large enough to reflect real practice rather than a single-center workflow. Investigators used electronic health record data from 1,609 adults treated with rTMS between January 2023 and June 2025 across 19 clinic groups. The model was trained on routine care patterns and then assessed in a held-out sample drawn from 370 patients in separate clinics, a design meant to test whether learned recommendations carried over beyond the data used to build the algorithm.
One sentence captures the result: when clinicians’ treatment decisions matched the algorithm’s recommendation, next-session PHQ-9 improvement was greater.
Session-Level Protocol Matching Linked to Larger Symptom Gains
Among the held-out patients, treatment decisions that aligned with the algorithm’s recommendation were associated with 0.788 points greater next-session Patient Health Questionnaire-9 improvement than treatments that differed, with a 95% confidence interval of 0.634 to 0.940. In a measurement system built around incremental symptom change, that difference is clinically relevant because it speaks to what happens between one rTMS session and the next, not just at the end of a course.
The projected effect was larger when recommendations were followed across the entire treatment episode. Full adherence to the algorithm’s guidance was projected to produce 3.22 points of additional improvement in PHQ-9 score, with a 95% confidence interval of 2.72 to 3.75. The magnitude matters because depression outcomes in routine care often hinge on cumulative gains made across repeated sessions; small advantages at each visit can accumulate into a more noticeable endpoint by the time the course is complete.
The result does not mean the algorithm discovered a single universal protocol for every patient. It instead suggests that optimal rTMS delivery may depend on a series of choices made in sequence, with the model identifying treatment patterns associated with better immediate symptom response. In practical terms, that points toward protocol selection as a dynamic process rather than a fixed prescription written once and left unchanged.
Why Reinforcement Learning Fits a Problem Built on Repeated Decisions
Reinforcement learning is well suited to clinical problems in which each choice changes the next decision point. rTMS treatment has exactly that structure: session by session, clinicians can adjust stimulation type, intensity, and laterality in response to early symptom response or lack of it. A static rule set can miss those changing conditions, while a data-driven policy can search for patterns that repeatedly line up with better outcomes in prior care.
In depression treatment, that matters because early response often shapes the trajectory of the rest of the course. If one stimulation approach is associated with better next-session improvement, a treatment team may be able to detect the signal sooner and use it to steer subsequent sessions. The appeal of this approach is not just predictive accuracy; it is the possibility of making each encounter more responsive to the patient in front of the clinician.
This study used routine clinical records rather than a tightly controlled efficacy trial, which gives it a different kind of value. Real-world data capture the variability of ordinary practice, including differences across clinics, clinicians, and patient histories that are often smoothed out in more rigid experimental settings. That setting also makes the findings more operationally relevant, because the algorithm was built from the same sort of information that health systems already collect.
What the 19-Clinic Cohort Can and Cannot Prove
The cohort spanned 19 clinic groups and 1,609 adults, which strengthens the case that the model learned from a broad treatment environment. Even so, the design remains observational. The algorithm identified associations between recommendation matching and improvement, but the study cannot prove that the recommendations themselves caused the symptom gains. Unmeasured confounding could still influence the pattern of treatment selection and response.
The held-out validation step is a major strength. By testing the model in 370 patients from clinics not used in training, investigators asked a harder question than simple retrospective fit: whether the learned policy would remain informative in a new clinical setting. That external check is important for any algorithm intended to influence treatment decisions, especially in psychiatry, where baseline severity, prior treatment exposure, and session-to-session variation can all affect outcomes.
Even with that caution, the findings point to a concrete clinical use case. A model that can recommend session-level rTMS protocols associated with greater short-term PHQ-9 improvement could eventually support clinicians who are currently choosing among multiple stimulation parameters without clear comparative guidance. The data do not yet establish a bedside standard, but they do indicate that routine records contain a usable signal about which treatment paths may be more effective for some patients.
What the Study Adds to rTMS Decision-Making
The work sits at the intersection of digital psychiatry, electrostimulation, and adaptive treatment design. It proposes a different way to think about rTMS: not as a single static intervention, but as a sequence of decisions that can be optimized as new information arrives. That framing is especially relevant in treatment-resistant depression, where patients often reach rTMS after multiple failed medication trials and where incremental improvements can carry substantial weight.
The authors also identified the organizational reality behind the model. The work was supported by the National Institute on Drug Abuse under award 1K01DA061975 and the National Institute of Mental Health under award 1UG3MH141096-01, with funders having no role in study design, analysis, or the decision to submit. Jason B. Gibbons disclosed a financial interest in Adaptive Testing Technologies, a company developing online mental and behavioral health assessment tools; that interest was reviewed and managed by Brigham and Women’s Hospital and Mass General Brigham in line with conflict-of-interest policy. All other authors reported no competing financial or nonfinancial interests.
For now, the central message is narrow and practical: a reinforcement learning model applied to routine rTMS care identified treatment patterns associated with better next-session symptom improvement and larger projected gains over a course of treatment. The remaining question is not whether the dataset contains a signal, but how that signal will perform when prospectively embedded into clinical decision-making and tested against standard practice in real-time care.