Introduction

Pain perception is not determined solely by nociceptive input but is strongly shaped by the brain state prior to stimulus onset 1,2. Converging evidence shows that pre-stimulus brain activity biases subsequent sensory processing, influencing both cortical responses and subjective pain experience 35. Such preparatory brain states reflect the configuration of neural systems involved in sensory readiness, attentional allocation, and salience processing, thereby setting the initial conditions under which nociceptive information is evaluated. Among the neural mechanisms shaping these preparatory states, oscillatory activity in the α-frequency band has been consistently implicated in sensory gating and pain modulation 69. In particular, α oscillations in primary somatosensory cortex are thought to regulate cortical excitability and filter incoming sensory input 10,11, with higher pre-stimulus α power predicting attenuated pain-evoked responses and reduced pain perception 6,1214. Despite these associations, it remains unclear whether targeted modulation of pre-stimulus α activity can causally alter pain outcomes, and through which neural pathways such effects are expressed.

Closed-loop neurofeedback (NFB) offers a principled framework for causally reshaping preparatory brain states by enabling individuals to learn voluntary regulation of specific neural signals through real-time feedback 1517. By translating ongoing brain activity into perceptible cues, neurofeedback engages learning-dependent processes that allow targeted neural rhythms to be progressively shaped prior to sensory stimulation 1820. Importantly, closed-loop neurofeedback systems comprise two functionally distinct yet interacting components 2123: active training, reflecting the individual’s intentional engagement in regulating neural activity, and feedback authenticity, determining whether the system provides veridical or non-contingent representations of ongoing brain states. Together, these components define the human and machine elements of the closed loop 16. However, it remains unresolved whether effective pain modulation via neurofeedback depends on the interaction between active training and authentic feedback, particularly when neurofeedback is used to modify preparatory brain states before nociceptive input.

A further limitation of existing work is its predominant focus on local oscillatory changes, leaving open how such modulation is embedded within broader brain state dynamics. Pain perception emerges from coordinated activity across distributed neural systems rather than isolated regional processes 2426. EEG microstates that are brief, quasi-stable patterns of whole-scalp activity provide a complementary framework for characterizing large-scale brain state organization 27,28, as supported by simultaneous EEG–fMRI and source imaging studies 2931. Operating on timescales comparable to oscillatory fluctuations, microstates offer a potential bridge between local neural modulation and global brain dynamics. Consistent with this view, neuromodulation studies suggest that analgesic effects are accompanied not only by changes in oscillatory power but also by reorganization of microstate dynamics 32,33. Yet whether modulation of pre-stimulus oscillatory activity via neurofeedback reshapes preparatory brain states at the global level, and whether such reconfiguration mediates subsequent pain processing, remains largely unexplored.

Here, we tested the hypothesis that authentic feedback enables effective training to enhance somatosensory α activity, which in turn reorganizes preparatory brain state dynamics indexed by EEG microstates, thereby biasing pain-evoked cortical responses and subjective pain perception. To this end, we employed a double-blind 2 × 2 factorial design manipulating training engagement and feedback authenticity, in which closed-loop neurofeedback targeting somatosensory α oscillations was delivered during a pre-stimulus period preceding nociceptive stimulation. As illustrated in Fig. 1A, participants completed both passive observation and active regulation conditions, each combining individualized threshold estimation with a neurofeedback–pain task designed to manipulate preparatory brain states prior to stimulation. At the trial level (Fig. 1B), a neurofeedback phase preceded each nociceptive stimulus, allowing participants either to observe or actively regulate ongoing brain activity before reporting subsequent pain perception. This manipulation was implemented using a closed-loop system in which real-time EEG signals were continuously translated into visual feedback, enabling learning-dependent modulation of somatosensory α activity (Fig. 1C). By integrating oscillatory modulation, large-scale brain state dynamics, pain-evoked potentials, and behavioral measures within a mediation framework, this study provides a mechanistic account of how closed-loop neurofeedback causally reshapes preparatory brain states to bias subsequent pain processing.

Study design and closed-loop neurofeedback protocol.

(A) Experimental procedure. Following a pain-familiarization phase, participants completed two conditions (nontraining and training) in a counterbalanced order. Each condition began with a 3-min resting-state EEG recording to establish individualized α-power thresholds, followed by a neurofeedback–pain task designed to manipulate preparatory brain states prior to nociceptive stimulation. (B) Trial structure of the neurofeedback–pain task. Each trial started with a 16-s neurofeedback phase during which visual feedback was continuously updated every 400 ms based on ongoing EEG activity. In the nontraining condition, participants passively observed the feedback display, whereas in the training condition they actively attempted to regulate brain activity to control the feedback. After a variable fixation interval (3–5 s), a laser stimulus (3.5 J) was delivered to the left hand. Participants subsequently rated pain intensity and unpleasantness on separate 0–10 numerical rating scales following a brief delay (3–5 s). (C) Closed-loop neurofeedback framework. The neurofeedback system comprised four components: EEG acquisition, real-time signal processing, visual feedback, and participant self-regulation. EEG was recorded from somatosensory electrodes (C4, CP4, CP6) contralateral to the stimulation site. In the real-feedback group, feedback was contingent on participants’ ongoing neural activity; in the sham-feedback group, feedback was generated from pre-recorded resting-state EEG segments. Every 400 ms, α-power (8–13 Hz) was estimated from the most recent 800-ms EEG window. When α-power exceeded the individualized threshold, the ball moved rightward; when it fell below threshold, the ball moved rightward and downward.

Results

