Abstract
Neuromodulation is becoming a common treatment strategy for patients with drug-resistant epilepsy who are not candidates for resective surgery. Responsive neurostimulation can effectively reduce seizure burden, however it remains unclear which neural signals are most important for triggered stimulation. Furthermore, the high-dimensional parameter space remains systematically underexamined. As more patients become candidates for neurostimulation, clinical teams will need to decide on the optimal site and stimulation program for therapeutic neuromodulation. In this review, we highlight how recent insight into the biological rhythms of epilepsy may pair with personalization protocols in the emerging field of neuropsychiatric neuromodulation. Finally, we discuss future directions for epilepsy neuromodulation, specifically how machine learning can offer clinical teams actionable feedback on neuromodulation efficacy.
Introduction
For one-third of patients with drug-resistant epilepsy, surgical resection of a seizure onset zone (SOZ) can be curative.1–3 Yet for many, resection is not an option. Neuromodulation is a valuable alternative for patients with SOZs in eloquent regions, multifocal SOZs, or generalized seizure onset. 4 Neuromodulation directly alters neural activity most commonly via open-loop deep brain stimulation or vagus nerve stimulation.5–7 Responsive neurostimulation (RNS) offers the possibility of adapting stimulation to triggered ictal events. 8 With RNS, physicians may personalize algorithms for each patient. 9 Long-term RNS recordings reveal that seizure propensity fluctuates over multitimescale risk cycles, shifting the view on seizures from paroxysms into precipitations of high-risk states.10,11 Long-term results from the first clinical trials in RNS report a 50% reduction in seizure burden for at least 73% of patients.12,13 Notably, a subgroup of super responders (35%) achieved over 90% seizure reduction. Further examination suggests that stimulation during periods of low seizure risk may drive seizure reduction. 14 These super responders demonstrate that neuromodulation under the right conditions could achieve near-full seizure control.
We identify 3 key factors for successful neuromodulation in epilepsy: when, where, and how to stimulate. 15 We contend that addressing these 3 questions will give patients the best chance of seizure control. The advances required to answer these questions will produce meaningful improvements to patients’ lives. For example, modeling seizure risk profiles is integral to determining optimal times for stimulation to guide epileptic networks away from seizures. Concurrently, this may produce needed advances in seizure forecasting, which will yield immediate benefit for patients. Lastly, it is important to advance the tracking of epileptiform activity (seizures and interictal epileptiform spikes 16 ), behavioral state, 17 and epilepsy-associated comorbidities 18 in order to quantitatively determine optimal therapies.
Formulating an ideal stimulation plan involves intensive personalization protocols. Thus, neuromodulation must be optimized in a patient-specific manner where clinicians work to understand patients’ lives and goals. 9 While modern closed-loop neuromodulation started in epilepsy, it is beginning to broaden to other pathologies such as obsessive-compulsive disorder, 19 major depressive disorder,20–23 and chronic pain. 24 While the network aberrancy may be different, epilepsy neuromodulation could learn from their personalization protocols and their advances in neural engineering.
Finally, we address a paradox of patient-specific neuromodulation. If it is possible to personalize stimulation parameters, all implant sites, and triggered events, then within 1 epileptologist's practice, there may not exist 2 similar patients. How should the field balance the need for parameter heterogeneity with population-level generalization? We synthesize advances in deep learning embeddings to highlight a potential for full patient specificity derived from generalizable models. With attention to data curation early on, we may be able to richly model electrophysiology networks, potentially addressing all 3 questions in a data-driven manner.
When to Stimulate: Modeling Seizure Propensity Using Intracranial Electrographic Recordings
Before long-term intracranial monitoring was readily available, seizures were often described as paroxysmal and unpredictable. 25 Long-term seizure studies were initially limited to seizure diaries, which present limitations for patients with consciousness-impairing or predominantly nocturnal seizures. 25 Long-term intracranial recordings reliably measure epilepsy dynamics on circadian, multiday, and even months to years-long scales. These studies strongly suggest that epilepsy26,27 and normal electrophysiology 28 exhibit cycles that may prove useful for guiding epilepsy neuromodulation.
Interictal epileptiform activity (IEA) is broadly defined as activity electrographically similar to a seizure, yet localized, and not self-sustaining in nature. While not unique to epilepsy, IEA's preponderance is a hallmark of epileptic brain activity. 29 RNS is sensitive to IEA, with the line-length detector particularly well suited to its detection. 14 Many triggered stimulations likely reflect IEA rather than seizures. 14 While IEA itself may not be seizure activity, its fluctuations have proven valuable for studying seizure propensity.11,26 In recent work, Gregg and colleagues combined intracranial recordings with other physiologic measurements from wearables. They found that sympathetic tone, heart rate variability, IEA rate, and other physiological signals, all fluctuate on multiple timescales. Seizure risk could be locked to the specific phases of these signals. For example, as IEA rates peaked, some patients were more likely to experience seizures, while in others seizure timing was locked to the rising phase of IEA. When considering multiple timescales, they reported a heightened risk for patients when the middle phase of a 6-day fluctuation coincided with the midday phase of IEA. In short, multiscale fluctuations in seizure risk indicate that seizures emerge from a confluence of several risk profiles (Figure 1). Combining these physiologic signals with intracranial data offers a promising means for personalizing therapeutic stimulation.

