Summary of "A Deterministic Constant-Competitive Algorithm for Dynamic Mixture-of-Experts Serving"

Summary (Overview)

  • Main Result: The paper proves a deterministic O(1)O(1)-competitive algorithm for Dynamic Mixture-of-Experts (MoE) serving, improving on the prior deterministic O(k)O(k) baseline and matching the asymptotic performance of randomized approaches.
  • Key Theorem: For every number of experts mm and replica budget k1k \geq 1, the algorithm satisfies ALGdet10CPBOPT+(5CPB+8)k+16\mathrm{ALG}_{\det} \leq 10C_{\mathrm{PB}} \cdot \mathrm{OPT} + (5C_{\mathrm{PB}} + 8)k + 16, where CPBC_{\mathrm{PB}} is an absolute constant from the Positive Body Chasing theorem.
  • Novel Contribution: A deterministic pathwise rounding theorem that converts fractional allocations to integral ones with service distortion factor 3 and movement bounded by fractional movement plus 6k6k.
  • Formal Verification: The complete theorem is machine-checked in Lean 4, with the two-sparse positive-body chasing theorem as the sole scientific source premise.
  • Implication: Randomization is not asymptotically necessary for constant-competitive MoE serving.

Introduction and Theoretical Foundation

Background

Dynamic Mixture-of-Experts inference requires deciding how many replica GPUs to assign to each expert as workloads change over time. The core trade-off involves:

  • Switching costs: Moving replicas between experts incurs movement costs
  • Bottleneck latency: Insufficient replication increases service latency

Prior Work

  • Huang, Lou, and Xiao formalized this as an online problem and proved an O(logk)O(\sqrt{\log k}) randomized competitive ratio, with an Ω(logk)\Omega(\sqrt{\log k}) lower bound for an offset-Fenchel-dual maximization problem.
  • Vergeres proved a deterministic factor-16 bound for the equality-budget fractional relaxation and a randomized factor-48 integral bound via Lazy Threshold Rounding.
  • The previous deterministic baseline was Ω(1)\Omega(1) to O(k)O(k) — achieved by keeping a fixed integral allocation, which is within factor k+1k+1 of any fractional path since every fractional coordinate lies in [0,k][0, k].

Problem Model

Fix m1m \geq 1 experts and k1k \geq 1 replica GPUs. The integral state space is:

Xm,k={xZ0m:i=1mxi=k}X_{m,k} = \left\{x \in \mathbb{Z}_{\geq 0}^m: \sum_{i=1}^m x_i = k\right\}

At round tt, a nonnegative workload vector rtR0mr_t \in \mathbb{R}_{\geq 0}^m is revealed. The online algorithm chooses xtXm,kx_t \in X_{m,k} and pays:

ft(xt)+xtxt11,ft(x)=maxi[m]rt,i1+xif_t(x_t) + \|x_t - x_{t-1}\|_1, \qquad f_t(x) = \max_{i \in [m]} \frac{r_{t,i}}{1 + x_i}

Methodology

1. Finite Positive Approximation to Reciprocal Service

The epigraph of r/(1+u)r/(1+u) admits a finite positive-polyhedral inner approximation with constant distortion. For a workload coordinate rr and augmented allocation uu, the tangent is defined as:

Lr,p(u)=r(2pq)p2=r(2p1u)p2,q=1+uL_{r,p}(u) = \frac{r(2p - q)}{p^2} = \frac{r(2p - 1 - u)}{p^2}, \qquad q = 1+u

Lemma 2 (Tangent Envelope): For all r0r \geq 0, q>0q > 0, p>0p > 0:

rqLr,p(u)=r(qp)2qp20\frac{r}{q} - L_{r,p}(u) = \frac{r(q-p)^2}{qp^2} \geq 0

If 0u2k0 \leq u \leq 2k, some p{1,,2k+1}p \in \{1, \ldots, 2k+1\} satisfies Lr,p(u)34r1+uL_{r,p}(u) \geq \frac{3}{4}\frac{r}{1+u}.

This yields the finite envelope Hr(u)=max1p2k+1Lr,p(u)H_r(u) = \max_{1 \leq p \leq 2k+1} L_{r,p}(u) with:

34r1+uHr(u)r1+u(0u2k)(1)\frac{3}{4}\frac{r}{1+u} \leq H_r(u) \leq \frac{r}{1+u} \quad (0 \leq u \leq 2k) \tag{1}

The inequality sLr,p(u)s \geq L_{r,p}(u) is equivalent to the positive covering row (with support size at most 2):

p2r(2p1)s+12p1u1(2)\frac{p^2}{r(2p-1)}s + \frac{1}{2p-1}u \geq 1 \tag{2}