As shown in Table 1, the real- and sham-feedback groups did not differ in demographic variables (age, sex) or baseline psychological measures (all p > 0.38), indicating good comparability prior to the intervention. Blinding was effective, as participants’ beliefs about their assigned condition did not differ between groups (χ2(1) = 0.83, p = 0.36).

Demographic and psychological characteristics of participants

Neurofeedback effects on EEG oscillations

Grand-average power spectra and training-induced changes are shown in Fig. 2A. Two-way repeated-measures ANOVAs revealed a robust main effect of training across frequency bands (see Table S1). Relative to the nontraining condition, neurofeedback training increased θ- and α-power in target and nontarget somatosensory as well as frontal regions, while decreasing β- and γ-power globally and δ-power in the nontarget somatosensory as well as parietal regions (all F1,72 > 4.52, pFDR < 0.05, ηp2 > 0.05), indicating broad oscillatory modulation associated with active training.

Effects of neurofeedback on somatosensory α oscillations and interhemispheric connectivity.

(A) Spectral power during the neurofeedback phase. Grand-average EEG power spectra (5–20 Hz) are shown for real (red) and sham (blue) feedback under training (solid lines) and nontraining (dashed lines) conditions. The lower panel illustrates the training effect (Δpower = training − nontraining). Scalp maps depict α-band power (8–13 Hz) changes for real and sham feedback, as well as their between-group difference (real − sham). Black circles indicate electrodes over target and nontarget somatosensory regions. (B–C) Regional α-power modulation. Training selectively increased α-power at both target and nontarget somatosensory cortices in the real-feedback group, whereas no reliable α modulation was observed under sham feedback. Accordingly, the training effect was significantly greater for real than sham feedback at both sites. Violin plots show full data distributions; box plots indicate interquartile ranges, medians, and means; dots represent individual participants. (D) Interhemispheric α-band connectivity. Training enhanced α-band functional connectivity between target and nontarget somatosensory regions only in the real-feedback group, with no significant change under sham feedback. The connectivity training effect was significantly larger for real than sham feedback. (E) Relationship between connectivity and regional α-power. Within the real-feedback group, training-related increases in interhemispheric α-band connectivity were positively correlated with α-power enhancement at the nontarget somatosensory cortex. No such association was observed in the sham-feedback group. (F) Mediation model. In the real-feedback group, enhanced interhemispheric α-band connectivity mediated the training-related increase in nontarget α-power, indicating that bilateral propagation of α modulation was supported by changes in functional coupling. Significance levels: *p < 0.05, **p < 0.01, ***p < 0.001; n.s. = not significant. Abbreviations: “+” indicates an increase following training relative to nontraining; “–” indicates a decrease.

Critically, significant training × feedback authenticity interactions were observed for α-power in both the target (F1, 72 = 7.65, pFDR = 0.04, η 2 = 0.10; Fig. 2B) and nontarget somatosensory regions (F1, 72 = 8.39, pFDR = 0.02, ηp2 = 0.10; Fig. 2C). Post hoc analyses showed robust α-power increases in the real-feedback group (both p < 0.001), but no reliable changes in the sham-feedback group (p = 0.06 and 0.99, respectively). Accordingly, training-induced α enhancement was significantly greater under real than sham feedback at both sites (p = 0.007 and 0.005, respectively). These results indicate that authentic feedback selectively supported α modulation in somatosensory cortices.

We next examined α-band functional connectivity between target and nontarget somatosensory regions (Fig. 2D). Training significantly increased interhemispheric connectivity overall (F1, 72 = 17.62, p < 0.001, ηp2 = 0.20), with a stronger effect under real feedback (F1, 72 = 5.92, p = 0.02, ηp2 = 0.08). A significant training × feedback interaction (F1, 72 = 4.54, p = 0.04, ηp2 = 0.06) revealed that connectivity increased reliably only in the real-feedback group (p < 0.001), but not in the sham group (p = 0.15). Hence, real feedback not only enhanced local α-power but also strengthened interhemispheric α-coupling.

To further characterize the relationship between oscillatory modulation and connectivity, we examined their association and mediation effects. In the real-feedback group, training-induced increases in α-band connectivity correlated with α-power enhancement at the nontarget somatosensory site (r38 = 0.53, p < 0.001; Fig. 2E), whereas no such relationship was observed in the sham group (r36 = 0.13, p = 0.45; Fig. 2E). Mediation analysis confirmed that α enhancement at the nontarget site was indirectly mediated by connectivity increases (indirect effect a×b = 0.29, 95% CI = [0.13, 0.48]; Fig. 2F), with no significant direct effect (c′ = 0.30, 95% CI = [–0.01, 0.61]). Together, these findings indicate that authentic neurofeedback engages connectivity-dependent plasticity, through which strengthened interhemispheric coupling supports broader α modulation beyond the trained region.

Neurofeedback effects on EEG microstates

Topographic maps of the five canonical microstate classes exhibited high spatial consistency across groups (all r60 > 0.95, p < 0.001; Fig. 3A), with a mean global explained variance of 78.76%, indicating comparable microstate structure across conditions.

Effects of neurofeedback on preparatory EEG microstate dynamics.

