The representation of priors and decisions in parietal cortex

Animals actively sample their environment through orienting actions such as saccadic eye movements. Saccadic targets are selected based both on sensory evidence immediately preceding the saccade, and a ‘salience map’ or prior built up over multiple saccades. In the primate cortex, the selection of each individual saccade depends on competition between target-selective cells that ramp up their firing rate to saccade release. However it is less clear how a cross-saccade prior might be represented, either in neural firing or through an activity-silent mechanism such as modification of synaptic weights on sensory inputs. Here we present evidence from magnetoencephalography for two distinct processes underlying the selection of the current saccade, and the representation of the prior, in human parietal cortex. While the classic ramping decision process for each saccade was reflected in neural firing rates (measured as event related field), a prior built up over multiple saccades was represented via modulation of the gain on sensory inputs from the preferred target, as evidenced by rapid frequency tagging. A cascade of computations over time (initial representation of the prior, followed by evidence accumulation and then updating) provides a mechanism by which a salience map may be built up across saccades in parietal cortex. It also provides insight into why evidence accumulation signals are present in parietal cortex, when inactivation of the region has been shown not to affect performance on single-trial tasks.


Introduction
Far from being passive recipients of sensory information, both humans and animals actively sample the environment using their sensory organs. They integrate information across many individual samples to build a model of the sensory environment. In rodents, active sampling processes include whisking and sniffing; in primates, the most important and best-studied process is the control of saccadic eye movements.
As an observer views a visual scene, several saccadic eye movements per second are generated in order to direct the eye's small focal window to points of potential interest.
Information from multiple fixations is integrated to construct a 'model' of the full visual field 1,2 . This model in turn influences the selection of targets for future saccades 3 . Therefore, the process of active sampling may be viewed as an interplay between two concurrent processes with distinct characteristics: Firstly, the brain must generate each individual sampling action. Since only one saccade is made at once, each individual saccade must be selected by a process of competition between representations of alternative possible saccadic targets 4 ; the process is by necessity winnertake-all in that the eyes can only fixate one location at a time 5 and must operate on a fast timescale, driven by dynamics that ensure a new saccade is made every few hundred milliseconds 6 .
Secondly, the brain must integrate the limited information gained from many individual saccades -not only to construct the visual scene, but relatedly, to inform the selection of targets for future saccades. Behavioural modelling suggests that the likely information value of future saccades is represented in a salience map 7,8 that can be regarded as a Bayesian prior distribution over potential saccadic targets 3,9 . Far from having winner-take-all dynamics, this salience map must capture the relative or probabilistic distribution over all possible saccades. It therefore must integrate information across multiple previous saccades.
The neural processes underlying the selection of individual saccades are, due to a combination of electrophysiological and modelling work, relatively well understood [10][11][12][13] .
Using evidence accumulation paradigms designed to extend the saccade selection process over hundreds of milliseconds -most commonly random dot kinematograms (RDK) or 'moving dots' tasks 14 -spatially-selective neurons in frontal and parietal cortical eye fields (FEF and LIP) have been shown to track the accumulation of evidence in favour of a saccade to their response field. Such evidence-tracking activity is consistent with a model in which each neuron's firing rate at a given moment represents the log odds that its preferred location will be the target of the next saccade, effectively ramping up to target selection or down to target rejection 10,15 . The process can be described mathematically as a sequential probability ratio test 12 . A key element of this decision model is a winner-take-all competition between targets 16 . An influential biophysically-specified form of this model developed by Wang and colleagues describes how two pools of neurons compete with each other to determine the choice of saccadic target 17,18,19 . In the present study, we use the Wang model to identify MEG signatures of the saccade selection process for each individual saccades.
In contrast, the mechanisms by which a prior or model is built up across multiple saccades have received less attention. Candidate mechanisms include increases in baseline firing rate, and changes in synaptic weights to favour different sensory inputs 17 . The latter process, which is primarily activity-silent, would not be expected to directly affect the MEG signal.
However, a change in synaptic weights should result in a change in gain for even irrelevant sensory stimuli co-located with favoured saccadic targets.
To exploit this possibility we used the method of rapid frequency tagging to probe for an activity-silent representation of the prior via changes in gain on the inputs to parietal cortex.
This technique presents an irrelevant, invisible perceptual manipulation (high-frequency rhythmic flicker of the targets) known to produce strong increases in oscillatory power in sensory cortices 20,21 . We tracked these power increases as they propagated forward through the visual system, thus indirectly probing input gains to higher visual areas such as posterior parietal cortex. This approach was designed to be sensitive to prior beliefs encoded via synaptic plasticity 17 rather than neural firing rates.
The study focusses on the mechanisms by which a prior, integrating over multiple saccades, is represented in parietal cortex. Although cortical regions concerned with saccade selection exist in both frontal cortex (frontal eye field, FEF) and parietal cortex (lateral intraparietal area, LIP), recent studies using inactivation in rodents and monkeys suggest a key role of parietal saccade regions in construction of the prior. Inactivation of parietal cortex (unlike frontal orienting fields 22,23 ) does not affect performance in classic single-saccade decision tasks, but does affect the use of a prior built up over a longer timescale. In particular, one recent study 24 , rats with parietal inactivation showed a reduced perceptual attraction bias (evidence of the influence of a prior) in an interval judgement task, and parietal neurons were shown to represent information about recent trials. This suggests that building up a prior or model over multiple saccades relies upon parietal cortex in particular. Notably, classic neurological observations also indicate a key role for parietal cortex in constructing an integrated map of candidate saccades: Unilateral damage to the parietal cortex results in a paucity of voluntary saccades and attention towards the ipsilateral field (neglect syndrome 25 ), as if the part of the salience map or prior covering the contralateral field had been permanently set to zero. This is in contrast to the effects of unilateral damage to the frontal eye fields, which result an active motoric bias (gaze vergence) towards the ipsilateral field 26 , as if a competitive process selecting between targets had become unbalanced, concordant with its causal role in the selection of individual orienting actions in rats and monkeys 27,22 .
We designed an experiment to test the hypothesis that parietal cortex represents information about stimulus history across multiple trials to build up a prior belief or salience map, using whole brain high-temporal-resolution imaging with magnetoencephalography (MEG). We modified the classic random dot motion task 28 in two ways, which our modelling indicated should drive independent signals relating to competition between saccadic targets, evidence accumulation overall, and the influence of prior beliefs.

