Backpropagation as Dirac-bracket dynamics of dissipative training

Nicolaus Linneu Holanda, Ivan Eugenio CunhaarXiv 2026

TL;DR

What if backpropagation isn’t just a clever computational trick, but a natural consequence of classical mechanics? By framing neural network layers as rigid physical constraints within a dissipative Hamiltonian system, the authors show that both forward-mode differentiation and backpropagation emerge automatically from the system's algebraic geometry—allowing you to train a neural network using pure physics, with no explicit backward pass required.

What Problem Does This Paper Address?

Physicists and machine learning theorists love viewing gradient descent as a ball rolling down a hilly loss landscape, complete with inertia (momentum) and friction (damping). Writing this down using Hamiltonian mechanics—the gold-standard mathematical framework of physics—unlocks powerful analytical tools, but there are two catches.

First, standard Hamiltonians conserve energy, whereas optimizers intentionally dissipate it to settle into a minimum. Second, previous physical models of training simply assumed the loss gradient was handed to them as a pre-computed potential force. They treated the optimizer as physics, and backpropagation as an external algorithm bolted onto the side. The authors ask: how does backpropagation itself arise natively inside the Hamiltonian dynamics of training?

Methods

To unify the optimizer and the network architecture into a single physical system, the authors combine two classic techniques from theoretical physics:

  1. Bateman–Galley Doubling (Handling Friction): To write a Hamiltonian for a system that loses energy, you create a mathematical mirror copy of it. As the real system dissipates energy (damping), the mirror copy absorbs it (anti-damping). Total energy is conserved across the doubled space, and you recover true physical training at the end by setting the two copies equal (the "physical limit"). This captures gradient flow, Polyak's heavy-ball, and Nesterov’s accelerated gradient.
  2. Dirac Brackets (Layers as Constraints): Instead of writing the network's full composite loss function into the Hamiltonian, the authors only include the final output cost. They promote every layer's activations to independent coordinates in phase space, with no kinetic energy of their own, and impose the layer equations ($h_\ell = f_\ell(W_\ell, h_{\ell-1})$) as rigid rules, or holonomic constraints. Using Paul Dirac’s 1950 theory for constrained mechanics, standard Poisson brackets are upgraded to Dirac brackets—an algebraic tool that forces the system's evolution to respect the constraints by inverting a matrix of constraint derivatives.

Datasets

The authors validate their mathematical framework using synthetic data—specifically, $N=6$ 3D input vectors drawn from a standard normal distribution, paired with 2D normal targets (for squared-error regression) or random two-class one-hot labels (for cross-entropy classification). No external or new benchmark datasets are introduced.

Key Insights and Ideas

  • The Network is a Robot Arm: Mechanically, a feed-forward network acts like a rigid kinematic chain (think of a multi-jointed robot arm). The weights are the joint angles, the activations are the link positions, and the loss at the output is a physical load hanging off the end effector. Backpropagation is literally the statics of this arm: computing the constraint forces (Lagrange multipliers) transmitted backward link-by-link to find the torque felt by each joint.
  • Auto-Diff Hides in the Constraint Matrix: To evolve a Dirac system, you have to invert the matrix of brackets between constraints. Because feed-forward layers depend sequentially on one another, this inverse matrix is cleanly block-triangular. One off-diagonal block naturally executes Jacobian–vector products (forward-mode auto-diff), while the transposed block executes vector–Jacobian products (reverse-mode backpropagation).
  • Optimizer-Network Separation: The constraint matrix and the resulting Dirac bracket depend only on the network architecture, weights, and inputs—never on the optimizer's mass or damping schedules. Nesterov’s look-ahead step simply snaps onto the front of the network as one extra momentum-dependent constraint layer that couples the two mirror copies.

Key Results

