Serial dependence is absent at the time of perception but increases in visual working memory

Recent experiments have shown that visual cognition blends current input with that from the recent past to guide ongoing decision making. This serial dependence appears to exploit the temporal autocorrelation normally present in visual scenes to promote perceptual stability. While this benefit has been assumed, evidence that serial dependence directly alters stimulus perception has been limited. In the present study, we parametrically vary the delay between stimulus and response in a spatial delayed response task to explore the trajectory of serial dependence from the moment of perception into post-perceptual visual working memory. We find that behavioral responses made immediately after viewing a stimulus show evidence of adaptation, but not attractive serial dependence. Only as the memory period lengthens is a blending of past and present information apparent in behavior, reaching its maximum with a delay of six seconds. These results dovetail with other recent findings to bolster the interpretation that serial dependence is a phenomenon of mnemonic rather than perceptual processes. However, even while this pattern of effects in group-averaged data has now been found consistently, we show that the relative strengths of adaptation and serial dependence vary widely across individuals. Finally, we demonstrate that when leading mathematical models of working memory are adjusted to account for these trial-history effects, their fit to behavioral data is substantially improved.

serial dependence was observed when memory demands were removed using the same comparison task in the follow-up study, in support of the idea that serial dependence requires working memory 9 . A complementary strategy for clarifying this issue has been to boost memory demands -by increasing the delay between stimulus and response in delayed-estimation tasks -to determine whether this potentiates the attractive bias 9,32 . Traditionally, errors that scale with delay length are interpreted as mnemonic in origin, whereas those that are constant over time are assumed to be tied to the perceptual or motor demands that are also fixed 33 . Over a limited range, the magnitude of the serial dependence effect increases the longer that working memory is active 9,16,17 . Despite this potential connection to working memory, serial dependence has yet to be incorporated into the many mathematical models that have been developed in recent years to fit the dispersion of errors in human memory-guided behavior [34][35][36][37][38][39][40][41][42][43][44] .
In the present study, we investigate temporal smoothing in visual cognition over a wider range of memory delays than has been used in the past. We use a spatial delayed response task, which has been shown to produce serial dependence in non-human primates 16,17 . Previous experiments using delayed response tasks to measure serial dependence have included a visual mask after the stimulus presentation period 1,2,8,9 , as well as a delay period of at least several hundred milliseconds before a response is permitted 1,2,8,9,16,17 , which encourages encoding into working memory and cannot cleanly measure more fragile perceptual representations 45,46 . In our shortest delay condition, we allow participants to respond immediately after stimulus offset, with no mask. From this 0-s baseline, we parametrically increase the delay length up to 10 s. In a separate experiment, we parametrically manipulate the length of the inter-trial interval (ITI). This permits us to assess the decay rate of the trial-history effect in the absence of intervening trials -clarifying its potential functional and biological implementation. Finally, we pursue a novel formal unification of the serial dependence phenomenon with mathematical models of working memory 34,35,[37][38][39][40][41] . This sets the stage for future experiments to dissect the neural mechanisms of serial dependence in the context of ongoing research into the organization of the working memory system 32 .

