Pyramid MoA: A Probabilistic Framework for Cost-Optimized Anytime Inference
Organizations: Independent Researcher
Abstract
We observe that LLM cascading and routing implicitly solves an anytime computation problem -- a class of algorithms, well-studied in classical AI, that improve solutions as additional computation is allocated. We formalize this connection and propose Pyramid MoA, a hierarchical Mixture-of-Agents architecture governed by a decision-theoretic router that escalates queries only when necessary. We establish a Probabilistic Anytime Property with provable monotonicity guarantees and derive a generalized escalation rule from Value of Computation theory that accounts for imperfect oracles, extending the Hansen-Zilberstein monitoring framework to stochastic LLM inference. On MBPP, the router intercepts 81.6% of bugs; on GSM8K/MMLU, the system nearly matches the 68.1% Oracle baseline while achieving up to 42.9% compute savings. The router transfers zero-shot to unseen benchmarks: matching Oracle accuracy on HumanEval (81.1%) and MATH 500 (58.0%) with significant cost reductions. We further discover a context-conditioned anchoring effect across four benchmarks: passing correct SLM reasoning improves Oracle accuracy by up to +19.2pp, while incorrect reasoning degrades it by up to -18.0pp, revealing a fundamental tension in hierarchical MoA architectures.
Figures & tables
| Anytime Computation | Pyramid MoA |
|---|---|
| Initial solution | Layer 1 (SLM ensemble) output |
| Extended computation | Escalation to higher-capability layers |
| Computation time axis | Model capacity / inference cost |
| Performance profile | Accuracy as a function of cost |
| Monitoring problem | Router’s escalation decision at each layer |
| Quality guarantee (deterministic) | Quality guarantee (probabilistic) |
| Feature | Consensus Router | Anytime Router |
|---|---|---|
| Algorithm | XGBoost | XGBoost |
| Training Domain | MBPP (Code) | GSM8K/MMLU (Math) |
| Primary Signal | Semantic Agreement | Token Log-Probabilities |
| Routing Characteristic | Error-catching (high recall) | Selective escalation (high precision) |
| Transfer Evaluation | HumanEval | MATH 500 |
| Benchmark | Gap | Acc | Satisfied? | |||
|---|---|---|---|---|---|---|
| MBPP (Code) | 0.558 | 0.379 | 0.690 | +0.311 | +17.3% | ✓ |
| HumanEval (Code, OOD) | 0.561 | 0.696 | 0.804 | +0.109 | +6.1% | ✓ |
| GSM8K/MMLU (Math) | 0.271 | 0.632 | 0.768 | +0.137 | +3.7% | ✓ |
| MATH 500 (Math, OOD) | 0.110 | 0.145 | 0.582 | +0.436 | +4.8% | ✓ |
| Benchmark | SLM Majority | Baseline | With Context | ||
|---|---|---|---|---|---|
| MATH 500 | Correct | 239 | 70.3% | 89.5% | +19.2 pp |
| Wrong | 261 | 59.0% | 41.0% | 18.0 pp | |
| MMLU | Correct | 301 | 89.4% | 96.0% | +6.6 pp |
| Wrong | 251 | 59.8% | 43.8% | 16.1 pp | |
| GSM8K | Correct | 1079 | 99.0% | 99.4% | +0.5 pp |
| Wrong | 121 | 88.4% | 73.6% | 14.9 pp |
LLM Routing
Large language model routing selects models, tools, experts, or inference strategies to balance answer quality, cost, latency, and deployment constraints.
See all 345 papers