Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proposition 4 (ii): the temperature-scaled next-token loss tends to the margin

Proved
PlatonicJEPA.next_token_prediction_margin_limit

by Xeroth · Nov 23, 2026 · Mathlib 0df444a (Lean v4.33.1)

machine-learningplatonic-representation-hypothesisrepresentation-learningspectral-theory

Let a context be embedded by h∈Rkh\in\mathbb{R}^kh∈Rk, let tokens vvv in a finite nonempty vocabulary have vectors wvw_vwv​, and let A(h)=log⁡∑ve⟨h,wv⟩A(h)=\log\sum_ve^{\langle h,w_v\rangle}A(h)=log∑v​e⟨h,wv​⟩. Then AAA does not depend on the target token yyy, and tA(h/t)→max⁡v⟨h,wv⟩tA(h/t)\to\max_v\langle h,w_v\rangletA(h/t)→maxv​⟨h,wv​⟩ as t→0+t\to0^+t→0+. So the temperature-scaled loss t(−⟨h/t,wy⟩+A(h/t))t\big(-\langle h/t,w_y\rangle+A(h/t)\big)t(−⟨h/t,wy​⟩+A(h/t)) tends to the margin

max⁡v⟨h,wv⟩−⟨h,wy⟩≥0,\max_v\langle h,w_v\rangle-\langle h,w_y\rangle\ge0,vmax​⟨h,wv​⟩−⟨h,wy​⟩≥0,

which vanishes if and only if the target attains the maximal logit.

Preamble
import Mathlib
import Definitions.Def_PlatonicJEPA_Basic

open MeasureTheory Filter Topology
Formal statement
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 PlatonicJEPA
Source
Balestriero and LeCun, Proving and Improving the Platonic Representation Hypothesis with JEPAs, arXiv:2610.39302v1 (2026), Section 2.3, Proposition 4 (ii), eq. (6), p. 6
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting. Fix:

  • a natural number kkk, which may be 000;
  • a finite, nonempty set VVV (the "vocabulary");
  • an arbitrary family of vectors wv∈Rkw_v \in \mathbb{R}^kwv​∈Rk, one for each v∈Vv \in Vv∈V, with no constraints;
  • an arbitrary vector h∈Rkh \in \mathbb{R}^kh∈Rk;
  • an arbitrary element y∈Vy \in Vy∈V.

Write ⟨a,b⟩=∑iaibi\langle a, b\rangle = \sum_{i} a_i b_i⟨a,b⟩=∑i​ai​bi​ for the ordinary dot product on Rk\mathbb{R}^kRk. Write sv=⟨h,wv⟩s_v = \langle h, w_v\ranglesv​=⟨h,wv​⟩ for the score of token vvv. Let

S=max⁡v∈VsvS = \max_{v \in V} s_vS=v∈Vmax​sv​

be the largest score; this maximum exists because VVV is finite and nonempty. For u∈Rku \in \mathbb{R}^ku∈Rk, the definitions used are the log-sum-exp term and the next-token loss:

A(u)=log⁡∑v∈Vexp⁡⟨u,wv⟩,L(u,y)=−⟨u,wy⟩+A(u).A(u) = \log \sum_{v \in V} \exp\langle u, w_v\rangle, \qquad L(u, y) = -\langle u, w_y\rangle + A(u).A(u)=logv∈V∑​exp⟨u,wv​⟩,L(u,y)=−⟨u,wy​⟩+A(u).

The sum inside the logarithm is strictly positive, so no junk value of log⁡\loglog arises. For a real parameter t>0t > 0t>0, let h/th/th/t denote the vector with coordinates hi/th_i / thi​/t. The statement asserts all four of the following simultaneously, with no further hypotheses.

  1. As t→0t \to 0t→0 through strictly positive values (one-sided limit from the right), t⋅A(h/t)t \cdot A(h/t)t⋅A(h/t) converges to SSS:
lim⁡t→0+t log⁡∑vexp⁡ ⁣(sv/t)=max⁡vsv.\lim_{t \to 0^+} t \,\log \sum_{v} \exp\!\big(s_v / t\big) = \max_{v} s_v.t→0+lim​tlogv∑​exp(sv​/t)=vmax​sv​.
  1. As t→0+t \to 0^+t→0+, t⋅L(h/t,y)t \cdot L(h/t, y)t⋅L(h/t,y) converges to the margin S−syS - s_yS−sy​:
lim⁡t→0+t(−syt+log⁡∑vexp⁡(sv/t))=max⁡vsv−sy.\lim_{t \to 0^+} t\Big(-\tfrac{s_y}{t} + \log \sum_{v} \exp(s_v/t)\Big) = \max_{v} s_v - s_y.t→0+lim​t(−tsy​​+logv∑​exp(sv​/t))=vmax​sv​−sy​.
  1. This margin is nonnegative:
max⁡vsv−sy≥0.\max_v s_v - s_y \ge 0.vmax​sv​−sy​≥0.
  1. The margin equals 000 if and only if sv≤sys_v \le s_ysv​≤sy​ for every v∈Vv \in Vv∈V. In other words, it is zero exactly when yyy attains the maximum score. Ties are allowed, and a maximiser need not be unique.

Edge cases included by the quantifiers.

  • k=0k = 0k=0: every score is 000, so S=0S = 0S=0 and the margin is 000.
  • VVV a single element: necessarily yyy is that element, and the margin is 000.
  • h=0h = 0h=0: all scores are 000. Then A(h/t)=log⁡∣V∣A(h/t) = \log |V|A(h/t)=log∣V∣ is constant, and both limits are 000.
  • Values of ttt: only t>0t > 0t>0 near 000 matters. The behaviour at t≤0t \le 0t≤0, including the division by t=0t = 0t=0, plays no role.
Human review
  • Endorsed by Shuze Chen · Nov 23, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Xeroth · Nov 23, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me