BrainLLM: Generative Language Decoding from Brain Recordings

Ziyi Ye, Qingyao Ai, Yiqun Liu, Min Zhang, Christina Lioma, Tuukka Ruotsalo, Ruotsalo, Tuukka · DOI

Abstract

Generating human language through non-invasive brain-computer interfaces (BCIs) has the potential to unlock many applications, such as serving disabled patients and improving communication. Currently, however, generating language via BCIs has been previously successful only within a classification setup for selecting pre-generated sentence continuation candidates with the most likely cortical semantic representation. Inspired by recent research that revealed associations between the brain and the large computational language models, we propose a generative language BCI that utilizes the capacity of a large language model (LLM) jointly with a semantic brain decoder to directly generate language from functional magnetic resonance imaging (fMRI) input. The proposed model can generate coherent language sequences aligned with the semantic content of visual or auditory language stimuli perceived, without prior knowledge of any pre-generated candidates. The proposed model is found to generate language that is more aligned with semantic stimulus in response to which brain input is sampled, demonstrating the potential and feasibility of employing BCIs in direct language generation.

Introduction

Decoding language from the brain—especially using non-invasive methods like functional Magnetic Resonance Imaging (fMRI)—has historically been a "needle in a haystack" problem. Because fMRI measures blood-oxygen levels (the BOLD signal), it is slow and noisy compared to the rapid-fire nature of human speech. Most existing research treats this as a classification task: researchers pre-construct a list of candidate sentences and then use brain data to pick the "best fit." While impressive, this approach is fundamentally limited; it cannot decode anything that was not in the original list. BrainLLM introduces true generative decoding, where the system produces open-vocabulary sequences based on neural representations of meaning.

Methodology: The Brain Adapter

The core innovation of BrainLLM is the Brain Adapter, a neural network designed to bridge the gap between high-dimensional fMRI voxels and the semantic embedding space of a Large Language Model (LLM).

Overview of the BrainLLM framework and qualitative results.

The framework operates in four distinct stages:

  1. Data Collection (S1): Brain responses are recorded via fMRI while participants perceive language stimuli (visual or auditory).
  2. Input Preparation (S2): Features are extracted from brain responses and passed through the Brain Adapter to create brain embeddings.
  3. Prompt Construction (S3): Brain embeddings are combined with text prompt embeddings to form a "soft prompt."
  4. Language Generation (S4): The LLM generates text auto-regressively, using the brain data to guide the semantic direction of the output.

Instead of fine-tuning the massive LLM (which would require more brain data than exists), the researchers kept the LLM weights frozen and only trained the Brain Adapter. This "prompt tuning" approach is data-efficient and leverages the pre-existing linguistic knowledge of models like Llama-2.

Key Insights and Results

The researchers validated BrainLLM on three major public fMRI datasets: Pereira’s (visual), Huth’s (auditory), and the Narratives dataset.

Synergy of Brain and Model

A fascinating finding is that brain signals are most helpful when the content is "surprising" to the LLM. If a sentence follows a predictable pattern, the LLM’s internal logic handles the generation. However, when the story takes an unexpected turn, the brain data provides the necessary "nudge" to maintain semantic alignment. This synergy allows the model to outperform standard LLMs that rely solely on statistical word likelihood.

Performance Metrics

BrainLLM demonstrated state-of-the-art performance across several metrics:

  • Similarity Metrics: It outperformed previous classification-based methods in BLEU-1, ROUGE, and Word Error Rate (WER) across multiple datasets.
  • Human Preference: In blind tests, human annotators preferred BrainLLM's output over control models nearly 50% of the time, finding it more semantically aligned with the original stimulus.
  • Scaling: Performance improved steadily with larger backbone models (e.g., Llama-2 7B vs. GPT-2) and increased training data per participant.

Discussion and Future Work

Despite its success, BrainLLM faces hurdles for clinical use. fMRI machines are immobile and expensive; future work must adapt these techniques for portable signals like EEG or fNIRS. Additionally, the BOLD signal lag remains a temporal puzzle for real-time applications. Finally, the authors emphasize the need for "safe brain adapters" to address privacy concerns regarding the potential for covert monitoring of thoughts, suggesting that future systems should require active participant cooperation.

Reference: Ye, Z., et al. (2025). BrainLLM: Generative Language Decoding from Brain Recordings. arXiv:2311.09889v6.

Summary updated

BibTeX
@misc{ye2023brainllm,
  author = {Ziyi Ye and Qingyao Ai and Yiqun Liu and Min Zhang and Christina Lioma and Tuukka Ruotsalo and Ruotsalo, Tuukka},
  title = {{BrainLLM: Generative Language Decoding from Brain Recordings}},
  year = {2023},
  eprint = {2311.09889},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.09889},
}
Figure