(A) Spatial configurations of EEG microstates. Five canonical microstates (A–E) were identified across both real- and sham-feedback groups, with topographies consistent with prior reports: A (right-frontal/left-posterior), B (left-frontal/right-posterior), C (anterior–posterior symmetry), D (frontocentral), and E (centroparietal). (B) Training- and feedback-related modulation of microstate transitions. The left, middle, and right panels depict the significance of the main effects of training, feedback authenticity, and their interaction on microstate transition probabilities, respectively. While training influenced several transitions, the most prominent effect was a selective reduction in transitions from microstate E to microstate D under real feedback compared with sham. (C) E → D transition probability. Training significantly reduced E → D transitions during the preparatory period only in the real-feedback group, with no reliable change observed under sham feedback. Accordingly, the training effect (training − nontraining) was significantly greater for real than sham feedback. Violin plots show full data distributions; box plots indicate interquartile ranges, medians, and means; dots represent individual participants. (D) Relationship with somatosensory α modulation. Across participants, greater training-related reductions in E → D transition probability were associated with larger increases in somatosensory α power at the target site. Dots represent individual participants (red = real feedback; blue = sham feedback). The solid line indicates the linear fit, with shaded areas denoting the 95% confidence interval. Significance levels: ***p < 0.001; ns. = not significant. Abbreviations: “+” indicates an increase following training relative to nontraining; “–” indicates a decrease.

Two-way repeated-measures ANOVAs revealed robust main effects of training (see Table S2). Relative to the nontraining condition, neurofeedback training increased the mean duration of microstates A, B, and D, as well as the time coverage of microstate B (F1,72 > 6.70, pFDR < 0.03, ηp2 > 0.08). In contrast, training significantly reduced the duration, occurrence, and time coverage of microstate E (F1,72 > 8.53, pFDR < 0.02, ηp2 > 0.10). No other main effects or interactions were observed (all F1,72 < 5.42, pFDR > 0.26, ηp2 < 0.07), indicating that these general temporal changes were independent of feedback authenticity.

Analyses of microstate transition probabilities are summarized in Table S3. Compared with the nontraining condition, training facilitated transitions among microstates B↔A, B↔C, B↔D, and C↔D (all F1,72 > 6.74, pFDR < 0.02, η 2 > 0.08), while suppressing transitions involving microstate E (E↔A, E↔B, E↔C, E↔D; all F1,72 > 4.49, pFDR < 0.05, η 2 > 0.05; Fig. 3B). Critically, a significant training × feedback authenticity interaction emerged for the E→D transition (F1,72 = 12.30, pFDR = 0.02, ηp2 = 0.15; Fig. 3C). Post hoc analyses showed that training robustly reduced E→D transitions in the real-feedback group (p < 0.001), but not in the sham-feedback group (p = 0.26), with a significantly stronger reduction under real feedback (p < 0.001). Moreover, training-related reductions in E→D transitions were negatively correlated with increases in target-region α power (r74 = −0.67, p < 0.001; Fig. 3D), directly linking microstate dynamics to oscillatory modulation.

Together, these results indicate that neurofeedback training reshaped both the temporal structure and transition architecture of EEG microstates, with authentic feedback uniquely amplifying suppression of E→D transitions, a large-scale brain state change associated with somatosensory α modulation.

Neurofeedback effects on pain ratings and evoked potentials

Pain ratings and training-induced changes are illustrated in Fig. 4A and Fig. 4B. Two-way repeated-measures ANOVAs revealed robust main effects of training on both pain intensity (F1,72 = 68.32, p < 0.001, η 2 = 0.49) and pain unpleasantness (F = 53.66, p < 0.001, η 2 = 0.43), indicating lower pain ratings during training relative to nontraining across groups. Main effects of feedback authenticity further showed generally lower ratings in the real-feedback group for both intensity (F1,72 = 5.66, p = 0.02, ηp2 = 0.07) and unpleasantness (F1,72 = 4.41, p = 0.04, ηp2 = 0.06).

Effects of neurofeedback on subjective pain perception and pain-evoked cortical responses.

(A–B) Pain ratings. Subjective ratings of pain intensity and unpleasantness elicited by noxious laser stimulation are shown for training and nontraining conditions under real (red) and sham (blue) feedback. Training reduced both pain intensity and unpleasantness, with authentic feedback producing a significantly greater reduction in pain intensity compared with sham feedback. (C) Laser-evoked potentials (LEPs). Upper panel: Grand-average LEP waveforms for training and nontraining conditions in the real- and sham-feedback groups, together with scalp topographies of the N2 and P2 components. Lower panel: Difference waveforms (training − nontraining) and scalp maps illustrating training-related modulation of N2 and P2 amplitudes. (D–E) N2 and P2 amplitudes. Training significantly reduced N2 and P2 amplitudes for both real and sham neurofeedback groups. The training effects on these two components (training − nontraining) were significantly greater for real than sham feedback. Violin plots show full data distributions; box plots indicate interquartile ranges, medians, and means; dots represent individual participants. (F–H) Associations between pain-evoked responses, pain ratings, and preparatory brain dynamics. Across participants, greater training-related reductions in P2 amplitude were positively associated with decreases in pain intensity and unpleasantness, as well as with reduced E → D microstate transition probability. Each dot represents an individual participant (red = real feedback; blue = sham feedback); black lines indicate linear fits, with gray shading denoting 95% confidence intervals. Significance levels: *p < 0.05; **p < 0.01; ***p < 0.001; ns. = not significant. Abbreviations: T, training; NT, nontraining; “+” indicates an increase relative to nontraining; “–” indicates a decrease.

Importantly, a significant training × feedback interaction was observed for pain intensity (F1,72 = 5.60, p = 0.02, ηp2 = 0.07), but not for unpleasantness (F1,72 = 1.68, p = 0.20, ηp2 = 0.02). Post hoc analyses confirmed that pain intensity decreased significantly in both groups (all p < 0.001), with a larger reduction under real feedback (p = 0.02; Fig. 4A). Pain unpleasantness decreased comparably in both groups (all p < 0.001), with no group difference (p = 0.20; Fig. 4B). These results indicate that neurofeedback training alleviated both sensory and affective dimensions of pain, with authentic feedback conferring an additional benefit for intensity reduction.

