MAGE: Towards Generalizable Multi-timescale EEG Representations

Tuan-Kiet Doan, Van-Chien Nguyen, Trung-Hieu Tran, Quang Hung Pham, Ngoc-Son Vu, Huy Phan, Phi Le Nguyen, Duc Han Le, Nikola Simidjievski, Van-Tam NguyenNeurIPS 2026

TL;DR

Brainwaves operate like a symphony—some thoughts play out as rapid, fleeting staccatos, while others hum along as slow, rolling basslines. Existing AI foundation models for brain data chop signals into a single, rigid window size, inevitably missing half the music. Meet MAGE, a tiny 0.6-million-parameter foundation model that slices brainwaves across multiple timescales at once and dynamically tunes in to whichever rhythm a specific task requires—beating models up to 40 times its size.

What Problem Does This Paper Address?

Electroencephalography (EEG)—recording electrical brain activity via scalp sensors—is a goldmine for healthcare, neuroscience, and brain-computer interfaces. Because labeled brain data is scarce, researchers have turned to self-supervised foundation models pretrained on massive amounts of raw, unlabeled EEG.

However, almost all current EEG foundation models share a blind spot: single-timescale tokenization. To feed continuous waves into a Transformer, they chop the signal into fixed-size time windows (patches). This creates a classic time-frequency bottleneck:

  • Short windows catch fast, transient spikes (like high-frequency $\gamma$ waves in emotion recognition or seizure transients) but miss the big picture.
  • Long windows capture slow oscillations (like $\delta$ waves in sleep staging) but blur out rapid details.

Because different brain decoding tasks rely on completely different frequency bands, locking a foundation model into one fixed window size limits how well it can generalize.

Methods

The authors introduce MAGE (Multi-timescale Adaptive Generalization for EEG), an architecture that treats different temporal scales like specialized "experts" in a Mixture-of-Experts (MoE) system.

Figure 1: Overview of the MAGE pretraining pipeline. MAGE employs (A) Multi-timescale tokenization and (B) Multi-timescale encoder, optimized with a dual-loss scheme for both semantic and fine-grained learning. (C) Multi-timescale Aggregator dynamically weights each scale for the final reconstruction.

