Manuscript Offprint
arXiv:2610.37139Generative Replay for Equilibrium Propagation: Toward Edge-Friendly Continual Learning in Hopfield Networks
GENERATIVE REPLAY FOR EQUILIBRIUM PROPAGATION: TOWARD POWER AND MEMORY-EFFICIENT CONTINUAL LEARNING IN HOPFIELD NETWORKS
Victor Cook, Gilles Sassatelli, Thierry Gil, Mohamed Watfa
LIRMM
Univ. Montpellier / CNRS, Montpellier
France
{victor.cook,gilles.sassatelli,thierry.gil,mohamed.watfa}@lirmm.fr
Marina Reyboz
CEA List
Univ. Grenoble Alpes, Grenoble
France
ABSTRACT
Equilibrium Propagation (EqProp) offers a biologically grounded and hardware-aligned alternative to backpropagation for training Hopfield Networks. However, its behavior in continual learning settings remains largely unexplored.
This work confronts catastrophic forgetting in EqProp-trained Hopfield Networks from the inside out, eliminating the need for external data buffers or architectural overhead that standard Experience Replay (ER) and Generative Replay (Gen-Replay) inevitably require. We introduce an Energy-Based Generative Replay strategy (EB-Gen) which exploits the intrinsic generative dynamics of Hopfield Networks, allowing a single model to act as both classifier and replay samples generator. Samples capturing past task knowledge are generated by relaxing a frozen copy of the network, enabling rehearsal solely through internally generated pseudo-data.
We evaluate the proposed method in the Class-Incremental setting, using the split versions of the MNIST and CIFAR10 benchmarks and compare it with FineTune, Experience Replay, Generative Replay, Sleep-Like Replay Consolidation (SRC) and Joint training. Our results show that EB-Gen significantly improves stability while preserving plasticity, achieving a 75% and 64% average accuracy on Split MNIST and Split CIFAR10 respectively. These findings show that Equilibrium Propagation can be adapted to alleviate catastrophic forgetting without forgoing the traits which made it compelling in the first place.
Prior work has explored a wide variety of methods such as parameter regularization (Kirkpatrick et al. (2017); Zenke et al. (2017)), dynamic or task-expanding architectures (Rusu et al. (2016)), and replay-based strategies (Lopez-Paz & Ranzato (2017); Shin et al. (2017)). While effective, these approaches often rely on explicit memory buffers, auxiliary models, or architectural growth—requirements that conflict with the constraints of resource-limited environments.
Energy-Based Models (EBMs) offer a promising alternative for such settings. By framing inference as energy minimization, they align naturally with analog hardware implementations, where power efficiency is critical. Moreover, Li et al. (2022) demonstrated that EBMs exhibit inherent resistance to forgetting due to their reliance on an energy function—an unnormalized probability distribution over data. However, their results were obtained using backpropagation, a globally optimized rule, leaving open the question of how EBMs behave under local learning regimes.
Equilibrium Propagation (EqProp), introduced by Scellier & Bengio (2017), provides a compelling framework to address this gap. Designed explicitly for energy-based networks, EqProp replaces backpropagation with a local learning rule derived from the system's relaxation dynamics. By comparing two equilibrium states—obtained via a free relaxation and a weakly nudged one—it enables training without needing any additional mechanisms. When applied to Hopfield Networks, EqProp unifies inference and learning under the same energy-minimization dynamics, allowing the network to sculpt its attractor landscape without auxiliary components. While EqProp has been extensively studied as a training paradigm for EBMs (e.g., Ernoult et al. (2019); Laborieux et al. (2021)), its potential for continual learning remains largely unexplored.
Recently, Kubo et al. (2025) introduces Sleep-Like Replay Consolidation (SRC), an EqProp-based method alleviating catastrophic forgetting in EqProp-trained Hopfield Networks by adding a Spike-Timing Dependant Plasticity - based knowledge consolidation phase before learning each new task. Our work investigates incremental learning in a more general setting, without employing spiking neural networks.
We demonstrate that Hopfield Networks trained with EqProp can be readily adapted to enable generative replay. Since learned tasks are represented as stable attractors, relaxing the network from unconstrained or weakly perturbed states consistently yields coherent configurations that capture previously acquired structures. We exploit this property to introduce Energy-Based Generative Replay (EB-Gen in short), a continual learning strategy in which a frozen copy of the currently training network generates pseudo-examples by relaxation and interleaves them with current task data. This approach allows replay to emerge naturally from the same dynamics used for inference and learning, requiring no stored data, auxiliary components, or alterations to the underlying model topology.
The contributions of this work are as follows:
• We show that EqProp does not naturally train Hopfield Networks to model the input distribution, and we propose a modification to the EqProp algorithm that effectively addresses this limitation,
• Building on this insight, we introduce EB-Gen, an Energy-Based Generative replay method that leverages the intrinsic generative dynamics of EqProp-trained Hopfield Networks without the need for stored data or generative models.
• We empirically evaluate the proposed approach on the Split-MNIST - CIFAR10 benchmarks, comparing them against FineTune, ER, SRC and standard Generative Replay to quantify stability–plasticity trade-offs.
The remainder of this paper is organized as follows. Section 2 reviews related work. Section 3 describes the models, datasets, and experimental methodology. Section 4 details the proposed EB-Gen approach. Experimental results are presented in Section 5 and further analyzed in Section 6.
2 RELATED WORKS
Catastrophic forgetting is a phenomenon which affects all neural networks when they are sequentially trained on non-identically and independently distributed (i.i.d) data (McCloskey & Cohen (1989)). This scenario might be particularly prevalent in resource-constrained environments, which makes it a particularly relevant setting for testing EqProp-trained Hopfield Networks as their main appeal is their amenability for low power analog hardware implementations.
Replay-based Continual Learning methods Numerous continual learning methods have been proposed. In this work, we concentrate on replay-based methods. Those methods mitigate forgetting by interleaving samples that represent previously learned data with examples from the current task during training. These replay samples are drawn from a reduced representation of previous tasks, which may manifest as a sparse memory buffer or a learned generative distribution. Experience Replay (ER), first introduced in Lin (1992), uses a simple buffer to store some of its training examples for replaying them later on. Generative Replay methods, use dedicated models to generate data inputs from former tasks. The generative models can be VAEs (van de Ven & Tolias (2019)), GANs (Shin et al. (2017)), diffusion models (Gao & Liu (2023)) etc. Although most methods use distinct models for generation and classification, some methods use a hybrid model to simplify the training process and share learned representations (van de Ven & Tolias (2019)). For more complex vision benchmarks, Liu et al. (2020); Stoychev et al. (2023); Jeong et al. (2025) train their generators on extracted features rather than raw inputs. Early foundational work Robins (1995); Ans (2004) focused on more biologically-inspired and -plausible methods often grouped under the name "pseudo-rehearsal".
Hopfield Networks Hopfield networks, first introduced by Hopfield (1982), are a class of recurrent neural networks that serve as associative memories, enabling the storage and retrieval of patterns. They comprise a set of neurons linked through bidirectional connections and are designed to converge toward stable states that encode stored patterns. Follow up works upgraded them from discrete to continuous state spaces Hopfield (1984).
Learning Rule In Hopfield (1982), Hopfield used Hebbian learning to train their models on toy problems. Hinton & Sejnowski (1983) introduced Contrastive Hebbian Learning to enable training Hopfield Networks for supervised tasks which require non-linear modeling capabilities. Eventually, Scellier & Bengio (2017) introduced Equilibrium Propagation with the goal of bridging Hopfield networks and standard neural networks trained via backpropagation.
Up-Scaling Hopfield Networks Hopfield Networks are notoriously difficult to train on larger scale problems (even when using EqProp). In reaction, a part of the literature focused on improving the pattern storage capacity of Hebbian-trained hopfield networks Krotov & Hopfield (2016); Ramsauer et al. (2020) while other works focused on improving EqProp by implementing it on the more potent CNN network topology (Ernoult et al. (2019)) and by improving training performance of EqProp by means of bettering gradient approximation Laborieux et al. (2021); Laborieux & Zenke (2022). Although these works achieved significant performance improvements on benchmarks like CIFAR10, they often come at the expense of changes to the model or the learning rule that reduces their hardware friendliness.
Training Hopfield Networks on Analog Hardware Analog hardware implementations of Equilibrium Propagation (EP) have advanced from theoretical proposals to practical demonstrations, leveraging the algorithm's inherent compatibility with energy-efficient, parallel architectures. In their seminal paper, Scellier & Bengio (2017) noted EqProp's potential for analog hardware due to local learning rules. Subsequent works validated this vision: Zoppo et al. (2020) and Oh et al. (2023). implemented EP on memristor crossbars, though weight updates were still computed externally. Kendall et al. (2020) extended these efforts to end-to-end analog training. Finally, Watfa et al. (2025) proposed a low-rank EP variant that computes gradients on-device, eliminating the need for external digital computation and enabling fully analog training.
Continual Learning and EBMs The problem of training EBMs in a continual learning setting has already been addressed a few times in the literature. Notably, Li et al. (2022) showed that Neural EBMs trained with contrastive divergence were much better at alleviating catastrophic forgetting than conventional neural networks (designated as "Softmax-Based Classifiers").
Singh et al. (2024) and Kubo et al. (2025) both implemented methods based on a "wake-sleep" cycle, where the wake phase is a regular learning phase, meant to acquire new knowledge fast, and the sleep phase is a consolidation phase, where the model reinforces its own knowledge. Although the results presented in Li et al. (2022); Singh et al. (2024) were promising, their use of backward gradient propagation and synchronous, feed-forward Neural EBM architectures lacked biological plausibility and analog hardware friendliness of Hopfield Networks on which the present work focuses. Conversely, Kubo et al. (2025) applied the "wake-sleep" cycle to an EqProp-trained Hopfield Network, although their algorithm required the Hopfield Network to transform into a spiking neural network for the sleep phase.
The closest prior work to ours is Ans (2004), which introduced pseudo-rehearsal using a model and its frozen copy for task solving and replay sample generation, respectively. This paper's approach remains the closest to our own in the literature, although it was tested on small-scale toy problems (with a maximum of 10 examples per task, 2-5 tasks learned sequentially). Their work employed non-EBM recurrent networks trained with Contrastive Hebbian Learning (CHL), an earlier algorithm. In contrast, our EB-Gen method leverages modern Equilibrium Propagation (EqProp), a more powerful and theoretically grounded training paradigm for energy-based models.
3 METHOD
We study the behavior of a Hopfield Network trained with Equilibrium Propagation under non-stationary data. Performance is evaluated on the incremental versions of the typical image classification benchmarks MNIST and CIFAR10. In addition to our proposed EB-Gen method, we evaluate two standard continual learning baselines: Experience Replay (ER) and Generative Replay (Gen Replay). We also use Joint Training (Joint) and FineTune (FT) as upper and lower bounds for the expected average accuracies.
3.1 HOPFIELD NETWORK AND EQUILIBRIUM PROPAGATION
Hopfield Networks A Hopfield network is a convergent recurrent neural network that stores information in the form of attractors of an energy landscape. It consists of units with continuous or binary states collected in a state vector , connected through a symmetric weight matrix , with and (no self-connections).
The network’s dynamics minimize an energy function via a gradient descent in the state space. This process is called “relaxation” and is formally expressed in equation 1. In its simplest form, the Hopfield energy is given by equation 2 generally augmented with bias and regularization terms.
Once discretized w.r.t time, the associated relaxation dynamics follows the following equation
which closely resembles inference in conventional neural networks.
Equilibrium Propagation Equilibrium Propagation is a supervised learning algorithm for Hopfield Networks that computes weight updates only using local information gathered from two successive relaxation phases. This eliminates the need for explicit gradient storage or a separate backward pass, making EqProp both biologically and hardware plausible.
Training proceeds in two phases. In the free phase, the input state variables are clamped (fixed) to a data sample x, while the remaining state variables are left free (able to relax). The system relaxes according to the energy dynamics until it reaches a stable equilibrium state .
In the nudged phase, the input remains clamped and a small perturbation is applied to the output variables by augmenting the energy with a task-related loss. The network energy becomes
where is a small scalar and t denotes the output target. The system then relaxes again to a new equilibrium . The resulting weight update is given by
which approximates gradient descent on the task-related loss.
For an individual synaptic weight , substituting E in (5) with the Hopfield energy expression from (2) yields equation (6) which illustrates the fact that EqProp relies only on local differences between pre- and post-synaptic activities across the two phases. These quantities can be accumulated locally, reducing the need for expensive data transfer.