Seizure risk fluctuates with physiological rhythms on multiple timescales. (a) Examples of chronic wearable sensor and brain recordings, and below, circadian and multiday bandpass filtered tracings and seizure onset times. (b) Corresponding polar histogram plots, with pink arrow R-value. The outer ring number is seizure count; for R-value amplitude the outer ring = 1. (c) Corresponding phase–phase plots show seizure counts with respect to circadian and multiday cycles. π = cycle trough, 0 and 2π = peak, and ↑/↓ = rising or falling phase. (d) Group averaged phase–phase plots for all significant (Rayleigh test) circadian and multiday cycles. Phase–phase plots were normalized to the total number of seizures per subject and the circadian and multiday phases were centered prior to averaging. The colormap scale has fixed proportional scale relative to the total seizure count for each channel, for direct comparisons between channels. The top right inset script is the number of subjects (S) and phase–phase analyses (PhPh) included in the group plot. IEA: interictal epileptiform activity, ACC: accelerometry, HR: heart rate, HRV: heart rate variability, EDAt: tonic electrodermal activity, TEMP: temperature, e: power of 10 (1e2 = 1 × 102). Reprinted with permission from Gregg NM, Pal Attia T, Nasseri M, et al. Seizure occurrence is linked to multiday cycles in diverse physiological signals. Epilepsia 2023;
Revisiting our 3 questions, these findings provide a roadmap for personalizing when to stimulate. As clinicians work with patients receiving chronic implants, they may review physiologic recordings in conjunction with detected seizures and IEA. After a collection period, patients may receive their own epilepsy chronotypes. 25 A clinician may then program stimulation triggered during low risk periods to disrupt the next high-risk cycle. Chronotype information may quell a major source of anxiety in patients by creating better seizure forecasting. 30 As clinicians personalize patient risk profiles, they may also trial different triggers for therapeutic stimulation. Further work is required to establish at what point during risk fluctuations epileptic networks are most amenable to remodeling via stimulation.
Concurrently, future work should compare which neural signals best capture these fluctuations. For example, as current data suggests, stimulating before high-risk periods may influence networks as their fluctuations likely track risk cycles. 31 The question remains: should clinicians continue pursuing seizure disruption, and if so, how? Neurostimulation could be targeted to augment endogenous 32 abortive mechanisms. 33 When those fail, neurostimulation could then prioritize preservation of consciousness. 34 Gregg and colleagues successfully model epilepsy's temporal dynamics in situ, demonstrating that synthesizing multiple physiologic modalities enriches our view of risk timing. However, iterative experimentation in the ambulatory setting is metered by the follow-up interval. While months-long cycles may offer insight into when to stimulate, resolving how via parameter optimization is tedious. Furthermore, where to stimulate is rarely re-evaluated during the ambulatory phase of epilepsy neurostimulation care. Emerging study designs in neuromodulation for neuropsychiatric disorders may offer a balance between long-term monitoring and rapid iteration.
Where and How to Stimulate: Current State of Adaptive Neuromodulation Paradigms
Current RNS parameter optimization is largely an empiric science.12,14 With over 12 million possible parameters, it is impossible to explore all safe stimulation and trigger settings within the lifetime of any given patient. 9 To optimize the efficacy of closed-loop neuromodulation, we must find opportunities to prototype and evaluate many stimulation parameters over a shorter interval. In this manner, epilepsy neuromodulation may learn from advances in neuropsychiatric neuromodulation to develop protocols to address the where and how.
Adaptive neuromodulation strategies are emerging throughout neuropsychiatry. Current investigations include neuromodulation for obsessive-compulsive disorder, 19 major depressive disorder,20–22 and chronic pain. 24 Adaptive protocols are optimized to stabilize field-specific symptoms or side-effects of stimulation, such as disrupted sleep. In Parkinson's disease researchers who successfully pioneered therapeutic open-loop deep brain stimulation have found benefit in creating adaptive protocols. 35 While these fields investigate different pathophysiologies, they all share the same hurdles regarding parameter optimization. Some groups have opted for intensive inpatient, intracranial monitoring phases where clinicians and researchers evaluate a milieu of therapeutic stimulation parameters, putative biomarkers, and optimize for final implant site.20,22,36 During these initial phases, participants receive many more electrode implants than they would with their long-term devices. Researchers then trial stimulation parameters in an accelerated fashion to curate a repertoire of promising stimulation parameters.
Taking major depressive disorder as an example, one current protocol for personalization involves an intensive inpatient phase with the goal of identifying 2 brain regions of interest, a set of viable stimulation parameters, and a putative biomarker. 36 Over a 10-day period, patients and researchers trial numerous stimulation sites and hundreds of stimulation parameters in a sham-controlled, blinded manner. After each stimulation or sham condition, participants complete clinical scales associated with their symptom severity. Throughout the week, stimulation parameters and stimulation sites are whittled down to those that lead to the greatest reduction in disease severity scores, resulting in candidate sites for long-term implantation. In addition, hours of richly annotated resting-state data are recorded. Researchers then analyze the neural correlates of symptom fluctuation using a combination of annotated resting-state recordings, and stimulation trials. From these analyses, the team develops a putative time-varying biomarker of the patient's depression. This biomarker may be found in sites outside of the optimal stimulation zone. Ultimately, implant sites are chosen by their ability to function as warning signs of disease severity and interfaces to modulate disease (where to stimulate). With the chronic implant phase, researchers call back upon the set of promising stimulation parameters to further optimize therapeutic stimulation and fine-tune the parameters of their identified mood biomarker (how to stimulate).
Such principles could readily be integrated into an epilepsy monitoring unit (EMU) prior to long-term neuromodulation therapy. Presently, the EMU is solely intended to localize SOZs. 37 Stimulation mapping is often only used for delineating the SOZ.38,39 For patients who may not become candidates for resection, there may be utility in dedicating a period of their EMU stay to trialing safe, therapeutic stimulation protocols and evaluating their impact on biomarkers of excitability, including frequency of interictal discharges. A clinical team may justify a few additional days as clinically necessary to provide patients with the best chance of seizure reduction. While teams can readily assess the safety and tolerability of any given stimulation parameter, its efficacy remains elusive. As previously mentioned, epilepsy risk fluctuates over a broad range of timescales. Assessing immediate efficacy therefore remains a challenge. One possibility would be to apply stimulation over a fixed period and assess overall seizure frequency in a randomized controlled fashion. While some patients may have frequent seizures, this strategy would be difficult to assess in patients with clustered or infrequent but disabling seizures. Emulating neuropsychiatric neuromodulation protocols may generate the data which addresses the fundamental questions of stimulation efficacy. However, without surrogate measures of seizure reduction the question remains: how should we assess the efficacy of neurostimulation on any given brain state? Furthermore, if all patients receive completely unique stimulation patterns, implantation plans, and biomarker triggers, how can we continue learning about epilepsy at the group level? Advances in machine learning (ML) may assist the field in this challenging topic.
High-Dimensional Stereo Electroencephalography Analysis to Elucidate Brain State
While ML has been adopted throughout epilepsy research, most applications focus on a few classic problems within epilepsy. For example, many studies employ data-driven techniques to localize the SOZ, 40 forecast seizures,41,42 or even develop data-driven epilepsy phenotypes. 43 However, neuromodulation is a burgeoning application of ML.44,45 Within an ML framework, there is a focused effort on creating meaningful representations of brain state using embeddings.46,47 These efforts deserve further development as their advancement may unlock a litany of clinical applications within and beyond neuromodulation.
ML algorithms produce specific behaviors from their primary goal of optimizing task-specific performance on a training set with clearly labeled data. However, intracranial electrophysiology data are sparsely labeled, and thus difficult to train in an automated fashion. 48 Epileptologists already comb through hundreds of hours of recordings to accurately label SOZs. Labeling all physiologic events of interest is beyond the capacity of expert reviewers. Thus, ML approaches must adapt to these techniques by learning meaningful patterns of electrophysiology without relying on perfectly labeled datasets. Unsupervised learning techniques, particularly variational autoencoders, are well suited for the task. 46
Johnson et al developed a model tasked with learning the statistical patterns in intracranial electrophysiology by progressively censoring different parts of the recorded signals and then coaxing the model to either fill in the missing portions or predict the next portions of these brain recordings. In contrast to supervised techniques where the product of training is the model's ability to make classifications on unseen data, the unsupervised model's worth comes from the integrity of its embedding space. Without informing the model of seizure onset or any other physiologic state, the model learned to group signals of similar state together. For example, as patients neared seizure onset, the embedding space started to group recordings into the same space on its “map” (Figure 2). Furthermore, the model was able to group recordings from sleep in their own area of the map. The model places N3 sleep closer to the preictal recordings, which corresponds to current findings in sleep physiology and seizure risk. 49

