arXiv:2609.00358cs.CVAug 2026

Manuscript Offprint

arXiv:2609.00358

Where Should Experience Live? Hierarchical Hebbian Memory for Continual Vision Transformers

Mohammed Yusuf Mujawar, Noorbakhsh Amiri Golilarz

Mohammed Yusuf Mujawar, Noorbakhsh Amiri Golilarz

Department of Computer Science

The University of Alabama, Tuscaloosa, AL, USA

Abstract—Vision Transformers provide strong visual representations but typically rely on slowly updated parameters, limiting their ability to organize newly acquired information across different memory timescales. This work proposes Hierarchical Hebbian Memory, a three-level memory architecture composed of rapid Working Memory, persistent Routed Episodic Memory, and slower Semantic Memory. A learned controller regulates memory contribution, read and write routing, plasticity, retention, and consolidation. A causal read-before-write lifecycle ensures that the current outcome cannot influence the prediction it supervises. The architecture is evaluated on Omniglot 5-way 1-shot recognition and CORe50 continual object recognition. With Swin-Tiny, the hierarchical model reaches 97.39% accuracy on Omniglot and 95.37% final accuracy on CORe50 when combined with experience replay. Learned multi-bank retrieval reaches 47.50% delayed-association accuracy, compared with 24.17% for a single persistent bank and 25.00% without memory. After intervening distractors, Episodic Memory retains approximately 0.96 cosine similarity with stored associations, while Working Memory falls to approximately 0.05. These results show that Hebbian association and learned memory routing can jointly organize online visual experience across rapid, persistent, and consolidated memory timescales within Vision Transformers.

Index Terms—Vision Transformers, Hebbian learning, associative memory, continual learning, few-shot learning, episodic memory, memory routing

I. INTRODUCTION

Vision Transformers provide strong visual representations, but most of their knowledge is stored in parameters updated through gradient based training. This limits their ability to rapidly store new associations without modifying the backbone. The problem is especially relevant in few shot and continual learning, where useful information may need to be acquired from only a small number of observations. Hebbian learning offers a local mechanism for forming such associations [1], while fast weight models maintain rapidly changing memory states alongside slower learned parameters [2], [3]. Associative fast weight formulations further connect key value binding with Transformer computation [4], [5].

Earlier Hebbian Vision Transformer studies established two useful results. Fixed Hebbian memory showed that its effectiveness depends strongly on where associative binding is introduced into the backbone [6]. Adaptive Hebbian Routing introduced learned control over memory contribution, plasticity, and retention for each few shot episode [7]. These approaches improve control of temporary associative memory, but they do not address how experience should be organized when information must persist beyond a single episode.

This creates a broader memory allocation problem. A single persistent state can accumulate experience but may increase interference when unrelated associations share the same storage. Conversely, resetting memory after every short context prevents useful information from being retained. Human memory provides a useful functional motivation for separating these roles. Working memory supports short lived information relevant to current processing [8], episodic memory preserves experience together with contextual information [9], [10], and semantic memory represents more stable knowledge [11]. Consolidation provides a mechanism through which selected experience can become more persistent over time [12]. These principles motivate a computational hierarchy with different memory lifetimes.

This work proposes Hierarchical Hebbian Memory, which organizes online visual experience across three interacting levels: Hebbian Working Memory, Routed Episodic Memory, and Semantic Memory. Working Memory forms rapid context specific associations, Episodic Memory maintains multiple persistent banks with learned read and write routing, and Semantic Memory selectively consolidates useful episodic information over a slower timescale. A learned controller coordinates memory contribution, routing, plasticity, retention, and consolidation, so that Hebbian plasticity determines what association is strengthened while routing determines where it is stored. The architecture follows a causal online lifecycle in which existing memory is read before prediction and outcome conditioned updates are applied only afterward. In the primary continual setting, the controller receives no task identity, although experience boundaries remain known to the protocol. Unlike recent memory augmented Transformer systems that focus mainly on long context language processing or continual associative learning [13]–[16], this work studies how online visual experience can be distributed across multiple memory timescales using Hebbian associative learning within Vision Transformers.

The architecture is evaluated in two complementary regimes: Omniglot 5-way 1-shot recognition for rapid adaptation and CORe50 continual object recognition across repeated visual experiences [17]. Continual comparisons include conventional replay and a Latent Replay implementation adapted from Pellegrini et al. [18]. Beyond recognition accuracy, the evaluation examines delayed retrieval, routing behavior, bank interventions, memory ablations, semantic consolidation, and computational cost.

The main contributions are:

  • A three-level Hierarchical Hebbian Memory architecture for Vision Transformers, separating rapid Working Memory, persistent Routed Episodic Memory, and slower Semantic Memory.

  • A task ID free controller that regulates both memory allocation and memory strength through separate read and write routing, plasticity, retention, contribution, and consolidation decisions.

  • An extension of temporary Hebbian associative memory into persistent multi-timescale storage using a causal online update process.

  • Evaluation across few shot and continual visual learning, together with direct analysis of delayed retrieval, routing organization, memory timescales, consolidation, and computational efficiency.

The remainder of this paper is organized as follows. Section II reviews related work on Hebbian and fast weight memory, neurocognitive memory organization, and memory-augmented Transformers. Section III presents the proposed Hierarchical Hebbian Memory architecture and its three memory levels. Section IV describes the experimental setup and evaluation protocols. Section V reports the main results and memory analyses. Section VI discusses the findings, and Section VII concludes the paper.

References (28)