Grand-average LEP waveforms and training-induced changes are shown in Fig. 4C. Consistent with behavioral effects, neurofeedback significantly modulated cortical pain responses. Robust main effects of training were observed for both the N2 (F1,72 = 135.05, p < 0.001, ηp2 = 0.65) and P2 components (F1,72 = 96.70, p < 0.001, ηp2 = 0.57), reflecting reduced amplitudes during training relative to nontraining. As shown in Fig. 4D and Fig. 4E, significant training × feedback interactions were also detected for both N2 (F1,72 = 7.40, p = 0.008, ηp2 = 0.09) and P2 (F1,72 = 6. 34, p = 0.01, ηp2 = 0.08). Post hoc tests showed amplitude reductions in both groups (all p < 0.001), with significantly larger decreases under real feedback (all p < 0.01).

Finally, reductions in LEP amplitudes were associated with behavioral pain relief. Training-related decreases in N2 and P2 amplitudes correlated with reductions in pain intensity (N2: r74 = −0.37, p = 0.001; P2: r74 = 0.44, p < 0.001; Fig. 4F) and unpleasantness (N2: r74 = −0.25, p = 0.03; P2: r74 = 0.32, p = 0.005; Fig. 4G). Moreover, greater P2 attenuation was associated with stronger suppression of E→D microstate transitions (r74 = 0.26, p = 0.02; Fig. 4H). Together, these findings indicate that authentic feedback enhanced the analgesic efficacy of neurofeedback by jointly attenuating pain-evoked cortical responses and reshaping large-scale brain state dynamics.

Mediation model linking feedback authenticity, neural modulation, and pain regulation

To elucidate the mechanistic pathways underlying neurofeedback efficacy, we constructed a SEM incorporating training-induced changes (training minus nontraining) in somatosensory α power, preparatory microstate transition dynamics (E→D), pain-evoked P2 amplitude, and pain ratings, with feedback authenticity (real vs. sham) specified as the exogenous variable. The model showed excellent fit (n = 74, χ2 = 1.11, root mean square error of approximation [RMSEA] < 0.001, root mean squared residual [RMR] = 0.03, goodness-of-fit index [GFI] > 0.99), indicating that the hypothesized structure adequately captured the data.

As illustrated in Fig. 5, three significant indirect pathways were identified. First, feedback authenticity was associated with greater training-related reductions in E→D microstate transition probability, which in turn predicted training-induced attenuation of P2 amplitude and lower pain ratings (indirect effect: −0.07, 95% CI = [−0.25, −0.01]). Second, feedback authenticity also predicted larger training-related decreases in P2 amplitude, which indirectly contributed to reduced pain ratings (indirect effect: −0.26, 95% CI = [−0.66, −0.02]).

Structural equation model linking feedback authenticity, preparatory neural modulation, and pain regulation.

The structural equation model examined how feedback authenticity shaped training-related pain regulation through a sequence of neural and behavioral mediators. Feedback authenticity was specified as the exogenous variable (0 = sham; 1 = real). All mediator variables reflect training-induced changes, defined as the difference between training and nontraining conditions. M1 denotes the training-related change in somatosensory α power (Δα-power) at the target primary somatosensory cortex. M2 represents the training-related change in EEG microstate transition probability from E to D (ΔE→D transitions), indexing reconfiguration of preparatory brain state dynamics. M3 corresponds to the training-related change in pain-evoked P2 amplitude (ΔP2), reflecting modulation of cortical responses to nociceptive input. The outcome variable (Y) is a latent pain-regulation factor derived from training-related changes in pain intensity and unpleasantness ratings (Δpain ratings). Solid arrows indicate statistically significant paths (p < 0.05), whereas dashed arrows denote nonsignificant paths. Nonstandardized regression coefficients are shown adjacent to each path. Significance levels: *p < 0.05, **p < 0.01, ***p < 0.001.

Critically, a full sequential pathway linked feedback authenticity to greater training-induced increases in somatosensory α power, which were associated with training-related reductions in E→D transitions, leading to attenuated P2 responses and lower pain ratings (indirect effect = −0.07, 95% CI = [−0.23, −0.01]). This pathway uniquely integrated local oscillatory modulation, global preparatory state reconfiguration, and downstream nociceptive processing, capturing the learning-dependent cascade through which neurofeedback biased pain perception.

Collectively, these results indicate that neurofeedback-induced pain regulation is supported by multiple, partially independent mechanisms. While authentic feedback modulated pain processing through both direct and indirect routes, the sequential α–microstate–P2 pathway provides a coherent mechanistic bridge linking preparatory neural plasticity to perceptual outcomes.

Discussion

In this study, we demonstrate that closed-loop neurofeedback biases pain perception by reshaping preparatory brain states prior to nociceptive stimulation, and that this effect critically depends on the availability of authentic neural feedback. When feedback veridically reflected ongoing brain activity, active training produced robust learning-related changes, selectively enhancing somatosensory α oscillations during the pre-stimulus period and reorganizing large-scale brain state dynamics indexed by EEG microstate transitions. In contrast, non-contingent feedback failed to support comparable training effects. Integrating neural and behavioral measures revealed a coherent cross-level mechanism: authentic feedback facilitated training-induced α-band modulation, which was embedded within a stabilization of preparatory brain state dynamics, and this reconfiguration in turn attenuated pain-evoked cortical responses and reduced subjective pain. Together, these findings identify authentic feedback as a critical enabling factor for effective neurofeedback learning and highlight preparatory neural dynamics as a mechanistic substrate through which closed-loop neurofeedback biases subsequent pain processing.