Results
We modified the classic random-dot kinematogram (RDK) task 28 in two ways (fig1A) so that a) there was probabilistic information that could be integrated across saccades to aid performance (i.e., a cross-saccade prior was needed) and b) the strength of evidence for a target could be dissociated from the direction of evidence (and therefore its concordance with the prior). In the classic RDK task participants observe mixtures of randomly and coherently-moving dots and accumulate evidence over hundreds of milliseconds to determine the direction of coherent motion, responding with a congruent saccade. We introduced longer term, cross-trial integration favouring left-or right-response, to drive the computation of a prior hypothesised to occur in parietal cortex. Additionally, we introduced within-trial competition between left-and right options to dissociate strength and direction of evidence within each trial.

Cross-trial integration (prior).
In classic RDK tasks, the dot direction on each trial is independent. Each option (left, right) is equally likely, and so subjects do not have to retain any information about the current trial after the trial ends. In our modified version, we introduced long-term correlations in the dot-motion direction. The probability that the next correct choice would be 'right' was not fixed at 50%, but took values of 20%, 50% or 80% for blocks of about 25 trials (changes in prior probability were un-signalled and occurred with a uniform hazard rate of 0.04 (fig1B, 'true probability' (solid grey line)). Since the dominant direction on previous trials could be useful for determining the direction on the current trial, participants could benefit from integrating information across trials to construct a prior over the dominant motion direction on the next trial (fig1B, 'belief strength' (purple trace)). We modelled this evidence integration process using a Bayesian ideal observer model (similar to 29,30 ), which captured local variations in prior probability, and learning delays. We used the expected value from the Bayesian ideal observer (see 'Methods' eq5) of p(right = correct), and modelled belief strength as |p(right) -0.5|, meaning that it became strong when there was a high prior probability of either leftward or rightward saccade. This allowed us to test whether these prior beliefs were reflected in brain activity, either as an influence on the decision process itself or in the 1s foreperiod prior to evidence presentation on each trial (fig1F).

7
Within-trial competition. In classic RDK stimuli a single set of coherent dots move to the left or right. In our modified version, all trials included some level of evidence for both choice options (left and right) concurrently, and participants reported the dominant motion direction (fig1C). This means that the level of the signal-to-noise or total coherence (total number of left and right dots, compared to random dots, fig1D). was manipulated orthogonally to competition (ratio of left to right dots, fig1E). Therefore, the strength of evidence on a given trial (the precision of the likelihood function in Bayesian terms) was dissociable from its direction, which could be compatible or incompatible with the prior. This allowed us to test (behaviourally and neurally) for evidence that the prior was used and precision-weighted against current evidence strength. This manipulation also allowed us to localize in time (and space) the single-saccade decision process, by testing for the hallmark of a competitive decision process namely that activity should depend upon the strength of evidence for the losing option as well as the evidence for the winning option 16 . In particular, we used Wang's biophysical model of a drift diffusion-like competitive process to model decision making in parietal and frontal cortex 31 ; this model makes precise predictions about the independent effects of competition and coherence on brain activity 32 .  Choice behaviour is influenced by the prior in accordance with Bayesian theory Participants (n = 29, final analysis n = 26, for information on participant exclusions see 'Methods') performed 600 trials of a modified random-dot motion task with added withintrial competition and cross-trial integration, divided into 4 blocks with short breaks, while MEG was recorded. All participants also completed a practice session of 300 trials, outside the scanner, on a separate day.
We first confirmed that participants' single-trial choice behaviour was influenced by both the total coherence (signal to noise) and the competition between left-and rightward motion, by fitting logistic regressions to participants' saccade directions (left, right) as a function of percent coherent motion and proportion of coherent dots that moved right. As expected, there was an interaction such that participants were more likely to saccade right when a greater proportion of the coherent dots moved rightwards and this effect increased as the total amount of coherent motion increased (t(25) = 9.74, p < 2*10 -10 , fig2A).
Next, we tested whether participants learned and used the across-trial regularities in the stimulus sequence (the prior).
We first confirmed that feedback from previous trials influenced participants' decision on the current trial using lagged logistic regression (figS1), indicating that participants were indeed retaining information across at least two previous trials. To model participants' prior beliefs, 9 we used a Bayesian ideal observer model 29 (see 'Methods' for full description) to compute, for every trial in a stimulus sequence, the prior belief that an ideal observer should have, based on the feedback observed on all previous trials. The 'ground truth' or generative probability of rightwards motion was either high (70 or 90%), low (30 or 10%), or neutral 50%; these probabilities changed (un-signalled) about every 25 trials (see fig1 and 'Methods'). The Bayesian ideal observer model estimated the probability that the dominant motion direction on the upcoming trial would be right or left, based on the feedback from previous trials. The advantage of this approach over using 'ground truth' prior probabilities is to capture local fluctuations in probabilities, and learning delays.
For visualisation (fig2B), we divided trials using a tertile split according to whether the Bayesian prior strongly favoured rightward or leftward motion, or neither (neutral prior). On  Because our bidirectional stimulus dissociated strength of evidence (total coherence) from direction of evidence (left vs right), we could test whether participants relied more upon the prior when evidence in the current trial is weak 33 (low total coherence), due to precision weighting, as predicted by Bayesian theory 33 . To visualise this effect, we repeated the Bayesian ideal observer analysis but divided the trials according to the level of total coherent motion on the current trial (fig2C, using the same tertile splits as above). As predicted, prior belief biased current choice strongly when there was little decision-relevant motion, (at 10% coherence, PSE moved from ≈50% to 10%/90%, fig2C, left) but had little effect when a lot of motion was decision-relevant (at 90% coherence, PSE moved from ≈50% to 48%/52%, fig2C, right).
The effect shown in figure 2C was statistically confirmed using logistic regression. Percent total coherent motion had opposite effects on the influence of current evidence and prior belief on choice; when total coherent motion was high, the current evidence (proportion of coherent dots moving right) influenced behaviour more (Wilcoxon test on logistic regression coefficients for (coherence*prior) interaction across the group: Z = 4.7, p < 3*10 -6 , nonparametric test due to first-level outliers, see 'Methods') but prior belief influenced behaviour less (Z = -2.52, p = 0.012). This contrasts with the previous analysis where we found no interaction between the prior belief and the degree to which competition influenced choice behaviour. This confirms that participants selectively weighted the two sources of evidence available to them; up-weighting the impact of their prior belief -shaped by what they had seen previously -when little sensory evidence was currently available to guide their choice. This precision-weighting resembles the optimal Bayesian strategy for the task 33 .
Neural models and neuroimaging Next, we turned to our MEG data for evidence of the neural mechanisms underlying the competitive process of selecting an individual saccade and the integrative process of forming a prior across many saccades.

Biophysical model of the neural mean field
We simulated the neural mean field (summed activity of neuronal pools representing the left-and right-targets) during the saccade selection process using an adaptation of the decision model previously been described by Wang and colleagues 31,32 . The Wang model has been successfully used in a value-based choice task 32 to predict the independent effects of total value (analogous to total coherence in our task) and value difference (analogous to competition in our task) on the event related field (ERF) as measured in MEG (fig3A,B), and has previously been fit to brain activity in both parietal 31  To verify that this competitive model was a good fit to the underlying neural process, we tested for a key signature of a competitive selection process: namely that the decision variable depends on the strength of evidence for the unselected option, as well the selected option 16 . We were able to directly test for the influence of the unchosen option because in our modified random dots task, evidence for the chosen and unchosen dots direction was manipulated independently, allowing us to identify signals driven by competition independently of signal to noise.

13
To model the effect of the prior as a driving input, the input to each pool occurred in three phases; the first representing a participant's prior belief about the upcoming stimulus, the second reflecting undifferentiated activity due to random dot motion during the 1-second 'incoherent motion' epoch, and the third reflecting properties of the stimulus itself -i.e., the number of dots moving left and right -during the 2.5-second 'coherent motion' epoch (fig3A). The timing of the driving inputs reflects electrophysiological findings that the initial response of parietal neurons 36,37 to target presentation, prior to evidence accumulation, weakly reflect the influence of prior beliefs on saccade selection 17,38 . The neural mean-field model generated three distinct predictions about the activity that should be observed in a competitive system. Firstly: Increasing total coherence (sum of dotsL and dotsR) should produce a parametric increase in neural activity following target onset (fig3D) in the time window 100-500ms following onset of coherent motion. Secondly: As competition decreases (i.e. greater absolute difference between dotsL and dotsR), there should be a parametric increase in neural activity following target onset (fig3G) in the same time window. Thirdly: Weakly increasing input due to prior knowledge in the prestimulus period ( fig 3A, figS2A) should not significantly alter prestimulus activity, but rather bias the initial conditions of the competitive accumulation process such that activity evoked by the much stronger stimulus-driven input parametrically increased with prior strength, even though the prior input was no longer active, presumably due to the weak prior input biasing the state of the network before the stronger inputs began.

Event-related activity reflects the competitive process of selecting the current saccade
We next tested whether the pattern of results predicted by the neural mean-field model were observed in parietal cortex, which is known to track evidence accumulation. We transformed subjects' MEG data to source space using LCMV beamforming 39 , and extracted time series from regions-of-interest (ROIs) in parietal cortex (fig3C, see 'Methods' for ROI definitions). We extracted the time-varying power in the low frequency range (2.8 -8.4 Hz) as a proxy for the event related field or ERF, the magnetic field arising from local field potentials in cortex 40 . We used low frequency power as a proxy because the ERF itself becomes sign-ambiguous after beamforming, but data in the time-frequency domain does not. We focussed on low frequencies rather than higher frequencies because the network model is dominated by low-frequency responses and does not exhibit higher frequency Contrary to our predictions, prior belief did not significantly modulate the low-frequency MEG signal in parietal cortex (t(25) = 0.80, p = 0.43, figS2). However, the absence of an effect of prior should perhaps be interpreted with caution, as for any null result; perhaps the effect was too subtle to be detected in the present paradigm. Furthermore, a relevant theoretical model 17 predicts an interaction between signed evidence on the current trial and signed prior belief based on previous trials. Accordingly, we tested for this interaction, however no significant effects were observed in the low-frequency MEG signal in parietal cortex (left hemisphere; t(25) = -1.51, p = 0.14, right hemisphere; t(25) = 0.087, p = 0.93).

A prior integrating across multiple saccades is represented in parietal cortex via gain modulation
Although participants' behaviour was clearly influenced by information on previous trials (figS1) consistent with computing a prior (fig2B), we were unable to detect activity corresponding to the prior in low frequency MEG signal (approximating the event related field, mainly driven by synchronised post-synaptic potentials).
However, theory suggests that the model of the prior as a driving input is a poor match for the physiological mechanisms by which prior beliefs are represented and influence choice: representations sustained over inactive periods or delays may be more efficiently represented by non-spiking mechanisms 41 . For example, in an extension of the biophysical model used above, prior beliefs were modelled as modifications to the synaptic weights from evidence-tuned inputs to the decision pools 17 . These gain modulations could manifest through short term synaptic plasticity on the timescale of seconds. It has been proposed that short term synaptic plasticity may act as an activity-silent store for working memories (or in this case, a prior) that is later reactivated as a bump attractor 42,43 , a proposed mechanism for working memory 17 .
To probe for possible gain changes between visual inputs and the parietal cortex, we exploited the method of rapid frequency tagging 44 . During the time that moving dot stimuli were present on the screen the two saccade targets were rhythmically flickering at two different high frequencies (41 and 45Hz, fig1F) that were indistinguishable to observers.
Flicker at such high frequencies is typically not perceived (they are for example close to the refresh rate of a standard 60Hz computer monitor -note that here we used a 1kHz projector to present stimuli). Indeed, no participant reported awareness that the stimuli were flickering. Flickering stimuli have previously been shown to produce detectable rhythmic activity in M/EEG signals 45 including at higher frequencies above 40Hz 20,21 , presumably by producing synchronised neural activity in visual cortex that propagates through the visual streams 46,47 . Parietal neurons are known to increase their neuronal gain when an attentional or saccadic target is present in their receptive field 11,[48][49][50] . Therefore, when one or other target is expected to be the saccadic target (for example due to a prior belief) we would expect the tag frequency for that target to propagate more effectively into parietal cortex; additionally we would expect the effect to be seen mainly in the contralateral hemisphere due to the lateralized representation of the visual field in occipital cortex.

Validation of frequency tagging
In the MEG data we recovered clear spectral peaks at the 41Hz and 45Hz tag frequencies (figS4A) that were present during the foreperiod, detectable from about 500ms after flicker onset (see 'Methods') and persisted during the entire stimulus period (fig4A). There was a clear lateralized effect such that the tag frequency presented at the right target was strongest in the left hemisphere of the brain, and vice versa.
The frequency tagging effect was strongest in parietal and occipital regions, propagating throughout posterior parietal cortex (figS4B). It should be noted that the frequency tagging signal could not be detected in frontal cortex including FEF, as expected given that the effect is an entrained visual oscillation -the signal propagates forward from occipital cortex but only through a few synapses.
We defined 'frequency tag activity' for each parietal ROI (left, right) as the time-resolved power at the specific flicker frequency of the contralateral flickering saccade target, corrected for the main effects of flicker frequency and hemisphere. Notably, our parietal ROI overlapped substantially with two regions of interest thought to be homologous to eyemovement regions LIP and 7a in the macaque 51 ; however the spatial resolution of MEG is not sufficient to say with certainty which intra-parietal sub-regions were the source. For full description of ROI definition see 'Methods'.

The cross-saccade prior is represented prior to evidence accumulation
If the parietal cortex represents a prior expectation based on the integration of previous saccades, this should be in evidence in the foreperiod, when only incoherent motion was present. We defined a time window from 500ms after flicker onset (the point at which tag activity was first evident in parietal cortex -fig4A) until the onset of coherent motion. We divided trials with a tertile-split into those on which the prior strongly favoured the contralateral target, strongly favoured the ipsilateral target, or was close to neutral.
Concordant with our hypothesis, we found that during the foreperiod, frequency tagging activity reflected the direction of the prior -activity was strongest on trials when the prior p=0.073) suggesting that either the representation of the prior is largely categorical, or that we had insufficient sensitivity to detect a parametric effect.

