ViT-Tiny §1a tie — the SGD-inline train step, all 200 parameters at the real backward chain #
What this file is. The T3 §1a tie of verified_mlir/vit_train_step.mlir — the per-example
SGD-inline step ViTRender.lean still writes — at the fused θ − lr·g ops:
vit_net_tied_certified (the last theorem) threads all 200 ViT-Tiny parameters through the
committed multi-head (3 heads, d_head 64), depth-12, vector-LayerNorm forward and the loss-driven
backward cotangent chain. Its batched peer at the un-fused gradient node, the smoothed loss and a
batch binder — the chain every vitin_* accuracy comes from — is ViTTiePoCGB.vit_net_tiedGB,
built from this file's block ties by batchMap / batchMapAux.
The file has two layers:
vit_block_tiedMHV/vit_block_tiedAtMHV— one multi-head (3 heads, d_head 64) vector-LN block, generic in the cotangent: the two residual fan-ins (vitCotHV,vitCotXinV), the three-way fan-in at LN₁ (vitCotLn1), and the per-head SDPA backward (ViTMultiHeadChain'svitCotD{Q,K,V}mh).vit_net_tied_certified— the 200-parameter capstone: the 192 block parameters threaded through all 12 blocks, the final LN, the classifier and the patch embed (vit_cls_dencovers the CLS token atN = 1).
Every conjunct delegates to a ViTPoC.*_den fold lemma at the chain cotangent — zero new ops,
zero new bridges. The vector-LN granularity that ships ([192] γ/β) is what is modelled.
Multi-head promotion (3 heads, d_head=64) — the committed-render block tie #
The committed vitTrainStepRenderV is multi-head: the SDPA-internal backward dAtt → dQ/dK/dV
runs per head (vitCotD{Q,K,V}mh, ViTMultiHeadChain), so the Q/K/V dense cotangents are the
multi-head …mh ones rather than the single-head vitCotD{Q,K,V}; everything else (the out-proj
Wo, LN₂, the MLP) is head-agnostic. vitBlockTiedMHV states the block's 16 parameter ties with
those cotangents (no separate ss/p saves — the per-head scores/weights are recomputed inside the
…mh cots from the saved Q/K); every conjunct delegates to a head-agnostic §1-fold generic
ViTPoC.*_den. @[irreducible] wrappers keep the 12-block composition opaque.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Multi-head forward + cot-in + input-only block wrappers (@[irreducible], the thread template) #
Multi-head forward block step (the committed render's block forward = vitBlockSpelledMHV,
which IS transformerBlockV at general heads by vitBlockSpelledMHV_eq).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Multi-head attention-residual fan-in: the block-input cotangent the chain hands upstream
(vitCotXinV at the multi-head Q/K/V dense cots — vitCotLn1 Wq Wk Wv dQmh dKmh dVmh IS the
multi-head LN₁ fan-in vitCotLn1MH). Recomputes the saves from xin (the vitBlockSpelledMHV
let-chain, multi-head att).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Multi-head input-only block tie — recompute the 9 saves from xin, then vit_block_tiedMHV.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The multi-head input-only block tie holds — unfold the saves, delegate to vit_block_tiedMHV.
Task 3 — the non-block param bundle + the all-200-params capstone (committed ViT-Tiny config) #
vitFinalLNTied/vitHeadTied/vitEmbedTied bundle the final vector-LN γ/β, the classifier Wcls/bcls,
and the patch-embed wConv/bConv/cls/pos as den = certified at their chain cotangents — each a direct
delegation to the §1-fold generics (ViTPoC.*_den), with the cls op (denseBiasSgdB N=1) folded by
vit_cls_den (its row-0 batch slice IS cls_token_grad, closed by vit_render_cls_certified). Then
vit_net_tied_certified threads the REAL forward + loss-driven backward and bundles all 200 params.
Final vector-LN γF/βF tied at the classifier-back cot vitCotFl.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Patch embed wConv/bConv/cls/pos tied at the embed-output cot dyEmbed.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The whole depth-12 MULTI-HEAD ViT-Tiny train step, tied — ALL 200 params (the vit peer of
convnext's cnx_net_tied_certified, at the committed config: 3 heads, d_head=64, D=192, N=196,
mlpDim=768, 10 classes, 16×16 patches). The real forward patchEmbed → 12 multi-head vector-LN blocks → final vector-LN → CLS-slice → dense head and the loss-driven backward cotangent chain
(the per-block multi-head fan-ins, the final-LN-back vitCotB2outV, the classifier-back vitCotFl,
the embed-output cot = block-1's vitBlockCotInAtMHV output) are threaded, and EVERY param op
denotes the certified loss-descent step: the 12 blocks' 192 params (vitBlockTiedAtMHV), the
final-LN γ/β, the classifier Wcls/bcls, and the patch-embed wConv/bConv/cls/pos — 200/200, the
FIRST net with zero param gaps (vit has the patch-weight cert). 3-axiom clean.