At the oscillatory level, only authentic—rather than sham—neurofeedback produced robust training-related enhancement of α power in the targeted somatosensory cortex, underscoring the necessity of veridical feedback for effective modulation of intrinsic neural rhythms 16,34. This dissociation indicates that α upregulation reflects learning-dependent plasticity that requires a reliable contingency between endogenous neural activity and external feedback, rather than nonspecific effects of task engagement or expectation 35,36. When feedback faithfully reflects ongoing brain states, it enables the formation of an internal model linking cognitive strategies to neural outcomes, thereby supporting reinforcement-based tuning of oscillatory activity 37,38. In contrast, non-contingent feedback disrupts this mapping and prevents stable acquisition of self-regulatory control over α rhythms.

Importantly, α modulation was not confined to the trained hemisphere. Instead, enhanced interhemispheric functional connectivity accompanied the propagation of α-band activity to the contralateral somatosensory cortex, suggesting that neurofeedback engages distributed network-level mechanisms rather than isolated local plasticity 39,40. This bilateral expression of α enhancement likely reflects coordinated communication within the somatosensory network. Prior work has shown that increased cortical α amplitude is associated with reduced cortical excitability 41 and attenuated BOLD responses in sensory regions 4244, supporting the interpretation that α synchronization implements strengthened inhibitory gain control over sensory processing 10,45. From this perspective, strengthening α-band activity across hemispheres through authentic neurofeedback may promote a spatially broader and more uniform preparatory inhibitory control state, in which sensory gating is implemented bilaterally.

Beyond local oscillatory modulation, closed-loop neurofeedback also reshaped large-scale brain organization, as reflected in systematic changes in EEG microstate dynamics during the preparatory period. EEG microstates represent a canonical set of transient, whole-brain configurations that capture momentary large-scale network states, and converging evidence from simultaneous EEG–fMRI and source imaging studies has linked individual microstates to distinct functional systems 2931. Within this framework, microstates D and E are of particular relevance for preparatory processing 28,30,31,46: microstate D is commonly associated with the dorsal attention network supporting top-down attentional control, whereas microstate E maps onto the salience network involved in integrating interoceptive, emotional, and motivational signals to guide attentional prioritization.

Against this background, real—but not sham—neurofeedback selectively reduced directional transitions from microstate E to microstate D during the pre-stimulus period. Functionally, this pattern suggests a diminished tendency for salience-related configurations to trigger subsequent recruitment of top-down attentional control 28,32, thereby altering the preparatory balance between salience detection and attentional engagement. Importantly, the magnitude of training-induced somatosensory α enhancement predicted the reduction in E→D transition probability, directly linking local oscillatory plasticity to directional reconfiguration of large-scale brain state dynamics 10,47. This coupling supports the view that α oscillations provide a temporal and functional scaffold for shaping global brain states, such that strengthening α-band inhibitory regulation through neurofeedback constrains how salience-related activity biases downstream control-related states. In this way, neurofeedback-induced oscillatory modulation is embedded within, and expressed through, coordinated changes in preparatory brain state dynamics.

Building on these preparatory neural adaptations, neurofeedback training exerted robust modulatory effects on pain processing during subsequent nociceptive stimulation. Active training was associated with reduced subjective ratings of pain intensity and unpleasantness, accompanied by attenuation of the N2 and P2 components of LEPs, which index salience detection and attentional orienting to nociceptive input and originate from operculo-insular, anterior cingulate, and somatosensory cortices 48,49. At a general level, such reductions are consistent with engagement of endogenous regulatory processes such as attentional control, imagery, or relaxation, which processes are known to influence pain via top-down mechanisms 5052. Crucially, however, accurate neural feedback conferred a clear advantage beyond nonspecific training effects. Compared with sham feedback, authentic neurofeedback produced significantly greater reductions in both pain ratings and pain-evoked N2 and P2 amplitudes. Mediation analyses further indicated that this advantage was rooted in learning-dependent neural plasticity established during the preparatory period. Specifically, authentic feedback facilitated greater training-related enhancement of somatosensory α power and stronger reductions in E→D microstate transitions, which together mediated downstream suppression of pain-evoked cortical responses and subjective pain. These findings support a hierarchical mechanism in which veridical feedback enables effective training to reshape preparatory brain states, thereby biasing subsequent nociceptive processing in a pain-regulatory direction.

The present findings extend current models of pain modulation by demonstrating a causal role of preparatory brain state dynamics in shaping subsequent nociceptive processing, rather than treating pre-stimulus activity as a passive correlate of pain responses 35,79. Previous neuromodulation studies have shown that exogenously manipulating pre-stimulus somatosensory α activity can influence pain-evoked potentials and subjective pain ratings 8,33. Here, we advance this line of work by showing that endogenous, learning-based self-regulation of neural activity—implemented through closed-loop neurofeedback—can similarly reshape neural dynamics before stimulus onset and bias how pain is subsequently encoded and experienced. These results provide empirical support for a state-based account of pain, in which pre-existing neural configurations determine the gain and routing of incoming nociceptive signals 3,5,53. Within this framework, our findings help clarify the functional contributions of different levels of neural organization: somatosensory α oscillations index local inhibitory gain control 10, whereas EEG microstate dynamics capture how such local modulation is expressed within coordinated, large-scale brain organization 32,33. Critically, the observed coupling between α modulation and microstate reconfiguration provides a mechanistic link between regional oscillatory plasticity and distributed brain-wide state dynamics, supporting multilevel accounts of pain as an emergent property of coordinated neural systems.