MAGE works in three main stages:

  1. Multi-timescale Tokenization: Instead of choosing one window size, MAGE chops the raw EEG signal into three parallel patch sizes simultaneously: 250ms, 500ms, and 1 second. Each patch is embedded using both 1D convolutions (for local time shapes) and Fast Fourier Transforms (for frequency spectra).
  2. Multi-timescale Attention (MtA): Within each scale, MAGE processes data in two sequential steps: Temporal Attention (tracking how a single sensor's signal evolves over time) followed by Spatial Attention (mapping how different brain regions talk to each other).
  3. The Trainable Aggregator (The Secret Sauce): Rather than smashing all scales together equally, a lightweight aggregator inspects the raw input's global time and frequency properties and outputs dynamic importance weights for each scale. To prevent "mode collapse"—where the network lazily relies on just one scale and ignores the others—the authors inject slight Gaussian noise into the aggregator's decisions during training.

For self-supervised pretraining, MAGE masks 70% of the input patches and optimizes a dual loss: a teacher-student alignment loss (predicting semantic representations) and a reconstruction loss (rebuilding the raw wave from the dynamically weighted scales). During downstream tasks, the pretrained encoder is kept frozen while only task-specific heads and the lightweight aggregator are fine-tuned.

Datasets

  • Pretraining: A ~500-hour subset of the Temple University Hospital EEG corpus (TUEG) using 19 standard EEG channels. (Scaling up to 2,500 hours showed diminishing returns!)
  • Downstream Evaluation: Seven diverse public benchmarks—motor imagery (BCIC-IV-2a, PhysioNet-MI, SHU-MI), emotion recognition (FACED), clinical anomaly detection (TUAB), error-related negativity (KaggleERN), and sleep staging (Sleep-EDFx). No new datasets were introduced, though the authors used rigorous multi-fold cross-subject splits rather than a single fixed split.

Key Insights and Ideas

  • Different tasks genuinely crave different clocks: When left to learn on its own, MAGE's aggregator naturally aligns with neuroscience intuition. As shown below, emotion recognition (FACED) puts ~60% of its weight on fast 250ms windows, whereas sleep staging (Sleep-EDFx) puts ~50% of its weight on slow 1-second windows.
Distribution of importance weights across timescales, showing fast scales dominating emotion recognition (FACED) and slow scales dominating sleep staging (Sleep-EDFx).
  • Smart inductive bias beats brute-force scale: By explicitly separating and weighting timescales, MAGE doesn't need massive parameter counts to untangle overlapping frequencies. It outperforms 4M–25M parameter models with just 0.6M parameters.
  • Dynamic routing for edge devices: The authors test MAGE-router, a variant that activates only the single highest-weighted scale per sample. While accuracy dips slightly compared to fusing all scales, it eliminates manual window-size tuning while slashing compute for low-power wearables.

Key Results

Across the seven benchmarks, MAGE achieves the highest overall average rank (2.14), comfortably beating the runner-up CSBrain (3.31, 8.9M parameters) and massive models like EEGPT (6.14, 25.0M parameters).

Table 1: Comparison of MAGE with existing foundation models across various downstream tasks, metrics, and test subjects. Numbers under model names indicate parameter sizes in millions (M). MAGE-froz denotes MAGE where the aggregator is kept frozen during downstream evaluation. MAGE achieves the highest average ranking among all models. Bold indicates the best result, and underlined indicates the second best. The symbol ↓indicates that the baseline model is significantly worse than MAGE, while ↑indicates that the baseline model is significantly better than MAGE based on the corrected two-sided paired t-test (p < 0.05). The average rank is calculated across all metrics.
  • Consistent Gains: MAGE outperforms fixed-patch baselines by 2–3% on BCIC-IV-2a, PhysioNet-MI, FACED, TUAB, and KaggleERN, and ties top performers on Sleep-EDFx and SHU-MI.
  • Fine-tuning the Aggregator Matters: Freezing the aggregator during downstream tasks (MAGE-froz) works surprisingly well on motor imagery, but causes a 3–4% drop on Sleep-EDFx—proving that letting downstream tasks re-balance timescales is vital when scales vary wildly in usefulness.
  • Multi-scale > Any Single Scale: In ablation studies, full MAGE achieves an average rank of 1.08, beating every isolated single-scale version of itself (250ms, 500ms, or 1s alone).

Limitations and Future Work

  • Hand-picked scales: MAGE still relies on a manually pre-defined menu of patch sizes (250ms, 500ms, 1s). Future work aims to generate or select continuous scales dynamically.
  • Compute overhead: Running attention across multiple token sequences simultaneously scales quadratically with sequence length, which the authors hope to streamline.
  • Puzzling dataset quirks: Two motor imagery datasets (SHU-MI and PhysioNet-MI) preferred opposite timescales—likely due to differences in cue designs, session structures, or sensor layouts rather than universal biology.
  • Multimodal horizons: Looking ahead, the authors plan to align MAGE with other physiological signals like heartbeats (ECG), muscle activity (EMG), speech, and fMRI.

Summary updated

Abstract

Electroencephalography (EEG) data plays an important role in understanding human brain activity, with various major applications. While current approaches, which largely build on EEG foundation models, have demonstrated strong performance across datasets and tasks, they typically rely on a fixed temporal scale. This design choice limits their ability to capture characteristics of neural dynamic behavior, often spanning across multiple timescales, which are naturally captured in EEG recordings. To address this limitation, we propose MAGE (**Multi-timescale Adaptive Generalization for EEG**), a foundation model that dynamically adapts to capture and integrate information across different timescales. Specifically, MAGE combines two key mechanisms: (i) a novel multi-timescale attention mechanism, capable of learning representations across multiple temporal scales, and (ii) a trainable aggregation module that dynamically identifies and adapts to the most informative timescale of the input signal. Experimental results across seven datasets demonstrate that MAGE consistently outperforms existing EEG foundation models while using substantially fewer parameters. Moreover, our results support the hypothesis that different downstream tasks benefit from distinct temporal scales.
BibTeX
@inproceedings{doan2026mage,
  author = {Tuan-Kiet Doan and Van-Chien Nguyen and Trung-Hieu Tran and Quang Hung Pham and Ngoc-Son Vu and Huy Phan and Phi Le Nguyen and Duc Han LE and Nikola Simidjievski and Van-Tam Nguyen},
  title = {{MAGE: Towards Generalizable Multi-timescale EEG Representations}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=cBtjuprKBt},
}

Loading related content...

Figure