An Instantaneous Voice-Synthesis Neuroprosthesis

A man with ALS tries to speak. Four electrode arrays, a transformer and a vocoder turn his brain activity into his voice every 10 milliseconds, so he hears himself as he tries.

Learn how one decoder reads 256 electrodes, trains without a recording of the speaker, and plays a voice, a question mark or a sung note while the person is still trying to speak.

Pick a way to play the voice back, then lengthen the sentence. See when he first hears a sound. Then we build, piece by piece, everything underneath: the signal, the target, the decoder, the deadline and the score.

You need a rough idea of what a neuron's spike is (a brief electrical pulse) and what a neural network does (maps numbers to numbers). We build the rest from zero.

Paper: Wairagkar, Card, Singer-Clark, Hou, Iacobacci, Miller, Hochberg, Brandman and Stavisky, “An instantaneous voice-synthesis neuroprosthesis”, Nature 2025 (doi:10.1038/s41586-025-09127-3). Context: Littlejohn et al., Nature Neuroscience 2025 (doi:10.1038/s41593-025-01905-6). Part of the lecture Real-Time Closed-Loop BCI.

Hear yourself, late or now

5

Illustrative timing: one word every 1.0 s (the paper measured 0.97 s per word when he spoke fast and 1.46 s when slow). The 10 ms frame is this paper's decoding step. The 80 ms chunk is the step size in Littlejohn et al.'s abstract; their latency is not a number printed here. Sentence-end synthesis ignores processing time, so its lag is a lower bound.

Chapter 0

Why Text on a Screen Is Not Enough

See what a person loses when a speech device waits for the end of the sentence, and what this paper builds to give it back

You sit at a dinner table. A friend starts a story, and halfway through you say, “wait, which Tuesday?” You hear your own voice as you speak. If it comes out too loud, you soften it. Your friend hears the question mark in your tone and answers at once.

Now take away the voice. A man with ALS (amyotrophic lateral sclerosis, a disease that slowly kills the nerve cells that drive muscles) loses control of his lips, tongue and breath. His speech turns into a slur that only his closest carers can follow. This is dysarthria: speech that is hard to produce, not hard to think.

The brain still plans the words. The plan just never reaches the muscles. A brain-computer interface (a BCI: a device that reads brain activity and turns it into a command) tries to catch that plan before the broken link. If you have not met the field yet, the lecture Real-Time Closed-Loop BCI sets the stage, and this page is a close reading of one paper that belongs to it.

What the earlier speech BCIs gave him

Recent speech BCIs turn the plan into text. The person tries to say a sentence. A decoder reads the brain signals, guesses the words, and prints them on a screen. This works well and is accurate. The paper cites it as a real step forward.

But text drops three things. It has no tone: “you are coming” and “you are coming?” look alike until a question mark is typed. It has no speed: the words appear after the decoder has seen enough to be sure. And it has no auditory feedback, the sound of your own voice coming back to your ears while you speak. Healthy speakers use that feedback every second without noticing.

The authors call the alternative a brain-to-voice neuroprosthesis. A neuroprosthesis is a device that replaces a lost nerve function. Here the function is making a voice. The decoder reads the brain and plays sound directly, with a delay so small that the speaker hears himself as he tries.

Three problems the paper must solve

The introduction names three unsolved problems. Each one gets chapters of its own below.

No ground truth. To train a decoder you need pairs: brain activity, and the sound it should become. This man cannot make an intelligible sound. So there is no recording of what he meant to say, and no record of when he started. Chapter 2 shows the trick.

Causal and fast. A decoder is causal if it uses only the past and the present, never the future. A text decoder can wait until the sentence ends and look at everything. A voice decoder cannot, because the sound must come out now. Chapters 3 and 5 build the decoder and its deadline.

Flexible. If the decoder picks from a fixed word list, it cannot say a made-up word, a laugh-like “hmm”, or a sung note. So the decoder must output the sound itself, not a word label. Chapters 3 and 7 cover this.

What the paper reports

The participant, called T15, is a 45-year-old man in the BrainGate2 clinical trial. Surgeons placed four silicon microelectrode arrays in his left precentral gyrus, a strip of cortex that controls movement, including speech movement. Each array has 64 electrodes, so 256 in all. An electrode is a tiny metal tip that senses the voltage from nearby neurons. The data in the paper span post-implant days 25 to 489.

From those 256 electrodes, a transformer predicts 20 numbers that describe the sound, once every 10 ms. A vocoder turns the numbers into a waveform. The whole path, from voltage to sound sample, took under 10 ms. Listeners who heard the output picked the right sentence from six choices 94.34% of the time on average. In open transcription, their median word error rate was 43.75%, against 96.43% for his own unaided speech.

The paper then goes further than words. T15 asked questions and put stress on chosen words by changing pitch. He also sang three-note melodies. We read all of this in the chapters ahead.

The road

Look back at the instrument at the top of the page. Its three playback methods are the paper's central comparison. Every part of the pipeline in this paper exists to make the 10 ms frame possible.

  1. The signal: from 30,000 voltage samples a second to 512 numbers every 10 ms.
  2. A target without a voice: how to train on speech that was never spoken.
  3. The decoder: a 600 ms window in, 20 sound features out, and a vocoder.
  4. Training for tomorrow: augmentation, a robust loss and a new model each session.
  5. The 10 ms deadline: why a frame that runs late makes the voice drift.
  6. Scoring a voice: correlation, listeners and error rates.
  7. Tone, questions and song: decoding how he wants to say it.
  8. The quiet dimensions: neural activity that does not move the voice.
  9. Field guide: numbers, terms, code, limits and links.
Why is a text-only speech BCI not enough for a conversation, according to the paper's introduction?

Chapter 1

The Signal: From Voltage to 512 Numbers

Turn a flood of raw voltage into two small counts per electrode every 10 milliseconds, and see why the threshold matters

