Code

Brain–computer interfaces · Neural decoding · Evaluation

We fed a sentence decoder noise instead of brain signals. It still picked the right sentence 66% of the time.

The score
A high score can come from anywhere.

The brain, the recording's length, the language model's knowledge of sentences, a lenient metric: the finished text cannot tell them apart.

The user
Only one source is the user's voice.

For someone who speaks through a brain–computer interface, only what is read from their brain is theirs.

We turn this from an assumption into a measurement: read the score before the language model enters, and give each source its own test.

Research questionWhere does a brain decoder's score come from, and when can a gain be credited to the brain?

Our answer
  1. Where does the score come from?In the pipeline we examined, much of it came from a shortcut in the input. Like many sentence-level designs, it pads each recording to a common length and marks where the real signal ends; with a weak brain signal, that length is an easy cue to learn. Read before its language model, noise that keeps only the length picks the right sentence 66.3% of the time, against 90.8% for real MEG. The point is not that the decoder fails, but that its output score cannot show how much of it comes from the brain.
  2. Where can you see it?Only before the language model. At the output, the language model writes fluent text from anything and lenient metrics reward it, so the shortcut hides. Read the score just before the language model, as a ranking of the test stimuli with a known chance level, and it shows. Read there with length removed, the brain alone still ranks the right audio first 44% of the time among 1,464 candidates, about 650 times chance.
  3. What counts as a real gain from context?One that disappears when the brain signal does. A bigger gain is not a better one. A context step that just matches sentences by length raises the score by up to 16.8 points, and with no brain signal at all it still scores about 22 times chance. A gain can be credited to the brain only if it shrinks as the brain evidence weakens and vanishes without it, as our sentence pooling does.
See how, step by step ↓

Problem

Where does the score come from? It depends where you look.

A typical brain-to-text system passes a recording through an encoder and then a language or speech model that writes the text, which a metric then scores. Everything after the encoder can add score without the brain: the language model writes fluent sentences on its own, and text metrics are lenient. The same noise test therefore gives opposite answers depending on where the score is read:

Recording
→
Encoder
→
① Read here
① Before the language model
Noise still scores 66%
→
Language model
→
Text
→
② Read here
② At the output
Looks clean

Noise tests reported for such pipelines replace the whole input and score the generated text, which comes out near zero. Yet the metric itself is lenient: a fixed filler like “the the”, which ignores the brain entirely, gets a BERTScore of 0.87 against real sentences.

Read before the language model, where the score is a ranking of the test sentences with a known chance level, noise that keeps only each recording's length still picks the right sentence two times out of three.

Observation

A length shortcut in the input

Many sentence-level pipelines pad every recording to a common length and tell the model where the real signal ends. That length travels with the input into the decoder. When the brain signal is weak, it can become the easiest cue to learn, and a score read at the output includes it without saying so.

Length works like a key
Illustrative example
2.4 s

Why was this not caught before? Two earlier checks point the other way. In invasive recordings from the brain surface, a network given noise of the right length stayed near chance; the signal there is far stronger. And noise tests on non-invasive decoders replaced the whole input and scored the output text, which came out near zero. The shortcut shows up only when the score is read before the language model and the test replaces only the brain content. Changing how the data are split can hide it at test time, but only a readout like this tells you how much of what remains comes from the brain.

Method

Source attribution: read early, test each source

Before any text is written, the test stimuli form a known, finite set, so the readout can simply rank them: the right one should come first, and chance is one over the number of candidates. Any encoder–decoder system can be read this way without retraining. Then each source of the score gets a test that removes it and keeps everything else.

Structure in the input

Replace only the brain content with noise, keep length and padding. What still scores comes from structure, not the brain.

Evidence within a window

Use fixed 3-second windows locked to each word, with test stimuli never heard in training. What still scores must come from the brain.

Context across windows

Add context back as a separate step on top of those scores, and test whether its gain depends on the brain evidence.

Brain evidence

What the brain signal supports on its own

A different task from here onAbove, a whole sentence-long recording had to pick the right sentence (90.8%). From here on, a 3-second window has to pick the right 3-second audio clip among 1,464, so length cannot help. The numbers below are not comparable with those above.

With length removed, a 3-second MEG window is matched against the audio of every word window in the test set. Real MEG ranks the right audio first 44.4% of the time among 1,464 candidates, about 650 times chance, and 21.7% among 825 on a second dataset. Noise stays at chance. Every single participant is above chance.

This score reads the word, not the sentence around it: when it is wrong, its top pick lies in the right sentence only 1.0% of the time, the same as expected from sentence lengths alone (1.1%). So what would knowing the sentence add?