2. Event/Reset Reduction to Positive Body Chasing

Using augmented coordinates (u1,,um,s)(u_1, \ldots, u_m, s), the algorithm presents two types of bodies to the positive-body chaser:

Event body (when request rtr_t arrives):

Et={(u,s):iuik,sLrt,i,p(ui) for all i,p}(3)E_t = \left\{(u,s): \sum_i u_i \leq k, \quad s \geq L_{r_{t,i},p}(u_i) \text{ for all } i, p\right\} \tag{3}

Reset body (after the round-t action):

Rt={(u,s):iuik,sδt},δt=2t(t1)(4)R_t = \left\{(u,s): \sum_i u_i \leq k, \quad s \leq \delta_t\right\}, \qquad \delta_t = 2^{-t} \quad (t \geq 1) \tag{4}

The geometrically shrinking positive resets charge service cost to vertical movement.

3. Balanced Projection (Removing Resource Augmentation)

The chaser operates with resource augmentation ϵ=1\epsilon = 1, giving iui2k\sum_i u_i \leq 2k. The balanced projection maps to exact-budget fractional allocations:

ρ(u)=k12iuim,xi(u)=ui2+ρ(u)(6)\rho(u) = \frac{k - \frac{1}{2}\sum_i u_i}{m}, \qquad x_i(u) = \frac{u_i}{2} + \rho(u) \tag{6}

Lemma 4: The map satisfies x(u)0x(u) \geq 0, ixi(u)=k\sum_i x_i(u) = k, xi(u)ui/2x_i(u) \geq u_i/2, and:

x(u)x(v)1uv1\|x(u) - x(v)\|_1 \leq \|u - v\|_1

4. Deterministic Pathwise Rounding (Key Novelty)

For a fractional state zz with izi=k\sum_i z_i = k, define the required integral level:

i(z)=max{0,zi23}(12)\ell_i(z) = \max\left\{0, \left\lceil \frac{z_i - 2}{3} \right\rceil\right\} \tag{12}

This is the smallest nonnegative integer satisfying 1+zi3(1+i(z))1 + z_i \leq 3(1 + \ell_i(z)).

Repair Rule: Given previous integral state yy and current fractional state zz:

  1. Find least index ii with yi<i(z)y_i < \ell_i(z) and temporarily add one unit there
  2. Among positive coordinates, choose jj maximizing dj(w,z)=3wj1zjd_j(w,z) = 3w_j - 1 - z_j
  3. Remove one unit from jj (the "deep donor")
  4. Repeat until all coordinates meet their required levels

Top-unit potential:

Φ(y,z)=i(3yi1zi)+(15)\Phi(y,z) = \sum_i (3y_i - 1 - z_i)_+ \tag{15}

Lemma 5 (Deep Donor): Every nonnegative integral vector yy of mass k+1k+1 contains a positive coordinate jj with 3yj1zj13y_j - 1 - z_j \geq 1.

Lemma 6 (Repair Charge): Rz(y)y12(Φ(y,z)Φ(Rz(y),z))\|R_z(y) - y\|_1 \leq 2(\Phi(y,z) - \Phi(R_z(y), z))

Lemma 7 (External Variation): For fixed yy and exact-budget fractional states z,zz, z':

