Jacobian-Free Short-Trace Backpropagation
Implementation & benchmark of arXiv:2608.00217 — Truncated Differentiation Through Primal-Dual Solvers for Inverse Potential Mean-Field Games
Source paper: Truncated Differentiation Through Primal-Dual Solvers for Inverse Potential Mean-Field Games arXiv:2608.00217 ⓘ · analyzed Aug 31, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Use a full primal-dual optimization solve in the forward pass, but backpropagate only through the last r iterations starting from a detached warm-start iterate. This avoids storing the full solver trajectory while preserving the forward solution, and provides a tunable bias-versus-memory tradeoff: r=0 is a cheap surrogate gradient, while increasing r should converge toward the implicit equilibrium gradient.
Formulas
Mathematical statement
The paper's forward problem is the convex constrained program $\min_{\rho,m} f_{\theta}(\rho,m)$ subject to $\partial_t\rho+\nabla\cdot m=0$, $\rho(s,0)=\mu_0(s)$, and $\rho\ge 0$, where $\rho$ is a population-density tensor, $m$ is a flux tensor, $\theta$ parameterizes the positive mobility map $c_{\theta}(s)$, and $\mu_0$ is the initial density. Let $z=(\rho,m,y)$ collect primal variables and the dual variable $y$ for the discretized linear continuity constraint, and let $K$ denote that constraint operator. Exact-proximal PDHG defines an iteration map $z_{k+1}=F_{\theta}(z_k)$; the paper identifies this map with a metric resolvent $F_{\theta}=(I+P^{-1}A_{\theta})^{-1}$ of the maximal-monotone KKT operator $A_{\theta}$ under a positive-definite preconditioner $P$. A full forward solve computes $z_N=F_{\theta}^{N}(z_0)$. JFB-$r$ chooses a detached warm start $\bar z=\operatorname{stopgrad}(z_{N-r})$ and differentiates only $z_N=F_{\theta}^{r}(\bar z)$. Thus the computed derivative is exactly the derivative of a finite-trajectory surrogate. Under a locally fixed active set at an exact equilibrium detach point, the tracked derivative approaches the implicit equilibrium derivative as $r$ increases.
Implementation notes
Integrate this at a neural-network layer whose output is obtained by solving a convex constrained problem. For the first MVP, use a discretized Benamou-Brenier-style layer with tensors rho and m, a small CNN predicting the positive mobility map c_theta, and a dual tensor y enforcing a discrete continuity equation. In the forward pass, initialize z0 and run N PDHG iterations exactly as in the baseline. Execute iterations 0 through N-r-1 under no_grad, retaining only the current state z; apply stop_gradient to obtain the detached warm start z_detach. Execute the final r iterations with autograd enabled, and pass the resulting terminal density or flux to the downstream loss. Pseudocode is: z=initialize(); for k in range(N-r): z=pd hg_step(z, theta, no_grad=True); z=stop_gradient(z); for k in range(r): z=pd hg_step(z, theta, no_grad=False); loss=task_loss(network_input, z); loss.backward(). Here pdhg_step is the exact implementation of the chosen primal proximal update, dual ascent update, and dual extrapolation; F_theta denotes this complete step and P is its positive-definite diagonal or block-diagonal preconditioner. The paper supplies the resolvent rationale, while gradient bias should be estimated by comparing against full unrolling on a tiny problem. Sweep r over 0, 1, 2, 4, 8, and 16. Use a 32x32 grid, synthetic source-target density pairs, and a 2-layer CNN for c_theta. Record peak activation memory, forward and backward wall time, gradient cosine similarity to full unrolling, constraint violation, and validation loss. The target signal is at least 4x lower backward memory and 2x lower backward time for r<=8, with similar recovery accuracy and increasing gradient cosine similarity as r grows.
Verification
Stage 1 · Toy mechanism gate: Passed ✓
Stage 2 · Mechanism transferred to benchmark: Confirmed ✓
Stage 2 · Practical benchmark result: Significant win ✓
Methodology: 8 paired seeds, permutation test (p<0.05) against a learning-rate-tuned baseline. How verification works
Stage 1 — Mechanism check agent confidence 8/10
Built a Jacobian-Free Short-Trace Backpropagation MVP with detached warm starts and autograd enabled only for the final r solver iterations. The mechanism manifested: observed gradient-tail errors matched |a|^r with maximum absolute discrepancy 0.0094, stability behavior matched the predicted |a| boundary, and r=8 reduced the retained autograd graph from 166 to 22 nodes (86.7%) while preserving the forward result. This is a positive mechanism result, not evidence of a practical end-to-end win because the requested 32x32 Benamou–Brenier PDHG/CNN experiment was not implemented.
- Agent confidence
- 8/10
- Baseline
- Full 80-step unroll: 166 graph nodes; gradient 18.8999993 at a=0.8; forward loss identical to JFB.
- Idea
- JFB-r=8: 22 graph nodes, 86.75% graph-node reduction; gradient 15.7291059 at a=0.8; relative gradient error 0.16777215, matching predicted 0.16777216. Across stable sweeps, maximum absolute error from |a|^r prediction was 0.009402.
Limitations: The solver is a scalar/vector linear resolvent-like toy rather than a 32x32 Benamou–Brenier PDHG layer with CNN mobility. Peak graph nodes are only a memory proxy; GPU peak memory, wall-clock speed, training/validation accuracy, constraint violation, active-set effects, and CUDA fallback were not tested.
How to run: python3 jfb_experiment.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2608.00217)
Beats the tuned baseline by 6.0% (p=0.0081, wins 8 / 8 paired seeds; metric: lower is better).
- Benchmark
- Poisson_jfb_short_trace
- Model
- mlp_tiny
- Paired seeds
- 8
- Baseline mean
- 0.0011
- Idea mean
- 0.001
- Effect (Δ)
- -0.0001 (−6.0%; negative = idea better)
- Wins
- 8 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±1.8%
- Mechanism
- Confirmed ✓
- Practical effect
- Helps
- Baseline tuning
- swept over 3 configs
The benchmark uses a small 1-D Poisson/Jacobi surrogate rather than a full 2-D Benamou-Brenier PDHG layer with CNN mobility, and graph-node counts are an activation-memory proxy rather than peak GPU memory or allocator measurements. Wall-clock backward speed, multi-GPU behavior, larger grids, nonlinear active-set effects, and the full requested r sweep were not tested; the protocol used r=8 with a three-point learning-rate sweep.
How to run: python3 run_bench.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Stage 2 — Benchmark latest Worked ✓
Agent confidence: 9/10
Implemented Jacobian-Free Short-Trace Backpropagation as a local modification of an iterative Dirichlet Poisson solver layer, using identical MLPs, data, Adam settings, epochs, and learning-rate search spaces for baseline and idea. On 8 paired seeds, JFB-r=8 improved test MSE from 0.00108759 to 0.00102201, with delta=-0.00006558, all 8 paired wins, and permutation p=0.0081, so the benchmark verdict is idea better (significant). The trained-model mechanism signature also showed gradient cosine 0.99799 and graph-node ratio 0.279 versus full unrolling, confirming the predicted memory/bias tradeoff in this benchmark.
- Baseline
- Best full-unroll baseline lr=0.01: mean test MSE 0.0010875872, std 0.0002177026, per-seed [0.0011947289, 0.0012675405, 0.0007458905, 0.0013288707, 0.0008003622, 0.0009001188, 0.0012070924, 0.0012560940]. Full graph nodes mean 171.75.
- Delta mean
- -0.0000655779 test MSE; 8/8 idea wins; permutation p=0.0081; verdict idea better (significant)
- Idea
- JFB-r=8, lr=0.01: mean test MSE 0.0010220094, std 0.0002187113, per-seed [0.0011456695, 0.0011954439, 0.0007086408, 0.0012542448, 0.0007219942, 0.0008089894, 0.0011173507, 0.0012237416]. Retained graph nodes mean 48.0; observed graph-node ratio 0.2795; gradient cosine to full unroll 0.99799.
Benchmark result
Beats the tuned baseline by 6.0% (p=0.0081, wins 8 / 8 paired seeds; metric: lower is better).
- Benchmark
- Poisson_jfb_short_trace
- Model
- mlp_tiny
- Paired seeds
- 8
- Baseline mean
- 0.0011
- Idea mean
- 0.001
- Effect (Δ)
- -0.0001 (−6.0%; negative = idea better)
- Wins
- 8 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±1.8%
- Mechanism
- Confirmed ✓
- Practical effect
- Helps
- Baseline tuning
- swept over 3 configs
The benchmark uses a small 1-D Poisson/Jacobi surrogate rather than a full 2-D Benamou-Brenier PDHG layer with CNN mobility, and graph-node counts are an activation-memory proxy rather than peak GPU memory or allocator measurements. Wall-clock backward speed, multi-GPU behavior, larger grids, nonlinear active-set effects, and the full requested r sweep were not tested; the protocol used r=8 with a three-point learning-rate sweep.
How to run: python3 run_bench.py
Artifacts
- REPORT.md 2.5 KB View
- bench_report.json 2.8 KB View Raw
- jfb_experiment.py 5.6 KB View Raw
- poisson_jfb_track.py 0.9 KB View Raw
- report.md 1.5 KB View
- report_bench_2026-08-31T151850.md 5.2 KB View
- results.json 8.4 KB View Raw
- run_bench.py 5.2 KB View Raw