EEG Decoding in Context: A Framework for Tuning-Free EEG Foundation Models
Organizations: National Key Laboratory for Novel Software Technology, Nanjing University · Institute of Brain-Machine Interface, Nanjing University
Abstract
Electroencephalography (EEG) decoding is a central route toward brain-computer interfaces for communication, rehabilitation, cognitive assessment, and neurological monitoring. Recent EEG foundation models have substantially advanced reusable signal representations, but their downstream use still typically requires a task-specific decoder, gradient-based adaptation, and validation-driven model selection. We investigate a complementary foundation-model paradigm based on in-context learning: labeled EEG recordings define the decoding task as context, and new recordings are predicted without updating model parameters. We first pair raw EEG features with a pretrained general-purpose in-context predictor. This direct formulation provides a promising starting point, but its performance remains limited and unstable and does not generalize reliably across EEG paradigms. We find that suitable context construction can address these limitations by improving the effective signal-to-noise ratio and exposing temporal and spatial structure. Building on this insight, we introduce a general framework that combines EEG-specific context construction with a frozen in-context predictor and a metric-based context adaptation mechanism, which matches each downstream task to an appropriate context representation without relying on validation data. Across ten datasets spanning seven EEG decoding paradigms, our method achieves the highest mean BAcc among eleven specialized and fine-tuned EEG baselines, without task-specific parameter updates or validation-based model selection. This framework provides a practical path toward tuning-free EEG foundation models in which adaptation is expressed through context rather than parameter updates.
Figures & tables
| Dataset | Dummy | EEGNet | CSBrain | ICL Predictor | ||
| Raw | Spec | Riem | ||||
| BCIC2020-3 | .2000 | .2740 | .6013 | .4493 | .2727 | .3227 |
| Mumtaz2016 | .5000 | .8701 | .8972 | .8510 | .8921 | .9510 |
| HMC | .2000 | .6675 | .7214 | .4075 | .6015 | .4300 |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Operator | Exposed EEG structure | Rows/trial | Width/row | Trial-level prediction |
| waveform | direct | |||
| per-trial normalized waveform | direct | |||
| windowed magnitude spectrum | direct | |||
| covariance tangent geometry | direct | |||
| regional covariance geometry | direct | |||
| local waveform views | mean over views |
| Dataset | Paradigm / target | Classes | Channels | Train | Support | Test query | |
| BCIC-IV-2a | Motor imagery | 4 | 22 | 2,784 | 2,784 | 1,152 | |
| PhysioNet-MI | Motor imagery | 4 | 64 | 6,300 | 6,228 | 1,803 | |
| BCIC2020-3 | Imagined speech | 5 | 64 | 4,500 | 4,500 | 750 | |
| FACED | Emotion recognition | 9 | 30 | 6,720 | 6,480 | 1,932 | |
| MentalArithmetic | Arithmetic / stress | 2 | 19 | 1,343 | 672 | 192 | |
| CHB-MIT | Seizure detection | 2 | 16 | 286,244 | 3,788 | 16,964 |
| Method | BCIC-IV-2a | PhysioNet-MI | BCIC2020-3 | FACED | MentalArithmetic | CHB-MIT | Siena | ISRUC | HMC | Mumtaz2016 | Mean |
| EEGNet | .2882 | .5995 | .2740 | .2755 | .5000 | .5212 | .7090 | .6951 | .6675 | .8701 | .5400 |
| ST-Transformer | .4418 | .5491 | .2693 | .1477 | .5000 | .7131 | .6272 | .7580 | .3958 | .8002 | .5202 |
| ContraWR | .2500 | .3949 | .2093 | .1111 | .6493 | .6522 | .7175 | .7733 | .7403 | .8554 | .5353 |
| CNN-Transformer | .3220 | .2651 | .2093 | .1111 | .6667 | .6019 | .7318 | .3730 | .7276 | .9064 | .4915 |
| FFCL | .5052 | .4369 | .1987 | .1982 | .6458 | .6881 | .6007 | .7349 | .7262 | .8821 | .5617 |
| SPaRCNet | .4870 | .5907 | .3933 | .3311 | .5174 | .5570 | .5955 | .7133 | .7434 | .8316 | .5760 |
| Dataset | ||||
| BCIC-IV-2a | .3030 | .2708 | .3116 | .0175 |
| PhysioNet-MI | .4637 | .3192 | .3592 | .0609 |
| BCIC2020-3 | .5853 | .2413 | .3120 | .1483 |
| FACED | .2992 | .1622 | .1503 | .0676 |
| MentalArithmetic | .6042 | .6840 | .6111 | .0361 |
| CHB-MIT | .8132 | .8460 | .7600 | .0354 |
| Budget | Rows | B-Acc. | AUC |
| 2,048 | 2,048 | .6484 | .8957 |
| 4,096 | 4,096 | .6465 | .8974 |
| 8,192 | 8,192 | .6540 | .8979 |
| 16,384 | 16,384 | .6579 | .9005 |
| 32,768 | 32,768 | .6596 | .9014 |
| Full | 46,480 | .6614 | .9026 |
| Comparison | Wins–losses | Exact | Holm | |
| Ours (Metric) vs . Ours (Raw) | 10–0 | 0 | .001953 | .005859 |
| Ours (Metric) vs . EEGNet | 9–1 | 2 | .005859 | .011719 |
| Ours (Metric) vs . CSBrain | 5–5 | 21 | .556641 | .556641 |
| Method / Context | BCIC-IV-2a | PhysioNet-MI | BCIC2020-3 | FACED | MentalArithmetic | CHB-MIT | Siena | ISRUC | HMC | Mumtaz2016 |
| EEGNet | 0.2 | 2.7 | 0.8 | 3.2 | 0.4 | – | 85.3 | 514.8 | 26.6 | 1.6 |
| ST-Transformer | 1.4 | 2.3 | 0.6 | 1.1 | 0.2 | – | 51.4 | 50.7 | 28.7 | 0.7 |
| ContraWR | 0.2 | 2.1 | 0.9 | 1.1 | 0.2 | – | 134.1 | 21.8 | 50.5 | 0.5 |
| CNN-Transformer | 0.2 | 1.5 | 0.9 | 1.2 | 0.2 | – | 95.8 | 595.5 | 21.7 | 0.9 |
| FFCL | 1.3 | 11.3 | 1.5 | 5.3 | 0.4 | – | 108.1 | 162.2 | 148.4 | 1.1 |
| SPaRCNet | 0.6 | 2.2 | 1.3 | 3.3 | 0.2 | – | 62.1 | 1093.7 | 45.4 | 0.5 |
| Operating point | Threshold | OOF recall | B-Acc. | AUC | Macro-F1 | Recall | Specificity | |
| Default | .500000 | – | .853393 | .923702 | .305677 | .641312 | .748663 | .958123 |
| OOF | .458758 | .501401 | .880012 | .923702 | .264249 | .616546 | .818182 | .941841 |
| OOF | .369771 | .602241 | .880728 | .923702 | .171579 | .556207 | .871658 | .889797 |
| OOF | .270143 | .703081 | .842167 | .923702 | .098199 | .487173 | .903743 | .780590 |
| OOF | .182795 | .801120 | .781784 | .923702 | .064614 | .425655 | .914439 | .649129 |
| OOF | .095901 | .901961 | .717008 | .923702 | .047170 | .355922 | .935829 | .498187 |
EEG Decoding
Electroencephalography (EEG) decoding maps brain-signal patterns to mental states, stimuli, speech, or intended actions.
See all 234 papers