Language Generation from Human Brain Activities

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

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. We compare the language generated from the presented model with a random control, pre-generated language selection approach, and a standard LLM, which generates common coherent text solely based on the next word likelihood according to statistical language training data. The proposed model is found to generate language that is more aligned with semantic stimulus in response to which brain input is sampled. Our findings demonstrate the potential and feasibility of employing BCIs in direct language generation.

Introduction

Decoding natural language from non-invasive brain recordings, such as functional magnetic resonance imaging (fMRI), represents a significant frontier in brain-computer interface (BCI) research. Historically, this task has been framed as a classification problem: selecting the most likely candidate from a pre-defined set of words or sentences. While effective in constrained environments, this approach fails to generalize to novel thoughts or open-ended communication.

BrainLLM addresses this limitation by treating language decoding as a generative task. By mapping neural activity directly into the latent embedding space of a frozen Large Language Model (LLM), BrainLLM enables the reconstruction of continuous, semantically accurate language without the need for candidate lists. This "brain-language interface" leverages the pre-existing linguistic knowledge of LLMs to bridge the gap between high-dimensional neural signals and coherent text.

Methodology

The BrainLLM framework utilizes a four-stage pipeline to transform fMRI scans into natural language:

  1. Data Collection and Feature Extraction: Participants are exposed to visual or auditory stimuli while their brain responses are recorded via fMRI.
  2. Brain Adapter Training: A Multi-Layer Perceptron (MLP) "Brain Adapter" is trained to map extracted fMRI features into the embedding space of the LLM. This adapter aligns neural representations with the latent space of text embeddings.
  3. Prompt Construction: The decoded brain embeddings are concatenated with text prompt embeddings (representing preceding context) and special "decoration" tokens to form a unified input for the LLM.
  4. Auto-regressive Generation: The frozen LLM (e.g., Llama-2 or GPT-2) generates text tokens based on the combined brain and text prompt input.
The BrainLLM pipeline, illustrating data collection (S1), input preparation (S2), prompt construction (S3), and auto-regressive language generation (S4).

To ensure stability, the model employs a "warm-up" phase to align brain and text embeddings before full generative training. This parameter-efficient approach keeps the backbone LLM frozen, focusing training efforts on the Brain Adapter.

Results

The model was evaluated across three diverse fMRI datasets (Pereira, Huth, and Narratives), demonstrating robust performance across visual and auditory modalities.

Qualitative and Quantitative Performance

BrainLLM achieved significantly higher likelihoods of generating ground-truth continuations compared to control models using shuffled brain signals. In full-text reconstruction tasks, the model maintained semantic coherence over extended periods, achieving a BLEU-1 score of approximately 0.25. Human evaluations further confirmed that BrainLLM's outputs were semantically closer to the original stimuli than those of control models.

Qualitative results comparing BrainLLM predictions with ground truth continuations and control predictions across various text prompts.

Key Insights

  • The Surprise Hypothesis: Brain signals were found to be most critical when the stimulus was "surprising" (low probability) to the LLM. In these instances, neural activity provides the necessary ground truth to steer generation away from generic, high-probability continuations.
  • Neural Scaling and Localization: Performance improved with larger LLMs and more training data, suggesting that the LLM's internal "reasoning" capabilities enhance decoding. Furthermore, signals from Broca’s area—traditionally linked to language production—yielded the highest accuracy, with win rates exceeding 80%.

Discussion and Conclusion

While BrainLLM demonstrates the feasibility of direct language generation from brain activity, several challenges remain. The temporal latency of the fMRI BOLD signal often results in "gist-level" reconstructions rather than verbatim accuracy. Future work will explore integrating fMRI with higher-temporal-resolution modalities and developing "safe" adapters to address the significant privacy and ethical implications of neural decoding.

Ultimately, BrainLLM represents a pivotal step toward open-ended BCIs, offering a scalable framework for restoring communication in patients with severe speech impairments.

Summary updated

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