OSCR

Interpretable embeddings of speech explain and enhance the brain encoding performance of audio models.

Code ↔ Paper

15 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 15 matches
  1. [1] § Results › SFMs encode brain-relevant semantic information ↔ release/Codes/semantics_lexical_control.py, lines 1 to 26 · score 0.86 · semantic QA features, gram probability, lexical predictability, word frequency, semantic control, unique neural variance · Report a mismatch
  2. [2] § Results › SFMs encode brain-relevant semantic information ↔ release/Feature_Codes/lexical_features.py, lines 1 to 55 · score 0.84 · gram probability, lexical predictability, word frequency, semantic control, unique neural variance, entropy · Report a mismatch
  3. [3] § Materials and methods › Interpretable features ↔ release/Feature_Codes/articulatory_features.ipynb, lines 133 to 196 · score 0.76 · ARPAbet, Word intervals, cmudict, nltk, corpus, phones · Report a mismatch
  4. [4] § Materials and methods › Interpretable features ↔ release/Feature_Codes/lexical_features.py, lines 1 to 55 · score 0.67 · speech presence, syntactic features, unique neural variance, mel spectrograms, semantic features, GBFB · Report a mismatch
  5. [5] § Materials and methods › Interpretable features ↔ release/Feature_Codes/podcast_audio_tagger.ipynb, lines 6 to 21 · score 0.64 · EfficientAT, audio tagger, Speech probability · Report a mismatch
  6. [6] § Results › SFMs encode brain-relevant semantic information ↔ release/Codes/lexical_control_fig5e.py, lines 1 to 30 · score 0.63 · unique semantic neural, IFG Tri, semantic interpretable features, HuBERT, SFM representations, WavLM · Report a mismatch
  7. [7] § Materials and methods › Encoding model construction ↔ release/Codes/func/variance_partition.py, lines 118 to 238 · score 0.63 · training folds, cross validation, channels, splitting, PCA, predict · Report a mismatch
  8. [8] § Results › SFMs encode brain-relevant semantic information ↔ release/Codes/semantics_lexical_control.py, lines 1 to 26 · score 0.61 · semantic QA features, speech presence, unique neural variance, mel spectrogram, GBFB, syntactic · Report a mismatch
  9. [9] § Materials and methods › Speech models ↔ release/Features/SSS/extract_speech_features.py, lines 286 to 352 · score 0.59 · hidden state, speech models, stride, training, audio, layer · Report a mismatch
  10. [10] § Materials and methods › Encoding model construction ↔ release/Analysis/joint_sfm.ipynb, lines 6 to 128 · score 0.57 · cross validation, high gamma, splitting, signals, chunks, PCA · Report a mismatch
  11. [11] § Results › SFMs encode brain-relevant semantic information ↔ release/Codes/semantics_lexical_layers.py, lines 1 to 26 · score 0.54 · unique semantic neural, IFG Tri, semantic interpretable features, SFM representations, neural variance, predicting · Report a mismatch
  12. [12] § Materials and methods › Interpretable features ↔ release/Feature_Codes/mel-spectrogram.ipynb, lines 40 to 82 · score 0.54 · Mel spectrograms, decibels, 8 kHz, librosa, bins, window · Report a mismatch
  13. [13] § Results › SFMs encode brain-relevant semantic information ↔ release/Codes/lexical_control_ifg.py, lines 58 to 111 · score 0.52 · pars triangularis, IFG Tri, median, Wilcoxon, semantic · Report a mismatch
  14. [14] § Materials and methods › Interpretable features ↔ release/Codes/partition_interpretables.py, lines 42 to 44 · score 0.52 · Spectro temporal modulation, resample, signal, GBFB · Report a mismatch
  15. [15] § Materials and methods › Encoding model construction ↔ release/Analysis/semantics_allmodels.ipynb, lines 1082 to 1196 · score 0.50 · optimal context, HuBERT, variance partitioning, WavLM, Whisper, encoding · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