From a translational perspective, these findings have several implications for optimizing neurofeedback-based interventions. First, they highlight the importance of feedback authenticity: veridical, real-time feedback is necessary for learning-dependent neural plasticity to translate into behavioral change, underscoring the need to rigorously control feedback contingency in both experimental and clinical applications. Second, because effective modulation emerged during a pre-stimulus window, neurofeedback need not coincide with pain delivery to influence outcomes. Instead, it may be used to optimize preparatory brain states before anticipated nociceptive events, extending its potential to anticipatory or preventive contexts 32,54. In this sense, our findings align with emerging preventive or anticipatory brain–computer interface frameworks that aim to modulate neural states before maladaptive processing unfolds. Third, identifying brain state dynamics as an intermediate mechanism highlights biomarkers beyond local oscillatory power. Measures such as microstate transition dynamics may provide complementary indices of training efficacy and support adaptive, state-sensitive closed-loop designs, thereby improving robustness and scalability of neurofeedback interventions.

In summary, this study demonstrates that pain processing is causally shaped by the neural state of the brain prior to stimulus onset. Using closed-loop neurofeedback, we show that authentic feedback enables learning-dependent modulation of preparatory brain states, characterized by coordinated changes in somatosensory α oscillations and large-scale microstate dynamics. These preparatory adaptations bias subsequent nociceptive processing and pain perception, linking local oscillatory plasticity to global brain state organization. Together, our findings provide mechanistic support for a state-based account of pain, highlighting preparatory neural dynamics as a critical leverage point through which endogenous regulation can influence sensory experience.

Methods

Participants

An a priori sample size estimation was conducted using G*Power 3.1 55 for a repeated-measures ANOVA with two groups (effect size = 0.25, α = 0.05, power = 0.95), indicating a minimum of 74 participants. To account for potential attrition, 80 healthy adults (42 males, 38 females; mean age ± SEM = 20.19 ± 0.25 years; Asian Chinese descent) were recruited through campus advertisements at a local university and randomly assigned to either the real-feedback group (n = 40) or the sham-feedback group (n = 40). Inclusion criteria required right-handedness and normal or corrected-to-normal vision. Exclusion criteria included: (1) acute or chronic pain, (2) cardiovascular or neurological disorders, (3) psychiatric diagnoses, (4) current use of psychoactive medication, or (5) any neuromodulation interventions within the past month. Data from six participants were excluded due to withdrawal from the study (n = 2) or excessive EEG artifacts (n = 4), resulting in a final analytic sample of 74 participants (real feedback: n = 38; sham feedback: n = 36). All participants provided written informed consent in accordance with the Declaration of Helsinki, and the study protocol was approved by the local ethics committee.

General experimental procedure

This double-blind, sham-controlled study employed a 2 × 2 mixed factorial design, with autonomous training (training vs. nontraining) as a within-subject factor and feedback authenticity (real vs. sham) as a between-subject factor. This design enabled dissociation of the contributions of participants’ active engagement in self-regulation from the authenticity of the neurofeedback signal in shaping training-related pain modulation. To maintain blinding, participants received neutral instructions without disclosure of feedback authenticity, and the study was conducted by two independent researchers operating in isolation: one blinded assessor conducted data collection and analysis, whereas one unblinded technician trained in EEG-based neurofeedback procedures generated the random allocation sequence, assigned participants to the study groups, and delivered the real or sham neurofeedback intervention without any post-intervention contact with participants. All other experimental procedures were identical across groups.

All participants completed the experimental procedures in a neuromodulation laboratory at a university in China. Upon arrival, participants completed a battery of psychometric questionnaires assessing individual differences in pain-related cognition, affect, and regulation. These included measures of pain catastrophizing (Pain Catastrophizing Scale), pain sensitivity (Pain Sensitivity Questionnaire), pain-related fear and anxiety (Fear of Pain Questionnaire; Pain Anxiety Symptoms Scale), perceived coping ability (Pain Resistance Scale), trait and state anxiety (State–Trait Anxiety Inventory), and emotion regulation strategies (Emotion Regulation Questionnaire). Following baseline assessment, the unblinded technician used a covariate-adaptive randomization procedure 56 to generate the allocation sequence and assign participants to the real- or sham-feedback groups, balancing demographic characteristics and psychometric profiles across conditions.

As illustrated in Fig. 1A, the experimental session began with a pain familiarization phase, during which participants received laser stimuli of varying intensities (2.5–4.5 J) and rated five 3.5 J stimuli using a 0–10 numerical rating scale (NRS) to confirm tolerability. Each subsequent condition (training and nontraining) comprised two components: (1) a 3-min resting-state EEG recording used to determine individualized neurofeedback thresholds; and (2) an NFB–pain rating task assessing the effects of feedback training on subsequent pain perception. For the real-feedback group, thresholds were derived from each participant’s own resting-state EEG data. For the sham-feedback group, thresholds were generated from a resting-state EEG database consisting of recordings from three independent individuals not involved in the study. Each database participant contributed five 5-min resting blocks, from which 3-min segments were randomly selected to define thresholds separately for the nontraining and training conditions.

As shown in Fig. 1B, each NFB–pain rating trial began with a 16-s neurofeedback phase, during which the position of a visual feedback stimulus (a moving ball) was updated every 400 ms based on real-time EEG processing. In the nontraining condition, participants passively observed the feedback display, whereas in the training condition, they actively attempted to regulate their brain activity to prevent the ball from falling. Following a fixation interval (3–5 s), a noxious laser stimulus (3.5 J; wavelength = 1.34 μm; pulse duration = 4 ms; beam diameter = 7 mm; Electronical Engineering, Italy) was delivered to the dorsal web space of the left hand. After a further delay (3–5 s), participants verbally rated pain intensity and unpleasantness on separate 0–10 NRS scales (0 = none, 10 = maximum). Each trial ended with a 2–4 s intertrial interval. Participants completed 30 trials per condition (training and nontraining), divided into two blocks, yielding a total task duration of approximately 25 min per condition.

