Edge of stability: two solvable toys

Companion to Training Dynamics NB2 §3 (td2_3_edge_of_stability). Time is counted in steps k here; the notebook's continuous time is t = kη.

1. Self-stabilization (§2.2, §2.8)

Gradient descent on L(x, y) = ½ y x² + c y⁻⁵, c = 62.5. The coordinate y is the curvature along x, which is the sharpness S near x = 0 (for y ≳ 2.6); ℓ(y) = c y⁻⁵ pushes it up (progressive sharpening). Each step also adds noise of size 10⁻³ to x, a floor for the unstable direction (in a real network: other directions, minibatch noise, round-off).

sharpness S = yk2/ηk
xk (flips sign every step at EoS)±σ, central-flow amplitude
loss L(xk, yk) (log scale)
presets:
mean of S, last 1000 steps
2/η (final)
mean x², last 1000 steps
σ² = −2ℓ′/S′ = 10c(η/2)⁶
peak loss

2. The catapult (§2.7)

The exact maps of the width-n model f = vᵀu/√n, one input, target 0, L = ½f²: f′ = f(1 − ηλ + η²f²/n), λ′ = λ + (ηf²/n)(ηλ − 4). Start at f₀ = 1.

loss ½fk² (log scale)½n (catapult scale f² ~ n)
ηλk2 (stability edge)4 (divergence edge in this model)
presets:
final ηλ
peak loss (step)
early-growth estimate of steps to the f² ~ n scale, ln n / (2 ln(ηλ₀ − 1)) (ignores curvature feedback)

Both panels iterate the maps exactly; nothing is fitted. A check script (checks/eos_toy_and_catapult_check.py) runs the simulation code below under Node and compares it with a Python implementation.