Gain modulation in parietal cortex is sensitive to dot motion, in the context of the prior
While the frequency-tag data provided evidence of gain modulation relating to prior beliefs, it did not track evidence accumulation (coherence or competition on a single trial basis) in the same way as the ERF (figS5). This is compatible with a model in which the prior is represented as activity-silent synaptic plasticity 17 , or by tonic changes in baseline firing rate as in a bump attractor 43 since tonic activity would likely not be detected in the band-passed MEG signal.
The gain modulation signal relating to prior beliefs was observed in the foreperiod of the task, during which the only lateralized effect is prior belief. If parietal cortex integrates incoming evidence with the prior belief to form a posterior, that will become the prior for the next trial (belief updating), we might expect to see a further gain-modulation signal representing the evidence, or decision, relative to the prior, reflecting this update process.
We coded trials as 'congruent' -i.e., the target favoured by the prior was also favoured by within-trial evidence -or 'incongruent'. Indeed, stronger activity at the contralateral tagging frequency was observed on congruent than incongruent trials, during the evidence accumulation phase of the trial (fig4E,F; linear regression followed by cluster-based permutation test on regression coefficients, tmaxsum = 21.0023, cluster p = 0.0238 see 'Methods'). Interestingly, this effect was observed to be strongest in a later time window (800-1150ms after stimulus onset) than the decision-related activity in FEF. This suggests that, in the context of a paradigm in which information can be integrated across many saccades, evidence coding in parietal cortex represents the combination of this evidence with the prior, akin to the formation of a posterior distribution that could be used to guide selection of future saccades 29 .
At no point did we observe a main effect of the ultimate saccade direction in parietal cortex (fig4G); this is perhaps unsurprising as the frequency tagging stimulus ended at the end of the coherent motion period, several hundred ms before the saccade was made.

