Theorem 2, pp. 15–16 (corrected: positive recurrence of the label-free configuration) — above load b_max/t_{b_max} every scheduler diverges; below it every work-conserving K-FCFS scheduler is stable
ProvedLLMThroughput.TokenBudget.theorem_2Throughput optimality of work-conserving scheduling. Consider the basic LLM queueing model. The batch processing time is under Assumption 1, with . The arrival counts are i.i.d. with finite mean . The request sizes are i.i.d., independent of the arrivals, take values in , and have means . Write for the total number of unprocessed tokens.
- Instability. If
then for every scheduling algorithm and every admissible initial state,
- Stability. If
then for every and every work-conserving K-FCFS scheduling algorithm there is a finite set of configurations with the following property. For every admissible initial state whose requests have at most unprocessed prefill and at most unprocessed decode tokens each, the first time at which the configuration lies in has finite expectation. A configuration is the remaining batch time together with the token counts of the requests in arrival order, with the labels forgotten.
The threshold is the largest token processing rate of any schedule. Below it, every work-conserving K-FCFS algorithm keeps the system stable, so these algorithms are throughput-optimal; above it, nothing can.
Formalization Note Slots are 0-based. The policy is a function of the current state, labels included, and is required to be feasible (and, in part 2, work-conserving and K-FCFS) at every admissible state. In part 2 the set is chosen before the initial state. The expectation is the Lebesgue integral of the hitting time in , so a time that is infinite with positive probability has infinite expectation. The boundary case is not covered, as in the source.
Differences from the source:
- correction: part (b), "the DTMC is positive recurrent" → there is a finite set of label-free configurations (remaining time and the token counts in label order) whose hitting time has finite expectation from every admissible initial state with size-bounded requests; reason: as printed the claim is false for the labelled state (5). With , , , , (load ) and Sarathi-Serve (work-conserving and K-FCFS with ), contains the request labelled and no larger label, so no state recurs. The labelled process is not even Markov once the newest request has departed. The configuration process is the chain the paper's Foster–Lyapunov argument (p. 45) works with, and finite expected return to a finite set is Foster's form of positive recurrence
- generalization: the initial state in the paper's state space → in part (a) any admissible state, in part (b) any admissible state whose requests satisfy , , with the policy's defining conditions required at every admissible state; reason: consists of admissible states whose requests obey the paper's size bounds (, for all ), and runs from stay in . A policy defined on extends to all admissible states (e.g. greedy oldest-first off ), which is feasible, work-conserving and K-FCFS with . The size bound cannot be dropped in part (b): with (), and a work-conserving policy that idles whenever the supply (9) is below , a single initial request with and never moves, so no finite serves every
- generalization: the policy is a function of the labelled state (5) → a function of the state (5) together with the next arrival label; reason: more policies are covered, and the paper's policies ignore the extra field
- encoding: feasibility (6a)–(6d) → (6a)–(6d) plus ; reason: implicit in "unprocessed decode tokens"
- encoding: real, → and , , ; reason: integer slots force integer , and the other conditions only exclude cases where or is undefined
- encoding: two independent i.i.d. sequences with → measurable maps,
iIndepFunandIdentDistribwithin each sequence, the sequences independent as random elements of and , and integrable; reason: the same assumptions in Lean's vocabulary. is finite in the paper (p. 42) - encoding: slots and request indices → 0-based slots and labels, with the state carrying the next label; reason: Lean convention; same instances
- encoding: almost surely →
∀ᵐ ω, Tendsto |X(n)| atTop atTop; reason: same statement
import Mathlib import Definitions.Def_LLMThroughput_TokenBudget_Model
namespace LLMThroughput.TokenBudget
open MeasureTheory ProbabilityTheory Filter Topology
open scoped ENNReal
theorem theorem_2 {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ]
(P : Params) (hP : P.Valid) (vpmax vdmax : ℕ) (a : ℕ → Ω → ℕ) (v : ℕ → Ω → ℕ × ℕ)
(hA : IIDArrivals μ a v vpmax vdmax) :
-- (a) instability under every scheduling algorithm
((P.bmax : ℝ) / (P.t P.bmax : ℝ) < arrivalRate μ a * (meanPrefill μ v + meanDecode μ v) →
∀ π : Policy, IsScheduler P π → ∀ x : State, Admissible P.bmax x →
∀ᵐ ω ∂μ, Tendsto
(fun n => totalTokens (run P π x (fun m => a m ω) (fun i => v i ω) n)) atTop atTop) ∧
-- (b) stability under every work-conserving K-FCFS algorithm
(arrivalRate μ a * (meanPrefill μ v + meanDecode μ v) < (P.bmax : ℝ) / (P.t P.bmax : ℝ) →
∀ (K : ℕ) (π : Policy), IsScheduler P π → IsWorkConserving P π → IsKFCFS P K π →
∃ F : Finset (ℕ × List (ℕ × ℕ)), ∀ x : State, Admissible P.bmax x →
(∀ r ∈ x.reqs, r.P ≤ vpmax ∧ r.D ≤ vdmax) →
∫⁻ ω, ((hitTime F (run P π x (fun m => a m ω) (fun i => v i ω)) : ℕ∞) : ℝ≥0∞) ∂μ
< ⊤) := by sorry
end LLMThroughput.TokenBudget
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.