Learning long range dependencies through time reversal symmetry breaking

Guillaume Pourcel, Maxence Ernoult

Introduction

The current deep learning landscape is heavily optimized for digital hardware like GPUs and TPUs, which are designed to handle the memory-intensive requirements of Backpropagation Through Time (BPTT). However, as the demand for processing extremely long sequences grows, researchers are increasingly looking toward analog physical systems—such as photonic or spintronic circuits—for their potential energy efficiency. A significant hurdle remains: BPTT is physically implausible for these systems because the "chain rule" cannot be easily executed in reverse through a physical substrate.

While forward-only alternatives like Real-Time Recurrent Learning (RTRL) exist, they typically suffer from cubic memory scaling or rely on biased approximations. This paper introduces Recurrent Hamiltonian Echo Learning (RHEL), a scalable, exact, forward-only learning algorithm that leverages the inherent physics of time-reversal symmetry to compute gradients.

The RHEL Algorithm

RHEL is inspired by Hamiltonian Echo Backprop, a concept from physics applicable to conservative, non-dissipative systems. Instead of mathematical differentiation, RHEL utilizes three distinct forward passes to physically compute gradients:

  1. Free Forward Pass: The system processes the input sequence normally, evolving its state $(\phi, \pi)$.
  2. Conjugation and Nudging: The system's momentum is flipped, and the input sequence is replayed in reverse. During this phase, an infinitesimal "nudge" (perturbation) is applied, pushing the system toward a state that minimizes the loss.
  3. Difference Measurement: Due to time-reversal symmetry, an unperturbed system would return exactly to its initial state. The nudge causes a deviation; the gap between the final state and the original starting state perfectly encodes the loss gradient.
Conceptual overview of RHEL: A nudge applied to a time-reversed trajectory allows for gradient computation via the difference between the final and initial states.

To bridge the gap between continuous physical dynamics and discrete machine learning, the authors developed Hamiltonian Recurrent Units (HRUs). These units are discrete-time, simulatable versions of physical systems that can be stacked into Hamiltonian State Space Models (HSSMs). This architecture allows RHEL to achieve $O(1)$ memory scaling relative to sequence length.

Experimental Results

The efficacy of RHEL was tested against BPTT across several benchmarks, focusing on its ability to match gradients and handle long-range dependencies.

Gradient Matching

A critical requirement for any BPTT alternative is the accuracy of the computed gradients. In static tests, RHEL demonstrated exceptional precision. As shown in Figure 6, the norm ratio between gradients produced by RHEL and those from BPTT is nearly 1.0 across all model parameters ($A, B, b, \delta, \alpha$). This confirms that RHEL provides an exact gradient without the memory overhead of storing intermediate activations.

Gradient matching results: The norm ratio between RHEL-computed gradients and BPTT gradients is nearly 1.0 across various model parameters ($A, B, b, \delta, \alpha$).

Long-Range Sequence Modeling

The models were evaluated on the UEA Multivariate Time Series Classification Archive and the PPG-DaLiA heart rate prediction dataset. On the UEA datasets, which feature sequences up to 18,000 steps, RHEL-trained models performed on par with BPTT-trained counterparts (e.g., 62.9% vs 63.4% accuracy).

More impressively, on the PPG-DaLiA regression task involving sequences of approximately 50,000 steps, RHEL successfully trained models that matched BPTT's performance (Mean Square Error of 8.4 for RHEL vs 7.8 for BPTT in nonlinear models). This demonstrates that RHEL scales effectively to the massive sequence lengths required by modern applications.

Discussion and Limitations

RHEL represents a significant step toward physical AI, but several challenges remain. The current formulation is restricted to non-dissipative (energy-conserving) systems, whereas real-world physical systems often involve friction or energy loss. Additionally, the reliance on measuring tiny perturbations can lead to numerical instability on digital hardware, requiring careful gradient rescaling. Finally, the requirement to replay the sequence in reverse prevents strictly online, real-time operation. Future work will focus on extending RHEL to dissipative systems and deploying the algorithm on actual analog hardware to fully realize its energy-efficiency potential.

Summary updated

BibTeX
@inproceedings{pourcel2025learning,
  author = {Guillaume Pourcel and Maxence Ernoult},
  title = {{Learning long range dependencies through time reversal symmetry breaking}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=w1ihNiIBOc},
}
Figure