Figure 1: The activation values needed for updating the weight are obtained locally in a topological sense but not in a temporal sense, as they are collected during two different forward phases.
A more complete and faithful description of our Energy-Based Learning setup is provided in annex A.
3.2 PROBLEM SETTING
Benchmarks We choose to study catastrophic forgetting on split-MNIST and Split-CIFAR10. We use the usual partitioning scheme, where classes are grouped following their default order with each group containing the same number of classes. Split-MNIST and Split-CIFAR10 are composed of 5 task containing 2 class each. We evaluate those benchmarks in the class-incremental setting, meaning that task identity is never provided at training or test time. Therefore, each output node of our models is permanently associated to a single class and their weights remain modifiable during the training of every task.
Setting limits Since we focus on class-incremental learning using the Split variations for typical image classification datasets, our analysis is restricted to sequential image classification problems with clearly defined task boundaries and independently and identically distributed (i.i.d) samples within each tasks.
Feature extraction For experiments on (Split-) CIFAR10, we employ a pre-trained, frozen ResNet-18 feature extractors for the natural image datasets. Our models will therefore be trained on the latent representations which are generated between the feature extractor and its classification head. This measure is particularly necessary as hopfield networks, in their basic form, are notoriously difficult to train on datasets which are more challenging than MNIST. For the experiments comparing EB-Gen to SRC, we follow the method described by Kubo et al. (2025) and use a truncated VGG13 for Split-CIFAR10, and a ResNet-152 for Split-ImageNet10.
Incremental learning performance metrics We consider a sequence of tasks , where each task is associated with a dataset and learned sequentially. Let denote the test accuracy on task after training the model on tasks through . The quantity measures performance on the current task immediately after learning , while for reflects retention of previously learned tasks.
We summarize performance over the full task sequence using the Learning Accuracy (LAcc): , which reflects plasticity, and the Average Accuracy (AAcc): , which reflects stability.
3.3 CONTINUAL LEARNING BASELINES
Baselines As a frame of reference to evaluate our model's continual performance, we use five baselines: FineTune, ER, Gen Replay, SRC and Joint Training.
FineTune is the most naive strategy where tasks are learned without any forgetting counter-measures, which makes it our lower bound for average accuracy. Conversely, Joint Training refers to the training of a model on the offline task obtained by joining every task together and mixing their samples, making it the upper bound for average accuracy.
We use a simple version of Experience Replay (ER) where samples are selected randomly and the hard predicted labels are used as replay outputs.
For Generative Replay (Gen Replay), we use a separate MLP-based symmetric VAE generator model to learn input features (for MNIST) or latent features (for CIFAR10) following the method employed by Stoychev et al. (2023).
For SRC, we directly use results from Kubo et al. (2025) and compare them to EB-Gen using the same feature extractors for .
General replay principle The chosen replayed/current sample ratio for a given method is the same for each task as an increasing ratio would imply an explosion of the memory footprint for a higher task count. When using a extracted features, each replay method (ER, Gen Replay and EB-Gen) uses latent features instead of raw input data for buffering or generative training.
4 ENERGY-BASED GENERATIVE REPLAY (EB-GEN)
Hopfield Networks trained with EqProp define an explicit energy landscape in which learned information correspond to stable attractors. This allows the same network to be used for both prediction and generation by varying which state variables are constrained during relaxation, enabling the generation of replay samples directly through the network dynamics without auxiliary models or stored training data.
4.1 SAMPLE GENERATION FROM EQPROP-TRAINED ENERGY LANDSCAPES
After learning a dataset with EqProp, we assume that the energy function contains multiple stable local minima (i.e. attractors), each capturing some of the data's input-output relationship. While any energy function formally defines a Boltzmann distribution , we do not directly sample from it. Instead, we generate samples by exploiting the network's relaxation dynamics, which is similar to using a gradient sampling method.
Sample generation in EqProp-trained Hopfield Networks is performed by releasing all state variables and allowing the system to relax to equilibrium. The resulting states correspond to stable attractors of the learned energy landscape and ideally represent previously learned input–output associations.
However, purely deterministic relaxation yields a limited set of recurrent attractors, reducing sample diversity and coverage of the underlying task distributions. To enhance diversity and improve sample informativeness, we introduce stochasticity during generation—either by injecting noise at each relaxation step (discrete-time Langevin-like dynamics) or by truncating relaxation early, where variability stems from random initialization (typically sampled uniformly over a predefined state range).
The resulting generated configurations provide a diverse set of surrogate data examples that can be interleaved with new-task data during subsequent training phases, enabling generative replay without storing past data or introducing auxiliary generative models.
4.2 WHY INPUT RECONSTRUCTION MUST BE EXPLICITLY TRAINED
Initial experiments showed that standard EqProp training does not produce models capable of generating meaningful input samples (see annex B.1). When all state variables are initialized freely and the system relaxes under the learned energy , the resulting equilibria collapse to simplistic or degenerate input patterns which fail to capture the structure of the data.
This behavior follows directly from the EqProp training objective. During learning, input units x are clamped to observed data, and the task loss depends only on the output variables y. As a result, the energy landscape is shaped to produce correct outputs conditioned on the input, but not to assign low energy to input configurations themselves. In probabilistic terms, EqProp constrains the conditional distribution while leaving the marginal distribution over inputs unconstrained.
When inputs are released during generation, the energy therefore provides no incentive for x to converge toward data-like configurations. The relaxation dynamics can settle in arbitrary input states that remain compatible with low-energy hidden–output configurations but do not lie on the data manifold. Explicitly training input reconstruction is therefore necessary to enable meaningful input generation.
4.3 HYBRID TRAINING FOR INPUT RECONSTRUCTION
To improve input generation, we extend the EqProp objective to explicitly train input reconstruction. During learning, a subset of input units is released and allowed to evolve under the same relaxation dynamics as the hidden and output units. Let denote the released input variables and their corresponding ground-truth values.
We introduce an input reconstruction loss
which is applied during the nudged phase of EqProp. The perturbed energy becomes
where controls the relative importance of input reconstruction.
This hybrid objective encourages low-energy equilibria to jointly encode consistent input–output configurations. As a result, the learned energy landscape supports meaningful relaxation-based generation of both the inputs (or extracted features for CIFAR10) and outputs of the hopfield network, which is essential for generative replay in continual learning.
4.4 THE GENERATIVE REPLAY PROCESS
For each new task (with ), a copy of the network trained on tasks is frozen and used to generate new replay samples which are then replayed to the new network alongside new examples. The (replayed/new) batch size ratio is a hyper-parameter of the method, often chosen greater than one. The complete algorithm for EB-Gen is formally described in annex B.2.
5 RESULTS
Based on the methodology introduced in Sections 3 and 4, we report results on hybrid EqProp training, pseudo-example generation, and their use for EB-Gen. The relevant model, training and continual learning hyper parameters for each method are summarized in annex C.
5.1 OFFLINE HYBRID TRAINING
We first demonstrate the hybrid training of a Hopfield Network with Equilibrium Propagation in the MNIST and CIFAR10 cases. We evaluate full offline training under three regimes:
-
Regular regime: input nodes are fully clamped to input data, no input cost,
-
Partial regime: Only of input nodes are clamped to input data, still no input cost,
-
Hybrid regime: Same as the partial regime, except an input reconstruction cost was added to unclamped input nodes.
The evolution of offline accuracy and input error for each regime are shown in figure 2, the corresponding final accuracy and input error performances are listed in Table 1 & 2. The input errors are computed by freeing of the model's input nodes and measuring the mean squared error between their equilibrium values and the corresponding input targets.