Lateralization of effects
It is notable that our analysis of the low-frequency, event-related responses (fig3, figS2) did not detect lateralized effects. Rather, activity in parietal cortex as a whole resembled the neural mean-field model as a whole. Given that topographic maps in parietal cortex primarily encode the contralateral hemispace 53 one might have expected to identify activity associated with accumulation of leftward evidence in right parietal cortex, and vice versa. However, we did not find lateralised effects either for motion on the current trial (figS6) or for prior belief based on previous trials (figS7), in the low-frequency event-related MEG signal. This contrasts the effects of prior belief observed in parietal cortex from frequency tagging (fig4), which were lateralised. One possible reason for this difference concerns the types of input. The low-frequency event related activity was primarily driven by the moving dot stimulus, which was presented foveally. In contrast, the the high-frequency parietal responses were driven by the flickering of the target stimuli, which were presented peripherally. Because MEG is primarily sensitive to post-synaptic potentials, the lateralisation of the inputs to parietal cortex (presumably from visual cortex) may have resulted in lateralised effects in parietal cortex specifically in the latter case.
Time course of neural effects suggests a sequential interplay between the prior and evidence accumulation processes An advantage of MEG over other human neuroimaging methods is its high temporal resolution. This allowed us to examine the sequence of effects concerning the selection of individual saccades and their integration into a prior (fig5).
To directly compare the sequence of events we ran a series of ANOVAs plotting the effect sizes for each of the factors affecting parietal activity as a function of time. A clear sequence of events emerged: initially the prior is represented via gain modulation, then the evolution of event-related activity reflects the evidence accumulation process as captured in a competitive mean field model, and finally the interaction of evidence and prior is again reflected in gain modulation. Before the onset of coherent motion (interval [-1 0]), differences in activity across trials must relate to the prior. In this 'foreperiod' time window, we indeed observed a lateralized effect in parietal cortex as a function of the participants' prior belief. Then, shortly after stimulus onset we observed parametric effects of stimulus coherence and stimulus competition predicted by the neural mean-field model and likely the signature of the choice process itself. Finally, having resolved competition between choice options, we observed a later effect which related to congruence between the participants' initial prior (i.e., a prediction about the upcoming stimulus direction) and their eventual decision; namely, a strong suppression of activity when the stimulus is incongruent with the prior belief. This likely reflects the integration of evidence from the current trial with the prior belief -perhaps reflecting a belief update process whereby information about the current trial is used to modify the state of parietal cortex to guide future saccades.