Python · 116 lines · 4.5 KB · CC-BY-4.0 · 2 matches

  1. """
  2. Does the unique neural variance of the semantic QA features survive a lexical
  3. predictability control? (Reviewer 1, comment 1.3)
  4. The manuscript isolates semantics against a non-semantic control set of
  5. {speech presence, mel-spectrogram, GBFB, phonetic, syntactic}. The reviewer
  6. observes that this omits word frequency, n-gram probability and LLM surprisal,
  7. and that the IFG tracks lexical predictability, so the "unique semantic"
  8. variance could be that confound instead.
  9. This runs the same partition twice, changing only the control set:
  10. baseline : A = semantics, B = {speech, melspec, gbfb, phonetic, syntactic}
  11. +lexical : A = semantics, B = baseline + lexical
  12. where `lexical` is the 6-column predictor set from
  13. Feature_Codes/lexical_features.py (unigram log-frequency, bigram / trigram /
  14. skip-gram log-probability, GPT-2 XL surprisal, GPT-2 XL entropy).
  15. If unique_A is largely unchanged, the semantic effect is not reducible to
  16. sequence predictability. No SFM is involved: this is the Fig 5c/d comparison,
  17. which is the one the reviewer's objection targets.
  18. Output: Results/Semantics/lexical_control.pkl with per-electrode arrays for
  19. both conditions.
  20. """
  21. #### ChatGPT was used to assist writing code. The authors reviewed, edited, and take full responsibility for the content.
  22. import os
  23. PODCAST_ROOT = os.environ.get("PODCAST_ROOT", "/engram/naplab/users/rs4613/Podcast") # set to your copy of the dataset
  24. import pickle
  25. import random
  26. import sys
  27. from pathlib import Path
  28. import numpy as np
  29. import scipy as sp
  30. import torch
  31. FUNC_DIR = f"{PODCAST_ROOT}/Encoding_v5/Codes/func"
  32. sys.path.append(FUNC_DIR)
  33. from variance_partition import variance_partition_func
  34. random.seed(42)
  35. np.random.seed(42)
  36. torch.manual_seed(42)
  37. FEAT_ROOT = Path(f"{PODCAST_ROOT}/Encoding_v5/Features")
  38. DATA_ROOT = Path(f"{PODCAST_ROOT}/Encoding_v5/Data")
  39. RES_ROOT = Path(f"{PODCAST_ROOT}/Encoding_v5/Results")
  40. stride, true_window = 0.25, 0.5
  41. speech_embedding = np.load(FEAT_ROOT / "podcast_audio_tag_v3.npy")[:-1, 0][:, None]
  42. melspec = np.load(FEAT_ROOT / f"melspec_{stride}_{true_window}.npy")
  43. melspec = melspec.reshape(melspec.shape[0], -1)
  44. gbfb = sp.io.loadmat(FEAT_ROOT / "gbfb_features.mat")["gbfb_features"].T
  45. gbfb_resampled = sp.signal.resample(gbfb, speech_embedding.shape[0], axis=0)
  46. semantics = np.concatenate(
  47. [np.load(FEAT_ROOT / f"semantics_{c}_{stride}_{true_window}.npy") for c in ("0", "3", "1.5")],
  48. axis=1)
  49. phonetic = np.load(FEAT_ROOT / f"phonetic_{stride}_{true_window}.npy")
  50. syntactic = np.load(FEAT_ROOT / f"syntactic_{stride}_{true_window}.npy")
  51. lexical = np.load(FEAT_ROOT / f"lexical_{stride}_{true_window}.npy")
  52. hg = np.load(DATA_ROOT / "hg_signal_resampled_4hz.npy").T
  53. print("HG shape:", hg.shape, "| lexical shape:", lexical.shape, flush=True)
  54. BASE_SETS = [speech_embedding, melspec, gbfb_resampled, phonetic, syntactic]
  55. BASE_PCAS = [None, 0.95, 0.95, None, None]
  56. BASE_NAMES = ["Speech", "Melspec", "GBFB", "Phonetic", "Syntactic"]
  57. CONDITIONS = {
  58. "baseline": (BASE_SETS, BASE_PCAS, BASE_NAMES),
  59. "plus_lexical": (BASE_SETS + [lexical], BASE_PCAS + [None], BASE_NAMES + ["Lexical"]),
  60. }
  61. results = {}
  62. for cond, (sets_b, pcas_b, names_b) in CONDITIONS.items():
  63. print(f"\n>>> {cond}: B = {'+'.join(names_b)}", flush=True)
  64. part = variance_partition_func(
  65. groupA_sets=[semantics], groupA_pcas=[None], namesA=["Semantics"],
  66. groupB_sets=sets_b, groupB_pcas=pcas_b, namesB=names_b,
  67. Y=hg, n_outer_splits=5,
  68. )
  69. results[cond] = {
  70. "names_B": names_b,
  71. "R2_A": part["r2A"].mean(axis=0),
  72. "R2_B": part["r2B"].mean(axis=0),
  73. "R2_AB": part["total"].mean(axis=0),
  74. "Unique_A": part["unique_A"].mean(axis=0),
  75. "Unique_B": part["unique_B"].mean(axis=0),
  76. "Shared": part["shared"].mean(axis=0),
  77. }
  78. u = results[cond]["Unique_A"]
  79. print(f" unique_A: mean {u.mean():.5f} | sum {u.sum():.3f} | "
  80. f"n>0 {(u > 0).sum()} of {u.size}", flush=True)
  81. ub, ul = results["baseline"]["Unique_A"], results["plus_lexical"]["Unique_A"]
  82. print("\n=== unique semantic variance, baseline vs +lexical ===")
  83. print(f" sum {ub.sum():8.3f} -> {ul.sum():8.3f} "
  84. f"({100*(ul.sum()-ub.sum())/ub.sum():+.1f}%)")
  85. print(f" mean {ub.mean():8.5f} -> {ul.mean():8.5f}")
  86. print(f" n electrodes > 0 {(ub > 0).sum():5d} -> {(ul > 0).sum():5d}")
  87. print(f" correlation across electrodes: {np.corrcoef(ub, ul)[0, 1]:.4f}")
  88. out = RES_ROOT / "Semantics" / "lexical_control.pkl"
  89. out.parent.mkdir(parents=True, exist_ok=True)
  90. with out.open("wb") as f:
  91. pickle.dump(results, f)
  92. print("\nSaved:", out)

