Proposition 4 (ii): the temperature-scaled next-token loss tends to the margin
ProvedPlatonicJEPA.next_token_prediction_margin_limitLet a context be embedded by , let tokens in a finite nonempty vocabulary have vectors , and let . Then does not depend on the target token , and as . So the temperature-scaled loss tends to the margin
which vanishes if and only if the target attains the maximal logit.
import Mathlib import Definitions.Def_PlatonicJEPA_Basic open MeasureTheory Filter Topology
namespace PlatonicJEPA
theorem next_token_prediction_margin_limit {V : Type*} [Fintype V] [Nonempty V] {k : ℕ}
(w : V → Fin k → ℝ) (h : Fin k → ℝ) (y : V) :
Tendsto (fun t : ℝ => t * ntpAntiCollapse w (fun i => h i / t)) (𝓝[>] 0)
(𝓝 (⨆ v, ∑ i, h i * w v i)) ∧
Tendsto (fun t : ℝ => t * ntpLoss w (fun i => h i / t) y) (𝓝[>] 0)
(𝓝 ((⨆ v, ∑ i, h i * w v i) - ∑ i, h i * w y i)) ∧
0 ≤ (⨆ v, ∑ i, h i * w v i) - ∑ i, h i * w y i ∧
((⨆ v, ∑ i, h i * w v i) - ∑ i, h i * w y i = 0 ↔ ∀ v, ∑ i, h i * w v i ≤ ∑ i, h i * w y i) := by sorry
end PlatonicJEPARead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Fix:
- a natural number , which may be ;
- a finite, nonempty set (the "vocabulary");
- an arbitrary family of vectors , one for each , with no constraints;
- an arbitrary vector ;
- an arbitrary element .
Write for the ordinary dot product on . Write for the score of token . Let
be the largest score; this maximum exists because is finite and nonempty. For , the definitions used are the log-sum-exp term and the next-token loss:
The sum inside the logarithm is strictly positive, so no junk value of arises. For a real parameter , let denote the vector with coordinates . The statement asserts all four of the following simultaneously, with no further hypotheses.
- As through strictly positive values (one-sided limit from the right), converges to :
- As , converges to the margin :
- This margin is nonnegative:
- The margin equals if and only if for every . In other words, it is zero exactly when attains the maximum score. Ties are allowed, and a maximiser need not be unique.
Edge cases included by the quantifiers.
- : every score is , so and the margin is .
- a single element: necessarily is that element, and the margin is .
- : all scores are . Then is constant, and both limits are .
- Values of : only near matters. The behaviour at , including the division by , plays no role.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.