Shaded boxes indicate preselected analysis windows (top and middle rows, see fig3E,F,H,I and 4C,D) and window delineated by cluster permutation test (bottom row, see fig4E,F). Coloured vertical dashed lines indicate maxima of the respective F-statistics.
The above is consistent with a model in which event-related neural activity field reflects the evidence accumulation process, but a prior integrating over multiple previous saccades and their outcomes is also represented by the modulation on input gains in parietal cortex 17 . This prior is represented even outside the time period in which evidence for different saccades is being weighed. The representation of the prior that is present before each saccade (in the foreperiod in our experimental task) serves to bias the saccade selection process, influencing choice behaviour (fig2B,C). During evidence accumulation, competitive dynamics lead to the selection of one or other saccadic target. Once the saccade selection process is resolved (but before the saccade is physically executed), an 'update' signal is observed in parietal cortex, perhaps reflecting the integration of the new evidence into the prior belief to form a posterior.

Discussion
Optimal exploration of the visual environment through eye movements requires the brain to perform two distinct computations: selecting among currently competing saccadic targets, and integrating information across saccades to construct a Bayesian prior in order to plan future saccades.
Using whole-brain imaging at high temporal resolution with MEG, combined with computational modelling, we demonstrated a temporal cascade of computations relating to both these processes in parietal cortex. Notably our observations are consistent with distinct mechanisms for the processes. Competition between left-and right-targets is resolved by mutual inhibition between two pools of neurons driven by left-and rightwards evidence. This process produces characteristic signals relating to the strength of evidence both for the chosen and unchosen option, which can be detected in both FEF and parietal cortex. In addition, prior beliefs are represented through gain modulation in parietal cortex, in advance of evidence presentation; after the competitive process is resolved, this signal reflects the congruence between current evidence and prior beliefs.
Neurally, representing each type of task-relevant information -currently available and previously learned -requires computations that operate on different intrinsic timescales, and display different neural dynamics. Resolution of competition between two currently-available choice options requires a fast, winner-take-all neural system that rapidly converges to one of two stable attractor states. In contrast, representation of previously-learned knowledge must maintain a broadly similar state over a long timescale and incrementally change as new datapoints are incorporated. It is therefore perhaps unsurprising that the two computations are implemented by different neural mechanisms.
Our results are relevant to ongoing debate about the role of parietal cortex in evidence accumulation. Until recently, the role of parietal cortex (LIP) has been difficult to distinguish from that of frontal cortex (FEF). Both FEF and LIP have been shown to contain spatiallyselective neurons that respond more strongly when a saccade is planned to their preferred location in the visual field, and the response functions of individual FEF and LIP neurons are strikingly similar [10][11][12][13] . However, recent inactivation studies in rodents and monkeys 22,24 , suggest that there is a functional dissociation between frontal and parietal eye fields whereby FEF is essential for evidence accumulation (although signals tracking sensory evidence are present in both FEF and parietal cortex), while the parietal cortex is essential to learn the across-trial statistics. Inactivation of parietal cortex 22,27 has no impact on performance in classic RDK evidence accumulation tasks (or analogous auditory tasks in the rat), whereas inactivating FEF 52 (or the homologous frontal orienting field or FOF in the rat) does impact performance. Conversely, inactivation of parietal cortex reduced the effect of prior expectations on decision-making 24 . Our results are consistent with this dissociation, as they support a role for parietal cortex in construction of the cross-trial prior.
However, a limitation of our approach is that we are unable to test for the same effect in frontal cortex due to methodological considerations. No reliable increase in power at the tag frequencies could be observed outside of occipital and parietal cortex (figS3). This is unsurprising as frequency-tagging relies on rhythmic visual sensory input resulting in synchronisation of post-synaptic potentials which MEG measures. Assuming some degree of post-synaptic 'jitter', more synapses between visual cortex and target region would necessarily lead to more jitter, and reduced signal, to the point where no tagging activity could be observed. Additionally, while the gain on visual signals in parietal cortex depends on attention and intended saccade direction, it is less clear that FEF responds to task-irrelevant visual stimulation that is orthogonal to task goals, as our high frequency flicker was. The equivalent test for gain modulation in (motoric) FEF might be to test the amplitude of the EEG evoked potential following a TMS pulse to FEF -however, to probe this was beyond the scope of the current study. It therefore remains possible that remains an open question whether other cortical regions also contribute to computing an across-trial prior. We focused on the synaptic inputs (I1, I2) to facilitate comparability with the MEG data, since MEG is known to be primarily sensitive to postsynaptic potentials (Hamalainen 1993). For optimal comparison with the MEG data which was bandpass-filtered and transformed to the frequency-domain, removing the DC component, we used the temporal derivative of the signal from the mean-field model.

