Two-sided conditioned DFA
Implementation & benchmark of arXiv:2607.18574 — Conditioned Direct Feedback Alignment via Activity and Error Geometry
Source paper: Conditioned Direct Feedback Alignment via Activity and Error Geometry arXiv:2607.18574 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Replace the raw DFA outer-product update with a damped left-right preconditioned update that whitens both presynaptic activity directions and local-error directions. The activity factor removes nuisance-dominated input anisotropy, while the error factor equalizes postsynaptic credit coordinates; separate damping prevents noisy error covariances from destabilizing training.
Formulas
Mathematical statement
For layer \(\ell\), let \(h_{\ell-1}\in\mathbb{R}^{d_{\ell-1}}\) be the presynaptic activation, \(a_\ell\in\mathbb{R}^{d_\ell}\) the preactivation, \(\phi'\) the elementwise derivative, \(e\in\mathbb{R}^{d_o}\) the output error, and \(B_\ell\in\mathbb{R}^{d_\ell\times d_o}\) a fixed DFA feedback matrix. The paper defines \(\delta_\ell^{\mathrm{DFA}}=(B_\ell e)\odot\phi'(a_\ell)\) and \(G_\ell^{\mathrm{DFA}}=\delta_\ell^{\mathrm{DFA}}h_{\ell-1}^{\top}\), where \(\odot\) denotes elementwise multiplication. It defines uncentered second moments \(C_{A,\ell}=\mathbb{E}[h_{\ell-1}h_{\ell-1}^{\top}]\) and \(C_{E,\ell}=\mathbb{E}[\delta_\ell^{\mathrm{DFA}}(\delta_\ell^{\mathrm{DFA}})^{\top}]\). Use damped inverses \(P_{A,\ell}=(C_{A,\ell}+\lambda_A I_{d_{\ell-1}})^{-1}\) and \(P_{E,\ell}=(C_{E,\ell}+\lambda_E I_{d_\ell})^{-1}\), where \(\lambda_A,\lambda_E>0\), and update \(W_\ell\) with \(W_\ell\leftarrow W_\ell-\eta P_{E,\ell}G_\ell^{\mathrm{DFA}}P_{A,\ell}\). Left multiplication corrects error-coordinate anisotropy and right multiplication corrects activity-coordinate anisotropy. The factorization \(P_E(\delta h^\top)P_A=(P_E\delta)(P_Ah)^\top\) preserves a local outer-product implementation, while damping limits amplification from small covariance eigenvalues.
Implementation notes
Integrate this at the hidden-layer weight-update site of an MLP or small CNN trained with direct feedback alignment. For every minibatch and layer, compute the usual DFA error \(\delta=(Be)\odot\phi'(a)\) and raw batch gradient \(G=\frac{1}{m}\sum_{i=1}^m\delta_i h_i^\top\), where \(m\) is batch size. Maintain exponential moving averages \(C_A\leftarrow\beta C_A+(1-\beta)\frac{1}{m}\sum_i h_i h_i^\top\) and \(C_E\leftarrow\beta C_E+(1-\beta)\frac{1}{m}\sum_i\delta_i\delta_i^\top\). Every update, or every K updates for speed, solve linear systems using Cholesky factors for \(P_A=(C_A+\lambda_A I)^{-1}\) and \(P_E=(C_E+\lambda_E I)^{-1}\); do not explicitly materialize inverses. Apply \(\Delta W=-\eta P_EGP_A\). Equivalently, transform each factor before accumulating the outer product: \(\tilde\delta_i=P_E\delta_i\), \(\tilde h_i=P_Ah_i\), then use \(\Delta W=-\eta m^{-1}\sum_i\tilde\delta_i\tilde h_i^\top\). The mathematics determines the second moments and inverse preconditioners; estimate them empirically. Initialize with \(\beta=0.99\), \(\lambda_A=10^{-3}\operatorname{tr}(C_A)/d_{\ell-1}\), and the more conservative \(\lambda_E=10^{-2}\operatorname{tr}(C_E)/d_\ell\), increasing \(\lambda_E\) if updates become unstable. First test a 2--3 hidden-layer tanh MLP on MNIST and Fashion-MNIST. Compare raw DFA, activity-only conditioning \((P_E=I)\), error-only conditioning \((P_A=I)\), and two-sided conditioning using matched learning-rate sweeps, feedback matrices, and parameter counts. Measure validation accuracy, loss versus optimizer steps, update norms, covariance condition numbers, wall-clock time, and divergence frequency. Success means reproducible accuracy or loss-descent gains over raw DFA and activity-only DFA at equal steps; failure means no gain after accounting for covariance-maintenance overhead.
Verification
Stage 1 · Toy mechanism gate: Passed ✓
Stage 2 · Mechanism transferred to benchmark: Not reproduced ✗
Stage 2 · Practical benchmark result: Significantly worse ✗
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 two-sided conditioned DFA MVP with EMA activity/error covariances, damped linear solves, mechanism checks, and matched raw/activity-only/error-only/two-sided DFA training runs. The required mechanism manifested: outer-product factorization error was 1.22e-15, the anisotropy sweep exactly matched predicted transformed-covariance ratios, scalar two-sided gain matched 1/((cE+lambdaE)(cA+lambdaA)) to numerical precision, and an independent 200k-sample covariance check had maximum error 0.0068. In training, two-sided DFA improved over raw DFA (83.6% vs 78.5%), but activity-only was better (86.9%) and conditioning incurred substantial overhead, so this is mechanism-confirmed rather than a demonstrated overall optimization win.
- Agent confidence
- 8/10
- Baseline
- Raw DFA: accuracy 0.7853 +/- 0.0342, loss 0.6339, 0/3 divergences, 0.49 s mean.
- Idea
- Two-sided DFA: accuracy 0.8356 +/- 0.0173, loss 0.4318, 0/3 divergences, 49.72 s mean; activity-only reached 0.8687 accuracy and 0.3272 loss, while error-only reached 0.5356 accuracy and 0.9626 loss.
Limitations: Only a small synthetic anisotropic 3-class MLP was tested, not MNIST, Fashion-MNIST, or CNNs. Learning-rate sweeps, K-step preconditioner refreshes, Cholesky implementations, FLOP-normalized comparisons, and broader damping/beta studies were not tested; wall-clock measurements were CPU-only and reflect repeated dense linear solves.
How to run: python3 experiment.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2607.18574)
Significantly WORSE than the tuned baseline (+27.1%, p=0.0081, wins 0 / 8 paired seeds).
- Benchmark
- Tabular regression (Friedman)
- Model
- mlp_tiny
- Paired seeds
- 8
- Baseline mean
- 17.4778
- Idea mean
- 22.2062
- Effect (Δ)
- 4.7284 (+27.1%; negative = idea better)
- Wins
- 0 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±6.7%
- Mechanism
- Not confirmed ✗
- Practical effect
- Hurts
- Baseline tuning
- swept over 3 configs
Only the registered tabular Friedman regression track was tested, using mlp_tiny, 400 training samples, 400 test samples, 12 epochs, and the shared three-value learning-rate grid. Activity-only and error-only ablations, broader damping and beta sweeps, larger datasets, other architectures, wall-clock normalization, and FLOP accounting were not tested.
How to run: python3 stage2_bench.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Stage 2 — Benchmark latest Failed ✗
Agent confidence: 9/10
Two-sided conditioned DFA was implemented as the training-update intervention on the registered tabular Friedman regression track with the shared mlp_tiny architecture. The idea was significantly worse than tuned raw DFA: test MSE 22.2062 versus 17.4778, paired delta +4.7284, permutation p=0.0081, and 0/8 paired wins. Therefore the benchmark system correctly yields worked=false.
- Baseline
- Raw DFA, best lr=0.001: test MSE 17.477807760238647 +/- 1.5610336422417328 over 8 seeds.
- Idea
- Two-sided conditioned DFA, best lr=0.01: test MSE 22.206230878829956 +/- 1.2034773425543663 over 8 seeds.
- Mechanism signature
- Not confirmed across all trained seeds; mean observed conditioned/raw update-norm ratio was 4.144475221633911.
Benchmark result
Significantly WORSE than the tuned baseline (+27.1%, p=0.0081, wins 0 / 8 paired seeds).
- Benchmark
- Tabular regression (Friedman)
- Model
- mlp_tiny
- Paired seeds
- 8
- Baseline mean
- 17.4778
- Idea mean
- 22.2062
- Effect (Δ)
- 4.7284 (+27.1%; negative = idea better)
- Wins
- 0 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±6.7%
- Mechanism
- Not confirmed ✗
- Practical effect
- Hurts
- Baseline tuning
- swept over 3 configs
Only the registered tabular Friedman regression track was tested, using mlp_tiny, 400 training samples, 400 test samples, 12 epochs, and the shared three-value learning-rate grid. Activity-only and error-only ablations, broader damping and beta sweeps, larger datasets, other architectures, wall-clock normalization, and FLOP accounting were not tested.
How to run: python3 stage2_bench.py
Artifacts
- bench_report.json 5.9 KB View Raw
- experiment.py 6.2 KB View Raw
- report.md 1.6 KB View
- report_bench_2026-08-31T123046.md 4.2 KB View
- results.json 16.4 KB View Raw
- stage2_bench.py 7.4 KB View Raw