History bias and its perturbation of the stimulus representation in the macaque prefrontal cortex.
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
Python · 98 lines · 5 KB · GPL-3.0
- import pickle
- from plotting_functions import figure_layout
- import matplotlib.pyplot as plt
- import numpy as np
- import os
- if __name__=='__main__':
- pwd_saved = '%s/data/' % os.getcwd()
- filename_decoding = 'results_decoding_setRandomStateNew_noGridS_lSVC_current_trial_S1_3classes_tws_m400S11400_length200_step25_min10trialPerClass_localnTest_400trialPerClass_10rep_area1_high1Hz'
- filename_null_dist = 'results_decoding_setRandomStateNew_globalNullDist_onlyPositiveLabel_noGridS_current_trial_S1_3classes_tws_m400S11400_length200_step25_min10trialPerClass_localnTest_400trialPerClass_1000rep_area1_high1Hz'
- dataset_decoding = pickle.load(open('%s%s.pickle' % (pwd_saved, filename_decoding)))
- result_decoding = np.array(dataset_decoding['result'], float)
- window_bin = dataset_decoding['window_bin']
- length = dataset_decoding['length']
- mean_acc_decoding = np.mean(np.diagonal(result_decoding, axis1=-1, axis2=-2), -1)
- dataset = pickle.load(open('%s%s.pickle' % (pwd_saved, filename_null_dist)))
- result_null_dist = np.array(dataset['result'], float)
- mean_null_dist = np.mean(np.diagonal(result_null_dist, axis1=2, axis2=3), -1)
- p_val = np.zeros(mean_acc_decoding.shape[-1])
- for i, acc_i in enumerate(np.mean(mean_acc_decoding, 0)):
- p_val[i] = max(1.0/mean_null_dist.shape[0], ((mean_null_dist[:,i] > acc_i).sum()+1) / (float(mean_null_dist.shape[0])+1))
- #plotting
- x_in = 3
- y_in = 2
- fontsize_main, fontsize, linewidth_main, linewidth, markersize_main, markersize = figure_layout(x_in, 2.5)
- fig, ax = plt.subplots(figsize=(x_in, y_in))
- #null dist
- plt.plot(window_bin + length/2, np.mean(mean_null_dist, 0), '-', linewidth=linewidth_main, color='k', label='chance level')
- plt.plot(window_bin + length/2, np.mean(mean_null_dist, 0) + np.std(mean_null_dist, 0), '-', linewidth=linewidth, color='k')
- plt.plot(window_bin + length/2, np.mean(mean_null_dist, 0) - np.std(mean_null_dist, 0), '-', linewidth=linewidth, color='k')
- #########
- plt.plot(window_bin + length/2, np.mean(mean_acc_decoding, 0), '-', linewidth=linewidth_main, color='r')
- plt.plot(window_bin + length/2, np.mean(mean_acc_decoding, 0) + np.std(mean_acc_decoding, 0), '-', linewidth=linewidth, color='r')
- plt.plot(window_bin + length/2, np.mean(mean_acc_decoding, 0) - np.std(mean_acc_decoding, 0), '-', linewidth=linewidth, color='r')
- ax.fill_between(window_bin+length/2, np.ones(len(window_bin))*.2, np.ones(len(window_bin))*.225, where=p_val<.05, facecolor='k' , alpha=.2) #p_val from mull dist test
- plt.xlim([window_bin[0], window_bin[-1] + length])
- plt.ylim([.2, .7])#([.2, 1.05])
- plt.xticks(np.arange(0,1001,500), np.arange(0,1001,500), fontsize=fontsize)
- plt.yticks(np.arange(.2, .75, .1), np.arange(.2, .75, .1), fontsize=fontsize)
- plt.xlabel('time [ms]', fontsize=fontsize_main)
- plt.ylabel('acc', fontsize=fontsize_main)
- fig.tight_layout()
- plt.show()
- pwd_tosave = '%s/figures/' % os.getcwd()
- filename_figure = 'fig3a'
- plt.savefig('%s%s.svg' % (pwd_tosave, filename_figure), format='svg')
- pwd_tosave_p = '%s/pvals/' % os.getcwd()
- np.savetxt('%s%s.txt' % (pwd_tosave_p, filename_figure), p_val)
- ##########################
- # static or dynamic decoding
- filename_decoding = 'results_decoding_setRandomStateNew_noGridS_lSVC_current_trial_S1_3classes_tws_m400S11400_square_length200_step25_min10trialPerClass_localnTest_400trialPerClass_10rep_area1_high1Hz'
- dataset_decoding = pickle.load(open('%s%s.pickle' % (pwd_saved, filename_decoding)))
- result_decoding = np.array(dataset_decoding['result'], float)
- window_bin = dataset_decoding['window_bin']
- length = dataset_decoding['length']
- mean_acc_decoding = np.mean(np.diagonal(result_decoding, axis1=-1, axis2=-2), -1)
- p_val = np.zeros(np.mean(mean_acc_decoding, 0).shape)
- for i in range(p_val.shape[0]):
- for j in range(p_val.shape[1]):
- acc_ij = np.mean(mean_acc_decoding[:, i, j])
- p_val[i, j] = max(1.0/mean_null_dist.shape[0], ((mean_null_dist[:,i] > acc_ij).sum()+1) / (float(mean_null_dist.shape[0])+1))
- #plotting
- x_in = 2.5
- y_in = 2
- fontsize_main, fontsize, linewidth_main, linewidth, markersize_main, markersize = figure_layout(x_in, 2.5)
- fig, ax = plt.subplots(figsize=(x_in, y_in))
- mtx_toplot = np.mean(mean_acc_decoding, 0)
- mtx_toplot[p_val > .01] = np.nan
- im = plt.imshow(mtx_toplot)
- time_bin = window_bin + length/2
- bin_i = range(12, 53, 20)
- plt.xticks(bin_i, time_bin[bin_i], fontsize=fontsize)
- plt.yticks(bin_i, time_bin[bin_i], fontsize=fontsize)
- plt.clim([1/3., .7])
- cbar = fig.colorbar(im, ticks = np.arange(.4, .71, .1), fraction=0.046, pad=0.04)
- cbar.ax.set_yticklabels(np.arange(.4, .71, .1), rotation=0, fontsize=fontsize)
- fig.tight_layout()
- plt.show()
- filename_figure = 'fig3b'
- plt.savefig('%s%s.svg' % (pwd_tosave, filename_figure), format='svg')
- np.savetxt('%s%s.txt' % (pwd_tosave_p, filename_figure), p_val)
fig3ab.py at commit 5137062, under GPL-3.0 · at the source
Overview
- Department of Brain and Behavioral Sciences, University of Pavia, Pavia, Italy
- Department of Wellbeing, Health and Environmental Sustainability, Sapienza University of Rome
- Department of Physiology and Pharmacology, Sapienza University, Rome, Italy
- Institute of Biochemistry and Cell Biology (IBBC), National Research Council of Italy (CNR), Rome, Italy
- Department of Pharmaceutical Sciences, University of Piemonte Orientale, Novara, Italy
Abstract
Abstract: Multiple history biases affect our representation of magnitudes, such as time, distance and size. It is not clear whether the previous stimuli interfere with the discrimination process from the moment of stimulus presentation, during working memory retention or even later during the decision‐making phase. We used a spatial discrimination task involving two stimuli of different magnitudes, presented sequentially at various distances from the centre. The monkey's task was to select the farthest of them. We showed that the previous stimulus magnitude produced an attractive effect on the current stimulus magnitude and that this effect was stronger when their stimulus features differed. In this case at the neural level we also observed that decoding of the stimulus magnitude achieved the highest accuracy when it matched the magnitude of the preceding stimulus for which the decoder was trained. This indicates that past stimuli can affect magnitude processing already during the stimulus presentation, even before the decision‐making process. Interestingly this effect coincided with an ‘activity‐silent’ period, followed by the reactivation of the decoding of the previous stimulus magnitude.
Key points: Previous experience alters how we perceive the world, including the magnitudes of stimuli.
We show that the magnitude of the previous stimulus exerts an attractive effect on the perceived magnitude of the current stimulus, and unexpectedly, this effect is enhanced when their visual features mismatch.
It is still debated whether the history effect results from interference with stimulus processing, from its persistence in memory or during the decision‐making phase.
By recording from the monkey's prefrontal cortex, we found that decoding of the first stimulus is facilitated when its magnitude is similar to that of the recent past stimulus, indicating that the influence of the past stimulus begins during stimulus processing.
The effect of the previous stimulus magnitude on the representation of the first current stimulus was stronger during the period in which the past stimulus was not explicitly decoded (the activity‐silent phase) and preceded its reactivation.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above.
danilobenozzo/paper_historyBias
513706264e472e39b052bc3df3b189cdd0dfb3e1, 13 November 2025Availability: 1 check, the latest on 30 September 2026: the link answers
- 30 September 2026: the link answers
7 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;
- 5 scripts, each with its path and the digest of its content;
- no match between paragraphs and code yet;
- 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
Script container to reproduce decoding accuracy curves and training/
Source data are available from the authors upon reasonable request.
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, 6 keywords, 9 MeSH terms, 4 funders, 67 references.
Cite
This paper
Benozzo, D., Ferrucci, L., Ceccarelli, F., & Genovesio, A. (2026). History bias and its perturbation of the stimulus representation in the macaque prefrontal cortex. The Journal of physiology, 604(7), 2985-3004. https://
BibTeX
@article{benozzo2026hist
author = {Benozzo, Danilo and Ferrucci, Lorenzo and Ceccarelli, Francesco and Genovesio, Aldo},
title = {{History bias and its perturbation of the stimulus representation in the macaque prefrontal cortex}},
journal = {The Journal of physiology},
year = {2026},
month = mar,
volume = {604},
number = {7},
pages = {2985--3004},
publisher = {Wiley},
issn = {0022-3751},
doi = {10.1113/
url = {https://
pmid = {41784475},
pmcid = {PMC13039257}
}
RIS
TY - JOUR
AU - Benozzo, Danilo
AU - Ferrucci, Lorenzo
AU - Ceccarelli, Francesco
AU - Genovesio, Aldo
TI - History bias and its perturbation of the stimulus representation in the macaque prefrontal cortex
T2 - The Journal of physiology
J2 - J Physiol
PY - 2026
DA - 2026/
VL - 604
IS - 7
SP - 2985
EP - 3004
SN - 0022-3751
PB - Wiley
DO - 10.1113/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1113/
"type": "article-journal",
"title": "History bias and its perturbation of the stimulus representation in the macaque prefrontal cortex",
"container-title": "The Journal of physiology",
"author": [
{
"family": "Benozzo",
"given": "Danilo"
},
{
"family": "Ferrucci",
"given": "Lorenzo"
},
{
"family": "Ceccarelli",
"given": "Francesco"
},
{
"family": "Genovesio",
"given": "Aldo"
}
],
"container-title-short":
"volume": "604",
"issue": "7",
"page": "2985-3004",
"DOI": "10.1113/
"PMID": "41784475",
"PMCID": "PMC13039257",
"ISSN": "0022-3751",
"publisher": "Wiley",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
5
]
]
}
}
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.1113/jp289827 [code]
- Neurons embedded in loop-like motifs act as central hubs for brain-wide integration.Journal: The Journal of physiologyIn common: 2 references, 3 authors
- [2] doi:10.1038/s41467-026-75705-2 [code]
- Redundant prefrontal hemispheres adapt storage strategy to working memory demands.Journal: Nature communicationsIn common: SciPy, Matplotlib, NumPy, non-human primate, 4 references
- [3] doi:10.1162/imag.a.1199 [code]
- Sustained alpha oscillations serve attentional prioritization in working memory, not maintenance.Journal: Imaging neuroscience (Cambridge, Mass.)In common: 5 references
- [4] doi:10.1016/j.xpro.2026.104804 [code]
- Protocol for analyzing slow cortical dynamics in mouse neuronal recordings.Journal: STAR protocolsIn common: SciPy, Matplotlib, NumPy, 4 references
- [5] doi:10.1371/journal.pbio.3003779 [code]
- Past and present goals are represented concurrently during visual search.Journal: PLoS biologyIn common: 5 references
- [6] doi:10.1038/s41467-026-74783-6 [code]
- Neural and computational correlates of strategic aborting and long-run policy optimization in the dorsolateral prefrontal cortex.Journal: Nature communicationsIn common: SciPy, Matplotlib, NumPy, non-human primate, 2 references
- [7] doi:10.1038/s41467-026-71664-w [code]
- Dorsal prefrontal cortex drives perseverative behavior in mice.Journal: Nature communicationsIn common: NumPy, 3 references
- [8] doi:10.1038/s41467-026-76106-1 [code]
- Facial expression discrimination emerges from partially overlapping neural subspaces of detection and identity.Journal: Nature communicationsIn common: SciPy, Matplotlib, NumPy, non-human primate, 2 references
- [9] doi:10.1126/sciadv.aed9309 [code]
- Dynamic population coding of kinematic structure across executed and observed actions in primate premotor cortex.Journal: Science advancesIn common: non-human primate, 3 references
- [10] doi:10.1371/journal.pcbi.1014730 [code]
- A unified model of short- and long-term plasticity: Effects on network connectivity and information capacity.Journal: PLoS computational biologyIn common: SciPy, Matplotlib, NumPy, 2 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.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 5 scripts, and 0 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:f24ef8c79e17728a…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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.
