TL;DR
Scaling modern multi-stage ML serving pipelines is like playing whack-a-mole: speed up one stage, and the bottleneck instantly migrates downstream. While traditional autoscalers lack pipeline-wide vision and deep RL controllers need weeks of offline training data, SAIR drops a Large Language Model directly into a live, unseen pipeline as an in-context reinforcement learning controller. Learning purely from live experience stored in its context window, SAIR cuts tail latencies by up to 50% and slashes GPU sharing costs by 30–60%—adapting from a cold start in under two minutes.
What Problem Does This Paper Address?
Modern ML inference rarely happens inside a single monolith. Instead, requests flow through an assembly line: CPU-heavy preprocessing (e.g., decoding images), GPU-accelerated neural network execution, and CPU-bound postprocessing, all linked by message queues.
Autoscaling this setup is notoriously tricky due to three coupled headaches:
- Dynamic bottleneck migration: As traffic shifts, the choke point jumps between CPUs and GPUs.
- Cross-stage coupling: Adding more preprocessing replicas clears the front door, only to trigger a delayed traffic jam at the GPU 30 seconds later.
- Confounded causality: High GPU utilization might mean you need more GPUs, or that downstream postprocessing is backed up.
Existing solutions leave engineers in a bind. Production rule-based scalers (like Kubernetes HPA) look at single stages in isolation and end up oscillating wildly. Deep RL controllers understand cross-stage effects, but require thousands of offline training episodes—data you simply don't have when deploying a brand-new pipeline (zero-shot deployment).
Methods
SAIR frames pipeline autoscaling as a contextual bandit operating in 30-second rounds, using an off-the-shelf LLM (GPT-5.1-mini) as an In-Context Reinforcement Learning (ICRL) policy. No gradient updates, no offline simulators. Instead, SAIR learns on the fly by storing (state, action, reward) tuples and feeding the best ones back into the LLM’s prompt.
To make an LLM behave like a rigorous control theorist, the authors introduce three clever mechanisms:
- Pareto-Dominance Reward Shaping: Latency and cost are fundamentally at odds. SAIR tracks an evolving Pareto frontier of optimal latency-cost trade-offs, mathematically guaranteeing a constant reward separation margin between non-dominated ("good trade-off") and dominated actions so the LLM can easily tell them apart amidst noisy telemetry.
- Bayesian-Surprise Retrieval: Context windows are finite. SAIR stores only positive-reward episodes and retrieves the top-$M$ experiences that are both similar to the current state and high in "Bayesian surprise" (outcomes that deviated sharply from expectations), maximizing information gain.
- Sub-Millisecond GPU Rate Control: Spinning up new GPU pods takes forever. Alongside standard Kubernetes API calls for CPU/memory, SAIR injects a lightweight user-space
LD_PRELOADlayer that intercepts CUDA kernel launches and throttles them via a token bucket. This allows continuous, reversible GPU compute allocation ($\rho \in [0, 1]$) in under 2 milliseconds—freeing up unused GPU cycles for co-located workloads.
Datasets
Because this is a live systems control paper rather than a static modeling benchmark, offline datasets are not used (by design, SAIR starts with an empty buffer). Instead, the authors evaluate SAIR across four live ML serving pipelines (~1M requests per run) with distinct hardware profiles:
- Image Classification (MobileNetV2; CPU-heavy preprocessing)
- NLP Analysis (BERT; balanced CPU/GPU with active bottleneck migration)
- Text Generation (Transformer decoder; GPU-heavy variable latency)
- Video Analysis (Multi-frame processing; memory-heavy, 10–20s latency)
Each pipeline is stressed under three synthetic arrival patterns: Poisson (steady random traffic), Ramp (gradually climbing load), and Burst (sudden traffic spikes).
Key Insights and Ideas
- LLMs dodge the "sim-to-real" gap: When the authors faithfully trained classic RL baselines (FIRM and AWARE) in queueing simulators and moved them to real hardware, the frozen policies froze up or failed under bursts. Because SAIR learns strictly online in-context, there is no sim-to-real gap.
- Curated positivity beats raw history: Filtering out the ~30% of actions that yield negative rewards is crucial. Letting the LLM see all its past mistakes ("Store-All" ablation) actually degraded P99 latency by 12.1% by cluttering the context budget with noise.
- LLM brains cost pennies compared to GPU brawn: Querying GPT-5.1-mini every 30 seconds costs $0.01–$0.05 per pipeline-hour—orders of magnitude smaller than the cloud compute dollars saved by smarter GPU scaling.
- Composition over memorization: Under sudden 1.7$\times$ traffic shifts, SAIR produced 4–8$\times$ fewer request timeouts than a nearest-neighbor replay baseline, showing the LLM actively composes novel multi-stage actions rather than just parroting past episodes.
Key Results
- Tail Latency: SAIR achieves the lowest or tied-lowest P99 latency across all 12 pipeline-workload combinations, cutting P99 by up to 50% over the next-best tuned production baseline.
- Resource Cost: Under GPU sharing/co-location, SAIR reduces effective cost by 30–60% typically (and up to 97% in best-case low-utilization scenarios), validated with physical co-tenants retaining ~98% standalone throughput.
- Fast Cold-Start & Diagnosis: Starting with zero history, SAIR matches a pre-warmed controller's latency within 2–3 decision intervals (47–59 seconds) and identifies injected pipeline bottlenecks with 86% overall accuracy.
Limitations and Future Work
- Timescale Limits: Because LLM inference takes 1–2 seconds and queues need 5–10 seconds to settle, SAIR targets coarse capacity scaling ($\Delta t \ge 10\text{s}$). Sub-second per-request scheduling (handled by systems like vLLM) is out of scope.
- When Offline Data Exists: If you do have weeks of historical traces for a static pipeline, dedicated offline-profiled controllers like InferLine remain a better fit.
- Single-Tenant Savings: The dramatic 97% cost reduction relies on GPU sharing (time-slicing or MIG) where another tenant uses the throttled capacity; in single-tenant whole-GPU billing, savings drop to replica consolidation margins (30–60%).
- Future Work: The authors highlight disaggregated prefill/decode LLM serving as a natural fit for SAIR's pipeline abstraction, requiring future integration of KV-cache transfer and GPU memory-pressure telemetry.
Summary updated