Stand outside a stadium. You cannot hear one person, but you can tell when the crowd roars. A microelectrode listens to neurons the same way. It sits in the cortex and picks up the electrical chatter of cells around its tip. Now and then one cell fires a sharp pulse, a spike, and the pulse shows up as a short dip in the voltage.

The paper records from 256 electrodes. Each one sends 30,000 voltage samples every second. That is 7.68 million numbers a second. The decoder cannot use all of them. Its first job is to squeeze the flood into a few numbers that still carry the speech plan.

One millisecond at a time

The real-time system cuts the stream into packets of 1 ms. At 30 kHz, one packet holds 30 samples per electrode. The recording hardware band-limits the signal to 0.3 to 7.5 kHz and stores it with a resolution of 250 nV. Software then handles each packet within 1 ms, so nothing waits.

Each packet goes through three steps. First, a band-pass filter keeps 250 to 5000 Hz and drops everything slower or faster. Spikes live in this band. Slow drifts and electrical hum do not. (If filters in the frequency domain feel new, the DFT lesson builds the idea.) The paper uses a 4th-order Butterworth filter (a standard smooth-edged band-pass design), with 1 ms of padding on each side so the packet edges do not ring.

Second, linear regression referencing (LRR) removes noise shared across electrodes. Think of a noisy room: if every microphone hears the same air conditioner, you can predict that hum on one microphone from the others and subtract it. LRR does this with regression weights, recomputed after each block of recording.

Third, the system extracts two numbers per electrode from the cleaned packet. These are the two neural features.

Two features: spike counts and spike-band power

The first feature is a threshold crossing: a moment when the voltage drops below a line. We set the line for each electrode from its own noise level. That level is the RMS (root mean square): square every sample, average, take the square root. It tells you how big a typical wobble is on that wire.

θc
The voltage line for electrode c. A sample below it counts as a spike event. The paper uses −4.5 times RMS.
RMSc
The typical size of the voltage wobble on electrode c. A noisy wire gets a line further from zero, a quiet wire a line closer in.
mean(x²)
Square each voltage sample x, then average. Squaring makes dips and bumps count the same.

A worked case. Say the wobble on one electrode has RMS 10 µV. The line sits at −45 µV. A real spike dips to −70 µV, so it crosses. Noise at −30 µV does not. The count for a 10 ms bin is the number of times the voltage went from above the line to below it.

The second feature is spike-band power: the mean of the squared filtered samples in the window, clipped at 50,000 µV² so a glitch cannot dominate. Power catches the small spikes a hard threshold misses and the combined hum of many cells. Both features come from the same packet. The paper does not sort spikes into single neurons, so a crossing pools whatever fired near the tip.

Set the threshold

Top: 100 ms of a toy filtered trace with six real spikes buried in noise. Bottom: the crossing count in each 10 ms bin. Green dots are real spikes caught, red dots are noise. Drag the line from lax to strict.

−4.5

Illustrative: a made-up trace (seeded noise plus six biphasic spikes, peak sizes 4.2 to 7 noise units). The −4.5 × RMS rule and the 10 ms bins are the paper's. Each downward crossing of the line is counted.

Slide the line up to −2.5 and the bottom bars fill with red. Noise crosses the line often, and the count no longer tracks neurons. Slide it down to −6.5 and you lose real spikes. At −4.5 you catch most spikes and few false ones, which is why a fixed multiple of RMS is a common choice. The paper recomputes the RMS thresholds after every block so they follow the electrode as its noise changes.

From counts to a clean 512-number vector

The decoder works in bins of 10 ms. For each electrode, the system counts the crossings in the bin and averages the spike-band power over its ten 1-ms windows. With 256 electrodes and two features each, one bin makes a vector of 512 numbers, written 1 × 512.

Raw counts and powers vary wildly between electrodes and drift over the day. So three more steps tidy them. Each bin is passed through a logarithm, which tames the rare huge values. Then each feature is normalized: we subtract its own mean and divide by its own standard deviation, both measured over only the past 10 s. Last, each feature is causally smoothed with a sigmoid-shaped kernel (a gentle S-shaped set of weights, heavier on recent bins) over the past 1.5 s, which blends recent bins and never peeks ahead.

zt
The normalized feature at time t, in units of “how unusual is this, lately”.
yt
The log of the raw count or power in the current 10 ms bin.
μt
The mean of that feature over the past 10 s. It moves as the signal drifts.
σt
The standard deviation over the same past 10 s. It rescales a loud wire and a quiet wire to the same size.

Every step uses only past data. That rule is the thread of the whole paper. If a step peeked at the future, the voice would have to wait for it. The only exception is the zero-phase filter inside each 1 ms packet, which looks at the padding of that one packet.

The result: every 10 ms the decoder receives 1 × 512 clean numbers. The next chapters never see a voltage again.

You lower the threshold from −4.5 to −2.5 times RMS. What happens to the crossing counts?

Chapter 2

A Target Without a Voice

Build a training label for speech that was never spoken, by stretching a computer voice to fit the rhythm in his brain

Imagine you must teach a student to translate, but you have lost the answer key. All you have is the exam questions. Someone hands you a sentence they say they meant, and the student's scribbles. You can write a fresh answer key from the sentence, but you must match it to the scribbles line by line.

T15 faces the same gap. A decoder learns from pairs: an input (brain activity) and a target (the sound that activity should produce). This is supervised learning. For a healthy speaker the target is a microphone recording. For T15 the recording is a slur that no listener can follow, so it is a poor target. Worse, we do not know when he started each word. He speaks at his own pace, one slow word at a time, with pauses.

The paper's fix is to invent the target. It has three moves.

Move 1: say it perfectly with a computer voice

Every training trial shows a sentence on the screen, so the intended words are known. The authors feed the text into a text-to-speech engine (TTS: software that reads text aloud). They use the native macOS TTS. The output is clean, fast speech with the right words. But its rhythm is the computer's, not T15's.