2(Φ(y,z)Φ(y,z))zz12(\Phi(y,z') - \Phi(y,z)) \leq \|z' - z\|_1

Theorem 8 (Deterministic Simplex Rounding): For every finite exact-budget fractional path z1,,zTz_1, \ldots, z_T and supplied y0Xm,ky_0 \in X_{m,k}, the repair rule produces a deterministic prefix-causal integral path satisfying:

1+zt,i3(1+yt,i)for every t,i(16)1 + z_{t,i} \leq 3(1 + y_{t,i}) \quad \text{for every } t, i \tag{16} t=1Tytyt116k+t=2Tztzt11(17)\sum_{t=1}^T \|y_t - y_{t-1}\|_1 \leq 6k + \sum_{t=2}^T \|z_t - z_{t-1}\|_1 \tag{17} tft(yt)3tft(zt)(18)\sum_t f_t(y_t) \leq 3\sum_t f_t(z_t) \tag{18}

Empirical Validation / Results

Main Theorem

Theorem 1 (Deterministic O(1)O(1)-competitive upper bound): For every m,k1m, k \geq 1 and every integral initial state, there is a causal deterministic integral online algorithm such that every finite nonnegative workload sequence satisfies:

ALGdet10CPBOPT+(5CPB+8)k+16\mathrm{ALG}_{\det} \leq 10C_{\mathrm{PB}} \cdot \mathrm{OPT} + (5C_{\mathrm{PB}} + 8)k + 16

The multiplicative constant is independent of mm, kk, the initial state, the horizon, and the workloads.

This gives the boxed competitive ratio bound:

CRdet(k)10CPBfor every k1\mathrm{CR}_{\det}(k) \leq 10C_{\mathrm{PB}} \quad \text{for every } k \geq 1

Since CPBC_{\mathrm{PB}} is absolute, CRdet(k)=Θ(1)\mathrm{CR}_{\det}(k) = \Theta(1) (the lower bound 1\geq 1 follows from the routine observation that every online path is feasible offline).

Proof Composition

The composition of results yields:

ALGdet(M+2k)+6k+3(43M+163)=5M+8k+1610CPBOPT+(5CPB+8)k+16\begin{aligned} \mathrm{ALG}_{\det} &\leq (M + 2k) + 6k + 3\left(\frac{4}{3}M + \frac{16}{3}\right) \\ &= 5M + 8k + 16 \\ &\leq 10C_{\mathrm{PB}} \cdot \mathrm{OPT} + (5C_{\mathrm{PB}} + 8)k + 16 \end{aligned}

where MCPB(k+2 OPT)M \leq C_{\mathrm{PB}}(k + 2\text{ OPT}) is the chaser's movement bound.

Formal Verification

The complete theorem is machine-checked in Lean 4.32.2 with pinned Mathlib 4.32.2. Key declarations:

  • dynamicMoe_explicit_deterministic_upper — the explicit deterministic upper bound
  • dynamicMoe_deterministic_theta_one — the Θ(1)\Theta(1) competitive ratio

The formalization uses the two-sparse positive-body consequence as its sole scientific premise. Lean reports only standard axioms (propext, Classical.choice, Quot.sound). The companion archive includes:

  • 33 focused tests
  • A 200-round oscillation control
  • A deliberately false rounding rule without hysteresis (demonstrating why the dead band is necessary)

Theoretical and Practical Implications

Theoretical Significance

  1. Resolves the deterministic gap: The prior deterministic bound was O(k)O(k); this paper achieves O(1)O(1), showing randomization is not asymptotically necessary for MoE serving.
  2. Novel rounding technique: The deterministic pathwise rounding theorem (Theorem 8) provides a general tool for converting fractional online algorithms to integral ones with constant service distortion and bounded movement stretch.
  3. Positive body reduction: The paper demonstrates how the MoE problem can be reduced to the Positive Body Chasing theorem, leveraging the d=2d=2 sparsity of the covering constraints.

Practical Implications

  • The algorithm provides a guaranteed competitive ratio independent of problem dimensions (expert count, replica budget, horizon).
  • The additive term (5CPB+8)k+16(5C_{\mathrm{PB}} + 8)k + 16 grows linearly with the replica budget but is independent of the expert count.
  • The model allocates replicas but does not model physical network topology, shared links, or routing.

Comparison with Prior Work

MethodTypeCompetitive Ratio
Huang, Lou, XiaoRandomizedO(logk)O(\sqrt{\log k})
Vergeres (fractional)DeterministicFactor 16
Vergeres (integral)RandomizedFactor 48
Previous deterministic baselineDeterministicO(k)O(k)
This paperDeterministicO(1)O(1) (factor 10CPB10C_{\mathrm{PB}})

Conclusion

Main Takeaways

  • The paper proves a deterministic O(1)O(1)-competitive algorithm for Dynamic MoE serving, closing the gap between deterministic and randomized approaches.
  • The key innovation is a deterministic pathwise rounding theorem with service distortion 3 and movement bounded by fractional movement plus 6k6k, replacing the need for Lazy Threshold Rounding.
  • The complete proof is machine-checked in Lean 4, providing formal verification relative to the Positive Body Chasing theorem.

Open Directions

  1. Sharper constants: The concrete bound 10CPB10C_{\mathrm{PB}} is not optimized; better numerical constants may be achievable.
  2. Efficiency: The paper does not claim polynomial-time implementation of the complete algorithm; explicit bit-complexity analysis remains open.
  3. Grid optimization: The concrete integer tangent grid uses O(mk)O(mk) covering rows per event; a geometric grid reduces this to O(mlog(k+1))O(m\log(k+1)).
  4. Broader applications: The deterministic rounding theorem may apply to other online allocation problems with similar structure.

Key Quote

"The main conclusion is that CRdet(k)10CPB\mathrm{CR}_{\det}(k) \leq 10C_{\mathrm{PB}} for every replica budget k1k \geq 1. Because CPBC_{\mathrm{PB}} is absolute, this is an O(1)O(1) upper bound. Thus the deterministic ratio has the same asymptotic order as the randomized ratio from the previous version, and randomization is not asymptotically necessary."

Related papers