LEAF: Language-EEG Aligned Foundation Model for Brain-Computer Interfaces

Muyun Jiang, Shuailei Zhang, Zhenjie Yang, Wu Mengjun, Wei Zhang, Weibang Jiang, Chenyu Liu, Zhiwei Guo, Rui Liu, Shangen Zhang, Yong Li, Yi Ding, Cuntai GuanNeurIPS 2026

TL;DR

Brain-computer interfaces (BCIs) usually decode noisy EEG signals by slapping isolated, task-specific classifiers onto neural encoders—treating "left hand" and "happy" as arbitrary numbers like 0 and 1. LEAF changes the game by using natural-language task instructions to actively shape continuous EEG representations and align them with text embeddings in a shared semantic space. By teaching a brain-signal encoder what tasks and labels actually mean, LEAF achieves state-of-the-art performance across 16 diverse BCI datasets.

What Problem Does This Paper Address?

Electroencephalography (EEG) captures brain activity at millisecond resolution without surgery, making it prime real estate for BCIs—whether you are decoding imagined movements, tracking mental workload, or recognizing emotions. The catch? EEG signals are notoriously noisy, nonstationary, and vary wildly from person to person and headset to headset.

Recently, researchers have turned to large-scale EEG foundation models to learn reusable signal representations. However, when adapting to downstream tasks, these models typically attach separate classification heads supervised by discrete, meaningless indices (0, 1, 2). The model has no idea that "Fear" and "Sad" are both emotions, or how a task instruction relates to the brainwave it is currently looking at.

Figure 1: Motivation for LEAF. (a) EEG foundation models use task-specific heads and discrete labels. (b) CLIP aligns images with textual prototypes. (c) LEAF uses task instructions to align EEG representations with textual label prototypes.

Prior attempts to bridge EEG and language (like NeuroLM) forced continuous brainwaves through discrete tokenizers to feed autoregressive language models. The authors of LEAF ask a different, CLIP-inspired question: Can natural-language instructions directly guide continuous EEG features into a clean, semantically meaningful space—while preserving the delicate spectral rhythms and temporal dynamics of the brain?

Methods

LEAF (~26.4M trainable parameters) tackles this in two distinct stages, after first unifying variable-channel EEG headsets onto a standardized 65-channel montage:

Figure 2: LEAF architecture. Left: Spectral–temporal pretraining combines frequency masking with bidirectional and causal reconstruction. Right: The instruction-conditioned Q-Former aligns EEG features with textual label prototypes from a frozen text encoder.
  1. Pretraining via Joint Spectral–Temporal Reconstruction (STR): Before touching language, the encoder needs to understand raw brainwaves. Each EEG window undergoes randomized frequency masking (using FFT to knock out a random frequency band, then iFFT back to time-domain) to prevent over-reliance on narrow spectral bands. After lightweight convolutional tokenization, the sequence splits into dual transformer towers: a bidirectional branch reconstructing randomly masked windows (capturing broader context) and a causal branch predicting sequential windows (capturing ordered transitions).
  2. Alignment via Instruction-Conditioned Q-Former (IQF): In stage two, outputs from both EEG towers are concatenated. A frozen text encoder (all-mpnet-base-v2) embeds a natural-language prompt—blending the task description (e.g., "Decode emotion from EEG") with candidate label prototypes. Using Feature-wise Linear Modulation (FiLM), this text vector scales and shifts the EEG tokens directly. Next, a small set of shared, learnable queries extracts task-relevant neural evidence via multi-layer cross-attention (a Q-Former). Finally, a contrastive cross-entropy loss pulls the output toward the ground-truth text label prototype while pushing away all other labels in the global vocabulary.

At test time, LEAF supports direct inference (picking the class prototype with highest cosine similarity, zero extra parameters needed) or supervised finetuning (attaching a task-specific MLP head to the instruction-tuned EEG encoder).

Datasets

No new datasets are introduced, but the scale of unification is extensive:

  • Self-Supervised Pretraining (~885.7 hours, 325,046 segments at 200 Hz): Six public corpora—Stieger2021, SEED-FRA, SEED-GER, SEED-SD, LargeSpanish, and ThinkOutLoud.
  • Instruction Tuning & Evaluation (16 Datasets): Covers five distinct BCI paradigms using strict cross-subject or cross-trial splits:
  • Motor Imagery (8): BCIC-IV-2a, OpenBMI-MI, BCIC-Upperlimb, SHU-MI, HighGamma, Cho2017, Shin2017A, PhysioNet-MI.
  • Emotion Recognition (5): FACED, SEED, SEED-IV, SEED-V, SEED-VII.
  • Other Paradigms (3): OpenBMI-SSVEP (visual frequency), Mental Workload, and BCIC-Speech (covert speech).

