SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2212.10898 · ICLR · 2023

Training language models to summarize narratives improves brain alignment

Mariya Toneva, Khai Loong

arXiv · PDF · Open in the Atlas

Code that ran

3 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2212.10898.json · badge: /api/ran/2212.10898.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
awwkl/brain_language_narratives canonical (classifier label)
classifier basis not recorded on the link
2 ran · 1 no recorded run
awwkl/brain_language_summarization canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
extract_brain_score Ran
ran, honoured the contract we drafted
awwkl/brain_language_summarization/all_scripts/figures_paper/plot_fig_1a_brain_score.py
code served (permissive licence) · get_code("57aff233884a8087")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned ndarray, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pickle
import numpy as np
import tempfile
import os

# Create a temporary pickle file with the expected data structure
# The function expects:
# - loaded to be an array-like object
# - loaded.mean(0) to return mean across first axis (folds)
# - result.mean(0) to return mean across subjects

# Create data with shape (n_folds, n_subjects, n_metrics) or similar
# Let's use (3 folds, 5 subjects, 2 metrics) to have distinct dimensions
data = np.random.rand(3, 5, 2)

# Create a temporary file and write the pickle
temp_file = tempfile.NamedTemporaryFile(mode='wb', delete=False, suffix='.pkl')
pickle.dump(data, temp_file)
temp_file.close()

pkl_path = temp_file.name

ARGS = {
    'pkl_path': pkl_path
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
extract_brain_scores_per_roi Ran
ran on a synthesized input
awwkl/brain_language_narratives/all_scripts/figures_paper/plot_fig_2b_RoI_brain_score.py
code served (permissive licence) · get_code("596ce83d4d70c143")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (10,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import pickle
import tempfile
import os

# Create temporary directory for pickle and npy files
temp_dir = tempfile.mkdtemp()

# Create a mock brain score pickle file
# brain_score should be a 2D array where mean(0) gives voxel-wise scores
brain_scores_data = np.random.rand(5, 100)  # 5 samples, 100 voxels
brain_score_pkl_path = os.path.join(temp_dir, 'brain_scores.pkl')
with open(brain_score_pkl_path, 'wb') as f:
    pickle.dump(brain_scores_data, f)

# Create mock HP_subj_roi_inds.npy file
# This should be a dict-like structure indexed by subject
roi_masks = {
    'PostTemp': np.random.rand(100) > 0.5,
    'AntTemp': np.random.rand(100) > 0.5,
    'AngularG': np.random.rand(100) > 0.5,
    'IFG': np.random.rand(100) > 0.5,
    'MFG': np.random.rand(100) > 0.5,
    'IFGorb': np.random.rand(100) > 0.5,
    'pCingulate': np.random.rand(100) > 0.5,
    'dmpfc': np.random.rand(100) > 0.5,
    'all': np.ones(100, dtype=bool)  # all voxels mask
}

hp_roi_inds_data = np.array({'subj_001': roi_masks}, dtype=object)
hp_roi_inds_path = os.path.join(temp_dir, 'HP_subj_roi_inds.npy')
np.save(hp_roi_inds_path, hp_roi_inds_data)

# Patch the data path in the module
import sys
original_dir = os.getcwd()
os.chdir(temp_dir)
os.makedirs('./data', exist_ok=True)
import shutil
shutil.copy(hp_roi_inds_path, './data/HP_subj_roi_inds.npy')

ARGS = {
    'brain_score_pkl_path': brain_score_pkl_path,
    'subject': 'subj_001'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (10,) — shape (10,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
extract_rouge_results Ran
ran on a synthesized input
awwkl/brain_language_narratives/all_scripts/plot_rouge_score.py
code served (permissive licence) · get_code("f486206c6dfc37de")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pickle
import tempfile
import os

# Create a temporary pickle file with the expected structure
temp_dir = tempfile.mkdtemp()
pkl_path = os.path.join(temp_dir, 'rouge_results.pkl')

# Create the expected data structure
# The function expects raw_dict with keys 'rouge1', 'rouge2', 'rougeL', 'rougeLsum'
# Each key maps to a tuple where index [1] is another tuple with index [2] being the f-measure score
raw_dict = {
    'rouge1': (None, (0.5, 0.6, 0.65)),
    'rouge2': (None, (0.4, 0.5, 0.55)),
    'rougeL': (None, (0.45, 0.55, 0.62)),
    'rougeLsum': (None, (0.42, 0.52, 0.61))
}

with open(pkl_path, 'wb') as f:
    pickle.dump(raw_dict, f)

ARGS = {
    'pkl_path': pkl_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
save_layer_representations Not yet run
unverified (harvested, no recorded run)
awwkl/brain_language_narratives/extract_nlp_features.py
code served (permissive licence) · get_code("962b05407e9aebd5")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 3 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
save_layer_representations 1 other paper
1 dated earlier
1905.11833 (2019-05)
Interpreting and improving natural-language processing (in machines) with natural language-processing (in the brain)

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Building systems that achieve a deeper understanding of language is one of the central goals of natural language processing (NLP). Towards this goal, recent works have begun to train language models on narrative datasets which require extracting the most critical information by integrating across long contexts. However, it is still an open question whether these models are learning a deeper understanding of the text, or if the models are simply learning a heuristic to complete the task. This work investigates this further by turning to the one language processing system that truly understands complex language: the human brain. We show that training language models for deeper narrative understanding results in richer representations that have improved alignment to human brain activity. We further find that the improvements in brain alignment are larger for character names than for other discourse features, which indicates that these models are learning important narrative elements. Taken together, these results suggest that this type of training can indeed lead to deeper language understanding. These findings have consequences both for cognitive neuroscience by revealing some of the significant factors behind brain-NLP alignment, and for NLP by highlighting that understanding of long-range context can be improved beyond language modeling. Code available at https://github.com/awwkl/brain language summarization.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2212.10898")
get_code_for_paper("2212.10898")
have("2212.10898")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2212.10898.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2212.10898.svg)](https://syntology.ai/paper/2212.10898)

Connect an agent — have() is free.