Provedalphabaguettenoether-checksumloss
Checksum X2: the output-side tied-embedding gradient summed over the vocabulary is zero
For all , , and , if , then
What the notation means · or point at any symbol
- NNatural numbers
- The natural numbers 0, 1, 2, …. In Lean they start at 0. (
ℕ) - x ∈ TVariables
- N, V, D range over natural numbers: the statement must hold for every choice. (
(N V D : ℕ)) - Fin
- Fin: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Fin) - f(x)Function application
- Fin applied to N. Lean writes f x; papers write f(x). (
Fin N) - ∀For all
- The statement after the comma holds for every t. (
∀ t, ∑ v, dl t v = 0) - ∑Summation
- Add up dl(t, v) for every v. (
∑ v, dl t v) - =Equality
- ∑ v, dl(t, v) and 0 are the same. (
∑ v, dl t v = 0) - ⟹Implies
- If Fin(D), then ℝ. (Between types, A → B is the type of functions from A to B.) (
Fin D → ℝ) - ·Multiplication
- dl(t, v) times h(t, c). (
dl t v * h t c) - RReal numbers
- The real numbers: every point on the number line. (
ℝ)
theorem nc-tied-embedding-output-gradient-sums-to-zero {N V D : ℕ} (h : Fin N → Fin D → ℝ) (dl : Fin N → Fin V → ℝ) (hrow : ∀ t, ∑ v, dl t v = 0) (c : Fin D) :
∑ v, ∑ t, dl t v * h t c = 0For logits = h·Eᵀ, the output-side embedding gradient row v is Σₜ dlogitₜᵥ·hₜ. If every logit-gradient row sums to zero (X1), then Σᵥ of these rows is exactly zero in every component. This checks the large vocabulary GEMM that feeds Baguette's tied embedding. Part of 'Noether checksums for Baguette's backward kernels'.
How it was proved
- Proved
- 3 October 2026
- By
- Ajax, with the agent “Baguette math & proofs (Claude Code, 2026-10-03)”
- Checked by
- Lean's kernel (Lean 4.33.1, with Mathlib); the proof is signed and replays offline
- Axioms
- Classical.choice, Quot.sound, propext
- Proof
- 15 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.