Same brain scores, two candidate pools
All 1,464 candidatesOnly the right sentence

Ranked only within the right sentence, the same scores put the right word first 88% of the time instead of 44%. That gap is what context could legitimately recover, if it can find the right sentence from the brain evidence.

Criterion

When can a gain from context be credited to the brain?

We add context back with a simple, training-free step: pool the scores of all windows in a sentence to guess which sentence they come from, and nudge the candidates of that sentence up. It raises accuracy from 44.4% to 52.1%, and from 21.7% to 28.6% on the second dataset. But a language model also “adds context”, and it can produce fluent sentences from noise. What separates a gain built on the brain from one that stands in for it?

PredictionIf this gain really builds on the brain signal, it must shrink as the brain signal weakens and disappear when none is left. A step that stands in for the brain would not.

Result

Weaken the brain signal, watch the gain

We blend each MEG window with a mismatched one, step by step, until no brain evidence for the right word remains. For comparison we run a second context step that ignores the brain and simply picks the sentences whose length matches.

Gain from context as brain evidence is removed (MEG-MASC)
100%
Sentence pooling (ours) Length matching
Brain-only accuracy
44.4%
Gain, sentence pooling
+7.7
Gain, length matching
+5.6

Our gain falls with the brain evidence and reaches zero when none is left. The length-matching step does the opposite: its gain peaks at 16.8 points when half the evidence is gone, and with no brain evidence at all it still scores about 22 times chance. It uses sentence structure in place of the brain.

Both steps use sentence structure. Only one of them needs the brain.

The same holds without any intervention. Across 123 participants, the gain rises with how well each person's brain signal is decoded on its own, and it is positive for every one of them:

One point per participant
MEG-MASC (27)MOUS (96)

Spearman correlation 0.88 on MEG-MASC and 0.90 on MOUS. On EEG, where brain-only accuracy is near chance, the same step yields no gain.

Impact

From assumption to measurement

Non-invasive decoders now write fluent sentences, and whether they read the brain has so far been assumed from the score. For someone who will one day speak through such a system, that is the question that matters. Source attribution answers it with three checks that need no change to a system's task, architecture or training:

  1. Look for training shortcuts. Replace only the brain content, keep length and padding, and see how much score survives.
  2. Read the score before the language model. There it is a ranking with a known chance level, and the language model and the metric cannot add to it.
  3. Credit context only if it needs the brain. Its gain must shrink as the brain evidence weakens and disappear without it.

A score is progress in reading the brain only if the brain is where it comes from.

Paper

Abstract

Source attribution overview: the readout sits before the decoder; panels show structure in the input, evidence within a window, and context across windows.
Source attribution: where the score is read out, and the three sources it is traced to. The readout sits before the decoder and ranks the correct stimulus among the test stimuli, so the decoder's prior and the text metric do not enter the score. (a) Duration-preserving noise shows how much of the score non-neural cues support. (b) Fixed-duration windows are ranked against the time-aligned audio of held-out stimuli. (c) A contextual stage pools frozen window scores within a sentence; the readout before and after it attributes the change to that stage.

Non-invasive neural language decoding has advanced rapidly, with end-to-end systems now turning MEG and EEG into fluent sentences. However, a high score may come from the decoder's language prior, the text metric, or the input structure rather than the brain, and the output alone cannot distinguish them. In this work, we ask where such scores come from. We find that in an end-to-end sentence decoding pipeline, input duration alone supports most of the score: scored before the decoder, Gaussian noise of the same duration keeps 66.3% sentence-retrieval R@1 against 90.8% for real MEG, a shortcut absent from an earlier invasive ECoG control and missed by noise controls scored at the output. We propose source attribution, which reads the score out at the decoder's input, where evaluation becomes retrieval with a known chance level, and gives each of three sources—structure in the input, evidence within a window, and context across windows—its own control. With duration removed, word-locked MEG windows still identify their audio among 1,464 candidates for 44% of windows, while noise stays at chance. We further state that a contextual gain can be credited to the brain only if it falls with this local evidence and vanishes without it. A training-free aggregation meets this criterion on two MEG datasets, raising R@1 by 7.7 and 6.9 points, and yields no spurious gain on EEG, where local evidence is very weak; a stage that uses sentence length in place of evidence fails it. Crucially, source attribution requires no change to a pipeline's task, architecture, or training, suggesting broad applicability across encoder–decoder pipelines. By turning whether a decoder reads the brain from an assumption into a measurement, it lays a foundation for trustworthy non-invasive language decoding.