Move 2: find his rhythm from his own brain

The rhythm unit they choose is the syllable, the beat inside a word (“wa-ter-mel-on” has four). The paper says syllables are the basic units of prosody, the pattern of stress and timing in speech. So the target must know where each syllable of T15's attempt begins and ends.

On the very first session no brain recordings existed yet. The authors used the microphone instead. They looked at the loudness envelope of his attempted speech to mark word boundaries, and corrected them by hand. After that they relied on the brain alone. A decoder trained on earlier sessions synthesized speech from the new neural data. The envelope of that rough speech gave the syllable boundaries, which people reviewed and sometimes fixed.

That is a loop: yesterday's decoder helps draw today's labels, and today's labels train tomorrow's decoder. The label is only a proxy for his intent, and the paper treats it that way.

Move 3: stretch the computer voice to fit

Now there are two sets of syllable boundaries: the computer voice's and the one read from his brain. The authors align the loudness envelope of the TTS speech to the envelope of the neurally predicted speech using dynamic time warping (DTW). DTW finds the best way to bend one time axis onto another, like sliding beads along a string so two necklaces match bead for bead. The result is a map from TTS syllables to neural syllables.

Then each TTS segment is time-stretched: slowed or sped so its length equals the matching neural segment,.

sk
How much syllable k of the TTS voice is stretched. A value of 3 makes it three times longer.
Δkneural
The length of syllable k, read from his brain-driven boundaries, in milliseconds.
ΔkTTS
The length of the same syllable in the computer's fast speech.

A worked case with four syllables, all numbers illustrative. The TTS says “wa-ter-mel-on” in 180, 160, 190 and 240 ms (770 ms in all). His neural boundaries give 700, 450, 900 and 600 ms (2,650 ms). The factors are 700/180 = 3.9, 450/160 = 2.8, 900/190 = 4.7 and 600/240 = 2.5. Each syllable gets its own factor. A single factor for the whole word would be 2,650/770 = 3.4.

Stretch the computer voice

Blue: syllables as they sit in his neural activity. Purple: the computer voice after stretching. Dotted lines mark where the purple boundaries land. Choose how to stretch, then make his rhythm more uneven.

100%

Illustrative: four syllables and all durations are made up for the demo. The paper aligns at syllable level with DTW on loudness envelopes and stretches each segment to match; it does not publish these numbers.

With “One factor for all” and an even pace, the two rows agree. Make his pace uneven and the purple boundaries drift away from the blue ones. Frames near those boundaries would carry the wrong label, and the decoder would learn blurred sounds. This is why the paper aligns by syllable.

From target waveform to 20 numbers per frame

The stretched waveform is not fed to the decoder as audio. Every 10 ms it is reduced to 20 numbers by the encoder of LPCNet, a pretrained speech model (Chapter 3 explains the other half, the vocoder). The 20 are:

Each of the 20 features is min-max scaled with the minimum and maximum seen in the training TTS data, so all lie in a similar range. The paper notes that giving all outputs a similar numeric range helps accurate prediction. The scaled features are then smoothed in time.

f̃
The scaled value of one acoustic feature, between 0 and 1 for values within the training range. The decoder predicts this number.

For the own-voice demonstration, the authors swap the TTS engine for StyleTT2, a voice-cloning TTS fine-tuned on recordings of T15 before ALS. Everything else stays the same, so the decoder learns to output a voice that sounds like his old one.

Why does the paper stretch the TTS voice syllable by syllable instead of using one stretch factor for the whole sentence?

Chapter 3

The Decoder: 600 ms In, One Frame of Voice Out

Follow one 10 ms step through the network, shape by shape, from 512 neural features to 160 samples of sound

Think of a live interpreter at a conference. The speaker talks without pause. The interpreter does not wait for the speech to end. She keeps the last few seconds in her head and says the next small piece, over and over. This decoder works the same way.

Every 10 ms the decoder looks back at the most recent 600 ms of neural features. That window holds 60 bins of 10 ms, each a vector of 512 numbers, so the input is a table of shape 60 × 512. The decoder outputs exactly one thing: a vector of 20 numbers that describes the next 10 ms of voice. Ten ms later the window slides one bin, and the decoder runs again. Consecutive windows share 59 of their 60 bins.

Why 600 ms? The paper does not give a reason, so this is our reading. Speech muscles are planned before they move, and the paper finds cortical activity rising well before a word, a “sneak peek” for the decoder. A window of the recent past can hold that preparation and the current motion, and it needs no data from the future.

The pipeline, shape by shape

The network is a transformer, the same family that powers language models. (The Transformer lesson builds it from zero; here we need only the shape of the data.) A transformer lets every time step in the window look at every other one and decide which matter. Follow the table through these stages.

  1. Halve the length. The first layer averages each pair of adjacent bins. 60 × 512 becomes 30 × 512. Information about timing stays, but the sequence is half as long, so later layers run faster.
  2. Input embedding. Two dense layers (512 then 128 units, ReLU) turn each of the 30 time steps into a 128-number summary: 30 × 128. There is a separate embedding for each week of recording, to absorb week-to-week drift in the electrodes.
  3. Transformer. A positional encoding (a tag that tells the model which step is which) is added first. ReLU is a layer that zeroes negative numbers. Dropout randomly switches off half the connections during training so the model does not memorize. Residual connections add a block's input to its output so signals flow easily. Then 8 encoder blocks, each with 4 attention heads of size 128, dropout 0.5 after attention, two feed-forward layers (256 and 128 units) and normalization at its start and end. Extra residual connections link the blocks. The shape stays 30 × 128.
  4. Pool. The 30 steps are averaged into one vector: 1 × 128.
  5. Read-out. Dense layers of 1024 and 512 units (ReLU), then a last dense layer of 20 units. The output is 1 × 20.

