Two days ago I wrote about a multi-perspective diagnostic framework that found a hidden bug in a fluid dynamics solver. The tool — scaffold arrays — measures the same system from 26 simultaneous perspectives and uses the pattern of agreement and disagreement to diagnose what's happening.
Yesterday I pointed it at something completely different: a neural network learning to make decisions.
The same tool. The same diagnostic principle. A completely different domain. And it produced the same structural finding.
The Experiment
A neural gate is the simplest possible adaptive decision: given an input, should I go left or right? It's a single sigmoid neuron with a weight vector that learns from data via gradient descent. Nothing exotic — this is the atom of machine learning.
I treated the gate's learning process as a dynamical system. The weight trajectory w(t) evolves over time as the gradient updates it. The question: does this trajectory converge to a stable policy, and how can you tell?
The scaffold array measures the learning trajectory from multiple perspectives. Instead of different truncation levels (as in fluids), the perspectives are different learning rates. Run the same gate on the same data at seven learning rates (0.001 to 1.0) and compute the contraction ratio between consecutive rates. If they converge: the learning is stable. If they diverge: something is wrong. And the pattern of which diagnostics pass and which fail tells you what.
The Finding
I ran four experiments: linearly separable data (easy), XOR data (impossible for a single gate), concentric circles (impossible), and extreme learning rates (potentially unstable). Here's what the scaffold showed:
| Experiment | Loss | Weights | Gradients | Output | γ | Pattern |
|---|---|---|---|---|---|---|
| Linear (easy) | PASS | FAIL | PASS | PASS | -0.69 | Function converges, weights don't |
| XOR (impossible) | PASS | PASS | PASS | PASS | -9.19 | Everything converges (healthy failure) |
| Circles (impossible) | PASS | PASS | PASS | PASS | -9.15 | Everything converges (healthy failure) |
| Extreme η | FAIL | FAIL | FAIL | FAIL | -0.67 | Everything diverges (unstable) |
Four experiments, four different scaffold patterns. The tool discriminates.
What the Patterns Mean
The easy case: function converges, weights don't
On linearly separable data, the gate's output (average activation) converges across all learning rates — contraction ratio 0.63. But the weights diverge — ratio 2.16. Higher learning rates produce larger weights that encode the same decision boundary more sharply.
This is the same pattern I found in fluid dynamics. In the Navier-Stokes scaffold, the per-shell cascade balance (the function-level diagnostic) converged while the total enstrophy (the parameter-level diagnostic) diverged. The physics was stable; the measurement framework was over-parameterised. Same thing here: the gate's decision is stable; the weights are over-parameterised.
The impossible cases: healthy failure
On XOR and concentric circles — problems a single gate cannot solve — everything converges. All contraction ratios below 0.7. The gradient cascade exponent is -9.2: gradients vanish extremely fast.
The gate rapidly learns it can't solve the problem and stops trying. Every learning rate arrives at the same conclusion: the best a linear classifier can do is random guessing (loss ≈ 0.69). This is healthy failure — the system doesn't oscillate, doesn't diverge, doesn't waste compute. It converges to its limit and stays there.
The unstable case: everything diverges
At extreme learning rates (1 to 100), every diagnostic diverges. The gate's output depends critically on the learning rate — ratio 3.14 for the activation mean. The system isn't converging to anything; each learning rate takes a wildly different trajectory.
This is the analogue of the Euler equations in fluid dynamics: without regularisation (viscosity in fluids, moderate learning rate in ML), the Galerkin truncation doesn't converge. The scaffold catches this immediately.
The Structural Finding: γ < 0 Everywhere
The column that matters most is γ — the gradient cascade exponent. It measures how the gradient magnitude changes over the course of training. If γ is negative, gradients shrink over time. If positive, they grow.
In every experiment, γ is negative. The gradients always decay. The gate is intrinsically self-regularising.
Now compare with the fluid dynamics results:
| Domain | γ | What it measures |
|---|---|---|
| Navier-Stokes (ν > 0) | -1.5 | Energy cascade across wavenumbers |
| Euler (ν = 0) | -1.7 | Inviscid cascade |
| SQG (critical) | -2.0 | 2D quasi-geostrophic cascade |
| MHD (kinetic) | -0.4 | Velocity cascade in MHD |
| Neural gate | -0.1 to -9.2 | Gradient cascade across iterations |
Five domains. Every single one: γ < 0. The cascade — whether it's energy in a fluid or gradients in a neural network — weakens over time. The system self-regulates.
In fluids, this is a property of the Leray projection (the mathematical structure that enforces incompressibility). In neural gates, it's a property of the sigmoid activation and the gradient flow through it. Different mechanisms, same structural outcome: the transfer of information (energy / gradients) from large scales to small scales naturally attenuates.
Why This Matters
The scaffold array was built to diagnose convergence in fluid dynamics simulations. It found a hidden bug, identified the mechanism preventing blow-up, and validated across four fluid equations.
Now it works on learning dynamics too. Not because I redesigned it — the code is literally the same contraction ratio computation. The only change was what I plugged in: learning rates instead of truncation levels, loss trajectories instead of energy trajectories.
This suggests the scaffold array isn't a domain-specific tool. It's a general diagnostic for any system where you can define "resolution levels" and measure the same quantity across them.
The applications are immediate:
- Weather forecasting models — scaffold across grid resolutions. The failure pattern tells you whether a forecast feature is real or a grid artefact.
- Climate simulations — scaffold across parameterisation schemes. Diagnose whether long-term drift is physical or numerical.
- Autonomous systems — scaffold across sensor configurations. Does the decision change with the sensor setup? If so, the pattern tells you which sensor is the problem.
- Drug discovery simulations — scaffold across molecular dynamics time steps. Distinguish genuine conformational changes from integrator artefacts.
- Financial models — scaffold across calibration windows. Diagnose whether a trading signal is robust or window-dependent.
- Any adaptive system — scaffold across hyperparameters. The contraction ratio pattern diagnoses convergence, over-parameterisation, instability, and healthy failure — all from the same framework.
The Deeper Point
There's a reason the same diagnostic works on fluids and neural networks. Both are nonlinear dynamical systems with a conservation structure (energy in fluids, loss landscape geometry in ML) and a cascade (energy transfer between scales, gradient flow between layers). The scaffold array measures the cascade's convergence properties. If the cascade weakens at fine scales (γ < 0), the system self-regularises. If it strengthens (γ > 2), the system blows up.
The number γ — the cascade exponent — is the single most informative diagnostic for any system with this structure. And the scaffold array measures it from enough perspectives to tell you whether it's genuine or artefactual.
I didn't set out to build a universal diagnostic. I set out to understand why a fluid dynamics solver was producing wrong answers. The tool I built to answer that question turned out to answer a much bigger one: how do you know if an adaptive system is working?
You measure it from multiple perspectives. You compute the cascade exponent. If γ < 0, it's self-regularising. If the contraction ratios pass, it's converging. If some pass and others fail, the pattern tells you what's wrong.
One diagnostic. Any domain. Same principle.
Try It
The neural gate experiments run in seconds on any laptop. The fluid dynamics experiments run in minutes. All code is open.
- Neural gate scaffold: github.com/senuamedia/lab/domains/neural-gates
- Fluid dynamics scaffold: github.com/senuamedia/lab/domains (navier-stokes, euler, sqg, mhd)
- NS paper: Zenodo
- Cross-domain paper: Zenodo
- Lab site: lab.senuamedia.com
If you work with adaptive systems — ML, control theory, simulation, optimisation — try the scaffold on your own problem. Define your resolution levels. Compute the contraction ratios. See what pattern emerges.
Rod Higgins is the founder of Senuamedia and the creator of the Simplex programming language. The scaffold array methodology is documented at lab.senuamedia.com.