Error Forcing in Recurrent Neural Networks

A Erdem Sağtekin, Colin Bredenberg, Cristina SavinNeurIPS 2025

Abstract

How should feedback influence recurrent neural network (RNN) learning? One way to address the known limitations of backpropagation through time is to directly adjust neural activities during the learning process. However, it remains unclear how to effectively use feedback to shape RNN dynamics. Here, we introduce Error Forcing (EF), where the network activity is guided orthogonally toward the zero-error manifold during learning. This method contrasts with alternatives like Teacher Forcing, which impose stronger constraints on neural activity and thus induce larger feedback influence on circuit dynamics.

The Challenge of Training RNNs

Training RNNs is notoriously difficult due to the "vanishing and exploding gradient" problem. When using standard Backpropagation Through Time (BPTT), error signals can either disappear or blow up as they are projected back through long temporal sequences.

To solve this, researchers often use Teacher Forcing (TF), which replaces the network's predicted state with a "correct" target state during training. However, TF is often too aggressive. It typically forces the network into a specific "minimum-norm" state that satisfies the output, which may be completely at odds with the network's natural internal dynamics. This creates a "train-test mismatch": the network learns to rely on external "hand-holding" that isn't available during actual inference, leading to poor generalization and limited exploration of the state space.

Error Forcing: A Minimal Intervention

The authors introduce Error Forcing (EF), which offers a "minimally invasive" alternative to TF. Instead of forcing the hidden state to a single target point, EF projects the current state orthogonally onto the zero-error manifold—the entire set of neural states that would produce the correct output.

The EF mechanism (a) and its computational graph (b). Errors update both weights (blue) and activity (red).

Key technical components of this approach include:

  • Orthogonal Projection: Using the pseudoinverse of the readout matrix to calculate the smallest possible change to the current state that eliminates the output error.
  • Stop-Gradients: The algorithm uses a stop-gradient operation on the error correction term. This ensures that the performance gains come from guiding the network's dynamics into a useful regime, rather than just damping the Jacobians.
  • Biological Plausibility (EF-RFLO): To make the model more biologically plausible, the authors combined EF with Random Frequency Least-squares Online learning (RFLO), a local learning rule that avoids the non-local requirements of BPTT.

Key Insights

The core "aha moment" of EF is that we do not need to tell the network exactly what state to be in; we just need to nudge it out of the "error zone." By leaving the "null space" (dimensions that don't affect the current output) untouched, the RNN can maintain its natural trajectories and internal representations.

Furthermore, EF is not just a heuristic. The authors prove it can be derived as a form of approximate dynamic inference. Specifically, it acts as an online filtering approximation of the variational Expectation-Maximization (EM) algorithm, where errors are treated as latent variables to be inferred. Unlike Teacher Forcing, which is highly sensitive to the "forcing strength" hyperparameter, EF performs consistently well across a wide range of values, suggesting that the direction of the feedback is more important than its precise magnitude.

Experimental Results

The authors evaluated EF across three distinct tasks designed to test different aspects of temporal credit assignment:

  1. Delayed XOR: A nonlinear working memory task. EF-BPTT maintained a high success rate even as delays stretched to 2000 timesteps, while standard BPTT and TF performance plummeted.
  2. Sine Wave Generation: An input-dependent periodic signal generation task. While TF actually destabilized learning (leading to high Mean Squared Error), EF consistently converged to accurate solutions.
  3. Evidence Integration: A task where the network must accumulate sparse, noisy inputs over time to make a binary decision. EF successfully handled this accumulation without overriding the network's internal memory.

Even when using biologically constrained versions (like EF-RFLO with random or learned feedback weights), the algorithm still outperformed standard RFLO, proving that the benefits of error-based guidance persist even without perfect mathematical machinery.

Limitations and Future Work

While highly effective, EF has a few limitations. The ideal version requires the feedback weights to be the pseudoinverse of the readout weights (the "weight transport" problem). While random or learned weights still provide benefits, a performance gap remains. Additionally, the current derivation assumes a linear decoder; extending this to nonlinear decoders remains an empirical open question. Finally, applying EF to reinforcement learning—perhaps by using a "critic" network's value estimate as a short-term supervised objective—presents a promising avenue for future research.

Summary updated

BibTeX
@inproceedings{sagtekin2025error,
  author = {A Erdem Sağtekin and Colin Bredenberg and Cristina Savin},
  title = {{Error Forcing in Recurrent Neural Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=xVI8g50Qfk},
}
Figure