A quick count. The week-specific embedding has 512 × 512 + 512 weights in its first layer and 512 × 128 + 128 in its second. That is 262,656 + 65,664 = 328,320 weights, about 0.33 million, per week. The authors tuned all hyperparameters by hand with inference time in mind, because the model must finish inside a 10 ms budget (Chapter 5).

Follow one step through the decoder

Each row is one stage. The bar's height is the number of time steps, its width the number of features. Drag the stage slider, or press Play to run one 10 ms step from top to bottom.

1 of 11

All shapes and layer sizes are from the paper's Methods. Stages 9 and 10 follow the vocoder description: 20 predicted features plus 16 derived LPC features make 36, which LPCNet turns into one 10 ms frame (160 samples at 16 kHz).

From 20 numbers to sound

The 20 outputs are the same kind of numbers the target had in Chapter 2: 18 Bark cepstral coefficients, a pitch period and a pitch strength. They come out in the 0-to-1 scale, so the system first rescales each to its original range using the stored minimum and maximum.

The vocoder is the part that makes a waveform from those descriptors. The paper uses the pretrained LPCNet. It needs 16 more numbers, the linear predictive coding (LPC) coefficients. LPC models each sample as a weighted sum of the 16 samples before it, like predicting the next point of a smooth curve from its recent path. These 16 are not new information: they are computed from the 18 cepstral values. So 20 + 16 = 36 numbers go into LPCNet, and one 10 ms frame comes out, 160 samples at 16 kHz. Each frame is sent to the speaker as soon as it is ready.

The vocoder is fixed and was trained on ordinary speech, not on T15. All learning for T15 happens in the 20-number decoder.

Why predict sound, not words

A word-classifier would pick one of, say, 50 words. It cannot say a word it was never trained on. This decoder predicts acoustic features frame by frame, so any sound the feature space can describe is available. The paper shows made-up words, interjections such as “hmm” and “shoo”, and spelled-out letters. None of them were in the training tasks.

The trade is that the decoder must learn fine detail, not a clean label. That is harder, and the output is not always clear, as the scores in Chapter 6 will show.

The decoder runs every 10 ms on a 600 ms window. How many of the 60 bins in a window were also in the previous window?

Chapter 4

Training for Tomorrow's Signal

Teach a decoder on past days so it still works when the electrodes drift, using noise on purpose, a gentle loss and a fresh model each session

Tune an old radio to a station tonight. Tomorrow the dial has drifted a hair, and the voice is full of hiss. Neural recordings behave like this. An electrode shifts a few microns, the tissue around it settles, a cable picks up new noise. The brain's speech plan is the same, but the numbers that describe it change. The word for this is nonstationarity: the signal's statistics move over time.

A decoder trained only on Monday's exact numbers would stumble on Tuesday's. The paper attacks drift from five sides. You met two of them already: the 10-second rolling normalization and the thresholds recomputed after every block (Chapter 1), and the week-specific embedding layers (Chapter 3). That makes three defences. Two more remain: practice on messy copies and a fresh model each session. A third idea, a gentler loss, protects against badly labelled frames rather than drift.

Idea 1: practice on messy copies

Data augmentation means training on altered copies of each example so the model learns to ignore the alteration. The authors make 4 to 20 copies of every trial, each distorted in three ways. All sizes are in the normalized units of Chapter 1.

Make a messy copy

Blue: a clean toy trace of one feature, 120 bins (1.2 s). Pink: one augmented copy. Each slider starts at the paper's setting. Press New copy to roll fresh random values.

1.2
0.6
0.02

Illustrative: the clean trace is a made-up bump pattern and a single channel. The three s.d. values (1.2, 0.6, 0.02) are the paper's Methods; the sliders let you go past them to see each effect alone.

Set the noise to 0 and the offset to its paper value: the copy is the clean trace, lifted. Now raise the drift: the copy wanders away slowly. A model trained on all three shapes learns that a small lift, some hiss and a slow wander do not change the word.

Idea 2: a loss that forgives outliers

The loss is the number training tries to shrink: how far the predicted 20 features are from the target. With target features built by an imperfect pipeline (Chapter 2), a few frames will be badly wrong. A squared error would let those frames dominate the lesson. The paper uses the Huber loss, which is a mix: squared for small misses, linear for large ones.

Lδ(r)
The cost of one prediction whose error is r.
δ
The switch point between the two regimes. The paper sets δ = 1.35 (the text spells it “Hubert”).

Check that the two pieces meet. At |r| = δ the first gives ½δ². The second gives δ(δ − ½δ) = ½δ². They match, and so do their slopes (δ for both), so the curve has no kink. A worked case with δ = 1.35: an error of 0.5 costs 0.125, the same as squared error. An error of 3 costs 1.35 × (3 − 0.675) = 3.14, where squared error would charge 4.5.

Price an error

Three curves show the cost of an error r. Drag the error to the right and compare what each loss charges. Move δ to see where Huber changes shape.

3.00
1.35

The formulas are standard; δ = 1.35 is the paper's value. Squared loss is drawn as ½ r² so that it joins Huber smoothly.

One more detail ties the two ideas together. The target features come from a text-to-speech voice, so they are smooth and clean. The network output is trained to match them. The paper says Huber loss is less sensitive to outliers. Our reading is that a few badly aligned frames at syllable edges then pull on the fit only gently.

Idea 3: a new decoder every session

The last answer to drift is simple: retrain. For each evaluation session, the authors trained a fresh decoder on all cued-sentence trials from sessions up to a week before. That was about 4,100 to 8,300 trials, depending on the session. Training used the Adam optimizer, a constant learning rate of 5×10−4, a batch of 1,024 windows and 15 to 20 epochs. It took 20 to 40 hours on three RTX 3090 graphics cards.

One training sample is a 600 ms window of features and the 20-number target frame that follows it. Sliding the window by 10 ms makes thousands of samples from one trial. All evaluation sentences were unique: none repeated in the training or the test trials.

