MFT Gradient-Flow Monitor
Implementation & benchmark of arXiv:2608.12119 — Macroscopic fluctuation theory for the multi-time statistics of current in non-stationary diffusive systems
Source paper: Macroscopic fluctuation theory for the multi-time statistics of current in non-stationary diffusive systems arXiv:2608.12119 ⓘ · analyzed Sep 1, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Coarse-grain the training trajectory into a one-dimensional field over depth or parameter blocks, such as normalized gradient energy per layer, and model its redistribution as a fluctuating diffusive current. Compute the macroscopic fluctuation action over a sliding time window; use unusually large action as an early-warning signal for nonstationary gradient bursts and reduce the learning rate before divergence. The controller explicitly distinguishes flat layer profiles from step-like profiles, avoiding a universal long-memory noise assumption.
Formulas
Mathematical statement
MFT represents a density field q(x,t) and current j(x,t) through the continuity equation partial_t q plus partial_x j equals zero. For diffusivity D(q) and mobility sigma(q), the constitutive current is j equals minus D(q) partial_x q plus sigma(q) partial_x p, where p(x,t) is the response field, and the path cost of a current history is S[q,j] equal to the integral of [j plus D(q) partial_x q]^2 divided by 2 sigma(q). The Hamilton equations are partial_t q equals partial_x[D(q) partial_x q minus sigma(q) partial_x p] and partial_t p equals minus D(q) partial_x^2 p minus one half sigma-prime(q) times (partial_x p)^2. In the neural adaptation, x is normalized depth or block index, t is optimizer time, q is normalized squared gradient energy, and j is inferred redistribution of that energy across neighboring blocks. D and sigma are estimated locally from trajectory data. A large action means the observed current is unlikely under the fitted diffusive training dynamics and is used as a control signal.
Implementation notes
1. Exact integration point: insert the monitor after each optimizer step, before applying the next learning-rate update. Partition the network into L ordered blocks. For each step t, compute q_l(t)=||g_l(t)||_2^2/(sum_m ||g_m(t)||_2^2+epsilon), smooth it over 5 to 20 steps, and use x_l=l/(L-1) as the spatial coordinate. Initially this changes neither the forward nor backward pass; it only controls the scheduler. 2. Pseudocode: compute q from normalized block-gradient energy; estimate dq/dx by centered finite differences; estimate dq/dt from consecutive profiles; solve the discrete continuity equation j[l+1]-j[l]=-dx*dq/dt[l] using a minimum-norm flux and zero-flux boundaries. Estimate D by D=-Cov(j,dqdx)/Var(dqdx), and estimate sigma from sigma=dt*Var(j+D*dqdx)/2 over a sliding window, enforcing positive floors. Compute the discrete action S=sum_l,t dt*dx*(j+D*dqdx)^2/(2*sigma). Update the learning rate using the displayed exponential controller with an EMA reference S_ref from the first stable epoch. 3. Quantities computed directly are block gradients, finite differences, flux estimates, and action values. The MFT construction and action are transferred from the paper; D, sigma, and S_ref are empirical estimates. For a step-like initial gradient profile, use a separate reference distribution rather than the flat-profile baseline. 4. First cheap experiment: train a 4-layer MLP on MNIST with SGD, comparing fixed learning rate, cosine decay, gradient clipping, and this action controller at equal update budgets. Log loss, gradient norm, S_t, and maximum block-gradient ratio. The quantitative prediction is that abrupt gradient-burst windows have approximately linear -log P(S>s) versus measured S in the upper tail, and that reducing the learning rate when S_t/S_ref exceeds 2 lowers the probability of a subsequent burst. Fit perturbation relaxation by spatial Fourier modes; the predicted mode decay is exp[-D k^2(t-t_0)]. Support the method only if measured decay rates are approximately linear in k^2 and the intervention threshold precedes divergence by at least one monitoring window.
Verification
This idea has not been verified yet.
Verification happens in two stages: Stage 1 — a mechanism check on a toy system confirms the claimed mathematical phenomenon reproduces; Stage 2 — a benchmark implements the idea on a real (small) neural network task and compares it against a tuned baseline over 8 paired seeds with a permutation test.
Artifacts
Artifacts unavailable.