semantics_lexical_control.py, under CC-BY-4.0 · at the source

Overview

Authors: Riki Shimizu1, Richard J Antonello1, Chandan Singh2, Nima Mesgarani1
ORCID iDs: Riki Shimizu
  1. Mortimer B. Zuckerman Mind Brain Behavior Institute, Columbia University, New York, New York, United States of America
  2. Microsoft Research, Redmond, Washington, United States of America
Institutions: Mortimer B. Zuckerman Mind Brain Behavior Institute (United States); Columbia University (United States); Microsoft (United States) (United States)
Journal: PLoS computational biology, volume 22, issue 10, article e1014906
Dates: received 4 May 2026; accepted 15 October 2026; published online 30 October 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1371/journal.pcbi.1014906 · PMID 42961972 · PMCID PMC13722164 · OpenAlex W7224969437
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: intracranial EEG (iEEG / ECoG / SEEG) (modality), human (organism), cognitive (subfield)
Methods: Spectral & time-frequency, Connectivity, Smoothing, state filtering, decompositions, Machine learning, Statistics, Preprocessing
MeSH: Brain*, Models, Neurological*, Speech*, Speech Perception*, Computational Biology, Computer Simulation, Electrocorticography, Humans, Semantics (* major topic)
Topic: Speech Recognition and Synthesis (Artificial Intelligence, Computer Science), according to OpenAlex
Citations: not cited yet (Europe PMC); 46 references in the paper

Abstract