On day one there was no history. The team collected 180 open-loop trials from a 50-word vocabulary and trained a small decoder. That was enough to play synthesized voice back, rough but live, the same day. Later the authors showed offline that an optimized model could make it intelligible from that little data.

Why is the Huber loss a good fit for this decoder's targets?

Chapter 5

The 10 ms Deadline

See why every frame must finish before the next one starts, and how this paper compares with sentence-end and chunked streaming

A bakery has one oven and one rule: a fresh loaf must reach the shelf every 10 seconds. If the oven needs 8 seconds per loaf, the shelf is always stocked and each loaf is 8 seconds old. If the oven needs 14 seconds, each new loaf is 4 seconds later than the last. After a few minutes the shelf is hours behind. The line has not broken. It has simply fallen behind a clock that never stops.

A real-time voice decoder lives under the same rule. New neural features arrive every 10 ms. The decoder must turn each into a frame of sound within about 10 ms, forever. This is a real-time deadline. Missing it once is a glitch. Missing it every time is a voice that drifts further from the person who is trying to speak.

Two words that sound alike: latency and throughput

Throughput is how many frames the system finishes each second. It must be at least 100 per second to keep up with the 10 ms stream. Latency is how long one frame takes from the brain event to the sound in the air. Throughput decides whether the lag grows. Latency decides how big the lag is when it holds steady.

The paper reports that the entire chain, from signal acquisition to a synthesized speech frame, took less than 10 ms. The chain has several steps that run as separate asynchronous programs on the BRAND platform: the 1 ms packet feature extraction, binning and normalization, the 600 ms window, the transformer on a GPU, and the vocoder. The authors note that the largest latency in the end was not the neural network at all. It was the audio playback driver, the software that hands samples to the speaker. They lowered it later and expect more gains from better sound-driver interfaces.

This is why the authors tuned every hyperparameter by hand with inference time in mind. A deeper transformer might score slightly better, but a model that needs 12 ms per frame would break the loop. They ran inference on a single NVIDIA RTX A6000 graphics card. They also split the system into separate asynchronous nodes, so feature extraction for the next bin can run while the decoder is still working on the last one.

Real-time engineering has a second constraint: the clock never waits. A web page can show a spinner. A voice cannot. Whatever the decoder does, a frame of samples must reach the speaker every 10 ms, or the listener hears a gap.

When compute time exceeds the frame time

Let T be the frame period (10 ms) and c the time to compute one frame. If c ≤ T, each frame is finished before the next arrives, and the delay stays constant. If c > T, work arrives faster than it leaves, and a backlog builds.

lagn
How far behind the voice is after n frames, in milliseconds. This is extra delay on top of the steady delay.
n
The number of frames since the start. At 10 ms a frame, 100 frames is one second.
c
The compute time for one frame, in milliseconds.
T
The frame period. For this paper T = 10 ms.

A worked case. Let c = 14 ms. Each frame adds 14 − 10 = 4 ms of backlog. After 100 frames (1 s of speech) the voice is 400 ms late. After 300 frames (3 s) it is 1,200 ms late. Now let c = 8 ms. The max is 0, so the extra lag stays at zero forever.

Miss the deadline

The line is the extra lag against how long he has been speaking. Drag the compute time per frame past 10 ms and watch the line tilt upward. Then slide the time marker.

14.0 ms
3.0 s

The formula is exact for a system that queues every frame. The paper reports the chain finishing in under 10 ms; it does not publish a per-stage budget, so the sliders are illustrative. A real system could also drop frames, which this toy does not model.

The same deadline, three eras of speech BCI

The paper's introduction places its approach beside earlier work. The table sets out what the text says, plus the context paper. Only facts printed in these two sources are given.

ApproachWhen does sound start?What it outputs
Text decoders (earlier BCIs)No sound; words appear on screenText
Intermittent synthesis from a six-word set (ALS participant who could still speak aloud)Seconds after he spokeA six-word vocabulary
Acausal discrete units (anarthria participant)At the end of the sentence, after using data from before and afterSpeech from a 1,024-word vocabulary
Littlejohn et al. 2025 (high-density surface electrodes, RNN transducers)Decoding in 80 ms incrementsLarge-vocabulary speech in the pre-injury voice
Wairagkar et al. 2025 (this paper)Every 10 ms frame, whole chain under 10 msAcoustic features, so any sound, not a vocabulary

These systems also differ in electrodes and people, so the table is a map, not a score. The paper itself runs one fair test between two of its own methods. It compared instantaneous causal synthesis with an acausal method that decodes discrete units at the end of each sentence. The acausal method won on quality: mel-cepstral distortion (a distance between the synthesized and target spectra, where lower is better) was 2.4 ± 0.03 against 2.9 ± 0.5. That is the price of being causal. It buys the first sound within a frame, in exchange for a voice that is a little less clean.

Each frame takes 12 ms to compute and a new one arrives every 10 ms. How late is the voice, in extra lag, after 100 frames if every frame is queued?

Chapter 6

Scoring a Voice That Has No Ground Truth

Grade the synthesized voice twice, once by a formula against the target and once by people who have never heard it, and read what each number can and cannot tell you

How do you grade a translation? You can compare it to a model answer with a formula. Or you can hand it to a stranger and ask what they understood. The first is cheap and repeatable. The second is closer to what matters. The paper uses both for the voice.

Grader 1: how close is the sound to the target?

A mel spectrogram is a picture of sound: time runs across, pitch runs up, and brightness shows loudness. The mel scale spaces the pitch rows the way ears do, so low pitches get more rows. The paper uses 40 mel bands, computed from 50 ms Hanning windows with 10 ms overlap, in decibels.

The score is the Pearson correlation coefficient (r). It measures how well two traces rise and fall together. It is 1 when they match in shape and 0 when they are unrelated. The authors compute r for each of the 40 bands between the synthesized and target spectrograms, then average.