Posthoc interpretation of the KenazLBM brain-state embedding space. The 1024-D latent space is visualized via a variational autoencoder fed into a toroidal self-organizing map. (a and b) U-Matrix topologies, where darker ridges mark boundaries between distant states; panel (a) shows training data with a 4-h preictal density contour (proictal region), and panel (b) shows withheld validation preictal density aligning to the same region. (c and d) Cross-subject visitation, with yellow indicating universally visited states and purple indicating subject-specific states. (e and f) Overall occupancy, where blue marks more frequently visited states across the dataset. Johnson GW, Makhoul GS, Doss DJ, et al. Generalized brain-state modeling with KenazLBM. bioRxiv 2025. DOI: 10.1101/2025.08.10.669538. 46
In any given EMU stay, patients will receive implant schemes broadly tailored to their suspected epilepsy networks. Using cross-attention with zero-padded channels, Johnson et al report that the model could combine across patient recordings to construct the map (Figure 2(c) and (d)). Future work may be able to fine-tune this technology in an individualized manner, while utilizing a universal embedding space from which we may make inferences about brain states and risk cycles in epilepsy.
Returning to the EMU, given a generalizable, universal brain-state map, we may be able to address all 3 questions of neuromodulation. We can infer when to stimulate for therapeutic effect in the following manner. If our goal is to abort a seizure before it happens, then we can begin stimulation paradigms as brain states move toward the high-risk territory of the map. If the goal is to stimulate for network remodeling during low-risk periods, we can trigger stimulation when brain state is furthest from the high-risk state, possibly also leveraging known multiday rhythms to annotate low-risk territories on this map. To infer how and where to stimulate, the paradigm could be as follows: During an extended stay in the EMU, a team may conduct a sweeping stimulation survey of parameters and use readouts of the brain-state map to evaluate which combinations of locations and parameters have the most influence on the current location on the map. Next, the clinical team may further refine these sites by identifying which locations move brain state furthest from proseizure states or closest to a known healthy state. By the end of the EMU stay, the clinical team will confidently know which locations are most likely to influence the network and they will have a head start on the possibly years-long stimulation optimization task that lies ahead.
This approach naturally presents a few novel challenges. First, because these patients have diseases severe enough to warrant invasive monitoring, there may not be a truly healthy brain state to use as the target for adaptive paradigms. Future work may utilize a combination of risk fluctuation profiles and surrogates like IEA rate to develop assessments of target brain state. Cross-institutional collaboration may also provide needed external validation, and force generalizability across cohorts of patients with many distinct epilepsy pathologies. 50 Second, these models must be distilled to work in the ambulatory setting. With a standardized embedding space framework, future investigations can employ progressive compression techniques to develop approximate maps with electrode numbers that match current or near-future device capabilities. Finally, the computational power used to generate these embeddings already outstrips all application-specific integrated circuits (ASICs) used by device companies today. The next generation of neural engineers will need to develop ML-enabled ASICs and advances in microcontrollers that enable live inference in the ambulatory setting.
Taken to its logical endpoint, the embedding space may present a new way to conceptualize neuromodulation. Presently, we search for a fixed set of stimulation parameters to apply a given therapeutic effect to all people. Yet, the work highlighted here already underscores that the same stimulation parameter applied to one patient over different periods of time may have vastly different modulatory effects. Soon, we may conceptualize stimulation akin to how turning the rudder on a ship changes its trajectory. When making course corrections, any given parameter is only appropriate given the current position of the ship compared to the optimal trajectory. Developing a set of physiologically meaningful brain-state embeddings provides the critical information, necessary to tailor when stimulation is appropriate and which stimulation parameters applied to the right regions will bring patients closer to an optimal brain state.
Conclusion
Long-term implantable devices provide us with a view into the fluctuations of seizure risk and an interface to modulate that risk. From these recordings, we can appreciate that the highest risk states come from a confluence of multiday cycles that can conspire to precipitate seizures. Recent evidence suggests that stimulation should be timed to coincide with low-risk periods in order to remodel the epileptic network away from seizure propensity. However, localizing this signal within a broad implant scheme in a personalized manner remains a challenge for future studies. Neuropsychiatric neuromodulation has pushed the field of personalization. Epileptologists may borrow from this field's usage of the inpatient setting to wield the EMU as a test bed for therapeutic stimulation prototyping and biomarker development, which may narrow the search space of how to stimulate. Across all these modalities, institutions will amass troves of data that are ideal for modern statistical learning. ML offers a chance to unify these datasets into shared embedding spaces, which will act as maps for brain states. With the right engineering, we may be able to model these brain states with minimal channels. Further, using these maps, it may be possible to steer brain states away from high-risk periods using position on this brain-state map as a live readout of stimulation efficacy simultaneously addressing when, where, and how to stimulate. While seizure reduction is our waypoint, curative neuromodulation should be the ultimate destination of these technologies. With attention to the cycles of epilepsy, cross-pathology engineering, and data-driven collaborations, we may one day realize this goal.
Footnotes
Declaration of Conflicting Interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The authors disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the National Institute of Biomedical Imaging and Bioengineering, National Institute of Neurological Disorders and Stroke, Neil and Barbra Smit (grant numbers T32EB001628-17, T32EB021937, F31NS141612, R00NS097618, R01NS075270, R01NS108445, R01NS110130, and R01NS112252).