Speech foundation models (SFMs) are increasingly hailed as powerful computational models of human speech perception. However, since their representations are inherently black-box, it remains unclear what drives their alignment with brain responses. To remedy this, we built linear encoding models from six interpretable feature families: mel-spectrogram, Gabor filter bank features, speech presence, phonetic, syntactic, and semantic features, and contextualized embeddings from three state-of-the-art SFMs (Whisper, HuBERT, WavLM), quantifying electrocorticography (ECoG) response variance shared between feature classes. Variance-partitioning analyses revealed several key insights: First, the SFMs’ alignment with the brain can be mostly accounted for by their ability to learn and encode simple interpretable speech features. Second, SFMs exhibit a systematic trade-off between encoding of brain-relevant low-level and high-level features across layers. Finally, our results show that SFMs learn brain-relevant semantics which cannot be accounted for by lower-level speech features, with this capacity increasing with model size and context length. Together, our findings suggest a principled approach to build more interpretable, accurate, and efficient encoding models of the brain by augmenting SFM embeddings with interpretable features.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 15 matches between paragraphs and lines of code.

Zenodo 22296432

License: CC-BY-4.0
State: the link answers, verified on 1 November 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: “Data Availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (42 files), SciPy (23 files), PyTorch (20 files), pandas (16 files), Matplotlib (15 files), MNE-Python (9 files), MNE-BIDS (6 files), Nilearn (6 files), scikit-learn (4 files), h5py (3 files), seaborn (1 file), statsmodels (1 file), Hugging Face Transformers (1 file)
Availability: 1 check, the latest on 1 November 2026: the link answers (HTTP 200)
  • 1 November 2026: the link answers (HTTP 200)
61 files

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 61 scripts, each with its path and the digest of its content;
  • 15 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

Datasets cited

Data Availability