r
The correlation, between −1 and 1. Higher means the two sounds follow the same pattern.
cov(x, y)
How much x and y move together: the average of (x minus its mean) times (y minus its mean).
x, y
Loudness in one mel band over time, for the target (x) and the synthesized voice (y).
σx, σy
The spread of each trace. Dividing by them makes r ignore overall loudness.

Two details make the score honest. First, T15 pauses after each word, and silence is easy to predict. The authors cut the silences between words, so the score reflects the words themselves. Second, the two spectrograms have different lengths after the cut, so they are lined up with dynamic time warping (Chapter 2) before r is computed.

The results, all against the TTS-derived target: cued sentences r = 0.83 ± 0.04 across 40 mel bands. Silent mimed sentences, never used in training, r = 0.82 ± 0.03. Free responses in his own words, 0.79 ± 0.05. Pseudo-words, interjections and spelled letters, 0.79 ± 0.08. The own-voice decoder, 0.77 ± 0.05. The paper also tests free response against cued speech and finds the drop significant (Wilcoxon rank-sum, p = 10−6, n = 57 against 956).

A caution: r says the shape matches the target. If the target is wrong, a high r is high agreement with a wrong answer. That is why the next grader matters.

There is a second metric in the paper, mel-cepstral distortion (MCD). It measures the distance between the synthesized and target spectra, and lower is better. It appears in Chapter 5, where the acausal method scored 2.4 and the instantaneous one 2.9. The same warning applies: both compare to the target, not to what T15 truly meant.

Grader 2: can a person understand it?

Test 1 is transcript matching. Fifteen listeners on Amazon Mechanical Turk, who had never heard the voice, heard each synthesized sentence and chose the right transcript from six sentences of the same length. Pure guessing gives 1 in 6, about 17%. The mean accuracy was 94.34% and the median 100%. Because many listeners hit the ceiling, the test cannot separate good from very good.

Test 2 is open transcription. Twenty-eight listeners typed what they heard, with no word list to pick from. Each of 90 trials was typed by 7 listeners. Two error rates follow. Word error rate (WER) is the share of words that are wrong. Phoneme error rate (PER) is the same at the level of speech sounds. The medians for the brain-to-voice output were PER 34.00% and WER 43.75%. For T15's own unaided speech, the same listeners scored PER 83.87% and WER 96.43%.

Read these together. The voice is often understood, not always. Strangers got more than half the words right, from a man whose own speech they almost never understood.

A quirk of short sentences

WER counts wrong words over total words. In a 4-word sentence it can only be 0, 25, 50, 75 or 100%. That coarse ladder hides small changes. So the authors paired two sentences into one longer unit before computing error rates, and took the median over 7 transcribers.

Grade a listener

Pretend you are the listener's grader. Click the words they heard wrong. Switch between one sentence and a pair, and watch how fine the error ladder becomes. Bars compare your rate with the paper's medians.

The sentences are made up. The paper's medians are PER 34.00% and WER 43.75% for the synthesized voice, and PER 83.87% and WER 96.43% for his residual speech. Real WER also counts inserted and missing words; this toy marks substituted words only.

Why did the authors cut the silences between words before computing the correlation?

Chapter 7

Tone, Questions and Song

Read how he wants to say a sentence, not just what he wants to say, and turn it into a pitch change in the voice

Say “you are coming” twice. The first time, let your pitch fall at the end. That is a statement. The second time, let it rise. Now it is a question. Put the stress on “you” and it becomes a challenge. The words did not change. The melody did.

Linguists call these features paralinguistic: they travel alongside the words. Pitch (how high the voice is), stress (how strongly a word is said) and speed all belong here. A text decoder loses every one of them. A voice decoder can keep them, if the brain signal carries them. The paper asks whether it does, and finds that it does.

Speed comes free

Because the decoder is causal and plays each frame at once, the voice has the same pace as his attempt. T15 was asked to speak the same sentences fast or slowly. The synthesized words averaged 0.97 ± 0.19 s per word when he went fast and 1.46 ± 0.31 s when he went slow. No extra module was needed: a decoder that keeps time with the brain keeps its tempo.

Pitch needs a signal to learn from

The authors first looked for pitch intent in the neural data. When T15 asked a question instead of making a statement, activity on all four arrays rose toward the end of the sentence. When he stressed one word of “I never said she stole my money” (seven words, seven different meanings), activity rose around that word, beginning about 350 ms before it started.

There is a catch. For pitch the authors had no ground truth, as in Chapter 2. They grouped trials by their cue sentence, aligned them with dynamic time warping, subtracted the average from each trial, and looked at what was left: the change due to intonation. From that average they labeled each stretch of every trial as modulated (1) or not (0).

A small decoder beside the big one

The paper then trains two extra, deliberately small decoders: one for questions, one for emphasis. Each is a logistic regression, the simplest classifier that answers yes or no. It multiplies each input by a weight, adds them up and squeezes the sum into a probability.

p
The chance that this 10 ms step belongs to a modulated stretch. Above 0.5 counts as positive.
σ
The sigmoid. It maps any number to a value between 0 and 1.
w
One learned weight per input. There are 7,680 of them.
x
The input: a 600 ms window of spike-band power only, with adjacent bins averaged. That is 30 bins × 256 electrodes = 7,680 numbers.
b
A learned bias: the baseline lean toward yes or no.

Only spike-band power is used because it has the better signal-to-noise ratio, and fewer inputs help when data is scarce. Training data is scarce here because nearly all recordings were neutral sentences. The classifier runs every 10 ms, in parallel with the voice decoder.

Do not trust one noisy bin

One 10 ms vote is unreliable. So the system watches a window and acts only when most recent votes agree. For questions, the rule is: if more than 60% of the bins in the previous 700 ms are positive, fire. For emphasis, the window is 800 ms. After a fire, the system waits 1.5 s (a refractory period) before it can fire again, so one intention causes one change.

