arXiv:2611.03623cs.LGNov 2026

Manuscript Offprint

arXiv:2611.03623

Thought-deciphering via hierarchical EEG-to-text alignment

Xiaopeng Mao, Morten Mørup, Xin Xu, Sang Wan Lee, Sadasivan Puthusserypady

Abstract

Communication is important for our well-being, but it can be impaired by disabilities, such as locked-in syndrome (LIS), cerebral palsy (CP), and dysarthria.

Non-invasive brain-to-text brain-computer interfaces (BCIs) offer a promising solution by providing an alternative communication pathway for people with communication disabilities. However, most recent breakthroughs have relied on large, cumbersome, and costly neuroimaging modalities, such as functional magnetic resonance imaging (fMRI) and magnetoencephalography (MEG). Numerous studies have attempted decoding using the lighter and cheaper electroencephalography (EEG), but the results remain inferior compared to the other modalities. More importantly, we do not understand how these modalities are related to text at the letter, word, sentence, and higher semantic levels.

Many prior studies have focused on decoding below the sentence level because it is considerably easier to design an experiment around phonemes, letters, and words. However, during communication, sentences play a much more important role than words and letters. This is because sentences carry information at such a high level that they can be understood even if some words and letters are missing. However, within sentence-level decoding, sentence classification is not as well investigated as sentence generation, making it difficult to decide whether a sentence should be retrieved or generated in the context of EEG-to-text decoding. This paper strives to investigate sentence-level EEG-to-text classification via a novel hierarchical alignment framework, where the main goal is to retrieve a read sentence using its context and EEG as inputs. We hypothesize that higher-level semantic information, such as the general topic or context of a sentence, can be more easily captured from EEGs than the sentence itself. More specifically, we define a topic or context of related sentences as a semantic class and propose a hierarchical two-stage approach in which semantic class information guides subsequent sentence retrieval. In stage 1, EEG representations are aligned with broader semantic classes, such as topics containing semantically related sentences or story chapters. In stage 2, sentence-level EEG-text alignment is used to identify the corresponding sentence within the predicted semantic class. By narrowing down the semantic search space from classes to sentences, this approach aims to facilitate sentence-level decoding while reducing noise among different-class sentences. Among over 2,000 unique text samples, the best average top-5 and top-10 retrieval accuracies are 62.6% ± 1.0% and 83.5% ± 1.0%, respectively, with 65.4% ± 1.0% and 87.4% ± 1.8% for the best-performing subjects. On the contrary, a direct and unstaged EEG-sentence alignment only achieved an average top-5 and top-10 retrieval accuracies of 50.3% ± 2.3% and 68.3% ± 2.0%, respectively. A subsequent qualitative analysis shows that decoding effectiveness depends heavily on the context of the text. In short, our study suggests that a hierarchical decoding approach from a higher abstract level to a lower concrete level is promising for establishing an effective EEG-to-text BCI.

Keywords: Thought-deciphering, Brain-computer interface, Representation learning, EEG-to-text alignment

1 Introduction

A brain-computer interface (BCI) is a technology that enables communication between the brain and an external device. To date, numerous BCIs have been developed to translate people's thoughts into simple actions such as moving a prosthesis, pressing a button, etc. [1-7]. More recently, the focus has shifted towards direct thought-to-text generation [8-14]. So far, significant success has been achieved in invasive BCIs using either imagined handwriting or speech [15-21]. For example, Willett et al. demonstrated in a single-subject study that efficient communication can be established via imagined handwriting [20]. This is because invasive BCIs benefit from direct access to cortical activity, which enables higher-quality neural recordings [22, 23]. Nevertheless, invasive BCIs require surgical implantation, are costly, and are suitable for only a small subset of individuals with communication disabilities. Consequently, there is a need for non-invasive brain-to-text BCIs that can support people with varying degrees of communication impairment who either cannot or do not wish to undergo surgery. The most common non-invasive options include functional magnetic resonance imaging (fMRI), functional near-infrared spectroscopy (fNIRS), functional ultrasound (fUS), magnetoencephalography (MEG), and electroencephalography (EEG). With the help of fMRI, it becomes clear that thought can be decoded from different brain areas [24-27]. For example, Huth et al. found using fMRI that different brain areas could be mapped to different semantic categories [24], while Tang et al. showed that the brain produced similar responses when a subject was watching a movie, and when the subject was listening to the story of the movie [27]. Compared to fMRI, there are much fewer brain-to-text studies using fNIRS and fUS. In the case of fNIRS, it has been shown that while fNIRS has limited temporal resolution, it is capable of capturing linguistic information from the brain [28-32]. fUS, on the other hand, has yet to be used on brain-to-text-related tasks, although a combination of fUS and EEG works fairly well on motor imagery-related tasks [33]. The remaining brain-to-text literature has considered MEG and EEG. Notably, several recent MEG-based studies have demonstrated its high effectiveness in brain decoding [34-38]. For example, Défossez et al. reported a maximum top-10 MEG-to-audio classification accuracy of 70.7%, whereas EEG achieved only 25.7% [38]. However, it is well-known that MEG is bulkier and much more expensive than EEG. As for EEG, recent literature has focused mainly on text classification and generation. The text classification tasks mainly involve classifying simple linguistic units, such as phonemes and words [7, 39-47]. On the other hand, the text generation task has focused on using a large language model (LLM), such as a bidirectional and auto-regressive transformer (BART) to output text directly after taking EEG as input [8-14]. However, the so-called teacher forcing has often been used in these studies, meaning ground truth text has been used in both training and test stages [48]. This is because direct text generation depends heavily on the previous generations. If a previous word is wrong, the subsequent generation also more likely will be wrong. Hence, it is still difficult to generate text reliably in the test phase without using teacher forcing. So far, only a few studies have focused on sentence-level classification [49, 50]. For example, Barua et al. have achieved high classification accuracies on 20 common Turkish sentences [49]. However, a corpus of 20 sentences is very limited for daily communication. In another study, Yang et al. reconstructed sentences using retrieval-augmented generation (RAG) by aligning EEG with sentence keywords, but they aligned EEG and text at the word level and not the sentence level [50].

In this study, we define a topic or context of related sentences as a semantic class. We hypothesize that EEGs are much easier to discriminate between semantic classes than sentences, and the class-level information can be used to guide the sentence-level EEG-text alignment and classification. This approach bypasses teacher forcing completely and focuses on retrieving the target sentence, which is much more informative compared to phoneme, letter, or word-level decoding. We have developed and validated our approach on two public EEG-text datasets, namely, the ChineseEEG and Chinese imagined speech corpus (Chisco) datasets [51, 52]. The workflow of the entire study can be viewed in Fig. 1.

Figure

Fig. 1: Flow diagram of the study. Two different raw reading EEG datasets are used. A simple and fast preprocessing strategy is applied to both datasets (a). An EEG encoder converts an EEG sample into a 256-dimensional embedding, which is contrastively aligned with the corresponding text embedding at a class level. The encoded embeddings are used for semantic classification. Subsequently, a retrieval model is used to align EEG embeddings with text embeddings at a sentence level (b). For evaluation, the semantic classifier is evaluated using macro F1 scores, while the retriever limits its text search within the predicted class to find the target sentence (c).

References (100)

Couldn't load all references. Reload the page to try again.