Attention Dilution as a Label Tax in EEG Foundation Models

EEG foundation models are Transformers pretrained on thousands of hours of unlabeled brain recordings so that a downstream task, such as detecting seizures or abnormal EEG, needs only a few expert labels. They work by cutting a recording into many short patches (tokens) and letting every token attend to every other one. The attention weights must sum to one, so when a diagnostic event occupies a few seconds of a long window, its share of attention shrinks as the window grows. This is attention dilution. We propose that dilution is more than a long-context curiosity in label-scarce medicine: it acts as a label tax. A diluted event contributes only a small fraction of the pooled representation, so a classifier needs many more labeled examples to find it.

The proposal makes this claim measurable and offers a very cheap fix. On real EEG, we plant events at controlled durations within windows of controlled length and measure how many labels a pretrained model needs to reach a target accuracy. We then test whether retraining only a few hundred per-head attention temperatures, alongside the classifier, removes that tax. The temperature is the scalar that sets how sharply a head concentrates its weights. If the fix works, it is a near-free adaptation recipe for clinical Transformers. If it fails while a short-window pooling baseline succeeds, then the bottleneck is aggregation, not attention, and that is also worth knowing.

Core Claim

Let $\rho$ be the fraction of tokens in a window that carry the diagnostic event. Suppose a head spreads its attention roughly uniformly. The event's contribution to the pooled feature then scales with $\rho$.

Background EEG variability is largely shared across tokens within a recording, because subject and session effects do not cancel under averaging. The margin of a linear readout therefore also scales with $\rho$. Standard margin-based sample complexity, where labels needed scale as one over the squared margin, then gives

$$N^*(\rho) \propto \rho^{-2},$$

where $N^*$ is the number of labels needed to reach a fixed AUROC (area under the ROC curve). A model whose attention concentrates on event tokens should show a much flatter curve.

Our central, falsifiable claim has two parts. First, current EEG Transformers sit near the steep regime on realistic clinical windows. Second, letting each head learn its own temperature from the few downstream labels moves them substantially toward the flat regime, more so than low-rank adapters, uniform temperature changes, or fixed length-dependent scaling.

The idea is new in where it places the problem. Prior dilution work treats it as a failure of length extrapolation. Prior label-efficiency work treats sample complexity as a property of pretraining. We treat dilution as a determinant of label cost, and temperature as the parameter to spend labels on.

Relation to Prior Work

The motivating theory comes from three papers. Theoretical Limitations of Self-Attention in Neural Sequence Models proves that the influence of a single token on soft attention decays as $O(1/n)$ with sequence length $n$. Overcoming a Theoretical Limitation of Self-Attention shows that scaling logits by $\log n$ counteracts this decay, but notes that the dilution-free solutions are hard to reach by gradient descent. Focus and Dilution: The Multi-stage Learning Process of Attention shows that training itself alternates between concentrating and spreading attention. That result warns us not to assume lower entropy is always better, since few-label fine-tuning could just as easily over-concentrate on spurious features.

The method comes from Length Generalization of Causal Transformers without Position Encoding. Its HeadScale technique tunes 704 head-specific temperature parameters, on 0.03% of the original data, to repair an entropy spike past the training length. That work reports PG19 perplexity falling from above 1,000 to 18.3, and finds uniform scaling across heads clearly worse. HeadScale was built for length extension in language modeling. We reuse it for a different purpose: adaptation with few labels, on a different modality.

Selective Attention: Enhancing Transformer through Principled Context Control learns query-dependent temperatures. We use its argument that fixed scaling conflates what a head attends to with how sharply it attends. Its full mechanism, however, requires pretraining, and we restrict ourselves to post-hoc adaptation. LookSharp: Attention Entropy Minimization for Test-Time Adaptation minimizes the entropy of the final-layer classification token's attention without labels on corrupted images. It is the closest prior use of attention sharpness for adaptation. We differ in three ways: we use labels, we learn temperatures in every layer rather than penalizing a single map, and we allow learned temperatures to increase entropy where that helps.

The application side is EEG foundation models that all use dense softmax over many patches. Large Brain Model for Learning Generic Representations with Tremendous EEG Data in BCI (LaBraM) makes one token per channel-second, so a 64-channel minute produces 3,840 tokens. CBraMod: A Criss-Cross Brain Foundation Model for EEG Decoding splits attention into separate spatial and temporal passes, which shortens each attention sequence. Brant: Foundation Model for Intracranial Neural Signal reports a 10x label-efficiency gain on seizure detection. None of these papers measures attention entropy or reports systematic 1–10% label curves.

The constraining evidence is Benchmarking ECG FMs: A Reality Check Across Clinical Tasks. It finds that a 3.8M-parameter state-space model (ECG-CPC, a recurrent-style sequence model with no softmax) beats Transformers 25 times larger in 5 of 7 categories. It also finds that a Transformer, ECG-JEPA, is the most label-efficient model below 1,000 samples. Our study tests whether dilution explains part of this gap.

Research Program

The first component is a planted-event benchmark built from real data. We take normal-background windows from TUAB, the abnormal-EEG subset of the Temple University corpus. Into them we insert real annotated event segments drawn from TUEV, such as spike-and-sharp-wave and periodic discharges, using amplitude-matched blending. Each window then has known event duration and known window length $T$. The task is binary: event present or absent, with recordings split by subject.

We sweep three factors. The duty cycle $\rho$ takes values from about 1/4 down to about 1/64. The window length $T$ runs up to and beyond each model's pretraining window. The label budget $N$ ranges from roughly 50 to several thousand. For each configuration we estimate $N^*(\rho,T)$ and fit the slope of $\log N^*$ against $\log \rho$.