Results
Experiment 1: Manipulation of visual working memory delay. Participants completed a spatial delayed response task, depicted in Fig. 1. For Experiment 1, the length of the working memory delay period in this task was varied randomly from trial to trial (0, 1, 3, 6, or 10 s). Collapsing across these five delay conditions, we identified serial dependence in the group dataset significantly greater than zero ( < − p 10 4 , group permutation test; peak-to-peak = 1.67°; bootstrapped 95% confidence interval = [1.48°, 1.85°]). To do this analysis, we measured the magnitude of serial dependence as the peak-to-peak of the curve fit to the pattern of errors across all possible differences between current and previous stimulus location (see Methods). The peak-to-peak is a measure of the maximal pull of responses away from the correct stimulus feature value as a result of this trial-history bias. Previous studies have used similar measures of amplitude to quantify serial dependence 1,2,8,9,16 . No bias was present in the data in the direction of the stimulus on the upcoming trial ( . . n s , group permutation test; peak-topeak 0 14 = − .°; bootstrapped 95% confidence interval = [−0.59°, 0.15°]), which supports the conclusion that the dependence of behavior on the previous trial is not due to spurious correlations in the particular randomized sequences of stimuli generated for the subjects 10,14 .
Next we examined each of the delays individually. The magnitude of serial dependence across memory delays from 0-10 s is plotted in Fig. 2a. When participants reported the location of the stimulus immediately after viewing it, presumably relying at least in part on residual neural activity associated with perception, their responses showed signs of sensory adaptation, an effect that is opposite in direction from serial dependence ( < − p 10 4 , group permutation test; peak-to-peak  ;  Fig. 2b). In contrast, for every other delay tested, serial dependence was significantly greater than zero (all < . p 0 01, group permutation tests). Moreover, the magnitude of serial dependence increased from 0-1 s ( < − p 10 4 , group permutation test; peak-to-peak at 1 s = .°0 85 ; bootstrapped 95% confidence interval = .°.°[0 48 ,1 20 ]) and again from 3-6 s ( < − p 10 3 ; peak-to-peak at 6 s = .°3 37 ; bootstrapped 95% confidence interval [2 88 ,3 84 ] = .°.°) before asymptoting between 6 and 10 s ( . . n s ; peak-to-peak at 10 s = .°2 86 ; bootstrapped 95% confidence interval [2 28 ,3 41 ] = .°.°). Serial dependence was numerically strongest in the 6-s condition, shown in Fig. 2c. Here, the peak-to-peak is visible as the distance along the y-axis between the maximal and minimal values The events in each trial of the generic spatial judgment task used for Experiments 1 and 2 (not to scale, see Methods for exact dimensions). Stimuli were presented in black against a gray background. Participants maintained fixation at the central square whenever it was on the screen (all task stages aside from the response period). Each trial started with the presentation of the cue whose location needed to be remembered for either a variable (Experiment 1) or fixed (Experiment 2) delay. Upon the disappearance of the central square at the end of the delay, the mouse cursor appeared at the exact center of the screen (not shown), and subjects used the mouse to make their response. Responses were not timed. Immediately after the response was made, the fixation square returned for a fixed (Experiment 1) or variable (Experiment 2) inter-trial interval.
of the model fit to the data. We note that the asymptote in serial dependence between 6 and 10 s does not correspond to an asymptote in the accumulation of noise in working memory. Consistent with a recent theoretical study and reanalysis of empirical data 47 , we observed a sublinear increase in the variance of responses, which in the case of our data continued up to the 10 s delay (bootstrapped 95% confidence interval at 6 s = .°.° [41 28 ,44 92 ] Fig. 3). The large sample of participants from whom we collected data enabled us to assess the nature and range of individual differences in the pattern of trial-history effects that we observed at the group level. Adaptation and serial dependence are subtle effects -just a few degrees in magnitude at their peaks -whose tuning can be measured accurately only with many trials. Hence, we were statistically underpowered to detect differences between delay conditions for each individual subject (though we provide results divided by delay for a few sample subjects as Supp. Fig. 1). Instead, we collapsed over delay conditions for the purposes of evaluating which (if any) trial-history effect dominated throughout all time points in perception and working memory for each participant. The results are displayed in Fig. 4. Participants fell into three categories. Seven subjects showed evidence of strong repulsive adaptation that dominated across time points (all p < 0.05, permutation tests; all bootstrapped 95% confidence intervals < 0). One of these, whose repulsive bias was strongest (peak-to-peak 5 08 = − .°), is presented in Fig. 4b (and Supp. Fig. 1A). Another 11 subjects had data that showed weak and/or noisy variation as a function of the previous stimulus' location (all . . n s ). The remaining majority of subjects (n 20 = ) displayed visibly apparent and statistically significant attractive serial dependence (all < . p 0 05; all bootstrapped 95% confidence intervals 0 > ). However, among these, there was noticeable diversity in the tuning of the effect. Figure 4c shows Serial dependence is measured as the peak-to-peak of a least squares fit of the derivative of Gaussian (DoG) tuning function to the data. Error bars represent bootstrapped 95% confidence intervals. The magnitude of the serial dependence increases during the first 6 s of the delay period, and goes from significantly negative (evident of sensory adaptation) to significantly positive between 0 and 1 s. (b) Tuning of serial dependence across all possible angular differences between the current and previous stimulus, for the 0-s delay condition. The thin black line represents the group moving average of response errors, with the standard error in gray shading. The thick black line is the best-fitting DoG curve, and the orange line depicts the best fit of an alternative modelthe Clifford model (see Methods) -which cannot capture the pattern of sensory adaptation in this condition. Although its positive and negative peaks are asymmetrical, adaptation is significantly stronger than chance at 0 s, with a peak-to-peak of − .°1 72 . (c) Tuning of serial dependence for the 6-s delay condition. Here, serial dependence is significantly more positive than chance, and the peak-to-peak of the DoG fit -indicated by the blue double-headed arrow in the figure -is 3.37°. Note that in this condition both the DoG and Clifford models capture the amplitude of the effect equivalently well.
the tuning over stimulus differences for one subject with a low-amplitude (peak-to-peak = .°1 57 ) and narrow attractive serial dependence surrounded by negative "peripheral bumps" 9 (where the bias changes direction to repulsion when consecutive stimuli are far apart). In contrast, the participant highlighted in Fig. 4d (and Supp. Fig. 1B) evinced the canonical shape of the effect -a broad spread of the attractive effect (peak-to-peak 5 11 = .°) and less prominent peripheral bumps.
The time course of serial dependence we observed at the group level over the current trial's delay period was not reproduced when trials were sorted based on the previous trial's delay period. For each of the possible preceding delay period lengths, serial dependence in the current trial's response was significantly greater than zero (all < . p 0 01, group permutation tests; Fig. 5a). Between 0 and 6 s (of delay on the previous trial), serial dependence varied little (all comparisons . . n s , group permutation tests; minimum peak-to-peak at 6 s 1 78 = .°; maximum peak-to-peak at 3 s = .°2 21 ; all bootstrapped 95% confidence intervals overlapping). However, when the previous delay was as long as 10 s, serial dependence was significantly reduced relative to each of the other delay lengths (all < . p 0 005; peak-to-peak at 10 s = .°0 91 ; bootstrapped 95% confidence interval = .°.°[0 50 , 1 20 ]). Tuning for the conditions with the strongest (3 s) and weakest (10 s) serial dependence are displayed in Fig. 5b and c, respectively. This set of findings is partially consistent with results from another study that tested a narrower range of delays (0.8 -3.2 s) in non-human primates 16 . In this earlier study, it was found that the amplitude of serial dependence remained constant over this range (of previous delay length). Here, we extend this result to show that the previous trial's influence does eventually decay when the previous trial's delay is especially long.
In line with past work on the sources of error in working memory 9,33 , our findings suggest that the increasing serial dependence over longer delays (in the current trial) reflects its association with mnemonic processes rather than perceptual and motor processes that were held constant in our experiment. Research over the last decade has yielded several mathematical models designed to isolate distinct sources of error in working memory 34,35,[37][38][39][40][41] . None of these include parameters for the proactive interference that serial dependence represents 32 . Also, the only substantive difference between the models is their characterization of noise in the distribution of behavioral responses. As a form of systematic error, serial dependence is separable from noise, and so can be incorporated into any of these models without changing their definitions or differences. The simplest model (sometimes called the "equal precision" model 37,39 ) fits random error with a single von Mises distribution 34 . In contrast, the "variable precision" model assumes the standard deviation parameter of the von Mises varies from trial to trial according to a gamma distribution 37,38 . A third model explicitly regards the precision of working memory as arising from noise in Poisson-distributed spike trains of individual neurons 40,41 . Errors in this model are distributed according to a von Mises random walk 41 . We will refer to these three working memory models as EP (equal precision), VP (variable precision), and VMRW (von Mises random walk).
As a first pass, we fit each of these models to the behavioral data from Experiment 1. Model comparison on the basis of the corrected Akaike Information Criterion (AICc) revealed that the VMRW model fit the data about as well as the VP model (Δ AICc 3 9 5 3 = . ± . in favor of VMRW). Both of these models fit the data better than the EP model (Δ AICc 40 2 9 6 = . ± . in favor of VMRW; Δ AICc 36 2 8 1 = . ± . in favor of VP). This relative performance is consistent with published comparisons of the three models using behavioral data from other working memory tasks [37][38][39][40] .
Next, we created a hybrid model that incorporates serial dependence into the mean of the VMRW distribution -sliding the mean clockwise or counterclockwise on each trial by the magnitude dictated by the tuning of the history effect (see Methods). This hybrid model significantly outperformed the base VMRW model (Δ AICc 29 2 7 9 = . ± . ). However, this result on its own falls short of confirming that the serial dependence tuning function is needed to quantify the influence of the history effect on each trial. To verify that inclusion of the tuning curve visible in Figs 2 and 4-6 is needed for the improvement in fit, we developed an alternative hybrid "memory confusion" 2 model that takes trial history into account in a different way. In this model, it is assumed that on a subset of trials, subjects simply mix up which stimulus belongs to the current trial and report the previous trial's . Variance of response errors as a function of the current trial's delay in Experiment 1. The thin black line depicts the group mean, with bootstrapped 95% confidence intervals in gray shading. The thick black line is the linear best fit, which is a mismatch to the sublinear increase of variance with delay. A better fit is achieved with a power law (modified to allow for non-zero variance in the 0-s condition), depicted in orange. The power location when probed (analogous to a "swap" 36,43 over time rather than space). This "memory confusion" model provided no benefit above the base VMRW model and made it worse, due to the addition of parameters that captured little variance (Δ AICc = − . ± . 7 7 2 7). Finally, we tested whether the addition of the serial dependence tuning function to all three of the base models would change the order of performance among them. Whereas the VMRW and VP models performed equivalently without taking account of serial dependence, we found that the extended VMRW model outperformed the extended VP model when fit to our data (Δ AICc = . ± . 12 2 4 1). The fit of the extended EP model was still worse than that of the VP model with serial dependence terms (Δ AICc 14 7 5 2 = . ± . ). Hence, the overall best-fitting model to our data was the VMRW model with added terms for the DoG-shaped serial dependence effect.