A fire does not change the neural decoder. It edits its output. The pitch feature of the next frames is replaced by a preset profile: for a question, the pitch glides from low to high; for emphasis, from high to low, and the volume goes up by 20%. The authors made these profiles exaggerated so T15 could clearly hear that his intent worked. They note it can be softened later.

Fire on a majority

Each tick is one 10 ms vote. The green band is when he truly emphasises a word. The curve is the share of positive votes in the window; the dashed line is 60%. Make the votes noisier and change the window length.

80%

Illustrative: votes are random with the accuracy you set, and he emphasises a word from 1.0 s to 1.6 s. The 60% rule, the 700 ms question window and the 1.5 s refractory period are the paper's.

Try accuracy 55%. The votes are barely better than a coin flip, so the curve hovers near 50%. The trigger is erratic: it often misses the word and sometimes fires outside it. Try 80% with the 700 ms window: the share climbs past 60% inside the word and the trigger fires on time in nearly every run. Now pick 1,500 ms. The word lasts only 600 ms, so the long window is mostly filled with negative votes and never reaches 60%. A window must be long enough to smooth noise and short enough to fit the event.

Results: questions, emphasis and melody

Across all closed-loop trials, the system modulated question intonation with 90.5% accuracy and word emphasis with 95.7%, measured as the fraction of words modulated as the prompt required. A combined three-class classifier (none, question, emphasis) reached 80.0% offline.

For singing, T15 attempted melodies of 6 to 7 notes at low, medium and high pitch. A two-stage transformer pitch decoder ran beside the voice decoder. Listeners shown 189 pairs of notes picked the higher one correctly 73.02% of the time (chance is 50%). The authors also trained a single pitch-enhanced voice decoder on targets that held pitch levels. It synthesized the levels on its own. This shows that one model could learn both words and pitch, if given training data in which the participant tries the full range.

Why does the system require more than 60% positive bins over 700 ms instead of firing on a single positive bin?

Chapter 8

The Quiet Dimensions

Split neural activity into the part that drives the voice and the part that does not, and see what the quiet part tells us about a sentence

Watch a baseball pitcher. Before the ball leaves the hand, the arm swings back, the body coils, the weight shifts. None of that motion is the throw. It is the preparation. If you filmed only the hand at release, you would miss most of what the body did.

Cortex has the same habit. A speech decoder watches 256 electrodes, but not every pattern across them leads to a sound. Some patterns prepare a sound. Some track feedback. Some do jobs we have not named. The paper uses a tool from motor neuroscience to pull these apart, and the result explains why the decoder gets a head start.

Activity as a point, and two kinds of direction

At any moment the 256 electrodes give one list of numbers. Treat that list as a point in a space with one axis per electrode. As he speaks, the point moves. A direction in this space is a recipe for mixing electrodes.

Now take a simple linear read-out (a fixed weighted sum), y = W z, that maps the neural point z to the voice features y. Some directions change y. These are output-potent directions: they have power over the output. Directions at right angles to them leave y unchanged. These are output-null directions: you can move along them and the voice does not change at all.

z
The neural activity at one instant: one number per electrode feature.
zpotent
The shadow of z on the rows of W (a standard projection, the closest point in that span). This is the part the read-out sees.
znull
What is left. W znull = 0, so this part never reaches the voice.

A worked case in two dimensions, with made-up numbers. Let W = [1, 0], so y = z1. Take z = (3, 4). The output is y = 3. The potent part is (3, 0) and the null part is (0, 4). Change z to (3, 9): the output is still 3. The second dimension has been "loud" without changing the voice.

The paper uses established methods from motor control for this split. It finds the dimensions that line up in time with the speech features and treats their orthogonal complement as the null space. The exact fitting is in the paper's methods; the idea is the one above.

What the split reveals

The authors noticed something odd. Over the course of a cued sentence, total neural activity fell. Yet the quality of the synthesis stayed the same from the first word to the last. So some of the activity could not be driving the voice. The split confirms it.

Move along the quiet axis

Orange: the output-potent trace the voice follows. Blue: the output-null trace, which rises before each word. Grey dashed: total activity. Scale the quiet part or emphasise word 3, and see which trace changes.

1.0×

Illustrative toy: five 1 s words, null bumps beginning 350 ms before each word (the lead time the paper reports for emphasis) and shrinking by 15% per word, with emphasis multiplying one bump by 1.8. The shapes are made up; the 2.5% and 97.5% variance figures and the ranking of effects come from the paper.

Slide the quiet part to zero. The orange trace does not move, so the voice would not change. The grey total falls to match orange. Then raise it, and the total grows while the voice stays put. A decoder that listens to the whole 512-feature window may be able to use the null traces as an early warning, because they rise before the word. This is the “sneak peek” the authors mention.

What the authors think it means, and what they do not know

The authors hypothesise that the declining null activity is a buffer: the motor cortex holds the plan for the whole sentence and empties it as words are spoken. They also suggest that the extra null activity before an emphasised word is the cost of changing how a word is said. They call both ideas speculation and invite further work. They do not know why null activity rises at the very last word. They suggest it may be T15 judging his own performance.

With a linear read-out y = W z, what happens to y if z moves only along an output-null direction?

Chapter 9

Field Guide

Keep the numbers, the terms, the core code and the limits of the paper on one page

The paper answers one question: can a person who cannot speak hear his own voice, live, from his brain? The answer, for one man with ALS, is yes. Four arrays give 512 features every 10 ms. A transformer turns a 600 ms window into 20 acoustic features. A vocoder plays them. The decoder trains on a computer voice stretched to his rhythm, and the whole chain runs inside the frame.

The numbers