Alongside label cost we log two attention diagnostics per head and layer. The first is attention entropy. The second is the attention mass that falls on the planted event tokens. Together these let us link label cost to the attention mechanism rather than infer it.

The second component is the intervention. We freeze the pretrained LaBraM and CBraMod encoders, using their public GitHub implementations (935963004/LaBraM and wjq-learning/CBraMod). We then train a per-head, per-layer inverse temperature $\lambda^{(\ell,h)}$, which multiplies that head's logits, together with the classification head.

That is a few hundred extra parameters. We initialize every temperature at one and place no sign constraint on the change, so a head may sharpen or broaden. For each condition we analyze which heads move and in which direction. This tests the Focus-and-Dilution prediction that some heads should broaden rather than sharpen.

The third component transfers the analysis to real clinical tasks. We use TUAB, TUEV, and CHB-MIT seizure detection at 1%, 5%, 10%, and 100% of training labels. As a secondary check of the state-space tension, we run the 12-lead ECG benchmark with ECG-JEPA, with and without temperature tuning, against ECG-CPC.

Baselines

The naive reference point is a linear probe on the frozen encoder with its original temperatures. This measures the label tax as the pretrained model ships. It uses the same splits and label budgets, with the probe's learning rate and weight decay tuned over the same grid as every other method. The second reference is full fine-tuning of the encoder, which is the default practice in the LaBraM and CBraMod papers. We give it an equal hyperparameter search budget and report the best of several seeds per label budget.

The strongest existing number on the real tasks is LaBraM-Huge, which Large Brain Model for Learning Generic Representations with Tremendous EEG Data in BCI reports at TUAB AUROC 0.9162 and TUEV balanced accuracy 0.6616 with full labels. No reported result was found on Lacuna for these models at 1–10% label budgets, so we produce those curves ourselves.

The strongest parameter-efficient competitor is low-rank adaptation of the attention projections, which trains small low-rank updates to the attention weight matrices. Here we match the trained-parameter count at its smallest rank, and also report a larger rank, so that any gain from temperature tuning cannot be attributed simply to having fewer parameters to overfit. Beating it means one of two things: lower $N^*$ at the same target AUROC on at least two of the three clinical tasks, or matching it with an order of magnitude fewer trained parameters together with a flatter $\rho$ slope on the planted benchmark.

Three ablations isolate the key ingredient. The first is a single shared temperature for all heads, which tests whether head specificity matters, as HeadScale found it did for text. The second is fixed $\log n$ logit scaling following Overcoming a Theoretical Limitation of Self-Attention, which tests whether a learned temperature is needed at all. The third is an entropy penalty on attention during fine-tuning, in the style of LookSharp: Attention Entropy Minimization for Test-Time Adaptation, which tests whether direction-free, label-driven temperatures beat a fixed push toward sharpness.

We also separate where the effect comes from. In one variant temperatures are tuned only in the final pooling attention; in the other, in all layers. This tells us whether dilution is fixed at readout or inside the encoder.

Why not just…?

Why not just use shorter windows and max-pool their predictions? This is the most serious threat. Classifying 1–2 second windows and taking the maximum over the recording treats the problem as multiple-instance learning, where a recording-level label must be traced to whichever short window contains the event. That sidesteps dilution entirely. Coarser patching is weaker, because it smears fast transients; that is the same concern that led Advancing Radiograph Representation Learning with Masked Record Modeling to add super-resolution reconstruction for fine detail. Short-window max-pooling, however, keeps full temporal resolution. We therefore include it, along with a learned attention-pooling variant, at matched label budgets.

Short-window pooling should lose when diagnosis depends on context across windows, such as evolving seizure onset or whether a discharge is periodic. It should win on isolated events. If it matches temperature tuning everywhere, including at low $\rho$, we will report that the label tax is real but best paid by restructuring aggregation, and drop the temperature recipe as the headline.

Why not just use a state-space model? Benchmarking ECG FMs: A Reality Check Across Clinical Tasks shows compact state-space models are excellent on ECG. It also shows a Transformer winning below 1,000 labels, and Transformers remain the default for EEG because channel layouts vary across hospitals. We include a state-space baseline trained with contrastive predictive coding on the planted benchmark. If its $\rho$ slope is flat while softmax Transformers are steep and temperature tuning closes the gap, that is direct evidence that dilution explains part of the Transformer deficit.

Why not just retune the softmax temperature once, globally? HeadScale's ablation found uniform scaling worse than per-head scaling for length extension. Selective Attention argues that a single scale cannot serve both heads that should stay broad and heads that should sharpen. Neither result was obtained on biosignals or with few labels, so the shared-temperature and $\log n$ ablations test this directly. If they match per-head tuning, the simpler recipe is the result and we will say so.

Decisive Checks

The proposal stands or falls on three outcomes. On the planted benchmark, the frozen linear probe should show a $\log N^*$ versus $\log \rho$ slope substantially steeper than zero, approaching the predicted $-2$. The steepness should grow once $T$ exceeds the pretraining window, and the attention mass on event tokens should fall in step. If the slope is already flat, there is no label tax and the program ends there.

Per-head temperature tuning should flatten that slope and raise event-token attention mass more than low-rank adaptation and the uniform and $\log n$ ablations. If it does not, temperature is not the right parameter to spend labels on.

On TUAB, TUEV, and CHB-MIT at 1–10% labels, the gains should be largest exactly where events are brief relative to the window. They should be smallest on TUAB-style abnormality detection, where the abnormal signal is spread across the whole recording. This dose-response pattern, rather than a single average improvement, is what would show that the mechanism is dilution and not generic regularization.