Context Gating in Spiking Neural Networks: Achieving Lifelong Learning through Integration of Local and Global Plasticity

Jiangrong Shen, Wenyao Ni, Qi Xu, Gang Pan, Huajin Tang

TL;DR

This paper introduces CG-SNN, a Spiking Neural Network framework that mimics the prefrontal cortex's "context gating" to solve catastrophic forgetting. By integrating local plasticity rules (like STDP and Oja’s rule) with global backpropagation, the model achieves robust lifelong learning and successfully replicates human-like behavioral patterns in sequential task learning.

What Problem Does This Paper Address?

Artificial intelligence, including brain-inspired Spiking Neural Networks (SNNs), suffers from catastrophic forgetting: when a model learns a new task, it often overwrites the weights necessary for previous tasks, causing performance to plummet.

Humans don't have this problem. We use the prefrontal cortex (PFC) to "gate" information, focusing on task-relevant features while ignoring others. While existing SNN lifelong learning methods use techniques like memory replay or regularization, they often lack biological plausibility and fail to capture the nuances of human cognitive control. The authors aim to bridge this gap by creating an SNN that uses biologically inspired local plasticity to manage context, allowing it to learn multiple tasks in succession without losing old knowledge.

Methods

The authors propose the Context-Gated Spiking Neural Network (CG-SNN). The core innovation is the iterative training between two scales of plasticity:

  1. Global Plasticity: Standard backpropagation (using surrogate gradients for multi-spike models) updates the network's overall weights to minimize error on the current task.
  2. Local Plasticity: Biologically inspired rules—Spike-Timing-Dependent Plasticity (STDP) for single-spike networks and Oja’s rule for multi-spike networks—are used to update the connections between "context neurons" and hidden layers.

As shown in the architecture diagram below, context signals (representing different tasks) act as gates. The local plasticity rules strengthen the connections between specific context inputs and the hidden units relevant to that task, effectively "locking in" task-specific pathways.

Fig. 1. The framework of the network construction of the single-spike CG-SNN and multi-spike CG-SNN. (left) The network structure of single-spike CG- SNN. The first encoding layer codes the input stimuli into spike trains and avoids weak signal ignorance. The additional context signals of tasks are introduced into the second layer. The iterative training between global and local plasticity proceeds during the training process, in which all the synaptic weights are updated by the global backpropagation rule, and the weights of context signal are updated by the local plasticity rule. (middle) The network structure of multi-spike CG-SNN. The network is a simple feed-forward MLP with two hidden layers with IF spiking neurons that receive the pixels information of pictures together with the one-hot contextual signal as input. And the connections between the contextual cue and the first layer will be successively updated by the Hebbian learning rule. (right) shows the blocked and interleaved distribution of the two tasks’ samples.

Additionally, the authors introduce "sluggish neurons"—a mechanism that uses an exponentially moving average for context signals—to model the learning biases observed in human participants during interleaved training.

Datasets

The model was primarily evaluated using a dataset derived from human behavioral studies.

  • Tree Feature Task: Participants (and the model) must decide whether to "plant" a tree based on two continuously varying dimensions: leaf density and branch density.
  • Contexts: In "Garden 1," only leaf density determines success; in "Garden 2," only branch density matters.
  • Learning Regimes: The tasks are presented in either blocked (all of Task 1, then all of Task 2) or interleaved (mixed) sequences.

Key Insights and Ideas

  • Local Rules for Global Stability: Interestingly, the authors found that global gradients alone aren't great at establishing task-specific gating. Local rules like STDP are much more effective at creating the large weight magnitudes needed to "protect" task-relevant neurons from being overwritten during subsequent learning.
  • Replicating the "Congruency Effect": Humans perform better when features for two different tasks align (congruent trials). CG-SNN is one of the few models that naturally reproduces this effect, whereas vanilla SNNs fail because they forget the first task too quickly.
  • Emergent Selectivity: The CG-SNN develops a significantly higher proportion of task-selective neurons (~25%) compared to standard artificial neural networks (~10%). This sparse, specialized representation is key to its resistance to forgetting.

Key Results

  • Resistance to Forgetting: In the single-spike model, vanilla SNN accuracy on the first task drops to chance immediately upon starting the second task. CG-SNN maintains ~75% accuracy.
  • Superior Performance: The multi-spike CG-SNN outperformed other popular lifelong learning methods. It achieved 90.44% accuracy on Task 1 after learning Task 2, compared to 81.69% for the XdG (Context-dependent Gating) method.
  • Human-like Dynamics: The model's psychometric curves (the "S-curve" of decision-making) closely matched those of human volunteers, particularly in how they handle irrelevant feature dimensions.
Comparison of accuracy curves between vanilla SNNs and CG-SNN variants.

Limitations and Future Work

The authors noted that STDP was less effective in multi-spike models because high-frequency firing made the local plasticity unstable. They had to switch to Oja's rule to achieve stability, suggesting that different SNN architectures may require specific local rules.

Future work could explore more complex neuromodulation mechanisms (like dopamine-inspired signals) and test the CG-SNN on larger-scale benchmarks beyond the binary decision tasks used here. There is also potential for implementing these models on neuromorphic hardware to take full advantage of their energy efficiency.

Summary updated

BibTeX
@article{shen2025context,
  author = {Jiangrong Shen and Wenyao Ni and Qi Xu and Gang Pan and Huajin Tang},
  title = {{Context Gating in Spiking Neural Networks: Achieving Lifelong Learning through Integration of Local and Global Plasticity}},
  journal = {Knowledge-Based Systems},
  year = {2025},
  doi = {10.1016/j.knosys.2025.112999},
}
Figure