A neural network that maintains and retrieves memories based on context
Organizations: Department of Psychology, University of Texas at Austin · Center for Theoretical and Computational Neuroscience, Washington University in St. Louis · Department of Neuroscience, University of Texas at Austin · Department of Neuroscience, City University of Hong Kong · Department of Electrical and Systems Engineering, Washington University in St. Louis · Department of Psychology, University of Chicago · Neuroscience Institute, University of Chicago · Institute for Mind and Biology, University of Chicago · Department of Psychology, Washington University in St. Louis
Abstract
Every day, people continuously infer situational context and adjust the way they understand and remember the world. Context, signaled by the prefrontal cortex, is known to modulate working memory and episodic memory, but the algorithmic understanding of this modulation remains limited. Here, we train a recurrent neural network (RNN), augmented with an episodic memory buffer, to infer context using Bayesian inference as it continuously makes predictions of upcoming scenes while watching naturalistic movies. When the inferred context modulates the RNN's recurrent connectivity (the basis of working memory) in a low-rank manner, the model's activity patterns best match neural responses in human participants who watched the same movies during fMRI. Context also modulates episodic memory retrieval, such that the model retrieves memories based on not only content similarity but also context similarity. This is implemented as a key-value system with self-attention, designed to additionally encode context and retrieve context-congruent memories. The resulting model not only better resembles human brain representations but also learns to retrieve memories like humans much faster than a model without context modulation. Together, our findings suggest a computational mechanism by which context modulates information maintenance and long-term memory retrieval in naturalistic environments.
Figures & tables
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| Input | Low-rank WM | Full WM | Output | None | |
|---|---|---|---|---|---|
| Next-scene prediction accuracy at train ( ) | 0.850 0.006 | 0.801 0.010 | 0.860 0.006 | 0.810 0.010 | 0.772 0.007 |
| Next-scene prediction accuracy at test ( ) | 0.514 0.018 | 0.583 0.019 | 0.555 0.025 | 0.597 0.023 | 0.514 0.017 |
| Bayesian context inference accuracy (%) | 58.73 2.19 | 60.61 5.32 | 53.23 4.15 | 75.40 2.66 | - |
| Model–brain representation similarity ( ) | 0.0039 0.0011 | 0.0087 0.0020 | 0.0080 0.0019 | 0.0053 0.0013 | 0.0066 0.0016 |
| WM+EM | WM | None | |
|---|---|---|---|
| Next-scene prediction accuracy at train ( ) | 0.799 0.011 | 0.804 0.012 | 0.778 0.008 |
| Next-scene prediction accuracy at test ( ) | 0.565 0.030 | 0.494 0.030 | 0.414 0.043 |
| Bayesian context inference accuracy (%) | 62.10 4.73 | 61.22 4.63 | - |
| Model–brain representation similarity ( ) | 0.0032 0.0009 | 0.0027 0.0009 | 0.0020 0.0007 |
| Model–human retrieval similarity ( ) | 0.283 0.054 | 0.207 0.054 | 0.265 0.039 |