Figure 2: Training performance curves for MNIST and CIFAR10. Averaged over 5 runs.
| Regime | MNIST | CIFAR10 |
|---|---|---|
| Regular | 92.5 ± 0.3% | 83.5 ± 0.2% |
| Partial | 87.5 ± 0.7% | 72.9 ± 2.1% |
| Hybrid | 86.2 ± 0.5% | 77.5 ± 0.3% |
Table 1: Final accuracy table
| Regime | MNIST | CIFAR10 |
|---|---|---|
| Regular | 5.5 ± 0.2 | 6.29 ± 0.4 |
| Partial | 10.5 ± 0.0 | 30.4 ± 1.4 |
| Hybrid | 0.15 ± 0.0 | 3.80 ± 0.2 |
Table 2: Final input reconstruction error table. The training lasted 5 epochs for MNIST and CIFAR10.
While table 1 shows that using regimes with partial input clamping substantially degraded accuracy by roughly 5 to , table 2 and figure 2 show that the hybrid regime successfully improves input reconstruction w.r.t the regular regime. Due to this input/output prediction trade-off, we restrict the hybrid regime to freeing only of the input nodes for the remainder of the experiments. Notably, the regular regime ended up also reducing reconstruction error for CIFAR-10, while the partial regime saw an explosion of the input error for both datasets, showing that using the input cost is mandatory for enabling input reconstruction.
Our results show that the hybrid training can successfully train our model to improve its partial input reconstruction capability. The next step is to evaluate whether this ability translates to full input generation.
Examples of image generated using a hopfield network trained on MNIST using the regular and hybrid regime are shown in annex B.1. We observed that, in the hybrid training setting, the generated inputs rarely resembled MNIST digits and often did not even resemble numbers. Whether or not those samples can still be used for performing replay will be assessed in the following section.
5.2 CONTINUAL LEARNING WITH ENERGY-BASED GENERATIVE REPLAY
After showing that EqProp can also be tuned to perform input reconstruction alongside its primary classification task, we evaluate the full EB-Gen method in the incremental setting previously described in section 3.
| Split Datasets | MNIST | CIFAR10 |
|---|---|---|
| ER | 85.6 ± 1.0% | 76.6 ± 0.5% |
| Gen Replay | 74.8 ± 3.2% | 50.5 ± 2.7% |
| EB-Gen | 75.3 ± 1.0% | 56.1 ± 0.9% |
| FT | 19.4 ± 0.0% | 21.9 ± 0.5% |
| Joint | 91.7 ± 0.6% | 82.7 ± 0.2% |
| Joint-Hybrid | 85.5 ± 0.8% | 75.9 ± 0.2% |
Table 3: Average Accuracy (AAcc) of EqProp-trained models after learning Split-MNIST - CIFAR10 with FT, ER and EB-Gen.
| method | split dataset | average accuracy |
|---|---|---|
| EB-Gen | MNIST | 76.6 ± 0.5% |
| CIFAR10 | 83.4 ± 0.8% | |
| ImageNet10 | 77.4% | |
| FT (ours) | ImageNet10 | 72.6% |
| SRC | MNIST | 64.7 ± 4.35% |
| CIFAR10 | 81.3 ± 1.98% | |
| ImageNet10 | 77.7 ± 2.91% |
Table 4: Average Accuracy (AAcc) of EqProp-trained models after learning Split-MNIST - CIFAR10 - ImageNet10 with EB-Gen or SRC. Results are averaged over 5 runs except for ImageNet10.
The obtained results are summarized in Table 3, except SRC which is only compared with EB-Gen in Table 4.
The table shows that ER performed the best in terms of stability for both Split MNIST and Split CIFAR10, only losing average accuracy w.r.t to the upper bound defined by Joint. EB-Gen loses at least average accuracy w.r.t ER, this result is to be linked with the results of the Joint-Hybrid method, in which the joint task is learned using the hybrid training regime, thus losing average accuracy w.r.t regular Joint training. Joint-Hybrid being the actual upper bound for EB-Gen, it partially explains its lower performances.
Gen Replay performed slightly worst than EB-Gen on both Split-MNIST and Split-CIFAR10.
FineTune performed the worst with average accuracy on Split MNIST/CIFAR10, which corresponds to complete forgetting of four tasks out of five.
Figure 3 shows a complete history of the task-specific validation accuracies during training for each continual method on both Split MNIST and Split CIFAR10.