Experiment 2: Manipulation of baseline interval between trials.
It is possible that the delay manipulation in Experiment 1 confounded two variables 1 : the time for which subjects must hold the current item in memory and 2 the time that has elapsed since the behavioral response on the previous trial, before the current trial's response. To assess whether the time course of serial dependence we observed (Fig. 2a) corresponds to mnemonic processes and not the simple passage of time, we conducted a second experiment in which the inter-trial interval (ITI) varied randomly among 1, 3, 6, and 10 s. The delay in this new task was held constant at 3 s. In all other respects, the tasks for the two experiments were identical. For all but three individuals, serial dependence was measured as the peak-to-peak of the DoG fit to the data. The DoG was a qualitatively poor fit to the remaining participants (e.g., Fig. 4c), due to the prominence of peripheral bumps in their serial dependence tuning functions, which the DoG cannot capture. (The term "peripheral bumps" refers to repulsion at large differences between consecutive stimuli, in the same condition in which attraction occurs at small differences.) These participants are colored orange in this plot. Letters in this plot refer to the subfigures that follow. Significant negative adaptation and positive serial dependence (p < 0.05, permutation tests) are labeled with asterisks. Error bars are bootstrapped 95% confidence intervals. (b) Tuning of sensory adaptation across all possible angular differences between the current and previous stimulus, for the subject whose adaptation was strongest (peak-to-peak 5 08 = − .°. The thin black line represents the group moving average of response errors, with the standard error in gray shading, and the thick black line is the bestfitting DoG curve, which fits the data as well as the Clifford model (in orange). (c) Tuning of serial dependence for a subject with a non-canonical pattern of the effect (peak-to-peak 1 57 = .°). The peripheral bumps are high in amplitude and wide relative to the narrow central attractive bias. The Clifford model in orange captures the positive and negative peaks of the effect well (even while the widths are misestimated), whereas the DoG mischaracterizes the bias as adaptation (negative peak-to-peak). (d) Tuning of serial dependence for a subject with strong, canonical serial dependence (peak-to-peak 5 11 = .°). Here, the central peaks of serial dependence are wider and higher-amplitude than the peripheral bumps, and both the DoG (in black) and Clifford model (in orange) capture the magnitude of the effect well, though the DoG misses the peripheral repulsion.
Next we examined each of the ITIs individually. The magnitude of serial dependence across ITIs from 1-10 s is plotted in Fig. 6a. The magnitude of serial dependence decreases gradually during the interval between trials, marginally from 3-6 s ( = .
p 0 01, group permutation test, Bonferroni-corrected α = . 0 008; lower bound of bootstrapped 95% confidence interval at 3 s 2 48 = .°; upper bound of confidence interval at 6 s 1 81 = .°) and significantly from 6-10 s ( < − p 10 4 ; lower bound of bootstrapped 95% confidence interval at 6 s = .°1 00 ; upper bound of confidence interval at 10 s = .°0 48 ). The difference in serial dependence between the 1-s (Fig. 6b) and 3-s ITIs was statistically non-significant. The slope of this time course is opposite that obtained in Experiment 1, strengthening our conclusion that increased serial dependence with increased delay length is due to the prolongation of memory demands rather than the mere passage of time. For the largest ITI (10 s), participants' responses on the trial after the ITI were repelled away from the preceding trial's stimulus, an effect consistent with sensory adaptation ( = . p 0 006; peak-to-peak = −1.38°; bootstrapped 95% confidence interval = − .°− .°[ 2 15 , 0 48 ]; Fig. 6c). In Figure 5. (a) Peak-to-peak of serial dependence in the group data for each length of the previous trial's delay tested in Experiment 1. The peak-to-peak was calculated using a least squares fit of the Clifford tuning function to the data. Statistics could not be computed reliably using the DoG function due to its inability to capture the "peripheral bumps" of serial dependence, which were prominent when the data were sorted by the length of the previous delay period (see Supp. Fig. 2). Error bars represent bootstrapped 95% confidence intervals. Serial dependence is constant between 0 and 6 s, but then drops in magnitude between 6 and 10 s. (b) Tuning of serial dependence across all possible angular differences between the current and previous stimulus, for responses that followed trials with a delay length of 3 s. The thin black line represents the group moving average of response errors, with the standard error in gray shading, and the thick orange line is the best-fitting Clifford curve (2.21° peak-to-peak). The DoG fit (thick black line) misses the large-amplitude peripheral bumps at the extremes of the x-axis in this plot. (c) Tuning of serial dependence when the preceding trial's delay period was 10 s. Here, the peak-to-peak of the Clifford fit is 0.91°. The attractive peaks of serial dependence in this condition are clearly reduced relative to Fig. 5b, but the peripheral bumps are just as prominent. The best DoG fit reasonably approximates the magnitude of the attractive effect, but its failure to account for the peripheral bumps causes resampling and permutation statistics to be unstable (Supp. Fig. 2).
contrast, for every other ITI tested, serial dependence was significantly greater than zero (all ≤ − p 10 3 , group permutation tests).

