LightBeam: An Accurate and Memory-Efficient CTC Decoder for Speech Neuroprostheses
Authors: Ebrahim Feghhi, Junlin Hu, Nima Hadidi, Jonathan C. Kao
Organizations: Neuroscience Interdepartmental Program, University of California Los Angeles · Department of Electrical & Computer Engineering, University of California Los Angeles · Department of Computer Science, University of California Los Angeles
A promising pathway for restoring communication in patients with dysarthria and anarthria is speech neuroprostheses, which directly decode speech from cortical neural activity. Two benchmarks, Brain-to-Text '24 and '25, released intracranial recordings from patients with dysarthria along with a baseline algorithm trained with Connectionist Temporal Classification (CTC). Despite significant innovation on these benchmarks, all leading published prior work relies on a WFST-based CTC decoder that requires ∼320 GB of RAM. These memory requirements limit accessibility for both patients and researchers. Here, we propose LightBeam, a non-WFST based CTC decoder that requires only ∼10 GB of RAM and achieves state-of-the-art performance on both benchmarks. LightBeam achieves this by integrating an LLM into the beam-search process via delayed fusion, obviating the prior need for using a large N-gram LM. LightBeam is implemented in Python and is open-source.
Figures & tables
\multirow 2* Method
B2T ’24
B2T ’25
WER
RAM
VRAM
RTF
Pub. WER
Priv. WER
RAM
VRAM
RTF
WFST-Based (Orig.)
9.76
-
-
-
6.67
7.00
-
-
-
WFST-Based (Re-impl.)
9.71 ± 0.08
322.9
9.0
0.05
6.31 ± 0.12
6.72 ± 0.05
317.8
18.1
0.01
LightBeam (Ours)
9.37 ∗† ± 0.08
9.4
5.6
0.14
5.77 ∗† ± 0.12
6.47 ∗† ± 0.05
11.6
5.8
0.06
Table 1: Combined performance and computational efficiency on B2T ’24 and ’25 benchmark test sets when using the baseline GRU encoder. Peak RAM and VRAM are reported in GB. Processing speed is measured in RTF using an GeForce RTX 5090 GPU. Lower is better for all metrics. Mean ± SEM across n=10 seeds. WFST-based (Orig.) is a single seed result provided by original authors, and re-implementation (re-impl) values are generated in this study. ( ∗ sig. better than Orig., † sig. better than Re-impl.)
\multirow 2* Method
B2T ’24
B2T ’25
WER
RTF
Pub. WER
Priv. WER
RTF
WFST-Based
8.36 ± .12
0.02
4.95 ± .26
4.81 ± .13
0.01
LightBeam
8.08 † ± .12
0.10
4.44 † ± .21
4.59 † ± .14
0.05
Table 2: Word Error Rate (%) comparison on the B2T ’24 (WER) and B2T ’25 (Pub. and Priv. WER) benchmarks when using the causal time-masked Transformer with bounded KV cache. Mean ± SEM over n=10 seeds. ( † sig. better than WFST decoder).
Figure 1: LightBeam continues to match or outperform baseline WFST decoder across all benchmarks when both methods are paired with generative error correction. Results are shown with time-masked Transformer. Asterisks indicate significant improvement when performing paired t-test across n=10 seeds.
Configuration
B2T ’24 WER
B2T ’25 WER
LightBeam (Full)
14
.17 ± 0.08
6
.36 ± 0.05
No LLM first-pass rescore
17
.17 † ± 0.05
8
.31 † ± 0.07
No NWP Fine-tuning
15
.89 † ± 0.09
7
.26 † ± 0.04
No Phoneme Variants
14
.05 ± 0.07
6
.36 ± 0.05
Table 3: Ablation study on B2T ’24 and B2T ’25 validation sets with baseline GRU. Values are Mean WER (%) ± SEM ( n=10 seeds). † denotes significant degradation relative to Full model.
Figure 2: Impact of LLM rescore interval on validation WER and RTF across both datasets. An encoder frame is output every 100 ms in B2T ’24, and every 80 ms in B2T ’25. Shaded regions indicate SEM across n=10 seeds. LLM rescore interval was set to 10 and 15 throughout the study for B2T ’24 and ’25, respectively.
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
Source
Blocks
Sentences
Split
Switchboard
182
7,672
Train, Val/Test
Freq. Words
48
2,050
Train, Val/Test
50-word Vocab
25
1,091
Train Only
Openwebtext
5
172
Val/Test only
Harvard
3
98
Val/Test only
Random
2
79
Val/Test only
Appendix
Table A1: Distribution of data sources across training and evaluation splits.
Hyperparameter
Value
Patch Length
4 (0.08 ms)
Patch Width
512
Transformer Dimension
384
Layers
5
Heads
6
Head Dimension
64
Appendix
Table A2: Transformer architecture and training hyperparameters for B2T ’25. Feed-forward network (FFN) multiplier indicates the increase in dimensionality in the FFN module.
Figure A1: Phoneme Error Rate (PER) as a function of left-context window size for B2T’24 and B2T ’25 on validation set.
Hyperparameter
B2T’ 24
B2T’ 25
Blank Penalty
log(7)
log(90)
Acoustic Scale ( α )
0.5
0.325
Beam
18
17
Max Active States
7000
7000
Min Active States
200
200
Appendix
Table A3: WFST decoding hyperparameters for B2T ’24 and ’25 benchmarks during first-pass rescoring. These hyperparameters were tuned by the original authors using the baseline GRU encoder, and the same set of hyperparmeters were used for analyses with the time-masked Transformer. Variable notation is copied from original authors ( [ 23 , 2 ] ).
Hyperparameter
B2T’ 24
B2T’ 25
Acoustic Scale ( α )
0.5
0.325
N-gram LM weight ( β )
0.5
0.45
LLM weight
0.5
0.55
N-best beam size
100
100
Used quantized LLM
Yes
No
Appendix
Table A4: WFST decoding hyperparameters for B2T’24 and ’25 benchmarks during second-pass rescoring. These hyperparameters were tuned by the original authors using the baseline GRU encoder, and the same set of hyperparmeters were used for analyses with the time-masked Transformer.Variable notation is copied from original authors ( [ 23 , 2 ] ).
Hyperparameter
B2T’ 24
B2T’ 25
LLM rescore interval (Encoder Frames)
10
15
LLM Weight ( ϕ )
1.2
1.2
N-gram LM Weight ( ω )
0.8
1.0
Acoustic Scale ( α )
0.6
0.4
Beam Size ( k )
1000
900
Beam Prune Threshold ( θ )
22.0
18.0
Appendix
Table A5: LightBeam decoding hyperparameters for B2T ’24 and B2T ’25. These hyperparameters were tuned using the GRU encoder, and the same set of hyperparmeters were used for analyses with the time-masked Transformer.
Hyperparameter
Value
Base Precision
BFloat16
Optimizer
AdamW
Learning Rate
2×10−4
Weight Decay
10−3
Batch Size
16
Epochs
3
Appendix
Table A6: Fine-tuning hyperparameters for the next-word prediction task
Hyperparameter
Value
Quantization
4-bit NF4 (bitsandbytes)
Optimizer
AdamW-8bit
Learning Rate
2×10−4
Batch Size
16
Epochs
1
Data Scheduling
[val, train, val]
Appendix
Table A7: Fine-tuning hyperparameters for the generative error correction
Figure A2: RTF Distributions of LightBeam across all trials on the test set of B2T ’24 and B2T ’25. The scale of the y-axis is logarithmic.
LLM
B2T ’24
B2T ’25
WER
RTF
VRAM
WER
RTF
VRAM
llama-3.2-1B
14.17 ± .22
0.18
6.14
6.36 ± .14
0.06
5.60
llama-3.2-3B
13.82 † ± .13
0.26
9.82
6.24 ± .16
0.08
9.64
Appendix
Table A8: Word Error Rate (%) comparison on the B2T ’24 and B2T ’25 Validation set when using GRU encoder and different LLMs for Delayed Fusion. Mean ± SEM over n=10 seeds. ( † sig. better than 1B Model).
Decoding continuous speech from intracortical recordings is a central challenge for brain-computer interfaces (BCIs), with transformative potential for individuals with conditions that impair their ability to speak. While recent microelectrode array (MEA) decoders achieve impressive accuracy, their performance is fundamentally limited by the small size of existing datasets, they remain brittle to session-to-session variability, and their ability to generalize across participants remains unexplored. We introduce BrainWhisperer, a neural speech decoder that integrates high-resolution MEA recordings with a large pretrained automatic speech recognition (ASR) model. Building on interpretability findings showing that Whisper's encoder learns phoneme-selective representations with localized attention, we train a customized version of Whisper, modified to process neural features, using a hybrid objective that combines CTC loss on phonemes--predicted from the third encoder layer--and cross-entropy loss on word tokens. We introduce domain-informed modifications including windowed self-attention to capture articulatory continuity, hierarchical month/day-specific low-rank projections to address non-stationarity, and subject-specific embedders enabling cross-subject training. Evaluated on a publicly available MEA dataset (Card et al.), BrainWhisperer matches or outperforms prior state-of-the-art decoders. Critically, cross-dataset training improves performance even on individual datasets without fine-tuning, demonstrating unprecedented generalization. The model supports dual decoding paths: a high-accuracy phoneme-based path with external language model rescoring, and a fast direct text generation path enabling sub-100ms inference with minimal hardware requirements.
A speech neuroprosthesis decodes attempted speech from brain activity and ends by rescoring the decoder's candidate sentences with a language model of several billion parameters, the only component that needs a GPU. Replacing that model with a cheaper one is hard: general language models asked to pick one sentence from a list answer from where a label sits in the list rather than from the sentence itself. We pose rescoring as a single typed decision, one call that returns a probability for every candidate, served by Jev, a hosted model trained for calibrated decisions, and combine it with the decoder's own score. On 978 held-out sentences from a participant with ALS, where the published decoder alone reaches 8.1% word error, Jev reaches 7.5% against 7.8% for both OPT-6.7b and Qwen2.5-7B; with the decoder's weight re-tuned, 6.9% against 7.2% and 7.4%. Jev is ahead in all four comparisons and at most 0.2 points behind at the 95% bound. It costs 0.07 USD per thousand sentences and needs no GPU; a dedicated GPU running a 7B model is cheaper per sentence only above 43% utilisation, far beyond what one user generates. End-to-end latency over the internet is 262 ms, of which 62 ms is spent at the provider, the same order as a 7B model on a local GPU (27 ms) but not faster.
The loss of speech limits communication for individuals with paralysis. Direct neural-to-speech synthesis is challenging due to the limited availability of neural data for training speech brain-computer interfaces. Most existing systems rely on cascaded neural-to-text-to-speech pipelines, which increase inference latency and propagate errors across stages. We present Brain2Speech-Net, a single-stage neural-to-speech generation framework without intermediate text decoding. We use a differentiable phoneme bottleneck and a deep-HMM alignment mechanism to map long neural recordings into the latent space of a text-to-speech (TTS) model, enabling high-quality speech synthesis. Brain2Speech-Net is the only system in our comparison that produces intelligible speech while generating faster than real time.
Shreeram Suresh Chandra, Zexin Cai, Yu Tsao +2
Johns Hopkins University, USA · Academia Sinica, Taiwan · University of Edinburgh, UK