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.
MAGE works in three main stages:
- 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).
- 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).
- 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.
- 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).
- 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