Discussion
In everyday visual experience, humans rely not just on moment-to-moment perception but also on continued maintenance of information in working memory to navigate their environments and accomplish tasks. While there is much evidence to suggest that working memory recruits the same cortical areas active during sensory perception [48][49][50][51][52][53][54][55][56] , remembered visual content differs in quality 33,57,58 -and potentially representational format 59,60 -from feedforward signals driven by the presence of an external stimulus. Both behavioral data 33,57,58 and computational theory 61 have implied that passage of visual percepts into memory makes them less precise. This past work has also claimed that mnemonic processes do not attach to percepts any accumulating systematic bias -just random noise due to drift and/or decay 33,57,58,61 . With the experiments reported here, we provide new evidence to disconfirm this view. Serial dependence -a systematic bias in the direction of the preceding trial's stimulus -is absent from percepts until the working memory system is engaged. Our demonstration of repulsive adaptation -with no attractive serial dependence -in the perception condition extends previous work 9 by showing that this oppositely valenced effect that precedes working memory does not require that subjects make a comparison between two simultaneously presented stimuli 9 ; adaptation occurs in the context of the same delayed response task that yields serial dependence when memory demands are increased.
By testing a wider range of delays between stimulus and response than used in previous studies 9,16,17 , we were able to chart the time course of serial dependence in visual working memory. This technique -of probing participants to report the contents of memory at variable points in time after stimulus offset -is common in visual psychophysics 62 . It has revealed how information passing through the visual system progresses from a rich perceptual code to a more impoverished mnemonic one. For a few hundred milliseconds after visual input ceases, a great deal Figure 6. (a) Peak-to-peak of serial dependence in the group data for each ITI tested in Experiment 2. The peak-to-peak was calculated using a least squares fit of the DoG tuning function to the data. Error bars represent bootstrapped 95% confidence intervals. Serial dependence decreases in magnitude as the ITI lengthens, and then flips to significant repulsive sensory adaptation at an ITI of 10 s. (b) Tuning of serial dependence across all possible angular differences between the current and previous stimulus, for the 1-s ITI condition. The thin black line represents the group moving average of response errors, with the standard error in gray shading, and the thick black line is the best-fitting DoG curve (2.59° peak-to-peak). In orange is the best fit of the Clifford model, which captures the amplitude of the effect as well as the DoG. (c) Tuning of sensory adaptation for the 10-s ITI condition. Here, the peak-to-peak of the DoG fit is −1.38°. The Clifford model cannot conform to the narrow width of the effect in this condition and underestimates its magnitude.
SCIeNtIfIC REPORTS | 7: 14739 | DOI:10.1038/s41598-017-15199-7 of perceptual detail is still accessible to the observer in iconic memory -a form of storage intermediate between perception and working memory 63 . After that, within one second of delay, capacity-limited, distraction-resistant working memory comes online in parallel with a larger-capacity system that is vulnerable to distraction -fragile memory 45,46,[64][65][66][67] . Our experiments demonstrate that the residual sensory trace associated with iconic memory is free of serial dependence -though it does carry the opposite, repulsive bias associated with sensory adaptation. The attractive bias arises slowly in the later short-term memory systems, but asymptotes before long-term storage processes are engaged (at approximately 20 seconds of delay 58 ). Future research may resolve with finer resolution the exact moment at which serial dependence appears and whether it is most strongly associated with fragile or distraction-resistant stages of working memory. (Consistent with most work in this area 68,69 , we have tended to use the term "working memory" as a shorthand for both of these systems.) Our results indicate that not only do the relative strengths of serial dependence and adaptation differ over time (between perception and working memory) -they also differ across individuals (Fig. 4). This suggests that serial dependence may appear in behavior sooner -perhaps as early as the perceptual period -in individuals for whom adaptation processes are especially weak (Supp. Fig. 1). By the same reasoning, experimental manipulations employed to dimish the strength of adaptation might help reveal an earlier onset of weak, underlying positive serial dependence in most subjects. However, as it can take as little as 50 ms for a viewed stimulus to be consolidated into working memory 70 , it seems unlikely that future investigations conducted at finer temporal resolution will identify robust serial dependence at time points that definitively exclude the involvement of working memory -especially given that positive serial dependence is weaker the sooner the response is made to a stimulus. (We note that subjects are likely to have engaged working memory encoding processes even in our 0-s delay condition, where serial dependence was not consistently observed. Our argument is that consolidation into working memory is likely necessary, but not always sufficient -if maintenance times are short -for the occurrence of the effect.) The measurement of neural signals associated with serial dependence may be needed to definitively disambiguate whether the effect originates in low-level sensory cortex immediately upon sensory perception or hundreds of milliseconds later, after sensory input has propagated to higher-level areas involved in the maintenance of short-term perceptual memories 32 .
Beyond demonstrating that serial dependence accumulates for longer in working memory than previous studies have indicated 9,16,17 , we have taken strides to integrate this phenomenon into the study of working memory in ways it has not been before 32 . Specifically, we have made concrete, formal improvements to prominent mathematical models designed to characterize the psychological architecture of working memory. The provision of terms for serial dependence to these models allows them to capture more variance in behavioral data and ensures that the variance associated with the temporal smoothing operation of serial dependence does not distort estimates of the models' other parameters. Furthermore, our results demonstrate that the inclusion of these terms can reveal performance differences between seemingly equivalent models -we found that the VMRW model performs better than the VP model only after the tuning of the trial-history effect is taken into account. Claims that have been made about the nature of decay rates in working memory without consideration of trial-history biases must now be reëvaluated. For example, one study that modeled behavioral responses following different delay period lengths concluded that maintained representations are susceptible to spontaneous complete erasure from working memory as the delay length increases (measured as an increase in guess rates), but not to subtle degradations in precision (measured with the κ parameter of a variation on the EP model) 42 . However, because this study ignored potential serial dependencies in the data, as well as alternative models of noise (e.g., VP and VMRW), the validity of this conclusion is unclear. It is impossible to address claims about total loss of information from memory with our data, because guess rates in our simple one-item spatial task were near zero. In the future, however, the hybrid models we have developed that incorporate serial dependence may help elucidate the nature of working memory storage in more difficult multi-item tasks 44 . To what extent serial dependencies occur when multiple items are held in mind at once is an open question that the hybrid models we have validated can help answer.
Our experiments have filled other gaps in the field's understanding of the temporal properties of serial dependence. We have determined the approximate duration for which this effect persists between trials. At least in spatial working memory, the attractive bias disappears within ten seconds after the end of each trial, and is replaced by (or exposes a persistent) low-amplitude adaptation. This constrains possible neural theories of serial dependence -viable mechanisms must have time constants on the order of 10 s, which rules out especially short-term (e.g., synaptic facilitation) and long-term (e.g., long-term potentiation) forms of plasticity. Previous attempts to measure the washout period of serial dependence in humans have used a short, fixed ITI, preventing the measurement of pure time in the absence of intervening trials 1,14 . One experiment using non-human primate subjects did report a decrease in serial dependence between 2 and 7 s of ITI 16 . Over this range, the effect remained above baseline for two of three subjects, and no crossover to adaptation was observed. We have also shown that serial dependence weakens when the stimulus on the previous trial is maintained for as long as 10 s. It is possible that the neural code changes abruptly around this time point: for example, elevated neural firing keeping the representation active may begin to fail spontaneously (as happens in some neural-network models 71 ), leaving the representation in an "activity silent" state supported by short-term plasticity 72,73 . Exponential decay of this synaptic trace (without continued active firing to keep it in place) may explain the reduced influence on responses on the subsequent trial.
Reframing serial dependence as a phenomenon of working memory rather than perception does not change the theories that have been put forth about its functional importance 32 . Thus, it remains an important mechanism for stabilizing representations against interruptions in visibility 1,8 . The contents of working memory track the focus of attention [25][26][27][28][29][30][31] , which, during the execution of a single goal, can remain the same for several seconds, even as the raw visual input that impinges on the retina fluctuates due to saccades, occlusion, and changes in lighting. Hence, temporal autocorrelation in visual working memory is potentially even higher than it is in visual scenes (and perception). If true, this would explain why serial dependence may have evolved in working memory as opposed to perceptual circuits -more autocorrelation enhances the ability of temporal smoothing to limit the influence of noise and boost signal. Moreover, the offloading of attractive serial dependence to memory systems may accord perceptual systems enhanced capacity to specialize in novelty detection, in part via adaptation. More research is needed to elucidate the ways in which serial dependence and adaptation interact, and to reveal the ecologically valid situations in which one or the other (perhaps both at the same time) enhance visual performance 32 . Such continued study should aim to clarify the mechanisms and functional consequences of the striking diversity we observed in the strength and tuning shape of these effects across individuals.