Neurofeedback training protocol

The NFB system provided continuous visual feedback by mapping somatosensory α-power onto the horizontal position of a white ball displayed on a gray background (Fig. 1C). The closed-loop architecture comprised four components: EEG acquisition, real-time signal processing, visual feedback, and participant self-regulation 18,21,54,57.

  1. EEG acquisition. EEG data were recorded using a 64-channel Ag/AgCl electrode cap (Brain Products GmbH, Germany) arranged according to the international 10–20 system. Signals were referenced online to CPz, sampled at 1000 Hz, and bandpass filtered online between 0.01 and 100 Hz. Electrode impedances were kept below 10 kΩ. Control signals were derived from electrodes over the right somatosensory cortex (C4, CP4, CP6), contralateral to the site of pain stimulation.

  2. Real-time processing. Every 400 ms, an 800-ms segment of the most recent EEG data was extracted from a continuous buffer, bandpass filtered (1–40 Hz; third-order IIR Butterworth, −12 dB/octave), linearly detrended, and transformed using a 512-point Hamming-windowed fast Fourier transform (0.5 Hz resolution) to estimate instantaneous α-power (8–13 Hz).

  3. Visual feedback. Estimated α-power was compared with an individualized threshold every 400 ms. When α-power exceeded the threshold, the ball moved one unit rightward; when it fell below the threshold, the ball moved one unit rightward and downward. In the real-feedback group, α-power and thresholds were computed from participants’ ongoing EEG activity, whereas in the sham-feedback group, feedback was generated from 16-s EEG segments randomly drawn from a resting-state EEG database.

  4. Self-regulation. In the training condition, participants were instructed to “mentally keep the ball from falling,” without explicit strategy guidance, encouraging spontaneous self-regulation. In the nontraining condition, participants passively observed the ball’s movement without attempting regulation.

This closed-loop system enabled real-time translation of somatosensory α-power into dynamic visual feedback under tightly controlled conditions. Following the experiment, a blinding check assessed perceived feedback authenticity by asking participants whether they believed they had controlled the ball’s movement during training.

Offline EEG data processing

Offline EEG preprocessing was performed using EEGLAB 58. For NFB phase data, EEG signals were bandpass filtered between 1 and 100 Hz and notch filtered at 50 Hz to remove line noise. Data were segmented into consecutive, non-overlapping 2-s epochs within each 16-s NFB interval. For laser-evoked potentials (LEPs), EEG data were filtered between 1 and 30 Hz, segmented into 1500-ms epochs time-locked to stimulus onset (−500 to 1000 ms), and baseline corrected using the pre-stimulus interval (−500 to 0 ms). Epochs containing gross artifacts due to movement or electrode noise were manually rejected. Independent component analysis 59 was subsequently applied to remove ocular and muscle artifacts. Data were then re-referenced to the average reference, and the original reference electrode (CPz) was restored to the montage.

EEG oscillatory power analysis

To quantify neurofeedback-related changes in oscillatory dynamics, power spectral density (PSD) was estimated from non-overlapping 2-s epochs during the NFB phase using the FieldTrip toolbox 60. PSDs were computed with a multitaper fast Fourier transform (FFT) using discrete prolate spheroidal sequence (DPSS) tapers, yielding 1-Hz spectral smoothing over the 1–100 Hz range (0.5-Hz frequency resolution). Power values were log-transformed to decibel (dB) units and averaged across epochs within each condition for each participant.

Band-limited power was extracted for canonical frequency bands 1,32,61: delta (δ, 1–4 Hz), theta (θ, 4–7 Hz), alpha (α, 8–13 Hz), beta (β, 13–30 Hz), and gamma (γ, 30–90 Hz). For regional analyses, electrodes were grouped into predefined regions of interest (ROIs): target somatosensory cortex (C4, CP4, CP6), nontarget somatosensory cortex (C3, CP3, CP5), frontal cortex (F1, Fz, F2), and parietal cortex (P1, Pz, P2). Within each ROI, band-limited power was averaged across electrodes and epochs.

Functional connectivity analysis

To assess neurofeedback-induced changes in inter-regional synchronization, magnitude-squared coherence was computed between electrode pairs within and across ROIs. Each 2-s epoch was tapered with a Hanning window and transformed into the frequency domain using FFT. Auto-spectral densities Pxx(f) and Pyy(f), and the cross-spectral density Pxy(f), were calculated for each electrode pair and averaged across epochs. Coherence at frequency f was defined as equation (1):

where Pxx(f) and Pyy(f) denote the auto-spectral densities of electrodes x and y at frequency f, and Pxy(f) is their cross-spectral density. Cxy(f) reflects the proportion of power at frequency f in one signal that can be predicted from the other, ranging from 0 (no synchronization) to 1 (perfect synchronization).

Coherence estimates were Fisher’s r-to-z transformed and averaged within the α band (8–13 Hz). For each participant, α-band coherence values were averaged across epochs separately for the training and nontraining conditions. ROI-level connectivity measures were obtained by averaging coherence values across all electrode pairs within each ROI combination (e.g., target–nontarget somatosensory cortex).

EEG microstate analysis

EEG microstate analysis was conducted to assess how NFB influenced large-scale brain state dynamics, following established procedures 32,33,62,63. For NFB-phase data, preprocessed EEG signals were downsampled to 250 Hz and bandpass filtered between 2 and 20 Hz. Global field power (GFP) was computed as the spatial standard deviation across electrodes at each time point, and scalp topographies at GFP peaks were extracted to capture periods of maximal global activity and spatial stability.