Figure 3: Mean task-wise accuracy evolution during training across four continual learning methods (FT, ER, GEN and EB-Gen) on Split-MNIST. Shaded regions indicate one standard deviation across 5 runs.
The FineTune figure shows that each task-specific accuracy instantly drops to zero as soon as the model switches task, indicating absolute and brutal forgetting. All replay methods show a marked plasticity drop after the first task (especially on Split CIFAR-10), while first-task accuracy remains high throughout. This suggests an over-prioritization of the initial task, impairing performance on later ones—a trend most pronounced in EB-Gen, likely due to its shared parameter space for input and output representations. We also observe a significant drop of Task 1 accuracy when learning Task 5 with Split CIFAR10, also observable for other task transitions.
Table 4 compares the results obtained by Kubo et al. (2025) on Split-MNIST - CIFAR10 - ImageNet10) to ours. ImageNet10 is a 10 class subset of Imagenet-1k Russakovsky et al. (2015). Our method allows a and a improvement over SRC on Split-MNIST and Split-CIFAR10. Results on Split-CIFAR10/ImageNet10 where obtained with a VGG13/ResNet152 feature extractor pre-trained on CIFAR10/ImageNet10 following Kubo et al. (2025)'s procedure (whereas our previous CIFAR10 results were obtained with a resNet18 pre-trained on ImageNet-1k). Our updated FT performance shows that pre-training and testing on the same task greatly simplifies the continual learning task, almost making EB-Gen and SRC redundant on Split-ImageNet10 (only gain average accuracy w.r.t the lower bound).
6 ANALYSIS
6.1 FORGETTING IN EBMS
The forgetting sensitivity of EqProp-trained Hopfield networks (Section 5) mirrors observations in other EBMs (Li et al. (2022); Singh et al. (2024)). Below, we formalize a potential explanation for this phenomenon.
A Hopfield Network defines an EBM over state s with weight matrix W, evolving via energy minimization. The energy induces a Boltzmann distribution , where is the partition function.
Classical EBM training (e.g., contrastive divergence) approximates maximum likelihood by globally shaping via:
This objective lowers energy for data-supported states while raising it for model-sampled states.
In continual learning with task distributions , optimizing for task shifts probability mass toward . Since includes low-energy configurations from prior tasks , the negative phase inadvertently raises their energy, eroding earlier minima and causing forgetting.
EqProp resembles contrastive divergence: the free phase captures the model's prior via relaxation, while the nudged phase biases equilibrium toward data. Thus, the above analysis applies.
6.2 REPLAY-BASED CONTINUAL LEARNING, MEMORY FOOTPRINT AND ANALOG HARDWARE FRIENDLINESS
Despite underperforming ER on Split-MNIST-CIFAR10 and conventional Gen Replay on Split-MNIST (Section 5), EB-Gen retains key advantages: its Hybrid regime uses standard EqProp for input generation, and replay data emerges solely from the Hopfield network's natural dynamics. This eliminates auxiliary modules, making EB-Gen far more hardware-efficient—a core benefit of EqProp.
In contrast, ER would require either external digital memory or on-chip capacitive arrays (likely consuming significant chip area), while Gen Replay necessitates a separate generative model, incurring costs for training, inference, and weight storage.
7 CONCLUSION
We propose EB-Gen, a continual learning framework that enables EqProp-trained Hopfield Networks to learn in a class-incremental setting without sacrificing their appeal to analog hardware deep learning. Our approach employs the underlying Hopfield Network both as a classifier for learning new tasks and a generator for remembering old ones, thus alleviating the need for additional memory or generator modules. We demonstrated that our method helps significantly reduce catastrophic forgetting, confirming that EqProp-trained Hopfield Networks can effectively retain meaningful information across both input and output data spaces. Confirming that EqProp-trained Hopfield Networks can effectively retain meaningful information across both input and output data spaces. Moreover, since EB-Gen encodes past data within the network's weights and produces non-human-readable samples (see annex B.1), it may offer an opportunity for enhanced data privacy.
8 FUTURE WORK
In the future, we would like to replicate the presented results on a greater variety of continual learning scenarios, such as Domain-Incremental scenarios or task-boundary-less scenarios. Additionally, we aim to broaden the comparison with the continual learning state of the art, including parameter regularisation or isolation-based methods. Additionally, we believe that there is room for improving the current version of Energy-Based GenReplay, by testing other weight topologies or trying out typical generative replay tricks, such non-trivial sample selection strategies.
REFERENCES
Bernard Ans. Sequential learning in distributed neural networks without catastrophic forgetting: A single and realistic self-refreshing memory can do it. Neural Information Processing - Letters and Reviews, 4(2):27–32, 2004.
Matthias De Lange, Gido van de Ven, and Tinne Tuytelaars. Continual evaluation for lifelong learning: Identifying the stability gap. arXiv preprint arXiv:2205.13452, 2022.
Maxence Ernoult, Julie Grollier, Damien Querlioz, Yoshua Bengio, and Benjamin Scellier. Updates of Equilibrium Prop Match Gradients of Backprop Through Time in an RNN with Static Input. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019.
Rui Gao and Weiwei Liu. DDGR: Continual Learning with Deep Diffusion-based Generative Replay. In Proceedings of the 40th International Conference on Machine Learning, pp. 10744–10763. PMLR, July 2023.
Geoffrey E Hinton and Terrence J Sejnowski. Optimal perceptual inference. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, volume 448, pp. 448–453. Washington, 1983.
J J Hopfield. Neurons with graded response have collective computational properties like those of two-state neurons. Proceedings of the National Academy of Sciences, 81(10):3088–3092, May 1984.
John J Hopfield. Neural networks and physical systems with emergent collective computational abilities. Proceedings of the national academy of sciences, 79(8):2554–2558, 1982.
Hyemin Jeong, Seong-Woong Kim, and Dong-Wan Choi. Replaying with Realistic Latent Vectors in Generative Continual Learning. In Proceedings of The 3rd Conference on Lifelong Learning Agents, pp. 161–178. PMLR, February 2025.
Jack Kendall, Ross Pantone, Kalpana Manickavasagam, Yoshua Bengio, and Benjamin Scellier. Training end-to-end analog neural networks with equilibrium propagation. arXiv preprint arXiv:2006.01981, 2020.
James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A. Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, Demis Hassabis, Claudia Clopath, Dharshan Kumaran, and Raia Hadsell. Overcoming catastrophic forgetting in neural networks. Proceedings of the National Academy of Sciences, 114(13):3521–3526, 2017. doi: 10.1073/pnas.1611835114.
Dmitry Krotov and John J. Hopfield. Dense Associative Memory for Pattern Recognition. In Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc., 2016.
Yoshimasa Kubo, Jean Erik Delanois, and Maxim Bazhenov. Toward lifelong learning in equilibrium propagation: Sleep-like and awake rehearsal for enhanced stability. arXiv preprint arXiv:2508.14081, 2025.
Axel Laborieux and Friedemann Zenke. Holomorphic Equilibrium Propagation Computes Exact Gradients Through Finite Size Oscillations. Advances in Neural Information Processing Systems, 35:12950–12963, December 2022.
Axel Laborieux, Maxence Ernoult, Benjamin Scellier, Yoshua Bengio, Julie Grollier, and Damien Querlioz. Scaling Equilibrium Propagation to Deep ConvNets by Drastically Reducing Its Gradient Estimator Bias. Frontiers in Neuroscience, 15, February 2021. ISSN 1662-453X. doi: 10.3389/fnins.2021.633674.
Shuang Li, Yilun Du, Gido van de Ven, and Igor Mordatch. Energy-Based Models for Continual Learning. In Proceedings of The 1st Conference on Lifelong Learning Agents, pp. 1–22. PMLR, November 2022.
Long-Ji Lin. Self-improving reactive agents based on reinforcement learning, planning and teaching. Machine learning, 8(3):293–321, 1992.
Xialei Liu, Chenshen Wu, Mikel Menta, Luis Herranz, Bogdan Raducanu, Andrew D Bagdanov, Shangling Jui, and Joost van de Weijer. Generative feature replay for class-incremental learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition workshops, pp. 226–227, 2020.
David Lopez-Paz and Marc' Aurelio Ranzato. Gradient episodic memory for continual learning. In I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017.
Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Psychology of learning and motivation, volume 24, pp. 109–165. Elsevier, 1989.
Seokjin Oh, Jiyong An, Seungmyeong Cho, Rina Yoon, and Kyeong-Sik Min. Memristor Crossbar Circuits Implementing Equilibrium Propagation for On-Device Learning. Micromachines, 14(7):1367, July 2023. ISSN 2072-666X. doi: 10.3390/mi14071367.
German I. Parisi, Ronald Kemker, Jose L. Part, Christopher Kanan, and Stefan Wermter. Continual lifelong learning with neural networks: A review. Neural Networks, 113:54–71, 2019. ISSN 0893-6080. doi: https://doi.org/10.1016/j.neunet.2019.01.012.
Hubert Ramsauer, Bernhard Schäfl, Johannes Lehner, Philipp Seidl, Michael Widrich, Thomas Adler, Lukas Gruber, Markus Holzleitner, Milena Pavlović, Geir Kjetil Sandve, et al. Hopfield networks is all you need. arXiv preprint arXiv:2008.02217, 2020.
Anthony Robins. Catastrophic forgetting, rehearsal and pseudorehearsal. Connection Science, 7(2):123–146, 1995.
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211–252, 2015.
Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016.
Benjamin Scellier and Yoshua Bengio. Equilibrium Propagation: Bridging the Gap between Energy-Based Models and Backpropagation. Frontiers in Computational Neuroscience, 11, May 2017.
Hanul Shin, Jung Kwon Lee, Jaehong Kim, and Jiwon Kim. Continual Learning with Deep Generative Replay. In Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017.
Vaibhav Singh, Anna Choromanska, Shuang Li, and Yilun Du. Wake-Sleep Energy Based Models for Continual Learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4118–4127, 2024.
Samuil Stoychev, Nikhil Churamani, and Hatice Gunes. Latent Generative Replay for Resource-Efficient Continual Learning of Facial Expressions. In 2023 IEEE 17th International Conference on Automatic Face and Gesture Recognition (FG), pp. 1–8, January 2023. doi: 10.1109/FG57933.2023.10042642.
Gido M. van de Ven and Andreas S. Tolias. Generative replay with feedback connections as a general strategy for continual learning. (arXiv:1809.10635), April 2019. doi: 10.48550/arXiv.1809.10635.
Mohamed Watfa, Alberto Garcia-Ortiz, and Gilles Sassatelli. Low-Rank Equilibrium Propagation: An Online Incremental Learning Architecture for Analog-Based Hardware Accelerators. In MOCAST 2025 - 14th International Conference on Modern Circuits and Systems Technologies, Dresden, Germany, June 2025. doi:10.1109/MOCAST65744.2025.11083959.
Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In International conference on machine learning, pp. 3987–3995. Pmlr, 2017.
Gianluca Zoppo, Francesco Marrone, and Fernando Corinto. Equilibrium Propagation for Memristor-Based Recurrent Neural Networks. Frontiers in Neuroscience, 14, March 2020. ISSN 1662-453X. doi: 10.3389/fnins.2020.00240.
A EXACT ENERGY BASED LEARNING SETUP
A.1 HOPFIELD NETWORK
For our experiments, we used the same Hopfield energy formulation as the original EqProp paper by Scellier & Bengio (2017). Given a state and a weight matrix , the Hopfield energy takes the following form:
Where represents the energy of the interaction between units (with an activation function) and is the energy associated to the individual biases. The general relaxation equation stays the same, with the optional noise for generation:
With the energy state gradient and W a wiener process (a Gaussian noise with variance dt). The time-discretized version of this equation for a singular state unit is is
with . Plugging the Hopfield Energy in the previous formula yields
where is the interaction term, is the noise term, and is a state leakage term.
A.2 EQUILIBRIUM PROPAGATION
We use a variant of the original EqProp formulation introduced by Laborieux et al. (2021) where a third 'negative' nudging phase is computed after the usual 'positive' nudging phase in order to better approximate the true loss gradient. During the negative nudging phase, equation 4 becomes
with the only difference being the sign of . The equilibrium state retrieved from this phase is , it corresponds to a state which is particularly bad candidate for correctly associating the input image and the corresponding true target. The resulting weight update becomes
Since, in the case of EB-Gen, we also partially learn the input images, we had to choose whether the input cost beta factor should also become negative during the negative nudging phase. Since the goal of the negative phase is to ensure that the model doesn't associate the write inputs with the wrong outputs, we kept a positive beta value for the inputs. Trials of both negative and positive beta values proved that it was the most efficient choice.
Plugging equation 10 into equation 13 for a specific weight yields
which shows that the centered version of EqProp doesn't change the locality of the weight update.
B PSEUDO-EXAMPLE GENERATION WITH EQPROP-TRAINED HOPFIELD NETWORKS
B.1 GENERATED INPUT EXAMPLES
We exclusively conduct the evaluation on MNIST as the models trained on CIFAR10 use feature extractors, they can therefore only regenerate latent features which are likely to not be human-readable by default. Examples are generated with networks trained under four different regimes:
• an untrained network,
• training with full data input,
• training with 1% input damage and an input reconstruction cost,
• training with 10% input damage and an input reconstruction cost.
Untrained

