Science
A thalamus–brainstem attractor network drives history-biased decisions
Key Points
Abstract Natural environments often change gradually, making it adaptive to bias decisions on the basis of the recent past — a phenomenon known as serial dependence1,2,3. Large-scale recordings during behaviour have identified that serial dependence is a common motif for decision-making, with neural representations of past experiences found throughout the brain4,5,6,7,8,9,10,11. However, it remains unclear whether this bias arises from dedicated neural circuits with history-specific...
Abstract
Natural environments often change gradually, making it adaptive to bias decisions on the basis of the recent past — a phenomenon known as serial dependence1,2,3. Large-scale recordings during behaviour have identified that serial dependence is a common motif for decision-making, with neural representations of past experiences found throughout the brain4,5,6,7,8,9,10,11. However, it remains unclear whether this bias arises from dedicated neural circuits with history-specific computations. Using whole-brain, cellular-resolution imaging in zebrafish performing memory-guided evasive manoeuvres12,13,14, we identified a hierarchical circuit that maintains past information and biases future choices. Discrete attractors in the dorsal thalamus encoded the position of the most recent obstacle, maintaining a categorical memory via persistent activity lasting 10–20 s. Optogenetic manipulation of the dorsal thalamus abolished or imposed serial bias. A downstream hindbrain integrator received input from the thalamus and combined it with current sensory cues to produce graded responses reflecting multi-trial history. Leveraging a comprehensive brain atlas in zebrafish15, we constructed a whole-brain computational model that recapitulated behaviour and also predicted a key role for heterogeneous inhibitory subtypes in enabling flexible state transitions. This attractor–integrator architecture reveals a hierarchical and modular computation that unifies robust memory retention with flexible sensory integration, providing a general principle for history-biased decisions.
This is a preview of subscription content, access via your institution
Access options
Access Nature and 54 other Nature Portfolio journals
Get Nature+, our best-value online-access subscription
£17.99 / 30 days
cancel any time
Subscribe to this journal
Receive 52 print issues and online access
£199.00 per year
only £3.83 per issue
Buy this article
- Purchase on SpringerLink
- Instant access to the full article PDF.
£ 29.95
Prices may be subject to local taxes which are calculated during checkout
Data availability
The data supporting the findings of this study are available on Zenodo68 (https://doi.org/10.5281/zenodo.18535967). Source data are provided with this paper.
Code availability
The source code for the spiking neural network model is available on GitHub (https://github.com/Mulab2020/HAN). The custom analysis code for experimental data is available on Zenodo68 (https://doi.org/10.5281/zenodo.18535967).
References
Cicchini, G. M., Mikellidou, K. & Burr, D. C. Serial dependence in perception. Annu. Rev. Psychol. 75, 129–154 (2024).
Kiyonaga, A., Scimeca, J. M., Bliss, D. P. & Whitney, D. Serial dependence across perception, attention, and memory. Trends Cogn. Sci. 21, 493–497 (2017).
Manassi, M. & Whitney, D. Continuity fields enhance visual perception through positive serial dependence. Nat. Rev. Psychol. 3, 352–366 (2024).
Hattori, R., Danskin, B., Babic, Z., Mlynaryk, N. & Komiyama, T. Area-specificity and plasticity of history-dependent value coding during learning. Cell 177, 1858–1872.e15 (2019).
Hwang, E. J. et al. Corticostriatal flow of action selection bias. Neuron 104, 1126–1140.e6 (2019).
Akrami, A., Kopec, C. D., Diamond, M. E. & Brody, C. D. Posterior parietal cortex represents sensory history and mediates its effects on behaviour. Nature 554, 368–372 (2018).
Barbosa, J. et al. Interplay between persistent activity and activity-silent dynamics in the prefrontal cortex underlies serial biases in working memory. Nat. Neurosci. 23, 1016–1024 (2020).
Thompson, J. A., Costabile, J. D. & Felsen, G. Mesencephalic representations of recent experience influence decision making. eLife 5, e16572 (2016).
Urai, A. E. & Donner, T. H. Persistent activity in human parietal cortex mediates perceptual choice repetition bias. Nat. Commun. 13, 6015 (2022).
Findling, C. et al. Brain-wide representations of prior information in mouse decision-making. Nature 645, 192–200 (2025).
Morcos, A. S. & Harvey, C. D. History-dependent variability in population dynamics during evidence accumulation in cortex. Nat. Neurosci. 19, 1672–1681 (2016).
Ahrens, M. B., Orger, M. B., Robson, D. N., Li, J. M. & Keller, P. J. Whole-brain functional imaging at cellular resolution using light-sheet microscopy. Nat. Methods 10, 413–420 (2013).
Vladimirov, N. et al. Light-sheet functional imaging in fictively behaving zebrafish. Nat. Methods 11, 883–884 (2014).
Mu, Y. et al. Glia accumulate evidence that actions are futile and suppress unsuccessful behavior. Cell 178, 27–43.e19 (2019).
Du, X. et al. Nervous system-wide single-cell morphology atlas of excitatory and inhibitory neurons in larval zebrafish. Preprint at bioRXiv https://doi.org/10.1101/2025.06.06.658008 (2025).
Molano-Mazón, M. et al. Recurrent networks endowed with structural priors explain suboptimal animal behavior. Curr. Biol. 33, 622–638.e7 (2023).
Yu, A. J. & Cohen, J. D. Sequential effects: superstition or rational behavior? Adv. Neural Inf. Process. Syst. 21, 1873–1880 (2008).
Fischer, J. & Whitney, D. Serial dependence in visual perception. Nat. Neurosci. 17, 738–743 (2014).
Braun, A. & Donner, T. H. Adaptive biasing of action-selective cortical build-up activity by stimulus history. eLife 12, RP86740 (2023).
Gupta, D., DePasquale, B., Kopec, C. D. & Brody, C. D. Trial-history biases in evidence accumulation can give rise to apparent lapses in decision-making. Nat. Commun. 15, 662 (2024).
Shiozaki, H. M. & Kazama, H. Parallel encoding of recent visual experience and self-motion during navigation in Drosophila. Nat. Neurosci. 20, 1395–1403 (2017).
Fritsche, M., Spaak, E. & De Lange, F. P. A Bayesian and efficient observer model explains concurrent attractive and repulsive history biases in visual perception. eLife 9, e55389 (2020).
Zhang, H. & Luo, H. Feature-specific reactivations of past information shift current neural encoding thereby mediating serial bias behaviors. PLoS Biol. 21, e3002056 (2023).
Lak, A. et al. Reinforcement biases subsequent perceptual decisions when confidence is low, a widespread behavioral phenomenon. eLife 9, e49834 (2020).
St John-Saaltink, E., Kok, P., Lau, H. C. & De Lange, F. P. Serial dependence in perceptual decisions is reflected in activity patterns in primary visual cortex. J. Neurosci. 36, 6186–6192 (2016).
Ahrens, M. B. et al. Brain-wide neuronal dynamics during motor adaptation in zebrafish. Nature 485, 471–477 (2012).
Zhang, Y. et al. Fast and sensitive GCaMP calcium indicators for imaging neural populations. Nature 615, 884–891 (2023).
Gold, J. I. & Shadlen, M. N. The neural basis of decision making. Annu. Rev. Neurosci. 30, 535–574 (2007).
Papadimitriou, C., White, R. L. III & Snyder, L. H. Ghosts in the machine II: neural correlates of memory interference from the previous trial. Cereb. Cortex 27, 2513–2527 (2017).
Kaas, J. H. in Evolution of Nervous Systems (ed. Kaas, J. H.) 499–516 (Elsevier, 2007).
Kappel, J. M. et al. Visual recognition of social signals by a tectothalamic neural circuit. Nature 608, 146–152 (2022).
Hageter, J., Starkey, J. & Horstick, E. J. Thalamic regulation of a visual critical period and motor behavior. Cell Rep. 42, 112287 (2023).
Heap, L. A. L., Vanwalleghem, G., Thompson, A. W., Favre-Bulle, I. A. & Scott, E. K. Luminance changes drive directional startle through a thalamic pathway. Neuron 99, 293–301.e4 (2018).
Govorunova, E. G., Sineshchekov, O. A., Janz, R., Liu, X. & Spudich, J. L. Natural light-gated anion channels: a family of microbial rhodopsins for advanced optogenetics. Science 349, 647–650 (2015).
Klapoetke, N. C. et al. Independent optical excitation of distinct neural populations. Nat. Methods 11, 338–346 (2014).
Chaudhuri, R. & Fiete, I. Computational principles of memory. Nat. Neurosci. 19, 394–403 (2016).
Lim, S. & Goldman, M. S. Balanced cortical microcircuitry for maintaining information in working memory. Nat. Neurosci. 16, 1306–1314 (2013).
Compte, A. Synaptic mechanisms and network dynamics underlying spatial working memory in a cortical network model. Cereb. Cortex 10, 910–923 (2000).
Murray, J. D. et al. A hierarchy of intrinsic timescales across primate cortex. Nat. Neurosci. 17, 1661–1663 (2014).
Zylberberg, J. & Strowbridge, B. W. Mechanisms of persistent activity in cortical circuits: possible neural substrates for working memory. Annu. Rev. Neurosci. 40, 603–627 (2017).
Khona, M. & Fiete, I. R. Attractor and integrator networks in the brain. Nat. Rev. Neurosci. 23, 744–766 (2022).
Inagaki, H. K., Fontolan, L., Romani, S. & Svoboda, K. Discrete attractor dynamics underlies persistent activity in the frontal cortex. Nature 566, 212–217 (2019).
Petrucco, L. et al. Neural dynamics and architecture of the heading direction circuit in zebrafish. Nat. Neurosci. 26, 765–773 (2023).
Dragomir, E. I., Štih, V. & Portugues, R. Evidence accumulation during a sensorimotor decision task revealed by whole-brain imaging. Nat. Neurosci. 23, 85–93 (2020).
Bahl, A. & Engert, F. Neural circuits for evidence accumulation and decision making in larval zebrafish. Nat. Neurosci. 23, 94–102 (2020).
Dunn, T. W. et al. Brain-wide mapping of neural activity controlling zebrafish exploratory locomotion. eLife 5, e12741 (2016).
Wang, X.-J. Probabilistic decision making by slow reverberation in cortical circuits. Neuron 36, 955–968 (2002).
Stein, H. et al. Reduced serial dependence suggests deficits in synaptic potentiation in anti-NMDAR encephalitis and schizophrenia. Nat. Commun. 11, 4250 (2020).
Yang, E. et al. A brainstem integrator for self-location memory and positional homeostasis in zebrafish. Cell 185, 5011–5027.e20 (2022).
Toso, A. et al. History-dependent biases in perceptual decisions depend on NMDA receptors. Preprint at bioRxiv https://doi.org/10.64898/2026.01.12.699039 (2026).
Wang, X.-J. 50 Years of mnemonic persistent activity: quo vadis? Trends Neurosci. 44, 888–902 (2021).
Koulakov, A. A., Raghavachari, S., Kepecs, A. & Lisman, J. E. Model for a robust neural integrator. Nat. Neurosci. 5, 775–782 (2002).
Brody, C. D., Romo, R. & Kepecs, A. Basic mechanisms for graded persistent activity: discrete attractors, continuous attractors, and dynamic representations. Curr. Opin. Neurobiol. 13, 204–211 (2003).
Boboeva, V., Pezzotta, A., Clopath, C. & Akrami, A. Unifying network model links recency and central tendency biases in working memory. eLife 12, RP86725 (2024).
Shang, C.-F. et al. Real-time analysis of large-scale neuronal imaging enables closed-loop investigation of neural dynamics. Nat. Neurosci. 27, 1014–1018 (2024).
Drieu, C. et al. Rapid emergence of latent knowledge in the sensory cortex drives learning. Nature 641, 960–970 (2025).
Fritsche, M. et al. Temporal regularities shape perceptual decisions and striatal dopamine signals. Nat. Commun. 15, 7093 (2024).
Pellicano, E. & Burr, D. When the world becomes ‘too real’: a Bayesian explanation of autistic perception. Trends Cogn. Sci. 16, 504–510 (2012).
Stringer, C. et al. Rastermap: a discovery method for neural population recordings. Nat. Neurosci. 28, 201–212 (2025).
Jiao, Z.-F. et al. All-optical imaging and manipulation of whole-brain neuronal activities in behaving larval zebrafish. Biomed. Opt. Express 9, 6154–6169 (2018).
Urasaki, A., Asakawa, K. & Kawakami, K. Efficient transposition of the Tol2 transposable element from a single-copy donor in zebrafish. Proc. Natl Acad. Sci. USA 105, 19827–19832 (2008).
Guilbeault, N. C., Guerguiev, J., Martin, M., Tate, I. & Thiele, T. R. BonZeb: open-source, modular software tools for high-resolution zebrafish tracking and analysis. Sci. Rep. 11, 8148 (2021).
Kawashima, T., Zwart, M. F., Yang, C.-T., Mensh, B. D. & Ahrens, M. B. The serotonergic system tracks the outcomes of actions to mediate short-term motor learning. Cell 167, 933–946.e20 (2016).
Li, N., Daie, K., Svoboda, K. & Druckmann, S. Robust neuronal dynamics in premotor cortex during motor planning. Nature 532, 459–464 (2016).
Tubiana, J., Wolf, S., Panier, T. & Debregeas, G. Blind deconvolution for spike inference from fluorescence recordings. J. Neurosci. Methods 342, 108763 (2020).
Tuckwell, H. C. Introduction to Theoretical Neurobiology (Cambridge Univ. Press, 1988).
Wang, C. et al. BrainPy, a flexible, integrative, efficient, and extensible framework for general-purpose brain dynamics programming. eLife 12, e86365 (2023).
Zhao, S., Shan, H. & Mu, Y. A thalamus–brainstem attractor network drives history-biased decisions (2.0.0). Zenodo https://doi.org/10.5281/zenodo.18535967 (2026).
Acknowledgements
We thank H. Luo and H. Zhang for discussions on the core behavioural concept of serial dependence; the CEBSIT thesis committee members for their guidance and constructive feedback throughout this work; P. Ji, J. Ye, R. Portugues and members of the Mu laboratory for valuable discussions on the project; H. Baier, K. Slanchev, J. Du and M. Ahrens for sharing fish lines; Y. Chen and the CEBSIT Optical Imaging Facility for assistance with confocal microscopy; C. Liu for generating transgenic fish; G. Zhou and X. Zhang for fish husbandry; and B. Mensh, M. Ahrens, J. Du, Z. Guo, G. Okazawa, L. Wang, Z. Zhang, S. Chen, Y. Li and W. Ge for helpful comments on the manuscript. Y.M. discloses support for the research of this work from the Brain Science and Brain-like Intelligence Technology National Science and Technology Major Project (2021ZD0204500, 2021ZD0204502, 2021ZD0203700 and 2021ZD0203704), the Creative Research Groups of the National Natural Science Foundation of China (32321003), the Strategic Priority Research Program of the Chinese Academy of Sciences (XDB1010301), the CAS Project for Young Scientists in Basic Research (YSBR−139), and the National Natural Science Foundation of China (32171026). S.W. discloses support for the research of this work from the National Natural Science Foundation of China (T2421004). K.W. discloses support for the research of this work from the National Natural Science Foundation of China (32125020). X.D. discloses support for the research of this work from the National Natural Science Foundation of China (62320106010). L.F. discloses support for the research of this work from the National Natural Science Foundation of China (62475063) and the Science and Technology Talent Innovation Project of Hainan Province (KJRC2025B11). The remaining authors declare no relevant funding.
Author information
Authors and Affiliations
Contributions
Y.M., S.Z. and H.S. conceived and designed the study. S.Z. and H.S. performed most of the experiments and analysed the corresponding data, including data from the visual obstacle-avoidance task, whole-brain calcium imaging, DT GABAergic neuron imaging, optogenetic activation and inhibition, and attractor-dynamics perturbation experiments. X.L. developed the hierarchical attractor model and performed the model simulations and analyses. H.S. developed the serial-dependence agent model. Y.Q. programmed the virtual reality task. J.H. performed the free-swimming serial-dependence behavioural experiments and analysed the data. Y.Q. and J.H. optimized the preprocessing pipelines for the raw imaging data. Y.-R.L. performed the serial-dependence behavioural experiments using the threatening-agent assay. Y.-R.L., Z.-Y.W. and D.L. performed the calcium imaging experiments using diverse visual stimuli. Z.J. built the light-sheet microscope (SPIM). L.Y. and L.C. built the optogenetic stimulation module for the SPIM. X.W. performed the high-speed volumetric imaging. M.-Q.C. analysed the mesoscopic projectome data. K.W. supervised the construction of the optogenetic module. L.F. supervised the construction of the SPIM. X.-F.D. supervised the collection and analysis of the mesoscopic projectome data. S.W. conceived and supervised the development of the hierarchical attractor model. Y.M., S.Z., H.S. and X.L. wrote the manuscript. Y.M. supervised the research.
Corresponding authors
Ethics declarations
Competing interests
The authors declare no competing interests.
Peer review
Peer review information
Nature thanks Albert Compte; Ethan Scott, who co-reviewed with Sarah Stednitz; and German Sumbre, who co-reviewed with Patricio Casanova, for their contribution to the peer review of this work. Peer reviewer reports are available.
Additional information
Extended data figures and tables
Extended Data Fig. 1 Avoidance behaviour in larval zebrafish and serial-dependent agent modelling.
a, Virtual reality (VR) obstacle avoidance task. Top left: the projected visual scenario on the screen, showing an approaching obstacle; the obstacle appears and disappears when it crosses any of these boundaries. Top right: the reconstructed swimming trajectory. Bottom: Fictive motor signals, recorded from the tail nerve roots, are used to decode navigation. b, Quantification of turning behaviour. Left: probability distributions of turn power for left-sided (L-trial, magenta) and right-sided (R-trial, green) obstacles (lines for cumulative curve, shading for 95% confidence interval), along with their differences. Right: Shuffling the trial labels eliminates the differences. Two-sample Kolmogorov–Smirnov test: P = 5.11 × 10−26; 3,543 bouts (L) and 3,386 bouts (R) pooled from 7 fish. c, Schematic of the free-swimming closed-loop assay. Fish position (centroid) and head direction were tracked in real time to render a dark disc obstacle at fixed fish-centred coordinates (1.2 cm anterior and 1.2 cm lateral). Avoidance responses evoked by the first encounter (no recent history) and the subsequent second encounter (within a 2-s interval) were compared to quantify serial bias. d,e, Both swimming trajectories (d) and the resulting cumulative lateral displacement (e) demonstrate that avoidance manoeuvres are significantly more pronounced following the second encounter (2nd L, 2nd R; dark colours) than those for the first encounter (1st L, 1st R; light colours). P = 2.21 × 10−5 for R trials comparison, P = 5.52 × 10−5 for L trials comparison; two-tailed paired Student’s t-tests, n = 9 fish. f, A computational model demonstrates the efficiency of serial-dependent navigation. f1, Schematic of obstacle map generation. Spatial regularity is controlled by parameter σ: low σ yields structured environments; high σ produces random configurations. f2, Navigational strategy of the reactive agent and the serial-dependent agent. f3, Representative trajectories from both agents navigating a highly regular map (σ = 40). f4, Efficiency (1/time to reach boundary) across different σ values. The serial-dependent agent outperforms the reactive agent in environments with high spatial regularity. Blue bar highlights σ range with significant group differences (two-tailed Wilcoxon rank-sum test, P < 0.05). Data are shown as mean ± s.e.m. ***P < 0.001, n.s., not significant.
Extended Data Fig. 2 Temporal persistence of serial dependence.
a, Avoidance distance is modulated by the sequence history of obstacles, including the two preceding and the current obstacles. b, Fictive behavioural state before trial onset and encountering obstacles, when the prior trial was a left (L, magenta) or right (R, green) trial. c, Serial bias persists in trials where the fish did not swim during the interval phase. Left: example motor traces showing paused swimming before trial onset (interval, grey). Right: quantification reveals that serial bias persists in the absence of motor output during the interval phase. Data are shown as mean ± s.e.m. *P < 0.05, ***P < 0.001, n.s., not significant; two-tailed paired Student’s t-tests.
Extended Data Fig. 3 The dorsal thalamus preferentially maintains trial history during the inter-obstacle interval.
a, The first principal component (Left, PC1) and the second principal component (Right, PC2) of population activity in each region during the interval phase. b, Discriminability index for history information during the interval across regions (same analysis as Fig. 2c), normalized to [0,1]. c, Persistence index, defined as the fraction of the interval over which left–right history information remains discriminable, expressed as a percentage of the interval duration. d, Persistence index computed for the interval versus the stimulus epoch (obstacle presentation), expressed as a percentage of the corresponding epoch duration. Coloured dots represent different brain regions. e, Selectivity index, quantifying the preference for interval versus stimulus encoding, defined as the difference in persistence between the interval and stimulus epochs and rescaled to [0, 1] (0.5 indicates no preference). f, Summary across metrics showing that the dorsal thalamus (DT, blue triangle) ranks highest in interval discriminability, persistence, and interval selectivity. n = 3 fish. Data are shown as mean ± s.e.m.
Extended Data Fig. 4 The DT drives serial dependence.
a, Optogenetic inhibition of the DT using transgenic lines with DT-selective expression (Et(fos:Gal4-VP16)s1026t; Tg(UAS:GtACR2-eYFP)sq212) or pan-neuronal expression (Tg(elavl3:stGtACR1-FusionRed) or Tg(elavl3:Gal4-VP16);Tg(UAS:GtACR2-eYFP)sq212) significantly reduced serial bias. b, Statistics of avoiding displacement under different activation conditions (ipsi-DT activation, contra-DT activation and control, see trajectories in Fig. 2l). In ChrimsonR(+) fish, unilateral DT activation elicited a robust behavioural bias compared to control region activation, whereas no significant bias was observed in non-opsin controls. Specifically, ipsilateral DT activation relative to the obstacle (e.g., activating the left DT during a left-sided obstacle trial) reduced avoidance distance. Conversely, contralateral DT activation (e.g., activating the left DT during a right-sided obstacle trial) increased avoidance. This optogenetic manipulation effectively mimics natural serial dependence, where the internal representation of a prior obstacle selectively enhances or attenuates subsequent avoidance manoeuvres. c,d, DT manipulations do not alter baseline locomotor output. During DT inhibition (c; same fish as in a) or DT activation (d; Tg(elavl3:ChrimsonR-tdTomato)), fictive swimming frequency, forwards velocity, and lateral velocity remained unchanged, indicating preserved baseline motor production. Two-tailed paired Student’s t-tests for a, b, and c; one-way ANOVA for d. *P < 0.05, **P < 0.01, ***P < 0.001; n.s., not significant. Data are shown as mean ± s.e.m.
Extended Data Fig. 5 Time constant and bistability of DT responses.
a, Intrinsic activity timescales of DT neurons during spontaneous activity, estimated by fitting a time constant using the blind sparse deconvolution (BSD) algorithm65. Here, spontaneous activity refers to the neural activity recorded in the absence of structured visual stimulation, with the fish maintained under uniform illumination (no obstacles or patterned visual inputs). This condition provides an estimate of baseline, internally generated activity without stimulus-evoked modulation. b, Optogenetic perturbation produces bimodal post-perturbation DT states that predict serial dependence: “stay” and “switch” trials exhibit oppositely biased swimming trajectories. c, Activity across regions in response to 6 stimulus types (L1, L2, L3, R1, R2, R3) during early and late phases (early: the first 1 s after stimulus onset; late: the 10th second after stimulus offset) in the distance paradigm. Bistability indices are shown in blue. Data are shown as mean ± s.d. for distribution, and mean ± s.e.m. for average late-phase response.
Extended Data Fig. 6 Hindbrain integrator neurons serve as the downstream of DT.
a, Anatomical composition of integrator neurons. b, Neural responses of integrator neurons to four stimulus sequences: Left–Left (LL), Right–Left (RL), Left–Right (LR), and Right–Right (RR). Left: left-hemisphere integrator responses. Right: right-hemisphere integrator responses. c, Integrator responses from b are pooled across hemispheres and plotted based on relative stimulus position (I: Ipsilateral vs. C: Contralateral) for all four two-trial sequence combinations (II, CI, IC, CC). d, Integrator activity during the interval phase correlates with the strength of bias in the subsequent trial. n = 301 trials from 4 fish. e, Functional downstream targets of the DT, revealed by optogenetic activation on left DT. e1, Anatomical location in a single fish (scale bar, 100 μm); e2, Group-level activation map pooled across fish (pooled from 3 fish, scale bar, 100 μm); e3, Spatial correspondence between the hindbrain integrator and DT-driven activation. Cyan, group mask of voxels exhibiting integrator-like dynamics (pooled from 5 fish); magenta, voxels significantly activated by DT stimulation (pooled from 3 fish). e4, Voxel-wise overlap between the two maps (44.2%) is significantly higher than chance expectations, quantified by a one-sided permutation test using volume-matched, morphologically dilated control regions. Permutation test: P = 0.029. f1, Single-neuron responses to left-DT stimulation, exhibiting ipsilateral inhibition and contralateral excitation of hindbrain neurons; f2, Population-averaged responses to left-DT stimulation. Left DT, n = 83 neurons; Right DT, n = 80 neurons; Left hindbrain, n = 63 neurons; Right hindbrain, n = 71 neurons. g, Activating the hindbrain integrator disrupts serial-dependent behavioural bias. g1, Schematic of the experiment. Unilateral holographic optogenetic stimulation targeted the hindbrain integrator during the final 2 s of the interval in larvae expressing ChrimsonR in glutamatergic neurons (Tg(vglut2a:Gal4); Tg(UAS:ChrimsonR-mKate2)). The stimulation ROI or mask was defined from a population-average hindbrain-integrator map (Fig. 4d) and registered to each fish by anatomical alignment; an outside-brain control used the identical pattern shifted laterally. Stimulation was delivered to the integrator hemisphere contralateral to the obstacle side. Serial bias was assayed using paired same-side obstacle sequences by comparing the first obstacle response (without recent history) to the second obstacle response (with recent history). g2, Avoidance trajectories for the first obstacle (black) and the subsequent obstacle under outside-brain control stimulation (grey) or hindbrain-integrator stimulation (blue), shown as mean ± s.e.m. g3, Quantification of serial bias, defined as the change in avoidance magnitude on the second obstacle relative to the first, under control versus hindbrain-integrator stimulation. Bars show mean ± s.e.m. Two-sided paired Student’s t-tests; P = 0.0052. n = 6 fish.
Extended Data Fig. 7 Hierarchical attractor network model and corresponding anatomical constraints.
Left: schematic of model architecture (right hemisphere) aligned with biological constraints from the larval zebrafish whole-brain connectivity atlas (left hemisphere; Du et al., 2025)15. Key anatomical constraints include: E:I ratio in ① the DT and ② hindbrain; projections from ③ the optic tectum (TeO) to ipsilateral DT, ④ between DT hemispheres, and ⑤ from DT to ipsilateral hindbrain integrator. Hindbrain integrator parameters were derived from regions R2, R3, R5, and R6. Right: detailed breakdown of the anatomical constraints. The 3D brain outline was adapted from ref. 15 with permission under a Creative Commons license CC BY-NC-ND 4.0.
Extended Data Fig. 8 Hierarchical model simulations.
a, Model schematic. Three-layer model architecture and the extended downstream motor-readout layer. Tectal input (L1) provides the sensory drive for avoidance, while the hindbrain integrator state (L3) modulates this drive through a non-linear gain interaction to generate motor output. b, Simulation results of the model. Example firing-rate traces in each layer (top three rows, L1, L2, and L3) and the corresponding simulated motor-layer responses and behavioural readout (bottom three rows) in response to a sequence of left (L) and right (R) stimuli. The model exhibits persistent bistable activity in the attractor layer (L2) and graded responses in the integrator layer (L3). Correspondingly, left- and right-selective motor populations show history-dependent response amplitudes after obstacle onset, and their activity is combined to generate avoidance output (lateral motion). c, Model activity projected onto PC space. Left: state-space trajectories of the attractor module (L2), averaged by trial type during the first and second trials. Each coloured dot marks the endpoint of one of 1,040 trials. Right: same analysis for the integrator module (L3). d, Simulated synaptic currents targeting the excitatory population of the left hemisphere in Layer 3 during both the stimulus and interval phases, for four trial conditions (LL, RL, RR, LR). In the right panels (RR and LR), when the current obstacle is on the right, the left hemisphere in Layer 3 receives strong inhibition during the interval phase (blue arrows), preventing it from remaining active. Consequently, the left hemisphere in Layer 3 contributes to memory maintenance only when the obstacle is on the left (left panels, LL and RL). When the preceding stimulus was also on the left (LL), inhibition during the stimulus phase is relieved (dashed box), yielding stronger net input and facilitating NMDA-dependent activation. n = 400 trials. Data are shown as mean ± s.d.
Extended Data Fig. 9 Dorsal thalamus GABAergic neuron subtypes support attractor dynamics.
a, State-switching accuracy as a function of input strength to the attractor layer. In a reduced model lacking sensory-driven inhibitory clusters, the attractor state is less likely to switch in response to new inputs unless the input strength is high (n = 10 simulation repeats). b, Spatial organization of excitatory and inhibitory neurons in the DT, using 2 example fish from Tg(elavl3:H2B-jRGECO1a); TgBAC(gad1b:Gal4-VP16); Tg(UAS:H2B-GCaMP6f) line and Tg(elavl3:H2B-jRGECO1a); Tg(vglut2a:GAL4FF); Tg(UAS:H2B-GCaMP6f) line, respectively. Scale bar, 20 μm. c, Neural responses of three neuron types in the DT—sustained excitatory neurons, sustained inhibitory neurons, and transient inhibitory neurons—to obstacle stimuli on their preferred side. d, Distribution of subclusters of DT GABAergic neurons and their number in each cluster are shown (pooled across 6 fish). e, Clustered population responses and similarity matrix from an example fish (left) and pooled across fish (right). f, Cluster-averaged trial-averaged responses (left) and fitted kinetic parameters (τdecay, τrise, delay, right) showing significant differences between clusters.Two-tailed unpaired Student’s t-tests: P = 2.11 × 10−25 (τdecay), 3.31 × 10−11 (τrise), and 3.74 × 10−93 (delay). In c and f, n = 749 vs. 242 cells (two clusters), pooled from 6 fish. Data are shown as mean ± s.e.m.
Extended Data Fig. 10 Generalization of dorsal thalamic persistence and scalable multi-trial integration.
a, DT population activity maintains persistent, lateralized history signals across diverse visual stimulus conditions. Activity corresponds to the left-DT − right-DT. Magenta, stimulus on the left side, green, stimulus on the right side. b, Generalization to escape behaviour in a “threatening agent” assay. b1: Schematic of the closed-loop paradigm where a dark disc actively pursues the fish, engaging it from the left or right side. b2,b3: Quantification of serial dependence in escape manoeuvres; avoidance distance increases on the second escape following a recent threat encounter, compared with the first escape, for both left- and right-obstacle trials. Two-sided paired Student’s t-tests: left-obstacle trials, P = 0.034 (n = 168 trials); right-obstacle trials, P = 0.042 (n = 145 trials). Data pooled from 10 fish. c, Model extension. To extend memory beyond a two-trial context, Layer 3 (L3) was partitioned into K independent NMDA-recurrent subgroups (here, K = 7). Within each subgroup, recurrent dynamics support either low or high stable NMDA activation levels (see Supplementary Note 1: ‘Analysis of multistable persistent activity in layer 3’). By lowering the NMDA-channel opening probability, entry into the high-NMDA state becomes stochastic rather than deterministic. Subgroups were uncoupled (no inter-subgroup recurrence), and the net L3 output was defined as the linear sum across subgroups. Consequently, consecutive “stay” trials cumulatively increase the probability of high NMDA state recruitment across the population, yielding a graded code that represents longer histories. Conversely, a “switch” trial acts as a global reset, reliably driving the network into the low-activity state and erasing the accumulated sequence information. d,e, Graded history encoding over multiple trials. Top, L3 population output traces for different trial sequences, grouped by the stimulus identity three trials back (d, t − 3) or four trials back (e, t − 4) while holding more recent trials matched. Bottom, L3 output measured in the late-interval window immediately before the next-trial onset. The increased separation across deeper-history conditions demonstrates that stochastic recruitment enables the network to integrate evidence over longer timescales. In d, three-trials-back sequences are shown (RRR, n = 61; LRR, n = 45; RLR, n = 51; LLR, n = 46; RRL, n = 48; LRL, n = 52; RLL, n = 48; LLL, n = 39). In e, four-trials-back sequences are shown (RRRR, n = 37; LRRR, n = 24; RLRR, n = 20; LLRR, n = 22; RRLR, n = 25; LRLR, n = 25; RLLR, n = 23; LLLR, n = 23; RRRL, n = 22; LRRL, n = 21; RLRL, n = 31; LLRL, n = 21; RRLL, n = 22; LRLL, n = 25; RLLL, n = 23; LLLL, n = 16). Data are shown as mean ± s.e.m.
Supplementary information
Supplementary Information (download PDF )
Supplementary Tables 1–5, Supplementary Note 1 and Supplementary Fig. 1.
Supplementary Video 1 (download MP4 )
Zebrafish avoidance behaviour in a virtual reality environment. Recording of consecutive trials from a representative fish in the virtual reality (VR) environment, demonstrating avoidance behaviour evoked by visual obstacles. Each trial contains a stimulus phase, where a visual obstacle evokes an evasive manoeuvre (encounter, avoid, and pass), followed by an interval phase without obstacle presentation. The top left panel shows the projected visual scene presented to the fish; the top right panel displays fish’s reconstructed 2D swimming trajectory; the bottom panel shows real-time swimming signals recorded from the left and right sides of the tail.
Supplementary Video 2 (download MP4 )
Zebrafish show history-dependent avoidance in free-moving behaviour. Video recording of an example trial in the free-swimming arena, played at real-time speed. The footage depicts the positions of visual obstacles, fish's swimming trajectory, head directions, avoidance distances, and avoiding bias. In this trial, two obstacles are positioned sequentially to the right relative to the fish's heading (first obstacle: orange; second obstacle: blue). Avoidance distance is defined as the lateral deviation from the fish's projected trajectory—extrapolated from its path prior to encountering the obstacles—induced by the avoidance manoeuvre. The serial bias is quantified as the difference between the avoidance distances for the two obstacles.
Supplementary Video 3 (download MP4 )
Dorsal thalamus activity exhibits bistable dynamics during the maintenance interval. Neural activity is projected onto the first three principal components (PCs) derived from trial-type-averaged (L vs. R trials) interval activity across DT neurons. The video first shows mean state-space trajectories for left-obstacle (magenta) and right-obstacle (green) trials, which evolve from a common initial state to two distinct, stable endpoints. It then displays representative single-trial trajectories, illustrating trial-by-trial categorical encoding. Throughout the video, colours evolve from light to dark to indicate the passage of time. For single trials, grey lines indicate the stimulus phase, coloured lines indicate the interval phase, and a moving dot marks the instantaneous neural state.
Supplementary Video 4 (download MP4 )
Model stimulation of L2 and L3 dynamics in hierarchical attractor model. PCA trajectories of model-simulated neural activity, revealing attractor-like dynamics in Layer 2 and history-biased integration in Layer 3. Each trajectory corresponds to one of four trial conditions (RR, LR, RL, LL), with dots marking the initial and final states of 1,600 trials, and solid lines indicating the condition-averaged trajectories. The video sequentially displays the neural state-space trajectories of the attractor module (Layer 2) and integrator module (Layer 3) during the first and second trials, respectively, which are projected onto the first three principal components (PCs).
Source data
Rights and permissions
About this article
Cite this article
Zhao, S., Shan, H., Liu, X. et al. A thalamus–brainstem attractor network drives history-biased decisions. Nature (2026). https://doi.org/10.1038/s41586-026-10623-3
Received:
Accepted:
Published:
Version of record:
DOI: https://doi.org/10.1038/s41586-026-10623-3