At the individual level, condition-specific microstate templates were identified using polarity-insensitive atomize–agglomerate hierarchical clustering (AAHC) with a spatial correlation distance metric. Group-level clustering proceeded in two steps: first across all conditions within each participant, and then across participants within each feedback group (real or sham). The optimal number of microstate classes was determined using the cross-validation criterion and the Krzanowski–Lai index, evaluated across solutions ranging from three to seven classes. Consistent with prior work, a five-class solution (A–E) was selected for subsequent analyses.

For each microstate class, three temporal parameters were computed 27: (1) the average duration that each microstate remains stable (i.e., mean duration; ms), (2) the frequency of occurrence for each microstate per second (i.e., occurrence; events/s), (3) the percentage of the total recording time occupied by each microstate (i.e., time coverage; %). In addition, transition probabilities were calculated to quantify the likelihood of switching between microstate classes, normalized by the total number of transitions. Transition matrices were computed separately for each participant and condition using the group-level microstate templates.

Laser-evoked potential (LEP) analysis

LEP analysis analysis was performed to assess how NFB training modulated cortical responses to nociceptive stimulation. For each participant, laser-evoked EEG responses were averaged separately for the training and nontraining conditions, yielding two condition-specific waveforms. Group-level grand averages were subsequently computed to visualize representative LEP waveforms and spline-interpolated scalp topographies.

Analyses focused on the N2 and P2 components 8,33, which exhibited maximal amplitudes over central electrodes (C1, Cz, C2, FC1, FCz, FC2, CP1, CPz, and CP2). The N2 component was defined as the most negative deflection within 180–300 ms following stimulus onset, and the P2 component as the most positive deflection within 300–500 ms. For each participant and condition, peak amplitudes of N2 and P2 were extracted within these predefined latency windows.

Statistical analysis

All statistical analyses were conducted on all 74 participants (real feedback: n = 38; sham feedback: n = 36) using MATLAB (MathWorks, Natick, MA, USA), IBM SPSS Statistics (Version 19; IBM Corp., Armonk, NY, USA), and IBM SPSS Amos (Version 26; IBM Corp., Armonk, NY, USA) in two-tailed. Baseline equivalence between the real- and sham-feedback groups was assessed using χ² tests for categorical variables and independent-samples t-tests for continuous measures.

To evaluate neurofeedback effects, two-way repeated-measures ANOVAs were performed with training (training vs. nontraining) as a within-subject factor and feedback authenticity (real vs. sham) as a between-subject factor. This analysis framework was applied to all primary outcomes, including EEG oscillatory power, functional connectivity, microstate metrics (temporal parameters and transition probabilities), pain ratings, and LEP components (N2 and P2 amplitudes). For EEG oscillatory power and microstate analyses, false discovery rate (FDR) correction was applied to control for multiple comparisons 64,65, and statistical significance is reported as pFDR. Significant main effects and interactions were followed up to determine whether training-related changes were specifically driven by authentic feedback. When a significant interaction was observed, training-induced change scores (Δ = training − nontraining) were computed for each outcome and compared between feedback groups.

Associations between neural and behavioral measures were assessed using Pearson correlation analyses. To test hypothesized mechanistic pathways, mediation analyses were conducted using the MEMORE macro 66 for within-subject designs, with bias-corrected bootstrapping (5000 resamples). Indirect effects were considered significant when the 95% confidence interval (CI) did not include zero. Finally, structural equation modeling (SEM) using the AMOS 67 was employed to integrate neural and behavioral measures within a multivariate framework.

Data availability

The raw EEG data, the processed data that underlie the statistical analyses and figures, and the custom MATLAB scripts that were used for the preprocessing and analysis have been deposited in an Open Science Framework repository (https://osf.io/x4gf2) 68. These will be made publicly available once the manuscript enters the peer-review process.

Acknowledgements

This work was supported by the ‘Sci-Tech Innovation 2030’ Brain Science and Brain-Inspired Intelligence Technology Research by the Ministry of Science and Technology of China (grant number 2022ZD0206400), National Natural Science Foundation of China (grant numbers 32271105 and 32200900), Shenzhen Basic Research Project (grant number JCYJ20230808105805012), and Shenzhen University 2035 Program for Excellent Research (grant number 2024C003).

Additional information

Author contributions

YHZ: Formal analysis, Visualization; Writing-original draft, Writing-review and editing. SQ: Conceptualization, Formal analysis, Writing-review and editing. QQZ: Conceptualization, Data curation, Formal analysis. SHC: Visualization; Writing-review and editing. JL: Formal analysis, Writing-review and editing. XYL: Conceptualization, Writing-review and editing. RCJ: Conceptualization, Writing-review and editing. WWP: Conceptualization; Formal analysis, Writing-original draft, Writing-review and editing, Funding acquisition, Supervision. All authors read and approved the final manuscript.

Funding

'Sci-Tech Innovation 2030' Brain Science and Brain-Inspired Intelligence Technology Research by the Ministry of Science and Technology of China (2022ZD0206400)

  • Weiwei Peng

MOST | National Natural Science Foundation of China (NSFC) (32271105)

  • Weiwei Peng

MOST | National Natural Science Foundation of China (NSFC) (32200900)

  • Xiaoyun Li

Shenzhen Basic Research Project (JCYJ20230808105805012)

  • Weiwei Peng

Shenzhen University 2035 Program for Excellent Research (2024C003)

  • Weiwei Peng

Additional files

Supplementary information.