No new data were generated by this study. The analyses used the publicly available “Podcast” ECoG dataset (Zada et al., 2025, Scientific Data 12:1135, https://doi.org/10.1038/s41597-025-05462-2), which is deposited on OpenNeuro under accession ds005574 (https://openneuro.org/datasets/ds005574; https://doi.org/10.18112/openneuro.ds005574.v1.0.2) and licensed CC0. All analysis code generated for this study, including scripts for interpretable feature extraction, encoding-model fitting, and variance partitioning, has been deposited on Zenodo with a citable DOI (https://doi.org/10.5281/zenodo.22296432). The deposit also includes the question-answering semantic features, which were generated with the OpenAI API and cannot be regenerated exactly; all other feature representations are reproduced from the public dataset by the deposited code.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 1 November 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 9 MeSH terms, 41 references.

Cite

This paper

Shimizu, R., Antonello, R. J., Singh, C., & Mesgarani, N. (2026). Interpretable embeddings of speech explain and enhance the brain encoding performance of audio models. PLoS computational biology, 22(10), e1014906. https://doi.org/10.1371/journal.pcbi.1014906

BibTeX

@article{shimizu2026interpretable,
author = {Shimizu, Riki and Antonello, Richard J and Singh, Chandan and Mesgarani, Nima},
title = {{Interpretable embeddings of speech explain and enhance the brain encoding performance of audio models}},
journal = {PLoS computational biology},
year = {2026},
month = oct,
volume = {22},
number = {10},
pages = {e1014906},
publisher = {PLOS},
issn = {1553-734X},
doi = {10.1371/journal.pcbi.1014906},
url = {https://doi.org/10.1371/journal.pcbi.1014906},
pmid = {42961972},
pmcid = {PMC13722164}
}

RIS

TY - JOUR
AU - Shimizu, Riki
AU - Antonello, Richard J
AU - Singh, Chandan
AU - Mesgarani, Nima
TI - Interpretable embeddings of speech explain and enhance the brain encoding performance of audio models
T2 - PLoS computational biology
J2 - PLoS Comput Biol
PY - 2026
DA - 2026/10/30
VL - 22
IS - 10
SP - e1014906
SN - 1553-734X
PB - PLOS
DO - 10.1371/journal.pcbi.1014906
UR - https://doi.org/10.1371/journal.pcbi.1014906
LA - en
ER -

CSL-JSON

{
"id": "10.1371/journal.pcbi.1014906",
"type": "article-journal",
"title": "Interpretable embeddings of speech explain and enhance the brain encoding performance of audio models",
"container-title": "PLoS computational biology",
"author": [
{
"family": "Shimizu",
"given": "Riki"
},
{
"family": "Antonello",
"given": "Richard J"
},
{
"family": "Singh",
"given": "Chandan"
},
{
"family": "Mesgarani",
"given": "Nima"
}
],
"container-title-short": "PLoS Comput Biol",
"volume": "22",
"issue": "10",
"page": "e1014906",
"DOI": "10.1371/journal.pcbi.1014906",
"PMID": "42961972",
"PMCID": "PMC13722164",
"ISSN": "1553-734X",
"publisher": "PLOS",
"URL": "https://doi.org/10.1371/journal.pcbi.1014906",
"language": "en",
"issued": {
"date-parts": [
[
2026,
10,
30
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1038/s41597-025-05462-2 [code]
The "Podcast" ECoG dataset for modeling neural activity during natural language comprehension.
Journal: Scientific data
In common: MNE-BIDS, MNE-Python, Nilearn, 8 other tools, OpenNeuro 10.18112/openneuro.ds005574.v1.0.2, OpenNeuro ds005574, intracranial EEG (iEEG / ECoG / SEEG), 6 references
[2] doi:10.7554/elife.106543 [code]
Stimulus dependencies-rather than next-word prediction-can explain pre-onset brain encoding in naturalistic listening designs.
Journal: eLife
In common: MNE-BIDS, Hugging Face Transformers, MNE-Python, 8 other tools, OpenNeuro ds005574, cognitive, 3 references
[3] doi:10.1038/s41467-024-49173-5 [code]
Shared functional specialization in transformer-based language models and the human brain.
Journal: Nature communications
In common: Hugging Face Transformers, Nilearn, statsmodels, 7 other tools, 9 references
[4] doi:10.1162/imag.a.1227 [code]
Large language models reveal the neural tracking of linguistic context in attended and unattended multi-talker speech.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: Hugging Face Transformers, MNE-Python, h5py, 7 other tools, intracranial EEG (iEEG / ECoG / SEEG), cognitive, 5 references
[5] doi:10.1016/j.isci.2025.112798 [code]
Neural encoding of linguistic features during natural sentence reading.
Journal: iScience
In common: MNE-BIDS, MNE-Python, h5py, 7 other tools, cognitive, 5 references
[6] doi:10.1038/s41467-026-72253-7 [code]
Spurious alignment between large language models and brains can emerge from non-robust methods and overlooked confounds.
Journal: Nature communications
In common: Hugging Face Transformers, Nilearn, h5py, 7 other tools, 5 references
[7] doi:10.1038/s41467-025-65518-0 [code]
Temporal structure of natural language processing in the human brain corresponds to layered hierarchy of large language models.
Journal: Nature communications
In common: Hugging Face Transformers, statsmodels, PyTorch, 6 other tools, intracranial EEG (iEEG / ECoG / SEEG), cognitive, 4 references
[8] doi:10.1038/s41562-025-02231-4 [code]
Conversational content is organized across multiple timescales in the brain.
Journal: Nature human behaviour
In common: h5py, seaborn, scikit-learn, 4 other tools, cognitive, 7 references
[9] doi:10.1162/nol_a_00125 [code]
Information-Restricted Neural Language Models Reveal Different Brain Regions' Sensitivity to Semantics, Syntax, and Context.
Journal: Neurobiology of language (Cambridge, Mass.)
In common: Hugging Face Transformers, Nilearn, h5py, 7 other tools, cognitive, 4 references
[10] doi:10.1371/journal.pbio.3002366 [code]
Many but not all deep neural network audio models capture brain responses and exhibit correspondence between model stages and brain regions.
Journal: PLoS biology
In common: Hugging Face Transformers, h5py, statsmodels, 7 other tools, 4 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014906.svg)](https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014906)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014906.svg
   :target: https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014906
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014906"><img src="https://openscicode.org/badge/doi/10.1371/journal.pcbi.1014906.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.