Methods
Participants. Fifty-five adults (34 female) from the UC Berkeley community were recruited to participate in this study. Thirty-five of these individuals completed Experiment 1 only, fourteen completed Experiment 2 only and six completed both experiments. All aspects of data collection and analysis were conducted in accordance with guidelines approved by the Committee for the Protection of Human Subjects at UC Berkeley. Informed consent was obtained from all subjects, and they were compensated monetarily for their time.
Experimental Procedures. Participants completed the protocol in a soundproof, dimly lit testing room.
For both experiments, they completed a spatial delayed response task, depicted in Fig. 1 (adapted from 44 ). The task was programmed in MATLAB using the Psychophysics Toolbox 74 (version 3) and run on a Mac mini (OSX El Capitan 10.11). For eight subjects in Experiment 1, a 17-in monitor was used with a screen resolution of 1280 × 1024 pixels. The remaining sessions were run with a 23-in monitor, 1920 × 1080 pixels. Results with regard to serial dependence were not appreciably different between the two groups that used different monitors (Supp. Fig. 3). All participants were seated such that their eyes were approximately 60 cm from the center of the testing display.
The stages of the generic task used for both experiments are as follows (with angle measurements reported in degrees of visual angle). Each trial began with the presentation of a black circle for 1 s at a random polar angle from fixation, with eccentricity fixed at °12 . The circle's diameter was °1 . All stimuli were displayed against a gray background. Participants were instructed to fixate a central black square -which spanned .°0 5 × .°0 5 -whenever it was on the screen (all stages of the task aside from the response period). In Experiment 1, participants remembered the location of the presented circle for a delay that varied randomly from trial to trial (0, 1, 3, 6, or 10 s). The delay was always 3 s in Experiment 2. At the end of the delay, the fixation square was replaced with the mouse cursor (at the exact center of the screen), and participants indicated the location in mind by moving the cursor to that location and clicking once. No feedback was given. Errors were measured in degrees of polar angle. In Experiment 1, a 1-s ITI followed the response period, before the start of the next trial. The ITI varied randomly from trial to trial in Experiment 2 (1, 3, 6, or 10 s). Each participant completed 1,000 trials (200 per delay) in Experiment 1, divided into 40 blocks over the course of one or two experimental sessions. All but two participants completed 1,008 trials (252 per ITI) in Experiment 2. The remaining two participants completed 999 and 1,017 trials, respectively. Data Analysis. The data were analyzed using Python, MATLAB, and shell scripts. All code written for this study is available in a public Git repository (https://github.com/dabliss/bliss_sd_behavior_2017.git).
Before model fitting for trial-history effects, the data were submitted to preprocessing. First, trials with responses that were within 5° of visual angle of the origin were dropped, as were trials with responses further than three standard deviations from the participant's mean error (<0.7% of all trials, across subjects). Next, we computed systematic directional error as the mean response for each stimulus location. This mean was then subtracted from the response on each individual trial (ignoring the location of the previous trial) to obtain the residual error that was used to characterize serial dependence. Replicating the procedure in 16 , we computed the systematic error by spatially low-pass filtering the responses as a function of stimulus location using the MATLAB function loess. Finally, to ensure that our analyses were restricted to data from participants who performed the task correctly, we removed those with noticeably poor performance. Specifically, we removed subjects with an overall mean absolute error greater than °10 of polar angle. This criterion, though arbitrary, removed only subjects with qualitatively noisy error histograms while retaining those whose errors were roughly normally distributed around the correct value (the expected pattern). Only three subjects in Experiment 1 failed to pass this criterion (mean absolute error . ± . 37 3 19 5 for these three compared to . ± . 4 7 0 2 for the others). Data from two subjects in Experiment 2 were excluded ( . ± . 53 9 1 8 for these compared to . ± . 4 7 0 4 for the others). Studies that have modeled the tuning of serial dependence to featural differences between past and current visual stimuli have used the derivative of Gaussian (DoG) 1,2,8,9 (or the very similar Gabor function 16,17 ). There is another function in the perception literature, developed by Clifford and colleagues 20 , that has been used to model sensory adaptation -and that therefore fits serial dependence readily (when multiplied by −1). Overall, these functions fit the data from our Experiment 1 equivalently well (collapsing over delays, Δ AICc = . ± . 0 8 1 0, favoring DoG over Clifford), and this equivalence also holds for Experiment 2 (collapsing over ITIs, Δ AICc = 1 1 1 0 . ± . , favoring DoG over Clifford). However, we noted significant differences between the Clifford and DoG models in certain conditions. Occasionally, the attractive bias of serial dependence is accompanied by a repulsion effect ("peripheral bumps" 9 ) when previous visual input is close to maximally different from the input on the current trial (the extremes of the x-axis in Fig. 2c). The DoG cannot account for this reversal of the response bias, so when it is prominent in the data, the best fit of the DoG tends to mischaracterize the true effect size (e.g., 4C). The Clifford model is a combination of sinusoids of different frequencies designed to capture the peripheral bumps when they appear 20 . However, when the trial-history effect is narrow over stimulus differences and there are no peripheral bumps, the Clifford model tends to fail (e.g., Fig. 2a). This is because the Clifford model -unlike the DoG -does not have an independent width parameter; shrinking the central width of the Clifford fit requires that the peripheral bumps be increased. To be consistent with previous literature on serial dependence, we use the DoG for all analyses, except in cases where it provides a poor fit to the data, in which case we use the Clifford model (as noted below). The mathematical definitions of both models are reported next.
In this study, differences between past and current visual input ranged between −180 and °180 of polar angle (a complete circle). The DoG is defined as where y is the signed error, x is the relative angle of the previous trial, a is the amplitude of the curve peaks, w is the width of the curve, and c is the constant − . e 2 / 0 5 . The Clifford model is stated as follows: where s is a scaling parameter and c is a centering parameter. We used the scipy 75 function least_squares (in the optimize module) to find the values of a and w, in the case of the DoG, or c and s, in the case of the Clifford model, that minimized the difference, for each x, between the estimated y and the subject's actual error. Across all values of x, we take the magnitude of serial dependence (or adaptation) to be the peak-to-peak of y x ( ), with the sign adjusted to match the direction of the effect (see Fig. 2c). To determine whether the magnitude of serial dependence was significantly greater than zero, or greater in one condition than in another, we submitted the data to permutation testing at the group level 2,9 . Specifically, we shuffled the values of x (current trial's location relative to the previous trial's) while leaving in place the corresponding errors. We then fit the DoG to the shuffled dataset. This process was repeated 10,000 times. The p-values we report are the proportion of permutations that led to equal or higher values for the peak-to-peak of the function fit than the one estimated for the unshuffled data. In the case of a comparison between conditions, we subtracted the null peak-to-peaks for one condition from those for the other, and report the proportion of these differences that had equal or higher values than the empirical difference. The criterion for significance was Bonferroni-corrected for each family of tests.
We computed bootstrapped confidence intervals as follows: 2,9 We resampled the data with replacement 10,000 times. We then fit the DoG to each resampled dataset. This yielded a distribution of peak-to-peak values from which we selected the boundaries of the 95% confidence interval -separately for each delay and ITI condition.
In our statistical analyses of group data, only one condition -the 10-s condition in the analysis of the previous trial's delay length for Experiment 1 -could not be fit reliably using the DoG, due to large peripheral bumps ( Fig. 5c; Supp. Fig. 2). Hence, for this analysis we used the Clifford model, which estimated the peak-to-peak reliably. In our plot of individual subjects' data ( Fig. 4a), the DoG fit (with bootstrapped confidence intervals) is reported for all but three subjects, for whom the Clifford model was a qualitatively superior fit. These three subjects are labeled in the figure, and one is highlighted in Fig. 4c.
Three base mathematical models of working memory -EP 34 , VP 37,38 , and VMRW 40,41 -were fit to our behavioral data, as described in the Results. Model fitting was done using the MATLAB function fminsearch, separately for each delay condition. EP is defined as s cos(s ) 0 the von Mises probability density function. Here, ŝ is each trial's response, s the corresponding stimulus, and I 0 the modified Bessel function of the first kind, order zero. The concentration parameter, κ, is a measure of response precision, spanning all trials, and is the model's one free parameter for fitting.
In VP, precision is drawn anew for each trial from a gamma (γ) distribution with mean J and scale parameter τ (the model's free parameters). Built from EP, this gives where EP's concentration parameter κ is a function of J -here expressed as Φ J ( ) -and J is formally defined as Fisher information. The analytical relation between κ and J is κ = , and Φ J ( ) is approximated numerically using this equation. The integral in Equation (4) has no analytical expression and so is also approximated using Monte Carlo simulations 37,39 .
Finally, in VMRW, noise in working memory is distributed according to a von Mises random walk, as derived from a population coding model of cortex 41 . Specifically, behavioral errors for a random walk of length r are von Mises distributed: Here, ψ r r ( ) m is the probability density function for a uniform random walk of length r and number of steps m. The variable m is itself Poisson-distributed, with expected value ξ. For additional equations and a full derivation, including the neural interpretation of these variables, see 41 . In order to fit this model to data, we approximated the density ψ r ( ) m via Monte Carlo simulation. The free variables for fitting are κ (the concentration parameter) and ξ, which corresponds to gain.
We added terms to these base models to capture temporal smoothing in the data in the form of serial dependence (or adaptation). In particular, we allowed the mean of each model's probability density function to vary on a trial-by-trial basis, as a function of the location of the previous trial's stimulus. Given a particular difference in location between the current and previous trial's stimuli, the mean shift was set to be the value of the DoG model fit to the data at that point. (That is, in visual terms, the input to the model was a point on the x-axis in Fig. 2c, for example, and the output mean shift was the DoG function's value on the y-axis.) This procedure added two additional variables to each of the base models -a and w.
As an alternative to the base models with the serial dependence expansion, we made alternative models that account for trial history by assuming that participants, on a subset of trials, confuse which stimulus was presented most recently and report the wrong item when probed. This alternative similarly allowed the mean of the base probability density functions to shift, depending on the difference between the previous trial's location and the current one, without altering their shape or width. This "swap over time" model is defined as 36 where BM is a base model, α (an additional free parameter) sets the frequency of swaps, and ⁎ s is the stimulus location for the previous trial.
Within each model, we used a separate set of parameters for each memory delay length, and formally compared the fits of different models using the Akaike Information Criterion (as recommended in 39 ), with the standard correction for finite sample sizes (AICc). AICc values were averaged across subjects for these comparisons.