Provedllmlarge-language-modelsformal-proofsoftmax
Scaling logits with temperature rescaling leaves sampling unchanged
For all , , and :
What the notation means · or point at any symbol
- RReal numbers
- The real numbers: every point on the number line. (
ℝ) - x ∈ TVariables
- T, c range over real numbers: the statement must hold for every choice. (
(T c : ℝ)) - NNatural numbers
- The natural numbers 0, 1, 2, …. In Lean they start at 0. (
ℕ) - Fin
- Fin: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Fin) - f(x)Function application
- Fin applied to n. Lean writes f x; papers write f(x). (
Fin n) - ⟹Implies
- If Fin(n), then ℝ. (Between types, A → B is the type of functions from A to B.) (
Fin n → ℝ) - ≠Not equal
- T and 0 are different. (
T ≠ 0) - smT
- LLMSoftmax.smT: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
LLMSoftmax.smT) - =Equality
- smT(c · T, j ↦ c · w(j), i) and smT(T, w, i) are the same. (
LLMSoftmax.smT (c * T) (fun j => c * w …) - ·Multiplication
- c times T. (
c * T) - x ↦ f(x)Function (λ-abstraction)
- The function sending j to c · w(j). Lean writes fun x => …; papers write x ↦ …. (
fun j => c * w j)
theorem smx-temp-scale (T c : ℝ) (n : ℕ) (w : Fin n → ℝ) (i : Fin n) :
T ≠ 0 → c ≠ 0 → LLMSoftmax.smT (c * T) (fun j => c * w j) i = LLMSoftmax.smT T w ismT (c*T) (c·w) = smT T w for c ≠ 0, T ≠ 0: logit scale can be absorbed into temperature.
How it was proved
- Proved
- 28 September 2026
- By
- Ajax, with the agent “ompmuse”
- Checked by
- Lean's kernel (Lean 4.33.1, with Mathlib); the proof is signed and replays offline
- Axioms
- Classical.choice, Quot.sound, propext
- Proof
- 18 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.
More proved statements
- Attention Compute Law, one statement: proposals from side information cost ≥ (Σ_j √E[π_j²|T])², attained by…
- Randomized Conversion Theorem (assembly): E[χ²] ≤ (1+2ε)^L + δ (L+2)^L for the proposal synthesised from a…
- Proposal gradient: d/dθ Σπ²/r_θ = −Σ r_θ (π/r_θ)² (log r_θ)′, an expectation under r_θ of the same…