Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

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

Proved
LLMThroughput.TokenBudget.theorem_2

by mikedeng1 · Oct 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

llm-inferencep2o-batch-pfp2ap2o-correctedp2o-gran-per-chapterp2o-plan-paperp2o-strengthenedp2o-v1positive-recurrencequeueingstabilitythroughput-optimality

Throughput optimality of work-conserving scheduling. Consider the basic LLM queueing model. The batch processing time is tb=c+a⌈b/b0⌉t_b=c+a\lceil b/b_0\rceiltb​=c+a⌈b/b0​⌉ under Assumption 1, with tbmax⁡≥1t_{b_{\max}}\ge 1tbmax​​≥1. The arrival counts ana_nan​ are i.i.d. with finite mean λ\lambdaλ. The request sizes (vp(i),vd(i))(v_p(i),v_d(i))(vp​(i),vd​(i)) are i.i.d., independent of the arrivals, take values in [1,vpmax⁡]×[1,vdmax⁡][1,v_p^{\max}]\times[1,v_d^{\max}][1,vpmax​]×[1,vdmax​], and have means mp,mdm_p,m_dmp​,md​. Write ∣X(n)∣=∑i∈Qn(Pi(n)+Di(n))|X(n)|=\sum_{i\in Q_n}(P_i(n)+D_i(n))∣X(n)∣=∑i∈Qn​​(Pi​(n)+Di​(n)) for the total number of unprocessed tokens.

  1. Instability. If
λ(mp+md)>bmax⁡tbmax⁡,\lambda(m_p+m_d)>\frac{b_{\max}}{t_{b_{\max}}},λ(mp​+md​)>tbmax​​bmax​​,

then for every scheduling algorithm and every admissible initial state,

P{lim⁡n→∞∣X(n)∣=∞}=1.\mathbb P\Big\{\lim_{n\to\infty}|X(n)|=\infty\Big\}=1 .P{n→∞lim​∣X(n)∣=∞}=1.
  1. Stability. If
λ(mp+md)<bmax⁡tbmax⁡,\lambda(m_p+m_d)<\frac{b_{\max}}{t_{b_{\max}}},λ(mp​+md​)<tbmax​​bmax​​,

then for every KKK and every work-conserving K-FCFS scheduling algorithm there is a finite set FFF of configurations with the following property. For every admissible initial state whose requests have at most vpmax⁡v_p^{\max}vpmax​ unprocessed prefill and at most vdmax⁡v_d^{\max}vdmax​ unprocessed decode tokens each, the first time n≥1n\ge 1n≥1 at which the configuration lies in FFF has finite expectation. A configuration is the remaining batch time together with the token counts (Pi,Di)(P_i,D_i)(Pi​,Di​) of the requests in arrival order, with the labels forgotten.

The threshold bmax⁡/tbmax⁡b_{\max}/t_{b_{\max}}bmax​/tbmax​​ 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 FFF is chosen before the initial state. The expectation is the Lebesgue integral of the hitting time in N∪{∞}\mathbb N\cup\{\infty\}N∪{∞}, so a time that is infinite with positive probability has infinite expectation. The boundary case λ(mp+md)=bmax⁡/tbmax⁡\lambda(m_p+m_d)=b_{\max}/t_{b_{\max}}λ(mp​+md​)=bmax​/tbmax​​ is not covered, as in the source.

Differences from the source:

  • correction: part (b), "the DTMC {X(n)}\{X(n)\}{X(n)} is positive recurrent" → there is a finite set FFF 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 an≡1a_n\equiv 1an​≡1, v≡(1,1)v\equiv(1,1)v≡(1,1), c=0c=0c=0, a=1a=1a=1, b0=bmax⁡=4b_0=b_{\max}=4b0​=bmax​=4 (load 2<42<42<4) and Sarathi-Serve (work-conserving and K-FCFS with K=1K=1K=1), X(n+1)X(n+1)X(n+1) contains the request labelled nnn 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 X\mathcal XX → in part (a) any admissible state, in part (b) any admissible state whose requests satisfy Pi≤vpmax⁡P_i\le v_p^{\max}Pi​≤vpmax​, Di≤vdmax⁡D_i\le v_d^{\max}Di​≤vdmax​, with the policy's defining conditions required at every admissible state; reason: X\mathcal XX consists of admissible states whose requests obey the paper's size bounds (vp(i)≤vpmax⁡v_p(i)\le v_p^{\max}vp​(i)≤vpmax​, vd(i)≤vdmax⁡v_d(i)\le v_d^{\max}vd​(i)≤vdmax​ for all iii), and runs from X\mathcal XX stay in X\mathcal XX. A policy defined on X\mathcal XX extends to all admissible states (e.g. greedy oldest-first off X\mathcal XX), which is feasible, work-conserving and K-FCFS with K=1K=1K=1. The size bound cannot be dropped in part (b): with an≡0a_n\equiv 0an​≡0 (λ=0\lambda=0λ=0), bmax⁡≥2b_{\max}\ge 2bmax​≥2 and a work-conserving policy that idles whenever the supply (9) is below bmax⁡b_{\max}bmax​, a single initial request with P=0P=0P=0 and D=ND=ND=N never moves, so no finite FFF serves every NNN
  • 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 δid≤Di\delta^d_i\le D_iδid​≤Di​; reason: implicit in "unprocessed decode tokens"
  • encoding: a,c≥0a,c\ge 0a,c≥0 real, b0∣bmax⁡b_0\mid b_{\max}b0​∣bmax​ → a,c∈Na,c\in\mathbb Na,c∈N and 1≤b01\le b_01≤b0​, 1≤bmax⁡1\le b_{\max}1≤bmax​, 1≤tbmax⁡1\le t_{b_{\max}}1≤tbmax​​; reason: integer slots force integer a,ca,ca,c, and the other conditions only exclude cases where ⌈b/b0⌉\lceil b/b_0\rceil⌈b/b0​⌉ or bmax⁡/tbmax⁡b_{\max}/t_{b_{\max}}bmax​/tbmax​​ is undefined
  • encoding: two independent i.i.d. sequences with λ=E[a1]\lambda=E[a_1]λ=E[a1​] → measurable maps, iIndepFun and IdentDistrib within each sequence, the sequences independent as random elements of NN\mathbb N^{\mathbb N}NN and (N2)N(\mathbb N^2)^{\mathbb N}(N2)N, and a1a_1a1​ integrable; reason: the same assumptions in Lean's vocabulary. λ\lambdaλ is finite in the paper (p. 42)
  • encoding: slots 1,2,…1,2,\dots1,2,… and request indices 1,2,…1,2,\dots1,2,… → 0-based slots and labels, with the state carrying the next label; reason: Lean convention; same instances
  • encoding: lim⁡n→∞∣X(n)∣=∞\lim_{n\to\infty}|X(n)|=\inftylimn→∞​∣X(n)∣=∞ almost surely → ∀ᵐ ω, Tendsto |X(n)| atTop atTop; reason: same statement
Preamble
import Mathlib
import Definitions.Def_LLMThroughput_TokenBudget_Model
Formal statement
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
Source
Dai, Deng, Li & Peng, Throughput-Optimal Scheduling Algorithms for LLM Inference and AI Agents, arXiv:2504.07347v3, pp. 15–16, Theorem 2 (eqs. (10)–(12)); model §3.1 pp. 12–14, Assumption 1 p. 11, work-conserving and K-FCFS p. 15
Human review
  • Endorsed by Shuze Chen · Oct 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 24, 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