OSCR

A neural signature of adaptive mentalization.

Code ↔ Paper

18 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 18 matches · 3 of them tie a paragraph to a whole file, not to given lines: weak matches, whose lines are not tinted
  1. [1] § Results › Characterizing adaptive mentalization with the CHASE model ↔ source/BAKR_2024_CHASE_model.m, lines 1–31 · score 0.84 · rock paper scissors, strategic player, best respond, recursive reasoning steps, CHASE model, exploitable
  2. [2] § Methods › CHASE model ↔ source/BAKR_2024_CHASE_model.m, lines 1–31 · score 0.81 · Strategic players, best responding, recursive reasoning steps, CHASE model, iteratively, rock
  3. [3] § Methods › Neuroimaging data acquisition and analysis › Univariate analysis ↔ source/BAKR_2024_2L.m, lines 140–212 · score 0.73 · SnPM, cluster forming threshold, SPM, FWE, inference, mask
  4. [4] § Methods › Alternative models › Self-tuning EWA ↔ source/BAKR_2024_CHASE_LR_update.m, lines 74–151 · score 0.73 · change detector function, foregone payoffs, empirical, tuning, EWA, model
  5. [5] § Methods › Neuroimaging data acquisition and analysis › Univariate analysis ↔ source/BAKR_2024_create_nuisance_regressors.m, the whole file · a weak match · score 0.69 · global signal, motion parameters, derivatives, confounds, regressors, uniformity
  6. [6] § Methods › CHASE model › Loss sensitivity and learning differences ↔ source/BAKR_2024_CHASE_model.m, lines 33–144 · score 0.68 · loss aversion, payoff matrix, recursive reasoning, wins
  7. [7] § Methods › CHASE model › Loss sensitivity and learning differences ↔ source/BAKR_2024_ToMk_model.m, lines 6–117 · score 0.68 · loss aversion, payoff matrix, recursive reasoning, wins
  8. [8] § Methods › CHASE model › A3: adaptive players ( > 1) try to infer the level of the opponent ↔ source/BAKR_2024_CHASE_model.m, lines 33–144 · score 0.62 · KL divergence, possible opponent, successive belief, BU, prediction
  9. [9] § Methods › CHASE model › A3: adaptive players ( > 1) try to infer the level of the opponent ↔ source/BAKR_2024_ToMk_model.m, lines 6–117 · score 0.62 · KL divergence, possible opponent, successive belief, BU, prediction
  10. [10] § Methods › Neuroimaging data acquisition and analysis › Multivariate analysis ↔ source/BAKR_2024_apply_pattern.m, the whole file · a weak match · score 0.58 · correlation coefficients, neural activation, bins, vector, adaptive, BU
  11. [11] § Methods › Neuroimaging data acquisition and analysis › Functional connectivity analysis › Denoising ↔ source/BAKR_2024_create_nuisance_regressors.m, the whole file · a weak match · score 0.55 · nuisance regressor, derivatives, confounding, signal
  12. [12] § Methods › Computational models ↔ BAKR_2024_run_model_fitting.m, lines 14–33 · score 0.55 · fictitious play, reinforcement learning, EWA, behavior, models
  13. [13] § Results › Opponent-level BUs can be decoded from neural activity ↔ BAKR_2024_results_and_figures.m, lines 530–596 · score 0.55 · multivariate activation pattern, social brain, overlaps, univariate, ROIs, decoding
  14. [14] § Results › Participants track action frequencies to predict nonstrategic play ↔ source/MERLIN_toolbox/mn_compare.m, lines 218–296 · score 0.54 · protected exceedance probability, model comparison, PXP
  15. [15] § Methods › Alternative models › Experience-weighted attraction (EWA) ↔ source/BAKR_2024_CHASE_LR_update.m, lines 74–151 · score 0.54 · foregone payoffs, forgetting, RL, attraction, EWA, weighted
  16. [16] § Results › CHASE outperforms existing alternative models ↔ BAKR_2024_run_model_fitting.m, lines 14–33 · score 0.52 · fictitious play, reinforcement learning, CHASE model, EWA, behavior
  17. [17] § Methods › Neuroimaging data acquisition and analysis › Replication in an independent dataset ↔ BAKR_2024_results_and_figures.m, lines 530–596 · score 0.52 · activation patterns, social brain, Univariate, Multivariate, correlation, decoding
  18. [18] § Results › Brain regions linked to evaluation and adaptation of mentalization strategies ↔ source/BAKR_2024_2L.m, lines 140–212 · score 0.51 · cluster forming threshold, SPM, FWE, Pos, Neg, mask

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

