Eq. (56), App. B.3, p. 41 — strong law of large numbers: E(n)/n → λ, V_p(N)/N → m_p, V_d(N)/N → m_d almost surely
ProvedLLMThroughput.TokenBudget.eq_56arrival-processiidp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1strong-law
Strong law for arrivals and token sizes. Work in the i.i.d. arrival model of §3.1. On a probability space the following hold:
- the arrival counts are i.i.d. with ;
- the sizes are i.i.d. with and ;
- the two sequences are independent.
Let and . Let be the number of requests arrived in the first slots, and let for . Then
These limits are the long-run arrival rates of requests and of prefill and decode work. The proof of Theorem 2(a) uses them, and so does the construction of fluid limits.
Formalization Note The first slots are slots , and sums requests . At the quotient is Lean's , which does not affect the limit. The random variables are measurable, and finiteness of is integrability of .
Differences from the source:
- encoding: two i.i.d. sequences and , independent of each other, with → measurable maps, mutually independent (
iIndepFun) and identically distributed (IdentDistrib) within each sequence, the two sequences independent as random elements of and , and integrable; reason: the same assumptions in Lean's vocabulary. The paper's is finite (p. 42, "the first moment assumption on ") - encoding: , → sums over the 0-based indices and ; reason: Lean convention; same quantities
Preamble
import Mathlib import Definitions.Def_LLMThroughput_TokenBudget_Model
Formal statement
namespace LLMThroughput.TokenBudget
open MeasureTheory ProbabilityTheory Filter Topology
theorem eq_56 {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ]
(vpmax vdmax : ℕ) (a : ℕ → Ω → ℕ) (v : ℕ → Ω → ℕ × ℕ)
(hA : IIDArrivals μ a v vpmax vdmax) :
∀ᵐ ω ∂μ,
Tendsto (fun n : ℕ => (arrivalsBefore (fun m => a m ω) n : ℝ) / n) atTop
(𝓝 (arrivalRate μ a)) ∧
Tendsto (fun N : ℕ => (∑ i ∈ Finset.range N, ((v i ω).1 : ℝ)) / N) atTop
(𝓝 (meanPrefill μ v)) ∧
Tendsto (fun N : ℕ => (∑ i ∈ Finset.range N, ((v i ω).2 : ℝ)) / N) atTop
(𝓝 (meanDecode μ v)) := by sorry
end LLMThroughput.TokenBudget
Source
Dai, Deng, Li & Peng, Throughput-Optimal Scheduling Algorithms for LLM Inference and AI Agents, arXiv:2504.07347v3, p. 41, eq. (56), App. B.3 (E(n), V_f(N) defined on p. 37, eq. (38); arrival model pp. 12–13)
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.