No Input Damage Training

1% Input Damage Training

10% Input Damage Training

Figure 4: Input samples generated after full input release for different training regimes.
When trained without input reconstruction, the network relaxes toward a diffuse, centered activation pattern that only captures coarse properties of MNIST, such as spatial extent and centering. While this reflects some dataset statistics, it provides no meaningful digit structure.
In contrast, models trained with partial input release and an explicit input reconstruction cost produce significantly more structured patterns. Although these patterns do not resemble human-interpretable images, this is not necessarily problematic: deep models often encode useful information in non-human-readable representations (such as filters used in CNNs). To assess whether these generated patterns carry task-relevant information, we need to evaluate their effectiveness for knowledge transfer, which we do in an online setting when testing EB-Gen.
Algorithm 1 Continual Learning with Equilibrium Propagation and EB-Gen
Require: Sequence of tasks , where and .
Require: EqProp hyperparameters: , learning rate , step size , time constant , free/nudged steps , , tolerance .
Require: Replay hyperparameters: pseudo ratio , mask fraction , noise scale , sampling steps .
Require: Hopfield energy: over . Losses: , , weight .
1: Initialize parameters
2: for do
3: Set teacher and freeze it
4: for each minibatch from do
(A) Pseudo-example generation (teacher model)
5: Initialize
6: for do
7: Initialize state
8: Release all state variables
9: for do
10:
11: end for
12: Extract from
13: Add to
14: end for
15: Form mixed batch
(B) EqProp training on mixed batch
16: Initialize accumulated update
17: for each do
18: Sample mask and define
19: Initialize state and clamp
Free phase
20: for do
21:
22: end for
23: Store
Nudged phase
24: Define
25: for do
26:
27: end for
28: Store
29: Accumulate
30: end for
31: Update parameters
32: end for
33: end for
B.2 GENERATIVE REPLAY ALGORITHM
Algorithm 1 details the full functioning of EB-Gen, including the generation and training part. Tasks are learned sequentially using EqProp on batches that combine current-task data with pseudo-samples generated by a frozen copy of the model. Replay is implemented directly through the relaxation dynamics of the learned energy function, without storing past data or introducing an additional independent generative models.
C EXPERIMENT PARAMETERS
| Parameters | MNIST | CIFAR10 | ImageNet10 |
| 0.01 | 0.001 | 0.08 | |
| 0.01 | 0.001 | 0.001 | |
| 1.0 | 1.0 | 1.0 | |
| 0.1 | 0.1 | 0.1 | |
| relax tol | 1e-3 | 1e-3 | 1e-3 |
| free phase | 250 | 500 | 500 |
| nudge phase | 50 | 50 | 50 |
| Hidden size | 125 | 512 | 1024 |
| extractor | None | ResNet18 | ResNet152 |
| batch size | 256 | 256 | 256 |
| epoch per task | 2 | 2 | 5 |
| optim | Adam | Adam | Adam |
| loss | MSE | MSE | MSE |
Table 5: General Hyper-Parameters for each tested dataset. Relaxation is the discrete time step size for the energy relaxation; 'relax tol' is the relaxation tolerance, where relaxation stops if the state update amplitude goes below it; 'free phase' and 'nudge phase' are the maximum number of steps for the free phase and nudged phase relaxations respectively. Model 'Hidden size' is the size of the network's hidden node; and are the learning rates for the first and second weight layers; "extractor" is the name of the used frozen feature extractor. Training 'optim' is the optimizer used to train the main model, the same 'loss' is used for output and input nodes. For the comparison with SRC, the CIFAR10 parameters where the same except the efature extractor, which was a truncated VGG13 (with batch norm)
| Parameters | MNIST | CIFAR10 |
|---|---|---|
| Buffer size | 128 | 512 |
| Replay ratio | 1 | 2 |
Table 6: Experience Replay-specific hyper parameters. 'Buffer size' is the maximum number of data samples ER can keep at a time. 'Replay ratio' is the replay/current sample size ratio used for a single training step.
| Parameters | MNIST | CIFAR10 |
|---|---|---|
| 0.01 | 0.005 | |
| 0.01 | 0.005 | |
| latent size | 128 | 128 |
| Replay ratio list | 1,2,2,2 | 1,2,2,2 |
| gen lr | 0.01 | 0.005 |
Table 7: Generative Replay-specific hyper parameters. WWe chose special and values for training Gen Replay on CIFAR10. 'Replay ratio list' specifies the replay/current sample size ratio associated to each task of the task sequence, starting from the second task (first one doesn't need replay). 'latent size' is the size of the latent space of the VAE. 'gen lr' is the learning rate used for training the generation model. The rest of the generator architecture and training parameters follows the one described by Stoychev et al. (2023).
| Parameters | MNIST | CIFAR10 | ImageNet10 |
| Replay ratio list | 0.5,1,2,4 | 1,4,4,4 | 0.5,0.5,0.5,0.5 |
| input loss | MSE | MSE | MSE |
| gen phase | 100 | 200 | 200 |
| chain len | 10 | 20 | 100 |
Table 8: Energy Based Generative Replay-specific hyper parameters. 'Replay ratio list' has the same meaning here as in Table 7. 'gen phase' is the maximum number of steps the generation process can take; 'chain len' is the amount of generated samples which are retrieved for a single relaxation.