MATLAB · 380 lines · 16 KB · no license · 4 matches

  1. function [negLL,states,data] = BAKR_2024_CHASE_model(data,model,curr_params,type)
  2. %
  3. % Code to fit the CHASE model (Buergi, Aydogan, Konovalov, & Ruff; under review)
  4. %
  5. % In brief, this model captures mentalization in strategic interactions by assuming that:
  6. % - Non-strategic players (defined as k = 0) have a tendency to repeat their historical action frequencies.
  7. % - Strategic players try to exploit this tendency by performing a limited number of recursive reasoning steps
  8. % (k > 0), i.e. iteratively (and noisily) best-responding to that action distribution.
  9. % - Finally, adaptive players (kappa >= 2) assume that they are facing a strategic player and try to infer
  10. % their level of recursive reasoning, by integrating evidence for the different levels over time.
  11. %
  12. % Inputs
  13. % - data: struct containing the experimental data (i.e. choices in Rock-Paper-Scissors) of both players
  14. % . choice_own: vector containing the chosen actions of the subject (from 1:3)
  15. % . choice_other: vector containing the chosen actions of the opponent (from 1:3)
  16. % - curr_params: vector containing the model parameters
  17. % . alpha: speed of updating attractions (i.e. learning rate of a delta rule over chosen actions)
  18. % . beta: recursive reasoning noise (i.e. softmax inverse decision temperature)
  19. % . gamma: sensitivity to evidence for the sophistication of the opponent
  20. % . lambda: loss aversion (or lack thereof)
  21. % . kappa: depth of mentalization (note: equal to k if kappa < 2)
  22. % Outputs
  23. % - negLL: scalar negative log-likelihood of the data, given the model and the parameters
  24. % - states: struct containing the inferred internal states (for e.g. use in neuroimaging analysis)
  25. % . SV: subjective value of the chosen action, given the current predictions about the opponent
  26. % . APE: opponent action prediction error, i.e. level of surprise about the observed opponent action
  27. % . BU: opponent sophistication belief update, i.e. the Kullback-Leibler divergence between successive
  28. % beliefs
  29. %
  30. % Niklas Buergi, 2024
  31. %% Initialize
  32. switch type
  33. case 'fit'
  34. % set game defaults, if none provided
  35. if ~any(isfield(data,{'strat_space','win','loss','tie'}))
  36. data.win = 1;
  37. data.loss = -1;
  38. data.tie = 0;
  39. data.strat_space = 3;
  40. end
  41. % extract variables
  42. choice_own = data.choice_own;
  43. choice_other = data.choice_other;
  44. % nTrials = size(choice_own,1);
  45. assert(numel(choice_own) > 1 & numel(choice_other) > 1 & numel(data.missing) > 1);
  46. case 'sim'
  47. task = data;
  48. data = struct();
  49. [data,env] = task.fxn(data,task,'init');
  50. data.n_trials = numel(data.trial);
  51. data.missing = zeros(data.n_trials,1);
  52. [data.score_own,data.score_other,choice_own,choice_other] = deal(NaN(data.n_trials,1));
  53. end
  54. nTrials = data.n_trials;
  55. nActions = data.strat_space(1);
  56. % name parameters
  57. params = array2table(curr_params','VariableNames',{model.params.name});
  58. % ======================== adapt to parameterization ========================= %
  59. % add loss aversion, if parameter provided
  60. if any(strcmp(params.Properties.VariableNames,'lambda')) % lossav
  61. data.loss = data.loss*params.lambda;
  62. end
  63. % construct payoff matrices
  64. [pi_own, pi_other] = comp_paymatrix(data);
  65. % set exp_max_k
  66. if strcmp(model.maxK_type,'fitted') % || strcmp(type,'sim')
  67. exp_max_k = params.kappa;
  68. else
  69. exp_max_k = model.exp_max_k; % i.e. if not provided via parameters, take from settings
  70. end
  71. % ========================= pre-allocate variables =========================== %
  72. % main variables
  73. subj_pred = NaN(nTrials,nActions); % subject's estimated probability of the different possible opponent actions
  74. subj_resp = NaN(nTrials,nActions); % subject's response probabilities to the estimate above (based on a noisy best-response)
  75. subj_KL_div = NaN(nTrials,1); % belief update (BU), given by the KL-divergence between successive beliefs
  76. subj_APE = NaN(nTrials,1); % 1 minus the probability assigned to the action chosen by the opponent (from subj_pred)
  77. subj_SV = NaN(nTrials,1); % subjective value of choosing the different actions, given one's predictions of the opponent
  78. % recursive reasoning steps (either from own perspetive ('LK'), or from the perspective of the opponent ('CH-leaky'))
  79. if exp_max_k < 2 || strcmp(model.architecture,'LK')
  80. subj_pred_k = deal(NaN(exp_max_k+1,nActions)); % 1st order beliefs (what subjects think the opponent will play)
  81. subj_resp_k = deal(NaN(exp_max_k+1,nActions)); % subject's response probabilities (BR), in response to their beliefs above
  82. elseif exp_max_k >= 2 && contains(model.architecture,'CH')
  83. opp_pred_oppk = NaN(exp_max_k,nActions); % 2nd order beliefs (what subject thinks opponent thinks about them)
  84. opp_resp_oppk = NaN(exp_max_k,nActions); % opponent's response probabilities, in response to their beliefs above (as perceived by the subject)
  85. subj_beliefs = ones(1,exp_max_k)/exp_max_k; % priors of the subject about the opponents's current level k, bounded by their own sophistication
  86. end
  87. % outputs for figures
  88. beliefs = NaN(nTrials,3);
  89. likelihoods = NaN(nTrials,3);
  90. % initialize attractions
  91. switch model.learning_rule
  92. case 'RW-freq'
  93. [f_mat_own,f_mat_other] = BAKR_2024_CHASE_LR_init(model.learning_rule,nTrials,nActions);
  94. case {'RW-reward','RW-hybrid'}
  95. [f_mat_own,f_mat_other] = BAKR_2024_CHASE_LR_init(model.learning_rule,nTrials,nActions,pi_own,pi_other);
  96. score_own = data.score_own; score_other = data.score_other;
  97. case 'RW-regret'
  98. [f_mat_own,f_mat_other,score_pot_own,score_pot_other] = BAKR_2024_CHASE_LR_init(...
  99. model.learning_rule,nTrials,nActions,...
  100. pi_own,pi_other,...
  101. choice_own,choice_other);
  102. case {'EWA-full','EWA-single'}
  103. [f_mat_own,f_mat_other,score_pot_own,score_pot_other,N_own,N_other] = BAKR_2024_CHASE_LR_init(...
  104. model.learning_rule,nTrials,nActions,...
  105. pi_own,pi_other,...
  106. choice_own,choice_other);
  107. end
  108. % =========================== save initial values ============================ %
  109. f_mat_own_0 = f_mat_own(1,:);
  110. f_mat_other_0 = f_mat_other(1,:);
  111. if exp_max_k >= 2 && contains(model.architecture,'CH')
  112. subj_beliefs_0 = subj_beliefs;
  113. end
  114. if any(strcmp(model.learning_rule,{'EWA-full','EWA-single'}))
  115. N_own_0 = N_own(1);
  116. N_other_0 = N_other(1);
  117. end
  118. %% Trial loop
  119. for iTrial = 1:nTrials
  120. % if any(data.choice_own == 0 | isnan(data.choice_own))
  121. % error('Missing choices - have to adapt first.');
  122. % end
  123. % skip updates if missing trial
  124. if numel(data.missing) > 1 && data.missing(iTrial)
  125. f_mat_own(iTrial,:) = f_mat_own(max(1,iTrial-1),:);
  126. f_mat_other(iTrial,:) = f_mat_other(max(1,iTrial-1),:);
  127. if any(strcmp(model.learning_rule,{'EWA-full','EWA-single'}))
  128. N_own(iTrial,:) = N_own(max(1,iTrial-1),:);
  129. N_other(iTrial,:) = N_other(max(1,iTrial-1),:);
  130. end
  131. continue
  132. end
  133. % re-set initial values (if fitting across blocks)
  134. if data.trial(iTrial) == 1 && iTrial > 1
  135. f_mat_own_old = f_mat_own(iTrial-1,:);
  136. f_mat_other_old = f_mat_other(iTrial-1,:);
  137. f_mat_own(iTrial-1,:) = f_mat_own_0; % need to overwrite old ones to ensure correct update below
  138. f_mat_other(iTrial-1,:) = f_mat_other_0;
  139. if exp_max_k >= 2 && contains(model.architecture,'CH')
  140. subj_beliefs = subj_beliefs_0; % will be overwritten at end of trial
  141. end
  142. if any(strcmp(model.learning_rule,{'EWA-full','EWA-single'}))
  143. N_own_old = N_own(iTrial-1);
  144. N_other_old = N_other(iTrial-1);
  145. N_own(iTrial-1) = N_own_0;
  146. N_other(iTrial-1) = N_other_0;
  147. end
  148. end
  149. % strategic reasoning
  150. if exp_max_k < 2 || strcmp(model.architecture,'LK')
  151. % ======================================================================
  152. % Low-level or static reasoning
  153. % ======================================================================
  154. for k = 0:exp_max_k
  155. % ========================= (Re-)active strategies =================== %
  156. if k == 0 % egocentric strategy (ignoring opponent)
  157. subj_pred_k(1,:) = ones(1,nActions)/nActions;
  158. subj_resp_k(1,:) = softmax_fxn(f_mat_own(max(1,iTrial-1),:),params.beta);
  159. elseif k == 1 % responding to the other's egocentric strategy
  160. subj_pred_k(2,:) = softmax_fxn(f_mat_other(max(1,iTrial-1),:),params.beta);
  161. subj_resp_k(2,:) = softmax_fxn((pi_own*subj_pred_k(2,:)')',params.beta);
  162. elseif k >= 2
  163. % ===================== LK: Higher-level reasoning =================== %
  164. % always add two steps of reasoning to last estimate of same type (i.e. odd vs even)
  165. subj_pred_k(k+1,:) = softmax_fxn((pi_other*subj_resp_k(k+1-2,:)')',params.beta);
  166. subj_resp_k(k+1,:) = softmax_fxn((pi_own*subj_pred_k(k+1,:)')',params.beta);
  167. end
  168. subj_pred(iTrial,:) = subj_pred_k(end,:);
  169. subj_resp(iTrial,:) = subj_resp_k(end,:);
  170. end
  171. elseif exp_max_k >= 2 && contains(model.architecture,'CH')
  172. % ======================================================================
  173. % CH: Belief-based strategies
  174. % ======================================================================
  175. % subject simulates reasoning process *of the opponent* to:
  176. % - form and update beliefs about the opponent's level of reasoning
  177. % - predict the next opponent action, marginalizing over these beliefs
  178. for k = 2:exp_max_k
  179. if k == 2 % opponent levels 0 & 1
  180. opp_pred_oppk(1,:) = ones(1,nActions)/nActions; % i.e. no expectations; used only for computing subject action predictions
  181. opp_resp_oppk(1,:) = softmax_fxn(f_mat_other(max(1,iTrial-1),:),params.beta); % = exp_p_a_opp(2,:)
  182. opp_pred_oppk(2,:) = softmax_fxn(f_mat_own(max(1,iTrial-1),:),params.beta); % = exp_p_a_subj(1,:)
  183. opp_resp_oppk(2,:) = softmax_fxn((pi_other*opp_pred_oppk(2,:)')',params.beta);
  184. elseif k > 2 % higher levels: add two more steps to last action estimate of same type (i.e. odd vs even)
  185. opp_pred_oppk(k,:) = softmax_fxn((pi_own*opp_resp_oppk(k-2,:)')',params.beta); % ..compute their opponent's best response to that..
  186. opp_resp_oppk(k,:) = softmax_fxn((pi_other*opp_pred_oppk(k,:)')',params.beta); % ..and compute their own best response to that
  187. end
  188. end
  189. % ========================= Subject beliefs ========================== %
  190. % subject's weighted opponent action prediction & response to that
  191. subj_pred(iTrial,:) = subj_beliefs * opp_resp_oppk;
  192. subj_resp(iTrial,:) = softmax_fxn(pi_own*subj_pred(iTrial,:)',params.beta);
  193. end
  194. % =========================== Action simulation ========================== %
  195. if strcmp(type,'sim')
  196. % subject
  197. choice_own(iTrial) = find(mnrnd(1,subj_resp(iTrial,:)));
  198. data.choice_own(iTrial) = choice_own(iTrial);
  199. % bot
  200. [data,env] = task.fxn(data,task,'update',env,iTrial); % need only: choice_other(iTrial)
  201. choice_other(iTrial,1) = data.choice_other(iTrial);
  202. score_own(iTrial,1) = data.score_own(iTrial);
  203. score_other(iTrial,1) = data.score_other(iTrial);
  204. end
  205. % ========================= Subject beliefs ========================== %
  206. if exp_max_k >= 2 && contains(model.architecture,'CH')
  207. % belief update
  208. prior = subj_beliefs;
  209. likelihood = softmax_fxn(opp_resp_oppk(:,choice_other(iTrial)),params.gamma);
  210. posterior = (likelihood .* prior') ./ sum(likelihood .* prior');
  211. subj_KL_div(iTrial) = nansum(posterior .* log(posterior ./ prior'));
  212. % save
  213. beliefs(iTrial,1:exp_max_k) = subj_beliefs;
  214. likelihoods(iTrial,1:exp_max_k) = likelihood;
  215. % replace with new belief
  216. subj_beliefs = posterior';
  217. end
  218. % compute internal states
  219. subj_APE(iTrial) = 1 - subj_pred(iTrial,choice_other(iTrial));
  220. subj_SV(iTrial) = pi_own(choice_own(iTrial),:) * subj_pred(iTrial,:)';
  221. % ==========================================================================
  222. % Level-0 update
  223. % ==========================================================================
  224. % L0 representation
  225. switch model.learning_rule
  226. case 'RW-freq'
  227. [f_mat_own,f_mat_other] = BAKR_2024_CHASE_LR_update(model.learning_rule,iTrial,f_mat_own,f_mat_other,...
  228. choice_own,choice_other,params);
  229. case {'RW-reward','RW-hybrid'}
  230. [f_mat_own,f_mat_other] = BAKR_2024_CHASE_LR_update(model.learning_rule,iTrial,f_mat_own,f_mat_other,...
  231. choice_own,choice_other,params,...
  232. score_own,score_other);
  233. case 'RW-regret'
  234. [f_mat_own,f_mat_other] = BAKR_2024_CHASE_LR_update(model.learning_rule,iTrial,f_mat_own,f_mat_other,...
  235. choice_own,choice_other,params,...
  236. score_pot_own,score_pot_other);
  237. case {'EWA-full','EWA-single'}
  238. [f_mat_own,f_mat_other,N_own,N_other] = BAKR_2024_CHASE_LR_update(model.learning_rule,iTrial,f_mat_own,f_mat_other,...
  239. choice_own,choice_other,params,...
  240. score_pot_own,score_pot_other,N_own,N_other);
  241. end
  242. % put overwritten values back (if fitting across blocks) <- cannot do earlier because this is used for update above
  243. if data.trial(iTrial) == 1 && iTrial > 1
  244. f_mat_own(iTrial-1,:) = f_mat_own_old;
  245. f_mat_other(iTrial-1,:) = f_mat_other_old;
  246. if any(strcmp(model.learning_rule,{'EWA-full','EWA-single'}))
  247. N_own(iTrial-1) = N_own_old;
  248. N_other(iTrial-1) = N_other_old;
  249. end
  250. end
  251. end
  252. %% Post-processing
  253. % internal states
  254. states.subj_SV = subj_SV;
  255. states.subj_APE = subj_APE;
  256. states.subj_KL_div = subj_KL_div;
  257. % states for figures
  258. % states.f_mat_own = f_mat_own;
  259. % states.likelihoods = likelihoods;
  260. states.beliefs = beliefs;
  261. switch type
  262. case 'fit'
  263. lik = NaN(nTrials,1);
  264. lik(~data.missing) = subj_resp(sub2ind([nTrials,nActions],find(~data.missing),choice_own(~data.missing))); % chosen action
  265. states.lik = lik;
  266. % states.p_a = subj_resp;
  267. negLL = -sum(log(lik(~data.missing)));
  268. case 'sim'
  269. states.beliefs = beliefs;
  270. states.level_k = env.level_k;
  271. % states.score_own = score_own;
  272. states.score = NaN(nTrials,1);
  273. for i_block = 1:task.n_blocks
  274. idx = (task.n_trials*(i_block-1))+1:(task.n_trials*(i_block));
  275. states.score(idx) = cumsum(score_own(idx));
  276. end
  277. % states.gamma = curr_gamma(1:nTrials);
  278. data.choice_own = choice_own;
  279. data.choice_other = choice_other;
  280. data.score_own = score_own;
  281. data.score_other = score_other;
  282. data.n_blocks = 1;
  283. data.bot_level = task.bot.levels;
  284. negLL = NaN;
  285. end
  286. end
  287. function p_actions = softmax_fxn(inputs,beta)
  288. p_actions = exp(beta*inputs)/(sum(exp(beta*inputs)));
  289. end

BAKR_2024_CHASE_model.m at commit 95c6522, no license · at the source

Overview

  1. Zurich Center for Neuroeconomics, Department of Economics, University of Zurich, Zurich, Switzerland
  2. Max Planck Institute for Biological Cybernetics, Tübingen, Germany
  3. University Research Priority Program ‘Adaptive Brain Circuits in Development and Learning’ (URPP AdaBD), University of Zurich, Zurich, Switzerland
  4. School of Psychology, Centre for Human Brain Health, University of Birmingham, Birmingham, UK
  5. Faculty of Medicine, University of Zurich, Zurich, Switzerland
Journal: Nature neuroscience, volume 29, issue 4, pages 934-944
Dates: received 11 February 2024; accepted 22 January 2026; published online 9 March 2026; in print 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41593-026-02219-x · PMID 41803318 · PMCID PMC13061600 · OpenAlex W7134268805
Open access: hybrid, a free copy (OpenAlex)
Status: code verified
Categories: fMRI (modality), human (organism), cognitive (subfield)
Methods: Spectral & time-frequency, Statistics, Smoothing, state filtering, decompositions, Machine learning, Connectivity, fMRI & imaging
Keywords: Neural decoding, Learning algorithms, Social behaviour, Psychology, Decision
MeSH: Adaptation, Psychological*, Brain*, Mentalization*, Theory of Mind*, Brain Mapping, Female, Humans, Magnetic Resonance Imaging, Male, Models, Neurological (* major topic)
Topic: Personality Disorders and Psychopathology (Clinical Psychology, Psychology), according to OpenAlex
Funding: European Research Council (725355); Swiss National Science Foundation (10.006.863)
Citations: cited by 4 papers (Europe PMC); 56 references in the paper

Abstract

Mentalization, inferring others’ emotions and intentions, is crucial for human social interactions and is impaired in various brain disorders. While previous neuroscience research has focused on static mentalization strategies, we know little about how the brain adaptively selects which strategies to use at any given moment. Here we investigate this core aspect of mentalization with computational modeling and functional magnetic resonance imaging (fMRI) during interactive strategic games. We find that most participants can adapt their strategies to the changing sophistication of their opponents, though there are considerable individual differences. Model-based fMRI analyses identify a distributed brain network in which activity and connectivity track this mentalization-belief adaptation. The extent to which people update their beliefs about others’ sophistication can be predicted out of sample from neural activity, providing a neural signature of adaptive mentalization. Our model elucidates the neural basis of mentalization ability and provides a method for assessing these capabilities in healthy and clinical populations.

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 18 matches between paragraphs and lines of code.

ruffgroup/neural_signature_of_mentalization

License: none: the authors keep all their rights
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Commit: 95c6522696ed3129c05e8932ce4f257ffd28ccc8, 13 November 2025
Languages: MATLAB (48), Python (3)
Size: 125 files, 51 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: SPM (9 files), Statistics and Machine Learning Toolbox (7 files), Image Processing Toolbox (3 files), CONN (1 file), Optimization Toolbox (1 file)
Availability: 1 check, the latest on 30 September 2026: the link answers
  • 30 September 2026: the link answers
52 files

Code availability

The analysis code to produce all main results and figures can be accessed at: https://github.com/ruffgroup/neural_signature_of_mentalization56.

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

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;
  • 51 scripts, each with its path and the digest of its content;
  • 18 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

No dataset and no data link were found in the paper.

Data Availability Statement

All behavioral data can be accessed at: https://github.com/ruffgroup/neural_signature_of_mentalization56. Preprocessed neural data are available upon request.

The analysis code to produce all main results and figures can be accessed at: https://github.com/ruffgroup/neural_signature_of_mentalization56.

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, 30 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 5 keywords, 10 MeSH terms, 2 funders, 44 references.

Cite

This paper

Buergi, N., Aydogan, G., Konovalov, A., & Ruff, C. C. (2026). A neural signature of adaptive mentalization. Nature neuroscience, 29(4), 934-944. https://doi.org/10.1038/s41593-026-02219-x

BibTeX

@article{buergi2026neural,
author = {Buergi, Niklas and Aydogan, Gökhan and Konovalov, Arkady and Ruff, Christian C},
title = {{A neural signature of adaptive mentalization}},
journal = {Nature neuroscience},
year = {2026},
month = mar,
volume = {29},
number = {4},
pages = {934--944},
publisher = {Nature Portfolio},
issn = {1097-6256},
doi = {10.1038/s41593-026-02219-x},
url = {https://doi.org/10.1038/s41593-026-02219-x},
pmid = {41803318},
pmcid = {PMC13061600}
}

RIS

TY - JOUR
AU - Buergi, Niklas
AU - Aydogan, Gökhan
AU - Konovalov, Arkady
AU - Ruff, Christian C
TI - A neural signature of adaptive mentalization
T2 - Nature neuroscience
J2 - Nat Neurosci
PY - 2026
DA - 2026/03/09
VL - 29
IS - 4
SP - 934
EP - 944
SN - 1097-6256
PB - Nature Portfolio
DO - 10.1038/s41593-026-02219-x
UR - https://doi.org/10.1038/s41593-026-02219-x
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41593-026-02219-x",
"type": "article-journal",
"title": "A neural signature of adaptive mentalization",
"container-title": "Nature neuroscience",
"author": [
{
"family": "Buergi",
"given": "Niklas"
},
{
"family": "Aydogan",
"given": "Gökhan"
},
{
"family": "Konovalov",
"given": "Arkady"
},
{
"family": "Ruff",
"given": "Christian C"
}
],
"container-title-short": "Nat Neurosci",
"volume": "29",
"issue": "4",
"page": "934-944",
"DOI": "10.1038/s41593-026-02219-x",
"PMID": "41803318",
"PMCID": "PMC13061600",
"ISSN": "1097-6256",
"publisher": "Nature Portfolio",
"URL": "https://doi.org/10.1038/s41593-026-02219-x",
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
9
]
]
}
}

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/s41467-026-73945-w [code]
Brain neuromarkers predict self- and other-related mentalizing across adult, clinical, and developmental samples.
Journal: Nature communications
In common: SPM, Statistics and Machine Learning Toolbox, 7 references
[2] doi:10.1038/s41467-026-71151-2 [code]
Common and distinct neural correlates of social interaction processing and theory of mind in narratives.
Journal: Nature communications
In common: Optimization Toolbox, SPM, Image Processing Toolbox, 1 other tool, cognitive, 4 references
[3] doi:10.1038/s41467-026-74565-0 [code]
The functional neurobiology of dispositions towards negative emotions.
Journal: Nature communications
In common: Optimization Toolbox, SPM, Image Processing Toolbox, 1 other tool, cognitive, 2 references
[4] doi:10.3389/fncir.2026.1741762 [code]
Task-dependent increases and decreases of BOLD signal in theory of mind brain regions during strategic social interaction.
Journal: Frontiers in neural circuits
In common: SPM, Statistics and Machine Learning Toolbox, fMRI, cognitive, 3 references
[5] doi:10.1016/j.bbih.2026.101299 [code]
Multimodal approach to identify neuropsychophysiological subgroups in myalgic encephalomyelitis/chronic fatigue syndrome and their relevance for rehabilitation: protocol for a mechanistic cross-sectional and longitudinal study.
Journal: Brain, behavior, & immunity - health
In common: Optimization Toolbox, SPM, Image Processing Toolbox, 1 other tool, 2 references
[6] doi:10.1038/s41597-026-07323-y [code]
A densely sampled fMRI dataset for investigating food valuation.
Journal: Scientific data
In common: SPM, Statistics and Machine Learning Toolbox, fMRI, 4 references
[7] doi:10.1007/s00429-026-03111-x [code]
Direction selectivity in naturalistic action observation: distributed representations across the action observation network.
Journal: Brain structure & function
In common: SPM, Image Processing Toolbox, Statistics and Machine Learning Toolbox, 3 references
[8] doi:10.1016/j.celrep.2026.117454 [code]
Model-based and model-free valuation signals in the human brain vary markedly in relation to individual differences in behavioral control.
Journal: Cell reports
In common: SPM, Statistics and Machine Learning Toolbox, cognitive, 4 references
[9] doi:10.1371/journal.pbio.3003675 [code]
Dynamic expectation strength and precision shape human pain perception through shared and dissociable α-oscillatory mechanisms.
Journal: PLoS biology
In common: Optimization Toolbox, SPM, Statistics and Machine Learning Toolbox, 2 references
[10] doi:10.1002/hbm.70602 [code]
Neuroimaging Correlates of Post-Stroke Pain After Ischemic Stroke: Secondary Analysis of the INSPiRE-TMS Trial.
Journal: Human brain mapping
In common: Optimization Toolbox, SPM, Image Processing Toolbox, 1 other tool, 1 reference

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.

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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

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