The LAMB triple, assembled — the peer of adamW_triple_faithful #
Lamb.lean gives the ℝ reference (lambDir, lambTrust, lambScale) and StableHLO.lean
gives each emitted op its own den (lambDirF_faithful, lambScaleF_faithful,
gradSumSqAccF_faithful). What was missing is the level above: the (θ', m', v') a train step
returns per parameter, which is what adamW_triple_faithful states for AdamW and what
planning/archive/proofs_tier_to_paper_nets.md §3.5 needs before ResNet-50's T3 can be written at
resnet50in160_lambaccdp8x64bce.
⛔ The audit's "LAMB has NO faithfulness theorem" was wrong in the part that named a cause.
Lamb.lean does prove properties of the trust ratio and nothing else, but lambDirF_faithful
and lambScaleF_faithful have said the emitted ops denote lambDir and lambScale since LAMB
landed, both by rfl and both at adamWParamF_faithful's bar. Only the assembly was absent.
The four ops, as ResNet34RenderB's .lamb arm emits them #
%r = lambDirF (θ, m, v, %b1 %ob1 %b2 %ob2 %bc1 %bc2 %eps %wd) g -- r = m̂/(√v̂+ε) + wd·θ
%n2 = gradSumSqAccF %lzero θ -- ‖θ‖², THIS tensor's own
%s = lambScaleF %n2 %r -- trust(‖θ‖²,‖r‖) · r
%θ' = sgdParamF θ %lr %s -- θ − lr · that
%m' = adamMNextF … g %v' = adamVNextF … g -- LAMB's m and v ARE Adam's
What is proved #
lambStep— the ℝ triple,(sgdParam lr θ (lambScale wn2 (lambDir …)), adamMNext, adamVNext).lamb_triple_faithful— the emitted four-op composition denotes it,rfl, at an ARBITRARY scalar child. The trust ratio's‖θ‖²is a graph operand, so the general statement is the one the AST supports and the two shipped instantiations are corollaries.- ⭐
lamb_triple_faithful_committed— at the render's own seed (gradSumSqAccFfrom%lzerooverθalone, one leaf deep), the scalar ISgradSumSq θ. That single-leaf fold is the entire difference from the global-norm clip, whose content is that ONE scalar is shared (clipFactor_sharedagainstlambScale_not_shared); the two emit nearly the same lines. - ⭐⭐
lamb_triple_faithful_excluded/lambScale_zero_weight— theno_weight_decaygroup (D2) feeds%lzerostraight in as the scalar, and the step is then EXACTLYθ − lr·r: trust is 1, not 0 and not0/0. timm readsif weight_decay != 0 or group['always_adapt']:before computing the ratio, so an excluded parameter takes a plain Adam step; this says the render's "skip the op and pass the zero" implements that, rather than only that the guard does not crash.
What is NOT claimed #
⚠ Faithfulness and well-definedness only, Lamb.lean's ceiling verbatim: that the rendered
LAMB denotes these functions, never that LAMB converges or beats AdamW.
⚠ The accumulated form is the same tail at a different gradient node. .lambAccum k emits
these four ops character-for-character against Gt (the momVNextF-at-μ := akeep accumulator)
rather than against g, so lamb_triple_faithful covers it at e := that node — the theorem is
∀ e. Likewise the clip, which sits between the two.
⚠ One replica. Under *dp* the gradient node feeds allReduceMeanF — the collective as an
AST node since 4d piece 2 (2026-09-07), until then emitted text outside the AST — so den e is
the per-replica gradient here and DataParallelNode.lean's adamW_at_allReduceMeanF is the
shape that composes a tail with the replica mean (DataParallel.lean, §4d).
lambStep and lambScale_zero_weight are Lamb.lean's (moved 2026-09-08).
The rendered LAMB triple is Proofs.lambStep — rfl, i.e. the four emitted ops compose
to exactly the ℝ definition, at adamW_triple_faithful's bar.
s is the scalar child carrying ‖θ‖²; it is a binder because the AST makes it one, and the
two shapes the render actually emits are the corollaries below. e is the gradient node,
also a binder, so the theorem covers the plain, accumulated, clipped and data-parallel
spellings without restatement.
⭐ The shipped scalar is THIS parameter's own squared norm. The render seeds
gradSumSqAccF at %lzero and folds over θ alone — one leaf deep, never across
parameters. That is the entire structural difference from clipGrad_faithful, which folds
the same op across every leaf and shares the result; the emitted lines are nearly identical
and the quantifier is the whole content (clipFactor_shared / lambScale_not_shared).
⭐⭐ D2, the no_weight_decay group: the emitted step IS a plain Adam step at trust 1.
timm reads if weight_decay != 0 or group['always_adapt']: before computing the ratio, so an
excluded parameter is NOT layer-adapted. The render implements that by skipping the norm op
and passing %lzero — the same zero the fold would have been seeded from — and this says the
result is θ − lr·r exactly, with lambDir untouched.
⚠ The pre-existing zero-norm guard does not already give this at the artifact. It fires at
‖θ‖ = 0 exactly, i.e. step one, where every BatchNorm β and dense bias starts; from step two
the parameter is small-but-nonzero and ‖θ‖/‖r‖ collapses to ~0.01–0.1 against timm's 1.0.
That is why lambTrust_zero_weight could hold while the render was still wrong.