The authors tested their setup on a small 3–5–4–2 network (two tanh hidden layers, linear output) by integrating the raw Dirac equations of motion with an 8th-order Runge–Kutta solver, completely bypassing any backward pass.

  • Machine-Precision Pointwise Match: Evaluating the algebra at random phase-space points (even away from the physical limit where the two copies differ), the Dirac bracket dynamics matched standard reverse-mode backpropagation gradients, forward-mode tangents, and Lagrange multipliers to within $2 \times 10^{-15}$ (and $3 \times 10^{-15}$ for Nesterov's coupled look-ahead constraints).
  • Training Without a Backward Pass: Integrating the continuous Dirac flow successfully trained the network identically to standard reverse-mode ODE integration across heavy-ball, time-dependent damping ($\gamma = 3/t$), and Nesterov dynamics. Constraints remained satisfied to $1.4 \times 10^{-11}$, and copy-averaged parameters matched standard training to $1.5 \times 10^{-11}$.
FIG. 1. Training a 3–5–4–2 network by integrating the Dirac flow of the constrained doubled system, whose Hamiltonian contains only the cost of the network output. (a) Training loss from the Dirac flow (circles) and from ordinary training with reverse-mode gradients (lines), for the heavy-ball method, γ = 3/t and Nesterov’s look-ahead dynamics with h = 0.1, whose curve nearly coincides with that of the heavy-ball method. (b) Deviation of the copy-averaged parameters from the reference (solid), constraint violation (dashed), and separation of the two copies (dotted), which grows from round-off through the anti- damped mirror modes.
  • Mirror Instability in Action: As shown in Figure 1b, tiny floating-point round-off errors inevitably excite the anti-damped mirror copy, causing the two copies ($|\mathbf{x}_1 - \mathbf{x}_2|$) to drift apart exponentially over long runs (reaching $1.4 \times 10^{-3}$ at $t=30$ for Nesterov). Conveniently, this separation only affects the average of the two copies at second order, keeping deviations from reference training tiny ($10^{-9}$).

Limitations and Future Work

  • Unstable Numerics & Continuum Focus: Because the anti-damped mirror copy makes the physical limit dynamically unstable, integrating the doubled system is meant as a theoretical lens for deriving exact mechanics rather than a faster replacement for PyTorch. Furthermore, the math models continuous-time, full-batch deterministic training; mini-batches only enter awkwardly as explicit time-dependencies in the constraints.
  • Beyond Feed-Forward: Because the constraint math only requires that activations be determined by earlier activations and parameters, the authors note it should naturally extend to any directed acyclic graph—including ResNets, weight sharing, and attention mechanisms.
  • Stochastic Training: Because Bateman–Galley doubling is the classical limit of the closed-time-path formalism used in physics to study thermal and quantum fluctuations, it offers a very natural launchpad for modeling stochastic gradient noise in future work.

Summary updated

Abstract

Gradient-based training of a parametric model is the motion of a damped particle in the potential set by the loss. Using the Bateman-Galley doubling of the degrees of freedom, which gives dissipative systems an action principle, we write gradient flow, the heavy-ball method and Nesterov's accelerated gradient method as Hamiltonian systems. We show that, within this Hamiltonian description, backpropagation is Dirac evolution. The activations of a feed-forward network are treated as coordinates of phase space, and the layer equations as constraints. These constraints are second class for every architecture, and Hamilton's equations with the resulting Dirac bracket reproduce training with the exact gradient of the loss, although the Hamiltonian contains only the cost of the network output. The Dirac bracket of an activation with the momenta of the parameters is its Jacobian, the inverse of the constraint matrix contains both the forward and the reverse modes of automatic differentiation, and the errors propagated by backpropagation are the Lagrange multipliers of the layer constraints: the constraint forces of a kinematic chain under the load of the cost. These results hold in the full doubled phase space, not only in the physical limit. The network's part of the constraint algebra is the same for every optimizer, Nesterov's look-ahead adds one layer of momentum-dependent constraints that couple the two copies of the doubled system, and gradient flow is obtained by constructing the Dirac bracket in stages. We confirm these statements numerically to machine precision and train a network by integrating the Dirac flow of its constraints, with no backward pass in the computation.
BibTeX
@misc{holanda2026backpropagation,
  author = {Nicolaus Linneu Holanda and Ivan Eugenio Cunha},
  title = {{Backpropagation as Dirac-bracket dynamics of dissipative training}},
  year = {2026},
  eprint = {2611.34479},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.34479},
}
Figure