Section SJ · SignSGD: drift and volatility
Proved in Lean
Lemma SJ.8 (Whitening a coordinate)
Let \(Q\) be orthogonal with first column \(\Sigma^{1/2}e_p/\sqrt{v_p}\) and put \(A\defeq Q^\T\Sigma^{1/2}\Delta\). Then \(\norm A_\F^2=2\cR\), the entry \(A_{1j}\) equals \(\mu_{pj}\), row \(1\) of \(A\) has squared norm \(R_p\), column \(j\) of \(A\) has squared norm \(C_j\), and \(\sign(G^\circ_{pj})\) has the law of \(\sign(G^A_{1j})\), where \(G^A\) is the isotropic gradient of the state \(A\). In particular Proposition SJ.3 applies to \((p,j)\) with \(F^2=2\cR\), \(\Delta_{ij}\) replaced by \(\mu_{pj}\), and \(\norm{\bar A}_\F^2=2\cR-R_p-C_j+\mu_{pj}^2\), whenever this is at least \(\cR/2\) and \(B\ge4\); its comparison term is
\[
\sqrt{\frac2\pi}\,\mathcal N_B\frac{\mu_{pj}}{\sqrt{2\cR}}=\frac{\mathcal N_B\,(\Sigma\Delta)_{pj}}{\sqrt{\pi\cR\,v_p}} .
\]
Proof.
Represent the output feature as \(y=\Sigma^{1/2}Qz\) with \(z\) standard Gaussian. Since \(Q^\T\Sigma^{1/2}e_p=\sqrt{v_p}\,e_1\), the coordinate is \(y_p=\sqrt{v_p}\,z_1\), and the residual is \(y^\T\Delta x=z^\T Ax\). Hence
\[
\big(y^\T\Delta x\big)\,y_px_j=\sqrt{v_p}\,\big(z^\T Ax\big)\,z_1x_j ,
\]
and the positive factor \(\sqrt{v_p}\) does not change the sign of the batch sum. Row \(1\) of \(A\) is \(e_p^\T\Sigma\Delta/\sqrt{v_p}\) and column \(j\) has squared norm \(\Delta_{\cdot j}^\T\Sigma\Delta_{\cdot j}\), and \(\norm A_\F^2=\Tr(\Sigma\Delta\Delta^\T)\). The deleted block has the squared norm left after removing row \(1\) and column \(j\).
Uses
- Proposition SJ.3 Drift of one coordinate
Used by
- Lemma SJ.9 Deletion estimates
- Proposition SJ.6 Coordinate errors in Frobenius norm
Lean
Proved in Lean
Muon.SignSGD.lem_app_sgd_whitening_i source
theorem lem_app_sgd_whitening_i {n m B : ℕ} (hN : 0 < n) (Sg : Matrix (Fin n) (Fin n) ℝ)
(hSg : Sg.PosSemidef) (Δ : Matrix (Fin n) (Fin m) ℝ) (p : Fin n) (hp : 0 < Sg p p)
(Q : Matrix (Fin n) (Fin n) ℝ) (hQ : Qᵀ * Q = 1)
(hQc : ∀ k, Q k ⟨0, hN⟩ = CFC.sqrt Sg k p / Real.sqrt (Sg p p)) (j : Fin m) :
(batchLaw n m B).map (fun β => Real.sign (physGrad Δ (linBatch (CFC.sqrt Sg) β) p j))
= (batchLaw n m B).map (fun β =>
Real.sign (physGrad (whitenedState Sg Δ Q)
(linBatch (1 : Matrix (Fin n) (Fin n) ℝ) β) ⟨0, hN⟩ j)) := byMuon.SignSGD.lem_app_sgd_whitening_ii source
theorem lem_app_sgd_whitening_ii {n m : ℕ} (hN : 0 < n) (Sg : Matrix (Fin n) (Fin n) ℝ)
(hSg : Sg.PosSemidef) (Δ : Matrix (Fin n) (Fin m) ℝ) (p : Fin n) (hp : 0 < Sg p p)
(Q : Matrix (Fin n) (Fin n) ℝ) (hQ : Qᵀ * Q = 1)
(hQc : ∀ k, Q k ⟨0, hN⟩ = CFC.sqrt Sg k p / Real.sqrt (Sg p p)) (j : Fin m) :
(∑ i, ∑ l, whitenedState Sg Δ Q i l ^ 2 = riskTwo Sg Δ) ∧
whitenedState Sg Δ Q ⟨0, hN⟩ j = whMu Sg Δ p j ∧
(∑ l, whitenedState Sg Δ Q ⟨0, hN⟩ l ^ 2 = whR Sg Δ p) ∧
(∑ i, whitenedState Sg Δ Q i j ^ 2 = whC Sg Δ j) := byMuon.SignSGD.lem_app_sgd_whitening_iii source
theorem lem_app_sgd_whitening_iii {n m B : ℕ} (hN : 0 < n) (Sg : Matrix (Fin n) (Fin n) ℝ)
(hSg : Sg.PosSemidef) (Δ : Matrix (Fin n) (Fin m) ℝ) (p : Fin n) (hp : 0 < Sg p p)
(Q : Matrix (Fin n) (Fin n) ℝ) (hQ : Qᵀ * Q = 1)
(hQc : ∀ k, Q k ⟨0, hN⟩ = CFC.sqrt Sg k p / Real.sqrt (Sg p p)) (j : Fin m) :
frobNorm (whitenedState Sg Δ Q) = Real.sqrt (riskTwo Sg Δ) ∧
(∑ k, ∑ l, sgdDeletedBlock (whitenedState Sg Δ Q) ⟨0, hN⟩ j k l ^ 2
= riskTwo Sg Δ - whR Sg Δ p - whC Sg Δ j + whMu Sg Δ p j ^ 2) ∧
(Real.sqrt (2 / Real.pi) * batchConst B * whMu Sg Δ p j / Real.sqrt (riskTwo Sg Δ)
= batchConst B * (Sg * Δ) p j / Real.sqrt (Real.pi * (riskTwo Sg Δ / 2) * Sg p p)) ∧
(4 ≤ B → riskTwo Sg Δ / 4 ≤ ∑ k, ∑ l, sgdDeletedBlock (whitenedState Sg Δ Q) ⟨0, hN⟩ j k l ^ 2 →
frobNorm (whitenedState Sg Δ Q) / 2
≤ frobNorm (sgdDeletedBlock (whitenedState Sg Δ Q) ⟨0, hN⟩ j)) := by