WhatValueWhere it comes from
ParticipantT15, 45 years old, ALS, ALSFRS-R 23 of 48Methods, Participant
Electrodes4 Utah arrays × 64 = 256, 1.5 mm longMethods
Recording30 kHz, 0.3 to 7.5 kHz, 250 nV; 1 ms packets of 30 samplesMethods, signal processing
FeaturesThreshold at −4.5 × RMS; spike-band power clipped at 50k µV²; 10 ms bins; 512 per binMethods
Decoder input600 ms window, shape 60 × 512, run every 10 msMethods, architecture
DecoderPer-week embedding (512, 128); 8 blocks; 4 heads; dropout 0.5; dense 1024, 512, 20Methods
Output20 features (18 Bark cepstra, pitch period, pitch strength); +16 LPC = 36; 160 samples at 16 kHzMethods
TrainingHuber δ = 1.35; Adam, lr 5×10−4; batch 1,024; 15 to 20 epochs; 4,100 to 8,300 trialsMethods, training
LatencySignal to speech frame under 10 ms; playback driver was the largest delayResults; Methods
Similarity to targetr = 0.83 ± 0.04 (cued); 0.82 ± 0.03 (mimed); 0.79 ± 0.05 (free)Results, Fig. 2
Listener matchingMean 94.34%, median 100% (chance 1 in 6)Fig. 2l
Open transcriptionPER 34.00%, WER 43.75% against 83.87% and 96.43% for his own speechFig. 2l
IntonationQuestion 90.5%; emphasis 95.7%; 3-class 80.0% offlineFig. 3e,g; Extended Data 6e
SingingListeners picked the higher note 73.02% of 189 pairsFig. 3i
Quiet dimensionsPotent 2.5% of variance, r = 0.82; null 97.5%, r = 0.85Fig. 4

The terms

The core as code

This sketch is the pipeline in a few functions. It shows the shapes and the order of steps. It is not the authors' code, which runs on the BRAND platform.

pythonimport numpy as np

def packet_features(x, rms):            # x: (30, 256) filtered, cleaned volts for 1 ms
    thr = -4.5 * rms                     # (256,) one line per electrode
    below = x < thr
    crossings = (below[1:] & ~below[:-1]).sum(0)      # (256,) downward crossings
    power = np.minimum((x ** 2).mean(0), 50_000)       # (256,) spike-band power
    return crossings, power

def bin_features(packets):               # 10 packets of (crossings, power)
    cr = np.sum([p[0] for p in packets], 0)            # counts add up over 10 ms
    pw = np.mean([p[1] for p in packets], 0)           # power averages
    return np.log(np.r_[cr, pw] + 1)                   # (512,) log-transformed

def decode_step(window, model, week, fmin, fmax):      # window: (60, 512), past 600 ms
    x = window.reshape(30, 2, 512).mean(1)             # average adjacent bins -> (30, 512)
    f = model(x, week)                                 # transformer -> (20,) in 0..1
    f = f * (fmax - fmin) + fmin                       # undo min-max scaling
    lpc = lpc_from_cepstrum(f[:18])                    # (16,) derived, not predicted
    return lpcnet(np.r_[f, lpc])                       # 36 -> (160,) samples at 16 kHz

def augment(x, rng):                      # x: (T, 512) one training trial
    x = x + rng.normal(0, 1.2, x.shape)                          # white noise
    off = rng.normal(0, 0.6, 256)                                # per-electrode offset
    x[:, 256:] += off; x[:, :256] += 0.67 * off                  # power, then crossings
    return x + np.cumsum(rng.normal(0, 0.02, x.shape[0]))[:, None]   # shared random walk

# training: Huber loss and Adam, as in the paper
# loss_fn = torch.nn.HuberLoss(delta=1.35)
# opt = torch.optim.Adam(model.parameters(), lr=5e-4, betas=(0.9, 0.98), eps=1e-9)

def fires(votes, window=70, thresh=0.6):  # intonation trigger: votes are 0/1 per 10 ms
    return np.mean(votes[-window:]) > thresh

A checklist for reading a speech BCI result

Limits the authors state

One participant with ALS, who could still vocalize a little and so had some sensory feedback. It is not known whether results hold for other people or for late-stage locked-in ALS. The voice is not consistently intelligible. His energy and effort changed quality. Evaluations gave little time for him to practice. It is open whether speed can rise. Intonation used preset pitch profiles and small side decoders, except in the proof-of-concept unified model.

Where it sits in the field

Compare with the Littlejohn et al. 2025 paper in Nature Neuroscience: surface electrodes over speech cortex, RNN transducers, decoding in 80 ms increments, large-vocabulary speech in a pre-injury voice. The two papers show that streaming voice is possible from very different hardware. The lecture Real-Time Closed-Loop BCI places both in the wider story.

Keep going

The takeaway. The voice appears in time because every step looks only backward, the model is small enough to finish in a frame, and the label is a computer voice bent to the brain's rhythm. The result is a voice that is often understood, not always. The intonation and the quiet dimensions show how much more the cortex holds than the words.

Credit. This lesson teaches the work of Maitreyee Wairagkar, Nicholas S. Card, Tyler Singer-Clark, Xianda Hou, Carrina Iacobacci, Lee M. Miller, Leigh R. Hochberg, David M. Brandman and Sergey D. Stavisky, “An instantaneous voice-synthesis neuroprosthesis”, Nature 2025, doi:10.1038/s41586-025-09127-3, and cites Littlejohn et al., Nature Neuroscience 2025, doi:10.1038/s41593-025-01905-6. Numbers come from the paper's text and Methods; the toy devices are marked illustrative.

Which design choice most directly lets the first sound play within one frame of his attempt?

Now press Teach and explain the whole path out loud, from memory: the two features, the stretched computer voice, the 600 ms window, the 10 ms deadline, the two scorers and the quiet dimensions. Then go back to the instrument at the top, lengthen the sentence under each method, and say why only one of them is a live voice.

An Instantaneous Voice-Synthesis Neuroprosthesis (Wairagkar et al., Nature 2025)
Read the paper · Back to the lecture: Real-Time Closed-Loop BCI