Generating and validating natural-language explanations for the brain.
68
stars
506
commits
Jupyter Notebook
primary language
Jun 1, 2026
updated
We’ve been studying how to scalably answer this question using LLMs and large-scale brain-imaging datasets. Together, these let us automatically generate and test scientific hypotheses about language processing in the brain, potentially enabling a new paradigm for scientific research. This repo contains code for running these analyses.
This repo contains code underlying 2 neuroscience studies:
This repo also contains code for experiments in 3 ML studies (for a simple scikit-learn interface to use these, see imodelsX):
Finally, here are 3 studies that share the codebase here:
Dataset
neuro/config.py and download data to the appropriate locations from this box folder
python experiments/00_load_dataset.py (will download the data using datalad){root_dir}/ds003020/derivative/pycortex-db/data/decoding folder contains a quickstart easy example for TR-level decoding
Code
cd into the repo, run uv add git+https://github.com/csinva/imodelsX, then run uv sync. This will locally install the neuro packageneuro.data.response_utils function load_response{neuro.config.root_dir}/ds003020/derivative/preprocessed_data/{subject}, where they are stored in an h5 file for each story, e.g. wheretheressmoke.h5ridge_utils.features.stim_utils function load_story_wordseqs{root_dir}/ds003020/derivative/TextGrids, where each story has a TextGrid file, e.g. wheretheressmoke.TextGrid{root_dir}/ds003020/derivative/respdict.json to get the length of each storyDemo
python experiments/02_fit_encoding.py
Jupyter Notebook
60.5%
HTML
36.6%
Python
2.9%
Generating and validating natural-language explanations for the brain.
68
stars
506
commits
Jupyter Notebook
primary language
Jun 1, 2026
updated
We’ve been studying how to scalably answer this question using LLMs and large-scale brain-imaging datasets. Together, these let us automatically generate and test scientific hypotheses about language processing in the brain, potentially enabling a new paradigm for scientific research. This repo contains code for running these analyses.
This repo contains code underlying 2 neuroscience studies:
This repo also contains code for experiments in 3 ML studies (for a simple scikit-learn interface to use these, see imodelsX):
Finally, here are 3 studies that share the codebase here:
Dataset
neuro/config.py and download data to the appropriate locations from this box folder
python experiments/00_load_dataset.py (will download the data using datalad){root_dir}/ds003020/derivative/pycortex-db/data/decoding folder contains a quickstart easy example for TR-level decoding
Code
cd into the repo, run uv add git+https://github.com/csinva/imodelsX, then run uv sync. This will locally install the neuro packageneuro.data.response_utils function load_response{neuro.config.root_dir}/ds003020/derivative/preprocessed_data/{subject}, where they are stored in an h5 file for each story, e.g. wheretheressmoke.h5ridge_utils.features.stim_utils function load_story_wordseqs{root_dir}/ds003020/derivative/TextGrids, where each story has a TextGrid file, e.g. wheretheressmoke.TextGrid{root_dir}/ds003020/derivative/respdict.json to get the length of each storyDemo
python experiments/02_fit_encoding.py
Jupyter Notebook
60.5%
HTML
36.6%
Python
2.9%