Bayesian learning model
Because the modified dots task had temporal structure (dominant motion direction on trial j could be predicted, but not perfectly, from trials 1… t-1), performance could be facilitated by tracking the true generative distribution of dominant motion directions, including when it changed. To model participants' learning strategies we used a Bayesian ideal observer model; a 'virtual participant' that was fed the sequences of feedback given to the human participants and constructed, via Bayesian inference, a belief about the generative distribution on the upcoming trial.

Model details
On each trial, the prior probability that the dominant motion direction would be 'right' followed a Bernoulli distribution with parameter ! , i.e. the prior probability that the correct answer would be 'right' on trial was ! .
The prior distribution over ! was initiated as a uniform on the range (0,1) on the first trial, and thereafter obtained from the posterior over !"# , based on the outcomes #:!"# , combined with a uniform 'leak'; the posterior and 'leak' distributions were weighted by a factor H representing the true hazard rate: Where: Eq. 2 i.e. it was assumed that participants know approximately the true value of following extensive pre-training.
Where a scalar value for the 'prior' is used in data analysis, this is the expected value of ! based on the prior distribution Eq. 5 Analysis of saccade data / behavioural data Custom matlab code extracted saccade direction (left, right, or no saccade) based on the eyetracker data. Due to a technical error one participant's eyetracker data were over-written and saccade information was reconstructed from the horizontal EOG.
To analyse saccade data we fit logistic regression models. Firstly, we asked whether the probability of saccading to the right on trial t depended on the proportion of coherent dots 29 moving right on trial t (%R = 10,30,50,70 or 90%), the total coherence on trial t (coh = 10,30,50,70 or 90%), and the interaction of these (%R-mean(%R) x coh) (fig1A).
Secondly, we asked whether the probability of saccading to the right on trial t depended on the proportion of dots moving right on trial t (%R = 10,30,50,70 or 90%), the participants' prior belief about the dots on trial t formed from observing feedback on trials 1,2… t-1 ( ! ) as defined in Eq 5 above), and the interaction of these (fig1B).
Thirdly, we asked whether the observed effects of proportion dots moving right and prior belief on saccade direction were altered as a function of the level of stimulus coherence. To test this we fit a first-level logistic regression with evidence (%R = 10,30,50,70 or 90%), and prior belief ( ! ) at each level of total coherence (coh = 10,30,50,70 or 90%). We then computed linear contrasts over the effects for evidence and prior belief across the five levels of total coherence. Due to the presence of outliers at the first level (generalized extreme studentized deviate many-outlier procedure 54 ) we used nonparametric Wilcoxon signed rank tests at the second level to test against the null hypothesis of zero median.

