Faster but less precise: expectation enhances response speed while reducing sensory fidelity.
The 9 matches · 3 of them tie a paragraph to a whole file, not to given lines: weak matches, whose lines are not tinted
- [1] § Materials and Methods › EEG acquisition and preprocessing ↔ code.zip/code/subfunctions/preprocess_eeg_data.m, the whole file · a weak match · score 0.83 · 200–500 ms, EEGLAB, SASICA, artifacts, component, drifts
- [2] § Materials and Methods › Pupillometry ↔ code.zip/code/subfunctions/preprocess_eye_data.m, the whole file · a weak match · score 0.77 · removing blinks, removing outliers, preprocessed, bandpass, buffer, scored
- [3] § Materials and Methods › Neural decoding of stimulus location ↔ code.zip/code/subfunctions/misc/shuffle_labels.m, lines 38–168 · score 0.73 · training trials, cross validation, channel responses, fold, sensor, filter
- [4] § Materials and Methods › Stimuli, task, and procedure ↔ code.zip/code/analyze_eeg_data.m, lines 81–136 · score 0.71 · vertical bias, horizontal bias, task irrelevant, blocks, match, position
- [5] § Materials and Methods › Neural decoding of stimulus location ↔ code.zip/code/subfunctions/misc/binary_classification.m, lines 37–170 · score 0.71 · training trials, cross validation, channel responses, fold, filter, electrodes
- [6] § Materials and Methods › Stimuli, task, and procedure ↔ code.zip/code/subfunctions/preprocess_behavioural_data.m, the whole file · a weak match · score 0.70 · vertical bias, horizontal bias, task irrelevant, blocks, reproduction, position
- [7] § Materials and Methods › Neural decoding of stimulus location ↔ code.zip/code/analyze_eeg_data.m, lines 1–39 · score 0.61 · forward model, cross validation, fold, EEG, 360 deg, channels
- [8] § Materials and Methods › Neural decoding of stimulus location ↔ code.zip/code/subfunctions/misc/shuffle_labels.m, lines 38–168 · score 0.61 · cross validation, channel responses, fold, sensors, training, matrix
- [9] § Materials and Methods › Pupillometry ↔ code.zip/code/subfunctions/misc/circ_detect_outliers.m, lines 1–52 · score 0.55 · median absolute deviation, outliers
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 · 169 lines · 6.2 KB · no license · 2 matches
- clear all
- close all
- try
- parpool('local',8)
- catch
- end
- addpath(genpath('/Users/uqrridea/OneDrive - The University of Queensland/MATLAB/toolboxes/decoding'))
- addpath(genpath('/Users/uqrridea/Documents/inverted_adaptation/eeg/functions/misc'))
- addpath(genpath('/Users/uqrridea/Documents/inverted_adaptation/eeg/functions/analysis'))
- addpath('/Users/uqrridea/OneDrive - The University of Queensland/MATLAB/toolboxes/eeglab2021.1')
- addpath(genpath('/Users/uqrridea/OneDrive - The University of Queensland/MATLAB/toolboxes/eeglab2021.1/functions'))
- eeg_data_folder = '/Users/uqrridea/Documents/inverted_adaptation/eeg/data/processed_data';
- mat_data_folder = '/Users/uqrridea/Documents/inverted_adaptation/eeg/data/raw_data';
- output = 'decoded_shuffle-labels_5chan';
- trials = 1:3600;
- nt = numel(trials);
- temporal_window = [-50,500];
- temporal_smoothing = 0;
- rear_electrodes = [20:31,57:64];
- n_ori_chans = 5;
- use_rear_sensors = true;
- eeg_file = wildcardsearch(eeg_data_folder,'*-cleaned.set');
- stim_pre = wildcardsearch(mat_data_folder,'*pre.mat');
- stim_post = wildcardsearch(mat_data_folder,'*post.mat');
- % eeg_file = eeg_file([1:34,36,35,37]);
- processed = wildcardsearch(eeg_data_folder,['*',output,'.mat']);
- for i = 1:numel(processed)
- processed{i} = processed{i}(numel(eeg_data_folder)+2:end-5-numel(output));
- end
- %%
- for participant = 1:numel(eeg_file)
- [~,sID,~] = fileparts(eeg_file{participant});
- % if isempty(strmatch(sID(1:end-8),processed,'exact'))
- disp(num2str(participant))
- tic
- meta_pre = load(stim_pre{participant});
- meta_post = load(stim_post{participant});
- [folder,fname,~] = fileparts(eeg_file{participant});
- EEG = pop_loadset('filename', [fname,'.set'], 'filepath',folder);
- EEG = eeg_checkset( EEG );
- t_idx = EEG.times>temporal_window(1) & EEG.times<temporal_window(2);
- times = EEG.times(t_idx);
- if temporal_smoothing>0
- EEG.data = filtfast(EEG.data,2,[],'gaussian',temporal_smoothing); % temporally filters the data
- end
- if use_rear_sensors
- Y = reshape(EEG.data(rear_electrodes,t_idx,:),numel(rear_electrodes),numel(times),nt,2);
- else
- Y = reshape(EEG.data(:,t_idx,:),EEG.nbchan,numel(times),nt,2);
- end
- % enable to sensors, treating time as features
- % Y = permute(Y, [2 1 3 4]);
- orientations_pre = cell2mat(meta_pre.sparam.np.ori(:));
- orientations_pre = reshape(orientations_pre',[prod(size(orientations_pre)),1]);
- orientations_post = cell2mat(meta_post.sparam.np.ori(:));
- orientations_post = reshape(orientations_post',[prod(size(orientations_post)),1]);
- orientations = [orientations_pre;orientations_post];
- adaptor_ori = meta_post.dparam.orientation;
- % bin orientations
- delta_ori = wrapToPi(circ_dist(orientations*2,adaptor_ori*2)/2);
- delta_ori = delta_ori + pi/2;
- edges = linspace(0,pi,n_ori_chans+1);
- labels = delta_ori*nan;
- for b = 1:n_ori_chans
- labels(delta_ori>edges(b)&delta_ori<edges(b+1)) = round(mean(edges(b:b+1))*180/pi);
- end
- chans = unique(labels);
- labels = reshape(labels,[],2);
- labels = Shuffle(labels);
- % create the design matrix
- funType = @(xx,mu) (cosd(xx-mu)).^(n_ori_chans-mod(n_ori_chans,2));
- xx = linspace(1,180,180);
- basis_set = nan(numel(xx),n_ori_chans);
- for cc = 1:n_ori_chans
- basis_set(:,cc) = funType(xx,chans(cc));
- end
- % 1.2. Cross-validation
- n_folds = 10;
- folds = cell(n_folds,2);
- for i = 1:2
- for iCond = 1:n_ori_chans
- % Find indices
- index = find(labels(trials,i) == chans(iCond));
- nIndex = length(index);
- % Shuffle
- index = index(randperm(nIndex));
- % Distribute across folds
- groupNumber = floor((0:(nIndex-1))*(n_folds/nIndex))+1;
- for iFold = 1:n_folds
- folds{iFold,i} = [folds{iFold,i}, index(groupNumber==iFold)'];
- end
- end
- [~,order(:,i)] = sort([folds{:,i}]);
- stim_mask(:,:,i) = zeros(length(labels(:,i)),length(xx));
- for tt = 1:size(stim_mask,1) % loop over trials
- stim_mask(tt,labels(tt,i),i) = 1;
- end
- end
- % Generate design matrix
- for i = 1:2
- design(:,:,i) = (stim_mask(:,:,i)*basis_set)';
- end
- numT = size(Y,2);
- estimatedChannelResponse = nan(n_ori_chans,numT,nt,3,'single');
- parfor time = 1:numT
- for i = 1:2
- tempResponses = [];
- tempAccuracy = [];
- DataTime = squeeze(Y(:,time,:,i));
- for fold = 1:n_folds
- TestTrials = folds{fold,i};
- TrainTrials = find(~ismember(trials,TestTrials));
- DesignTrain = design(:,TrainTrials,i);
- Y_train = DataTime(:,TrainTrials);
- Y_test = DataTime(:,TestTrials);
- cfg = [];
- decoder = train_beamformerMT(cfg,DesignTrain,Y_train);
- tempResponses = cat(2,tempResponses,decode_beamformer(cfg, decoder,Y_test));
- end
- estimatedChannelResponse(:,time,:,i) = tempResponses(:,order(:,i));
- end
- end
- parfor time = 1:numT
- % post-adaptation
- Y_train = squeeze(Y(:,time,:,1));
- Y_test = squeeze(Y(:,time,:,2));
- DesignTrain = design(:,:,1);
- cfg = [];
- decoder = train_beamformerMT(cfg,DesignTrain,Y_train);
- estimatedChannelResponse(:,time,:,3) = decode_beamformer(cfg, decoder,Y_test);
- end
- save([folder,filesep,fname(1:end-8),'-',output,'.mat'],'estimatedChannelResponse','basis_set','labels','trials','chans','temporal_smoothing')
- toc
- % end
- end
shuffle_labels.m, no license · at the source
Overview
Abstract
The brain's remarkable ability to process continuous sensory inputs with adaptive efficiency—balancing flexibility while minimizing metabolic cost—is thought to rely on predictive mechanisms that generate and update internal models that leverage statistical regularities in the environment. However, it remains unclear whether this efficiency arises from prioritizing reliable, expected events or informative, unexpected ones, as they offer complementary adaptive advantages. To isolate genuine expectation effects, we combined electroencephalography (EEG), pupillometry, and behavioral measures in a paradigm that independently manipulated task relevance (selective attention) and stimulus predictability, while minimizing stimulus repetition at identical spatial locations to control for low-level adaptation. Human participants (both sexes) responded faster and more accurately to expected events, which was enhanced when attention was engaged; however, these events were reproduced with lower precision, independent of attention. Feature-specific neural decoding revealed prestimulus effects of attention and poststimulus effects of expectation, with no interaction between the two. Attention increased decoding accuracy, while expectation reduced accuracy. The reduced representational fidelity for expected events appeared rapidly (∼100–200 ms after stimulus onset) and correlated with individual differences in perceptual precision. Collectively, our findings indicate two complementary processes that define how the brain leverages redundancy in the environment: an early (prestimulus) mechanism, which supports rapid motor responses to expected events and is mediated by attention, and a later (poststimulus) process, which dampens sensory responses to expected events and is unaffected by attention.
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 9 matches between paragraphs and lines of code.
OSF nekp7
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
50 files
- code.zip/
code/ , MATLAB, 150 linesanalyze_behavioural_data .m - code.zip/
code/ , MATLAB, 225 lines, 2 matchesanalyze_eeg_data.m - code.zip/
code/ , MATLAB, 15 linessubfunctions/ bandpass_eye_data.m - code.zip/
code/ , MATLAB, 6 linessubfunctions/ bin_labels.m - code.zip/
code/ , MATLAB, 23 linessubfunctions/ circ_decode_feature.m - code.zip/
code/ , MATLAB, 14 linessubfunctions/ convert_EDF_to_mat.m - code.zip/
code/ , MATLAB, 25 linessubfunctions/ cross_validation_folds.m - code.zip/
code/ , MATLAB, 21 linessubfunctions/ define_group_estimates_p laceholders.m - code.zip/
code/ , MATLAB, 71 linessubfunctions/ forward_encoding.m - code.zip/
code/ , MATLAB, 7 linessubfunctions/ generate_design_matrix.m - code.zip/
code/ , MATLAB, 26 linessubfunctions/ group_behavioural_data.m - code.zip/
code/ , MATLAB, 26 linessubfunctions/ interp_ems.m - code.zip/
code/ , MATLAB, 22 linessubfunctions/ misc/ FitCurve.m - code.zip/
code/ , MATLAB, 173 lines, 1 matchsubfunctions/ misc/ binary_classification.m - code.zip/
code/ , MATLAB, 114 linessubfunctions/ misc/ circ_cluster_correction. m - code.zip/
code/ , MATLAB, 92 linessubfunctions/ misc/ circ_cluster_correction2 D.m - code.zip/
code/ , MATLAB, 56 linessubfunctions/ misc/ circ_cluster_correction_ anova.m - code.zip/
code/ , MATLAB, 289 lines, 1 matchsubfunctions/ misc/ circ_detect_outliers.m - code.zip/
code/ , MATLAB, 56 linessubfunctions/ misc/ circ_iqr_method.m - code.zip/
code/ , MATLAB, 30 linessubfunctions/ misc/ circ_linear_bwlabeln.m - code.zip/
code/ , MATLAB, 120 linessubfunctions/ misc/ cluster_correction.m - code.zip/
code/ , MATLAB, 131 linessubfunctions/ misc/ cluster_correction2D.m - code.zip/
code/ , MATLAB, 95 linessubfunctions/ misc/ cluster_correction_Pears on.m - code.zip/
code/ , MATLAB, 233 linessubfunctions/ misc/ cluster_test.m - code.zip/
code/ , MATLAB, 93 linessubfunctions/ misc/ cluster_test_helper.m - code.zip/
code/ , MATLAB, 43 linessubfunctions/ misc/ collapse.m - code.zip/
code/ , MATLAB, 28 linessubfunctions/ misc/ colour_wheel.m - code.zip/
code/ , MATLAB, 29 linessubfunctions/ misc/ covdiag.m - code.zip/
code/ , MATLAB, 826 linessubfunctions/ misc/ export_fig.m - code.zip/
code/ , MATLAB, 226 linessubfunctions/ misc/ fdr_bh.m - code.zip/
code/ , MATLAB, 47 linessubfunctions/ misc/ filtfast.m - code.zip/
code/ , MATLAB, 20 linessubfunctions/ misc/ fitCic180.m - code.zip/
code/ , MATLAB, 261 linessubfunctions/ misc/ linspecer.m - code.zip/
code/ , MATLAB, 26 linessubfunctions/ misc/ match_clim.m - code.zip/
code/ , MATLAB, 26 linessubfunctions/ misc/ match_xlim.m - code.zip/
code/ , MATLAB, 26 linessubfunctions/ misc/ match_ylim.m - code.zip/
code/ , MATLAB, 371 linessubfunctions/ misc/ phasemap.m - code.zip/
code/ , MATLAB, 215 linessubfunctions/ misc/ polarShadedErrorBar.m - code.zip/
code/ , MATLAB, 15 linessubfunctions/ misc/ polarfill.m - code.zip/
code/ , MATLAB, 96 linessubfunctions/ misc/ raw2matlab.m - code.zip/
code/ , MATLAB, 145 linessubfunctions/ misc/ rm_anova2.m - code.zip/
code/ , MATLAB, 213 linessubfunctions/ misc/ shadedErrorBar.m - code.zip/
code/ , MATLAB, 169 lines, 2 matchessubfunctions/ misc/ shuffle_labels.m - code.zip/
code/ , MATLAB, 75 linessubfunctions/ misc/ wildcardsearch.m - code.zip/
code/ , MATLAB, 3 linessubfunctions/ nan_outliers.m - code.zip/
code/ , MATLAB, 3 linessubfunctions/ nan_outliers_IQR.m - code.zip/
code/ , MATLAB, 142 lines, 1 matchsubfunctions/ preprocess_behavioural_d ata.m - code.zip/
code/ , MATLAB, 104 lines, 1 matchsubfunctions/ preprocess_eeg_data.m - code.zip/
code/ , MATLAB, 107 lines, 1 matchsubfunctions/ preprocess_eye_data.m - code.zip/
code/ , MATLAB, 9 linessubfunctions/ remove_outliers_MAD.m
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;
- 50 scripts, each with its path and the digest of its content;
- 9 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 and code availability
The raw data and analysis code are publicly available at the following repository: https://
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, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 4 keywords, 1 funder, 53 references.
Cite
This paper
Hu, Z., Tran, D. M. D., & Rideaux, R. (2026). Faster but less precise: expectation enhances response speed while reducing sensory fidelity. The Journal of neuroscience : the official journal of the Society for Neuroscience, 46(28), e0154262026. https://
BibTeX
@article{hu2026faster,
author = {Hu, Ziyue and Tran, Dominic M. D. and Rideaux, Reuben},
title = {{Faster but less precise: expectation enhances response speed while reducing sensory fidelity}},
journal = {The Journal of neuroscience : the official journal of the Society for Neuroscience},
year = {2026},
month = jun,
volume = {46},
number = {28},
pages = {e0154262026},
publisher = {Society for Neuroscience},
issn = {0270-6474},
doi = {10.1523/
url = {https://
pmid = {42331630},
pmcid = {PMC13375892}
}
RIS
TY - JOUR
AU - Hu, Ziyue
AU - Tran, Dominic M. D.
AU - Rideaux, Reuben
TI - Faster but less precise: expectation enhances response speed while reducing sensory fidelity
T2 - The Journal of neuroscience : the official journal of the Society for Neuroscience
J2 - J Neurosci
PY - 2026
DA - 2026/
VL - 46
IS - 28
SP - e0154262026
SN - 0270-6474
PB - Society for Neuroscience
DO - 10.1523/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1523/
"type": "article-journal",
"title": "Faster but less precise: expectation enhances response speed while reducing sensory fidelity",
"container-title": "The Journal of neuroscience : the official journal of the Society for Neuroscience",
"author": [
{
"family": "Hu",
"given": "Ziyue"
},
{
"family": "Tran",
"given": "Dominic M. D."
},
{
"family": "Rideaux",
"given": "Reuben"
}
],
"container-title-short":
"volume": "46",
"issue": "28",
"page": "e0154262026",
"DOI": "10.1523/
"PMID": "42331630",
"PMCID": "PMC13375892",
"ISSN": "0270-6474",
"publisher": "Society for Neuroscience",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
22
]
]
}
}
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-025-60860-9 [code]
- Reply to: “Model mimicry limits conclusions about neural tuning and can mistakenly imply unlikely priors”Journal: n/aIn common: CircStat, Image Processing Toolbox, 9 references, author Reuben Rideaux
- [2] doi:10.7554/elife.103689 [code]
- Dissociable dynamic effects of expectation during statistical learning.Journal: eLifeIn common: shadedErrorBar, Image Processing Toolbox, Statistics and Machine Learning Toolbox, EEG, 7 references
- [3] doi:10.1016/j.neuron.2026.03.034 [code]
- Dentate gyrus interneurons modulate winner-take-all network dynamics in freely behaving mice.Journal: NeuronIn common: shadedErrorBar, CircStat, Optimization Toolbox, 5 other tools
- [4] doi:10.1371/journal.pone.0357956 [code]
- Early electrophysiological responses reflect precision-weighted prediction errors to face features.Journal: PloS oneIn common: EEG, cognitive, 9 references
- [5] doi:10.1038/s41562-026-02533-1 [code]
- Fluctuations in arousal reflect latent state transitions that facilitate behavioural optimization.Journal: Nature human behaviourIn common: shadedErrorBar, CircStat, Optimization Toolbox, 2 other tools, EEG, cognitive, 2 references
- [6] doi:10.1371/journal.pbio.3003938 [code]
- Theta oscillations tag episodic memories for sleep-dependent consolidation.Journal: PLoS biologyIn common: shadedErrorBar, CircStat, EEGLAB, 3 other tools, EEG, cognitive, 1 reference
- [7] doi:10.1038/s41467-026-73106-z [code]
- Respiratory pauses highlight sleep architecture in mice.Journal: Nature communicationsIn common: CircStat, Optimization Toolbox, EEGLAB, 4 other tools, EEG
- [8] doi:10.64898/2026.03.12.710517 [code]
- Cortical excitability inversely modulates fMRI connectivity via low-frequency neuronal couplingJournal: bioRxiv (preprint)In common: shadedErrorBar, CircStat, Optimization Toolbox, 4 other tools
- [9] doi:10.1126/sciadv.aeh7220 [code]
- Central complex representations of self-movement are sufficient to compute wind direction in flight.Journal: Science advancesIn common: shadedErrorBar, CircStat, Optimization Toolbox, 4 other tools
- [10] doi:10.1162/imag.a.1201 [code]
- All spectral frequencies of neural activity reveal semantic representation in the human anterior ventral temporal cortex.Journal: Imaging neuroscience (Cambridge, Mass.)In common: Optimization Toolbox, EEGLAB, Parallel Computing Toolbox, 3 other tools, 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, 50 scripts, and 9 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:65b63c15586327f7…
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
[.
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.
