Theorem 2: the stop-gradient signal is essential for success
ProvedSSLWithoutPairs.stop_gradient_essentialUnder the data model of Lemma 1, with finite second moments and , consider SimSiam () without stop-gradient. The objective is then differentiated through both branches. Let
where is the Kronecker product. Then:
- For all , , so the gradient flow with weight decay reads .
- is positive semidefinite for every .
- If is any trajectory, follows for , and , then .
Without the stop-gradient the representation collapses.
Formalization Note stacks columns, so the entry of at index is . In item 3 the gradient at time is a matrix , characterised by its partial derivatives.
import Mathlib import Definitions.Def_SSLWithoutPairs_Basic open MeasureTheory ProbabilityTheory Filter Topology Matrix
namespace SSLWithoutPairs
theorem stop_gradient_essential {n₁ n₂ : ℕ} (μ : Measure (Fin n₁ → ℝ)) [IsProbabilityMeasure μ]
(κ : Kernel (Fin n₁ → ℝ) (Fin n₁ → ℝ)) [IsMarkovKernel κ]
(h2 : ∀ i, Integrable (fun q : (Fin n₁ → ℝ) × (Fin n₁ → ℝ) => q.2 i ^ 2) (μ ⊗ₘ κ))
(η : ℝ) (hη : 0 ≤ η) :
(∀ (Wp : Matrix (Fin n₂) (Fin n₂) ℝ) (W : Matrix (Fin n₂) (Fin n₁) ℝ) (i : Fin n₂) (j : Fin n₁),
HasDerivAt
(fun s : ℝ => byolLoss μ κ Wp (W + s • Matrix.single i j 1) (W + s • Matrix.single i j 1))
((noStopH (augMeanCorr μ κ) (augCov μ κ) η Wp *ᵥ Matrix.vec W) (j, i) - η * W i j) 0) ∧
(∀ Wp : Matrix (Fin n₂) (Fin n₂) ℝ, (noStopH (augMeanCorr μ κ) (augCov μ κ) η Wp).PosSemidef) ∧
(∀ (Wp : ℝ → Matrix (Fin n₂) (Fin n₂) ℝ) (W G : ℝ → Matrix (Fin n₂) (Fin n₁) ℝ),
(∀ t : ℝ, 0 ≤ t → ∀ i j, HasDerivAt
(fun s : ℝ => byolLoss μ κ (Wp t) (W t + s • Matrix.single i j 1)
(W t + s • Matrix.single i j 1)) (G t i j) 0) →
HasMatDerivOn W (fun t => -G t - η • W t) →
∀ lam0 : ℝ, 0 < lam0 →
(∀ t : ℝ, 0 ≤ t → lam0 ≤ minEig (noStopH (augMeanCorr μ κ) (augCov μ κ) η (Wp t))) →
Tendsto W atTop (𝓝 0)) := by sorry
end SSLWithoutPairsRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Fix natural numbers (either may be ). Let be a probability measure on , the data distribution. Let be a Markov kernel from to , so that for each , is a probability measure on (the augmentation distribution of ). Assume:
- Second moments: for every coordinate , the map is integrable with respect to the joint law , where and then .
- Weight decay: is a real number with . The case is allowed.
All integrals below are Bochner integrals, which by convention take the value when the integrand is not integrable.
Objects used.
- Augmentation mean. For , let be the mean of :
- The matrices and . These are matrices defined by
Both are symmetric by construction.
- The loss. For an matrix and matrices , set
The expectation is over followed by two views drawn independently from .
- The matrix . For an matrix , is the matrix, with rows and columns indexed by pairs , given by
Here is the Kronecker product, so that
-
Vectorisation. is the vector indexed by the same pairs, with (columns stacked).
-
Minimal eigenvalue. is the infimum of the set of real roots of the characteristic polynomial of . If there are no real roots (in particular when ), the infimum of the empty set is taken to be .
-
Unit matrices. denotes the matrix with a in entry and elsewhere.
The theorem asserts the conjunction of three statements.
- Gradient formula without stop-gradient. For every matrix , every matrix , and every , , consider the real function
The online weight and the target weight are both set to and are both perturbed. This function is differentiable at , with derivative
-
Positive semidefiniteness. For every matrix , is positive semidefinite. That is, it is symmetric and for every real vector .
-
Convergence. Let be any function from to matrices. Let and be any functions from to matrices. Suppose:
- (a) for every and all , the function has derivative at ;
- (b) for every and every entry, has derivative
This derivative is taken within , so it is one-sided at .
- (c) there is a real such that for all .
Then (entrywise) as .
Remarks on what is and is not assumed.
- In statement 3 nothing at all is assumed about how evolves. No differential equation, continuity, or boundedness is required; only the eigenvalue bound (c) involves .
- Values of , , at play no role.
- If or , then equals by the empty-infimum convention. Hypothesis (c) then cannot hold with , so statement 3 is vacuous in that case.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.