Deep LLM layers expose passage-level context in EEG during silent reading
Organizations: nubrain
Abstract
In a previous report we showed that a decoder can recover open-vocabulary word-level information from 19-channel EEG recorded during silent reading, by aligning short EEG windows with hidden-state embeddings of the presented word taken from a large language model (LLM). That analysis contrasted two of the model's 33 layers: the context-free input embedding and one mid-depth layer. Here we ask how EEG-decodable structure is distributed over the full depth of the language model. We trained one decoder per layer of Llama-3.1-8B, with and without a causal transformer over the sequence of EEG windows. We distinguish word-level decodability from a context-tracking component. Word-level decodability peaks in early layers and declines steadily towards the last layer. In contrast, the context-tracking component of the retrieval gain rises with depth, both with and without a causal transformer. Unexpectedly, a decoder that sees a single 0.5-s window at a time tracks the text passage too. Two new controls dissect this component. A target-geometry control, a synthetic predictor made of the true target plus noise calibrated to each decoder's word-level accuracy, shows that context tracking is not a by-product of word decoding and target geometry. A control that permutes predictions across runs from either the same or from different sessions shows that most of the observed context-tracking is not caused by an EEG recording session signature. Instead, context tracking mostly follows the text. A single EEG window therefore carries passage-level information that a contextual target can absorb. The results locate word identity in the early layers of the language model, discourse state in the deeper layers, and make the choice of target layer a design dial for EEG language decoders.
Figures & tables
Appendix figures & tables17 assets
Supplementary material from the paper’s appendix.
Appendix
| Metric | Decoder | Peak | Value at peak | Peak per seed | Seed agreement | L0 | L20 | L32 | (layer) |
| within-run gain | noTF | L1 | 11.8 0.3 | 1/1/2/1/1 | 0.95 | 10.1 | 9.7 | 7.6 | -0.94 |
| TF | L2 | 16.8 0.2 | 2/2/2/2/2 | 0.97 | 9.7 | 14.0 | 10.4 | -0.81 | |
| position-corrected within-run gain | noTF | L1 | 11.8 0.3 | 1/1/2/1/1 | 0.95 | 10.1 | 9.7 | 7.6 | -0.94 |
| TF | L2 | 14.0 0.7 | 2/1/2/5/2 | 0.88 | 9.6 | 11.6 | 8.1 | -0.79 | |
| overall gain | noTF | L19 | 20.0 0.9 | 19/16/16/19/16 | 0.78 | 10.3 | 19.6 | 17.3 | 0.06 |
| TF | L9 | 38.5 1.9 | 9/9/8/5/6 | 0.85 | 11.0 | 34.7 | 27.9 | -0.59 |
| Decoder | Layer | Overall | Random run-mate | Geometry control, random | Lag 4 | Lag 256 | Geometry control, lag 4 |
| noTF | 0 | 10.3 0.3 | 1.0 0.1 | 0.1 0.1 | 1.1 0.1 | 1.0 0.1 | 0.1 0.0 |
| 1 | 17.0 0.6 | 3.8 0.3 | 0.4 0.0 | 5.2 0.3 | 3.5 0.3 | 0.6 0.1 | |
| 2 | 17.5 0.7 | 3.9 0.4 | 0.4 0.1 | 5.4 0.4 | 3.6 0.4 | 0.7 0.1 | |
| 4 | 18.1 1.0 | 4.7 0.5 | 0.5 0.1 | 6.4 0.6 | 4.4 0.5 | 0.8 0.1 | |
| 8 | 18.2 0.6 | 5.4 0.4 | 0.6 0.1 | 7.3 0.3 | 4.9 0.4 | 1.2 0.1 | |
| 12 | 18.2 0.8 | 5.7 0.6 | 0.7 0.1 | 7.8 0.5 | 5.3 0.6 | 1.3 0.0 |
| Decoder | Partner trials | Same session | Different session |
| noTF | matched | 0.32 0.03 | 0.24 0.02 |
| scrambled | 0.25 0.03 | 0.19 0.02 | |
| TF | matched | 0.47 0.04 | 0.36 0.02 |
| scrambled | 0.15 0.03 | 0.10 0.01 |
| Layer | within-run noTF | within-run TF | position-corr. noTF | position-corr. TF | overall noTF | overall TF | context-tracking noTF | context-tracking TF | context-indep. noTF | context-indep. TF |
| 0 | 10.1 0.3 | 9.7 0.1 | 10.1 0.3 | 9.6 0.2 | 10.3 0.3 | 11.0 0.1 | 1.0 0.1 | 1.6 0.0 | 9.2 0.3 | 9.4 0.1 |
| 1 | 11.8 0.3 | 15.9 0.3 | 11.8 0.3 | 13.4 0.3 | 17.0 0.6 | 33.4 1.5 | 3.8 0.3 | 6.5 0.6 | 13.2 0.4 | 26.9 1.0 |
| 2 | 11.6 0.3 | 16.8 0.2 | 11.6 0.3 | 14.0 0.7 | 17.5 0.7 | 35.0 1.7 | 3.9 0.4 | 6.3 0.7 | 13.6 0.4 | 28.7 1.0 |
| 3 | 11.2 0.3 | 16.2 0.2 | 11.2 0.3 | 12.7 0.6 | 17.4 0.6 | 34.1 1.0 | 4.3 0.4 | 6.3 0.3 | 13.2 0.3 | 27.8 0.7 |
| 4 | 11.1 0.3 | 15.8 0.3 | 11.1 0.3 | 12.7 0.8 | 18.1 1.0 | 34.6 1.8 | 4.7 0.5 | 6.7 0.7 | 13.4 0.6 | 27.9 1.2 |
| 5 | 11.0 0.3 | 16.3 0.2 | 11.0 0.3 | 13.3 0.5 | 18.6 0.7 | 36.7 1.4 | 5.0 0.4 | 7.2 0.7 | 13.6 0.5 | 29.5 0.8 |
| Layer | rare noTF | rare TF | mid noTF | mid TF | frequent noTF | frequent TF | rare / frequent noTF | rare / frequent TF |
| 0 | 3.56 0.47 | 3.29 0.50 | 4.00 0.17 | 3.48 0.24 | 10.84 0.37 | 10.44 0.15 | 0.33 0.04 | 0.32 0.05 |
| 1 | 5.19 0.49 | 8.44 0.70 | 6.27 0.57 | 9.99 0.57 | 12.53 0.34 | 16.75 0.36 | 0.41 0.03 | 0.50 0.04 |
| 2 | 5.90 0.54 | 10.00 0.35 | 6.66 0.29 | 12.00 0.82 | 12.30 0.39 | 17.53 0.25 | 0.48 0.05 | 0.57 0.02 |
| 3 | 6.20 0.39 | 10.55 0.72 | 6.68 0.27 | 12.65 0.64 | 11.79 0.36 | 16.71 0.24 | 0.53 0.05 | 0.63 0.05 |
| 4 | 6.18 0.75 | 11.18 0.91 | 7.21 0.57 | 12.70 0.51 | 11.62 0.30 | 16.31 0.35 | 0.53 0.07 | 0.69 0.06 |
| 5 | 6.58 0.63 | 12.25 0.45 | 7.49 0.58 | 14.04 0.76 | 11.52 0.26 | 16.65 0.25 | 0.57 0.05 | 0.74 0.03 |
| Layer | within-run | position-only | preceding-EEG | current-trial | position-corr. | dispersion |
| 0 | 9.7 0.1 | 0.0 0.2 | 0.0 0.1 | 9.6 0.2 | 9.6 0.2 | 0.156 0.014 |
| 1 | 15.9 0.3 | 2.5 0.4 | 3.4 0.3 | 10.0 0.2 | 13.4 0.3 | 0.121 0.009 |
| 2 | 16.8 0.2 | 2.9 0.6 | 4.0 0.4 | 10.0 0.3 | 14.0 0.7 | 0.117 0.014 |
| 3 | 16.2 0.2 | 3.5 0.4 | 3.2 0.4 | 9.5 0.3 | 12.7 0.6 | 0.118 0.012 |
| 4 | 15.8 0.3 | 3.2 0.7 | 3.3 0.6 | 9.4 0.6 | 12.7 0.8 | 0.101 0.011 |
| 5 | 16.3 0.2 | 3.0 0.6 | 3.5 0.6 | 9.8 0.2 | 13.3 0.5 | 0.096 0.009 |
| Layer | random noTF | geom. control noTF | lag 4 noTF | lag 256 noTF | random TF | geom. control TF | lag 4 TF | lag 256 TF |
| 0 | 1.0 0.1 | 0.1 0.1 | 1.1 0.1 | 1.0 0.1 | 1.6 0.0 | 0.1 0.0 | 1.8 0.1 | 1.7 0.0 |
| 1 | 3.8 0.3 | 0.4 0.0 | 5.2 0.3 | 3.5 0.3 | 6.5 0.6 | 1.4 0.0 | 20.7 1.3 | 0.7 0.3 |
| 2 | 3.9 0.4 | 0.4 0.1 | 5.4 0.4 | 3.6 0.4 | 6.3 0.7 | 1.3 0.1 | 22.0 1.6 | 0.1 0.3 |
| 3 | 4.3 0.4 | 0.4 0.1 | 5.8 0.5 | 3.9 0.4 | 6.3 0.3 | 1.3 0.1 | 21.9 0.9 | 0.2 0.1 |
| 4 | 4.7 0.5 | 0.5 0.1 | 6.4 0.6 | 4.4 0.5 | 6.7 0.7 | 1.3 0.1 | 22.2 1.2 | 0.5 0.3 |
| 5 | 5.0 0.4 | 0.6 0.1 | 6.8 0.4 | 4.6 0.4 | 7.2 0.7 | 1.4 0.1 | 24.1 1.2 | 0.6 0.3 |
| Layer | noTF trials matched same session | noTF trials matched different session | noTF trials scrambled same session | noTF trials scrambled different session | TF trials matched same session | TF trials matched different session | TF trials scrambled same session | TF trials scrambled different session |
| 0 | 0.08 0.02 | 0.08 0.03 | 0.07 0.02 | 0.08 0.02 | 0.13 0.02 | 0.11 0.01 | 0.12 0.02 | 0.11 0.01 |
| 1 | 0.25 0.04 | 0.21 0.03 | 0.19 0.04 | 0.16 0.03 | 0.38 0.04 | 0.32 0.03 | 0.10 0.02 | 0.08 0.02 |
| 2 | 0.25 0.03 | 0.21 0.02 | 0.19 0.04 | 0.16 0.03 | 0.41 0.04 | 0.36 0.03 | 0.10 0.02 | 0.08 0.02 |
| 3 | 0.26 0.04 | 0.22 0.03 | 0.20 0.04 | 0.17 0.03 | 0.42 0.04 | 0.36 0.04 | 0.11 0.02 | 0.08 0.02 |
| 4 | 0.28 0.04 | 0.22 0.04 | 0.22 0.04 | 0.18 0.04 | 0.44 0.05 | 0.36 0.07 | 0.12 0.02 | 0.09 0.03 |
| 5 | 0.29 0.04 | 0.22 0.03 | 0.23 0.04 | 0.17 0.03 | 0.44 0.04 | 0.35 0.04 | 0.12 0.02 | 0.08 0.02 |
| Layer | selected epoch noTF | selected epoch TF | validation loss noTF | validation loss TF | temperature noTF | temperature TF | norm. acc. (mixed) noTF | norm. acc. (mixed) TF | norm. acc. (within-run) noTF | norm. acc. (within-run) TF |
| 0 | 83 8 | 78 13 | 8.52 0.01 | 8.55 0.01 | 16.09 0.01 | 16.69 0.02 | 0.120 0.003 | 0.128 0.001 | 0.121 0.004 | 0.115 0.001 |
| 1 | 63 16 | 91 8 | 8.34 0.03 | 7.33 0.04 | 15.94 0.03 | 17.05 0.02 | 0.196 0.006 | 0.377 0.017 | 0.142 0.004 | 0.191 0.004 |
| 2 | 58 8 | 86 6 | 8.34 0.05 | 7.23 0.03 | 16.01 0.02 | 17.08 0.01 | 0.201 0.008 | 0.396 0.019 | 0.141 0.005 | 0.203 0.003 |
| 3 | 72 12 | 83 9 | 8.38 0.03 | 7.30 0.06 | 16.02 0.03 | 17.04 0.01 | 0.200 0.007 | 0.386 0.012 | 0.135 0.004 | 0.194 0.003 |
| 4 | 74 16 | 81 9 | 8.38 0.03 | 7.34 0.09 | 15.99 0.03 | 17.00 0.01 | 0.208 0.011 | 0.391 0.020 | 0.134 0.004 | 0.191 0.004 |
| 5 | 61 7 | 92 6 | 8.35 0.05 | 7.27 0.05 | 15.93 0.02 | 16.98 0.03 | 0.213 0.008 | 0.414 0.015 | 0.133 0.003 | 0.196 0.003 |
| List | Decoder | Layer | Top-1 | Top-1, lag-1 swap | Top-1, random swap | Top-10 | Top-10, lag-1 swap | Within-run gain (pp) |
| 50 content words | noTF | 0 | 5.1 0.7 | 2.7 0.2 | 2.9 0.1 | 33.8 1.2 | 23.8 1.5 | 8.0 0.6 |
| 1 | 12.8 0.5 | 7.2 0.5 | 5.6 0.3 | 59.5 0.9 | 45.5 1.4 | 13.2 0.7 | ||
| 2 | 13.0 0.9 | 7.2 0.6 | 5.7 0.4 | 60.2 1.8 | 46.6 1.5 | 13.3 0.9 | ||
| 4 | 14.0 1.1 | 8.5 0.4 | 6.4 0.5 | 61.7 2.2 | 50.0 1.5 | 12.1 0.8 | ||
| 8 | 13.6 1.0 | 9.6 0.5 | 6.9 0.6 | 62.1 2.3 | 53.5 2.6 | 11.1 0.4 | ||
| 16 | 15.6 0.5 | 11.3 0.4 | 8.3 0.6 | 64.5 0.8 | 56.8 1.9 | 10.9 0.8 |
| 50 content words, 1–25 | 50 content words, 26–50 | 50 most frequent words, 1–25 | 50 most frequent words, 26–50 |
| 1. said (1,206) | 26. left (218) | 1. the (14,112) | 26. on (1,387) |
| 2. man (590) | 27. say (213) | 2. and (6,503) | 27. said (1,206) |
| 3. like (414) | 28. thought (211) | 3. of (5,896) | 28. this (1,147) |
| 4. did (404) | 29. tell (211) | 4. to (5,887) | 29. from (1,128) |
| 5. time (394) | 30. night (204) | 5. a (5,756) | 30. be (1,114) |
| 6. know (357) | 31. make (202) | 6. he (4,064) | 31. my (1,103) |
| Component | Detail | No sequence model | With transformer |
| EEG encoder | global pathway, four convolutional blocks | 551,328 | 551,328 |
| global pathway, attention pooling | 385 | 385 | |
| local pathway, three convolutional blocks | 181,536 | 181,536 | |
| head, two fully-connected layers and output layer | 1,182,720 | 1,182,720 | |
| [MASK] token | 256-dimensional | 256 | 256 |
| Input layer normalisation | 512 | 512 |
EEG Decoding
Electroencephalography (EEG) decoding maps brain-signal patterns to mental states, stimuli, speech, or intended actions.
See all 198 papers