Phases of Muoncompanion
Section SA · Setup: model, momentum, regularized SignSVD, normalization
Proved in Lean
Proposition SA.6 (Startup and bias correction)
In the frozen-state model let \(K\in\R^{\Nout\times\Nin}\) be deterministic and let \((M_t^K)_{t\ge-1}\) be the recursion \(M_t^K=\bmom M_{t-1}^K+(1-\bmom)G_{t+1}\) started from \(M_{-1}^K=K\). Then for \(t\ge0\),
\begin{equation}\tag{SA.34} \begin{gathered} M_t^K=\bmom^{t+1}K+\sum_{j=0}^t\emaw{j}G_{t+1-j},\qquad \EE M_t^K=\bmom^{t+1}K+(1-\bmom^{t+1})\,\EE\Gt,\\ \Cov(\operatorname{vec}M_t^K)=\sw2\big(1-\bmom^{2(t+1)}\big)\Sigma_G . \end{gathered} \end{equation}
The bias-corrected zero-start buffer \(\widetilde M_t\defeq M_t^0/(1-\bmom^{t+1})\) has mean \(\EE\Gt\) and covariance \(\sw2\,\frac{1+\bmom^{t+1}}{1-\bmom^{t+1}}\Sigma_G\). If \(M_t^K\) and the stationary buffer \(\Mt\) are built from the same batches, then
\begin{equation}\tag{SA.35} M_t^K-\Mt=\bmom^{t+1}(K-M_{-1}),\qquad \EE\norm{M_t^K-\Mt}_\F^2=\bmom^{2(t+1)}\big(\norm{K-\EE\Gt}_\F^2+\sw2\mathsf V_B\big). \end{equation}
Proof.
The explicit form is an induction on \(t\), the case \(t=0\) being \(M_0^K=\bmom K+(1-\bmom)G_1\). The mean and covariance follow from the finite geometric sums
\[ \sum_{j=0}^t\emaw j=1-\bmom^{t+1},\qquad \sum_{j=0}^t\emaw j^2=(1-\bmom)^2\,\frac{1-\bmom^{2(t+1)}}{1-\bmom^2}=\sw2\big(1-\bmom^{2(t+1)}\big), \]
and the independence of the batches. Dividing by \(1-\bmom^{t+1}>0\) gives the bias-corrected moments, using \((1-\bmom^{2(t+1)})/(1-\bmom^{t+1})^2=(1+\bmom^{t+1})/(1-\bmom^{t+1})\).
The coupling follows by subtracting the two recursions, whose difference is \(M_t^K-\Mt=\bmom(M_{t-1}^K-M_{t-1})\), and iterating down to \(t=-1\). Since \(\EE M_{-1}=\EE\Gt\) and \(\EE\norm{M_{-1}-\EE\Gt}_\F^2=\sw2\mathsf V_B\) by Lemma SA.5(iii), expanding the square gives the second identity of (SA.35).

Uses

Used by

Lean

Proved in Lean
Muon.Setup.startup_weight_sum source
theorem startup_weight_sum {β : ℝ} (hβ0 : 0 ≤ β) (hβ1 : β < 1) (t : ℕ) :
    ∑ j ∈ Finset.range (t + 1), emaW β j = 1 - β ^ (t + 1) := by
Muon.Setup.startup_weight_sq_sum source
theorem startup_weight_sq_sum {β : ℝ} (hβ0 : 0 ≤ β) (hβ1 : β < 1) (t : ℕ) :
    ∑ j ∈ Finset.range (t + 1), emaW β j ^ 2 = sPow β 2 * (1 - β ^ (2 * (t + 1))) := by
Muon.Setup.startup_bias_corrected_variance_scalar source
theorem startup_bias_corrected_variance_scalar {β : ℝ} (hβ0 : 0 ≤ β) (hβ1 : β < 1) (t : ℕ) :
    sPow β 2 * (1 - β ^ (2 * (t + 1))) / (1 - β ^ (t + 1)) ^ 2
      = sPow β 2 * (1 + β ^ (t + 1)) / (1 - β ^ (t + 1)) := by
Muon.Setup.startupBuf source
def startupBuf (F : FrozenParams m n B) (S : FrozenSamples P m n B) (K : Mat m n) :
    ℕ → Ω → Mat m n
  | 0 => fun _ => K
  | k + 1 => fun ω =>
      F.β • startupBuf F S K k ω + (1 - F.β) • frozenBatchG F S ((k : ℤ) + 1) ω

private lemma sb_explicit (F : FrozenParams m n B) (S : FrozenSamples P m n B) (K : Mat m n)
    (ω : Ω) (k : ℕ) :
    startupBuf F S K k ω = F.β ^ k • K +
      ∑ j ∈ Finset.range k, emaW F.β j • frozenBatchG F S ((k : ℤ) - (j : ℤ)) ω := by
Muon.Setup.prop_app_setup_startup_i source
theorem prop_app_setup_startup_i (F : FrozenParams m n B) (S : FrozenSamples P m n B)
    (K : Mat m n) (t : ℕ) (ω : Ω) :
    startupBuf F S K (t + 1) ω = F.β ^ (t + 1) • K +
      ∑ j ∈ Finset.range (t + 1), emaW F.β j • frozenBatchG F S ((t : ℤ) + 1 - (j : ℤ)) ω := by
Muon.Setup.prop_app_setup_startup_ii source
theorem prop_app_setup_startup_ii [IsProbabilityMeasure P] (F : FrozenParams m n B)
    (S : FrozenSamples P m n B) (K : Mat m n) (t : ℕ) :
    mean P (startupBuf F S K (t + 1)) = F.β ^ (t + 1) • K +
        (1 - F.β ^ (t + 1)) • mean P (frozenBatchG F S ((t : ℤ) + 1)) ∧
      covT P (startupBuf F S K (t + 1)) =
        (sPow F.β 2 * (1 - F.β ^ (2 * (t + 1)))) • SigmaG S F := by
Muon.Setup.prop_app_setup_startup_iii source
theorem prop_app_setup_startup_iii [IsProbabilityMeasure P] (F : FrozenParams m n B)
    (S : FrozenSamples P m n B) (t : ℕ) :
    mean P (fun ω => (1 - F.β ^ (t + 1))⁻¹ • startupBuf F S 0 (t + 1) ω) =
        mean P (frozenBatchG F S ((t : ℤ) + 1)) ∧
      covT P (fun ω => (1 - F.β ^ (t + 1))⁻¹ • startupBuf F S 0 (t + 1) ω) =
        (sPow F.β 2 * ((1 + F.β ^ (t + 1)) / (1 - F.β ^ (t + 1)))) • SigmaG S F := by
Muon.Setup.prop_app_setup_startup_iv source
theorem prop_app_setup_startup_iv [IsProbabilityMeasure P] (F : FrozenParams m n B)
    (S : FrozenSamples P m n B) (K : Mat m n) (t : ℕ) :
    (∀ᵐ ω ∂P, startupBuf F S K (t + 1) ω - frozenBuf F S (t : ℤ) ω =
        F.β ^ (t + 1) • (K - frozenBuf F S (-1) ω)) ∧
      ∫ ω, (fro (startupBuf F S K (t + 1) ω - frozenBuf F S (t : ℤ) ω)) ^ 2 ∂P =
        F.β ^ (2 * (t + 1)) *
          ((fro (K - mean P (frozenBatchG F S 0))) ^ 2 + sPow F.β 2 * frozenVB S F) := by