MRI acquisition
To enable localisation of cortical source generators of the MEG signal, a high-resolution structural MRI was acquired for each participant using a Siemens 3T PRISMA MRI scanner with voxel resolution of 1 × 1 × 1 mm 3 on a 232 × 256 × 192 grid. The anatomical MRI scan included the face and nose to improve co-registration with the MEG data (see 'MEG processing and analysis'). MRIs could not be acquired for 3 participants due to drop-out and screening contraindications. All imaging analysis was therefore conducted on the remaining 26 datasets. To analyse the effect of the rapidly flickering saccade targets on posterior brain regions we used a combination of anatomical and data-driven selection criteria to focus on the brain regions that produced the strongest tagging response. We selected a 3s time-window from 800ms before the onset of coherent motion to 2.2s seconds afterwards -i.e., almost the entire period the targets were flickering -and calculated the fourier transform at all voxels for all participants and averaged across all artifact-free trials. We then compared power at the left-target frequency (41Hz for half the participants and 45Hz for the other half) with power at the right-target frequency, which revealed strong effects of tagging in voxels in parietal and occipital regions. We then used an anatomical atlas to create weighted maps defined by the conjunction of statistically significant differences between tag-frequency power and the parietal cortex anatomical label. The left parietal ROI consisted of all voxels in left parietal cortex that showed significantly greater power at the left-hemisphere tagging frequency than the right, and the reverse was true for the right parietal ROI. We multiplied these weight maps with the source-space data to create 'virtual channels' in left and right parietal cortex. We then performed time-frequency analysis on each virtual channel at the relevant tag frequency (41Hz or 45Hz, depending on the flicker rate of the contralateral frequency tag), using a longer 1000ms sliding window to increase frequency resolution. This We performed a tertile split on the prior, but -as we expected hemispherically lateralised effects due to the retinotopic organisation of parietal cortex -we used the signed prior, splitting into 'strong left', 'weak', and 'strong right'. We then averaged tag power values in the selected time window, at each level of prior and compared these using a 1 x 3 ANOVA with linear contrast. We also conducted a linear regression using the parametric prediction of the prior probability of dots moving right, ( ! ) as per Eq. 5, as explanatory variable, in the same time window.
Because we did not have a strong a priori prediction about the time window in which parietal activity might be driven by belief-decision congruence we used a nonparametric clusterbased permutation test 60 over all time points to determine whether there was a difference between the congruent and incongruent conditions. We again performed a tertile split on the prior; strong left, weak, strong right, and a three-way split on the dot directions; mostly left motion (10% or 30% right), equal motion (50% right), or mostly right motion (70% or 90% right). We then defined trials where the dominant motion direction and prior agreed as 'congruent', and trials where they were opposite as 'incongruent', and performed the cluster-based permutation test on the participant conditional means. The data underlying this manuscript are available upon request to the corresponding author.
Data will be deposited in a public repository upon publication of a revised manuscript.
Code availability statement The code used to generate these results is available upon request to the corresponding author. Analysis code will be deposited in a public repository upon publication of a revised manuscript.