Key Insights and Ideas

  • Language acts as a geometric organizer for brainwaves: Conditioning EEG tokens on text instructions doesn't just map modalities; UMAP and density analyses reveal it measurably shrinks intra-class variance and expands inter-class distance, pulling noisy neural trials into tight clusters around their text prototypes.
  • Explicitly naming candidate targets helps: During direct inference without parameter updates, feeding the model both the task description and candidate target labels boosts decoding accuracy over giving the task description alone (50.04% vs. 48.67%), and beats a generic prompt by 2.66 percentage points.
  • Queries dynamically specialize across layers: PCA visualizations of the Q-Former's learnable queries show them starting from a shared initialization and progressively fanning out layer-by-layer into distinct, task-tailored configurations depending on whether they are reading motor imagery, emotion, or SSVEP signals.
  • Neurophysiologically grounded attention: Gradient saliency maps confirm LEAF isn't relying on artifacts—it naturally attends to the motor cortex for movement tasks, frontal/temporal areas for emotion, and the occipital lobe for visual SSVEP tasks.

Key Results

Evaluated against four traditional deep-learning baselines (including EEGNet and Conformer) and four modern EEG foundation models (BIOT, EEGPT, LaBraM, CBraMod):

  • Overall Supervised Finetuning: LEAF ranks 1st in balanced accuracy on 12 of the 16 datasets, achieving a 16-dataset average of 64.14% (surpassing the strongest baseline, CBraMod, at 61.50%).
  • Strong Paradigm Gains: LEAF averages 70.34% across the eight motor imagery datasets and 49.88% across emotion datasets—highlighted by a 6.19 percentage point jump over the best baseline on the 5-class SEED-V emotion benchmark (41.26% vs. 35.07%) and 94.62% balanced accuracy on OpenBMI-SSVEP.
  • Smaller Text Encoders Can Win: Interestingly, in ablations, the compact all-mpnet-base-v2 outperformed much larger text models like Qwen3-Embedding-4B (50.04% vs. 47.97% direct inference accuracy).

Limitations and Future Work

While the main text does not feature a dedicated limitations section, the authors candidly highlight several boundaries in their experimental setup and results:

  • Direct inference is not yet zero-shot: Because multi-task instruction tuning uses the training splits of the 16 evaluation datasets, direct inference measures parameter-free decoding on held-out test splits of previously seen tasks, rather than zero-shot generalization to entirely novel BCI paradigms.
  • Transfer benefits aren't universal: Under supervised finetuning, LEAF trails baselines on 4 of the 16 datasets (OpenBMI-MI, SHU-MI, PhysioNet-MI, and SEED), showing that cross-task foundation pretraining varies in effectiveness across specific recording setups.
  • Narrow statistical margins in ablations: The authors note that several architectural ablation differences (such as transformer depth) and small sub-percentage gains on certain datasets should be weighed carefully alongside seed-to-seed variance rather than treated as sweeping statistical victories.

Summary updated

Abstract

Electroencephalography (EEG) foundation models learn transferable representations for brain–computer interfaces, but existing approaches treat tasks and labels as discrete targets and fail to use the semantic structure of natural-language task instructions to guide representation learning. We present LEAF, a foundation model for EEG–Language Alignment with Semantic Task Instruction and Querying. LEAF integrates task-aware semantic guidance to produce structured and linguistically aligned EEG embeddings, thereby enhancing decoding robustness and transferability. In the EEG pretraining stage, we introduce a joint Spectral–Temporal Reconstruction (STR) framework that captures the coupled spectral rhythms and temporal dynamics of EEG signals. STR applies randomized spectral perturbation to enhance frequency robustness and uses two complementary temporal objectives to learn both contextual and sequential structure. In the EEG-Language alignment stage, we propose the Instruction-conditioned Q-Former (IQF). This query-based cross-attention transformer injects instruction embeddings into EEG tokens and achieves semantic alignment with textual label embeddings through learnable queries. We evaluate LEAF on 16 downstream datasets spanning motor imagery, emotion recognition, steady-state visual evoked potentials, covert speech, and mental-workload decoding. Under supervised finetuning, LEAF achieves the best balanced accuracy on 12 of the 16 datasets and the strongest average performance across the evaluated paradigms. Further analyses show that instruction conditioning reduces intra-class variation, increases inter-class separation, and aligns EEG representations more closely with textual class prototypes. These findings support the use of task instructions as semantic priors for transferable EEG decoding. Code is available at https://github.com/Jiang-Muyun/LEAF.
BibTeX
@inproceedings{jiang2026leaf,
  author = {Muyun Jiang and Shuailei Zhang and Zhenjie Yang and Wu Mengjun and Wei Zhang and Weibang Jiang and Chenyu Liu and Zhiwei Guo and Rui Liu and Shangen Zhang and Yong Li and Yi Ding and Cuntai Guan},
  title = {{LEAF: Language-EEG Aligned Foundation Model for Brain-Computer Interfaces}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=Ao4vGWr7BX},
}
Figure