Supplementary Information
Lagged logistic regression reveals integration kernels over previous trials To determine whether participants indeed integrated information from previous trials we performed a logistic regression with dependent variable; saccade direction (left, right), and independent variables; proportion of coherent dots moving right, interaction of proportion coherent dots moving right with coherence (effectively the absolute number of dots moving right) and post-trial feedback. To determine whether task parameters on previous trials influenced choice on the current trial we included the above regressors at 'lags' ranging from zero (i.e., the task parameters on the current trial t) to 10 (parameters on trial t-10).
Lagged multiple regression revealed that absolute number of right-moving dots on the current trial strongly predicted choice on the current trial (t(25) = 10.51, p = 3.2e-11), but on previous trials (lags > 0) did not predict current choice. In contrast, feedback on trial t did not predict choice on trial t (t(25) = 0.56, p = 0.6); this was entirely expected since feedback followed choice. However, feedback on trial t-1 (t(25) = 5.2, p = 2e-5) and trial t-2 (t(25) = 2.8, p = 0.009) did predict choice on trial t. Proportion of dots right on current or previous trials did not predict current choice beyond the other regressors (all t < 1.8).
The above strongly indicates that participants' choice on trial t was influenced by the stimulus properties on trial t, and the history of post-trial feedback on previous trials t-1 and t-2.
No evidence that prior belief strength modulates low-frequency activity in frontal or parietal cortex For comparison with the analysis of stimulus-driven effects (fig3) we applied the same model to the frequency tagging data from parietal cortex, pooled across left and right hemisphere ROIs. As we were able to observe lateralized effects of the prior in parietal cortex (fig4), we also tested for a lateralized effect of evidence, i.e., whether 'more dots moving towards the contralateral side' produced a stronger tag response than 'more dots moving towards the ipsilateral side.   Additionally, although we did not detect an overall effect of the prior on evidence accumulation signals in the ERF, for completeness we tested whether a lateralized effect of the prior could be found. To generate predictions we re-ran our neural mean-field model with five levels of pre-stimulus input, ranging from 'strong left' (strong input to left motion pool, no input to right motion pool), to 'strong right' (reversed). This produced a linear modulation of the simulated evoked response that was proportional to the strength of the pre-stimulus input (figS7A,B).
To compare with our MEG data we fit a general linear model, with prior belief predicted by the Bayesian model as a regressor. However, our prediction was not confirmed (figS7C-F). In contrast to the neural mean-field model, no evidence was observed of linear trends in the MEG data as a function of prior belief (left, t(25) = 1.46, p = 0.16, right, t(25) = -0.52, p = 0.61, figS7C,F). Qualitatively, a quadratic effect was observed whereby weak prior belief produced a strong evoked response and strong belief in either direction produced a weak response.
This could reflect an overall process by which a competitive system in FEF is engaged more strongly when the prior is weak; however, this prediction was outside the scope of our model.