SAIR: Cost-Efficient Multi-Stage ML Pipeline Autoscaling via In-Context Reinforcement Learning
Jianchang Su, Yifan Zhang, Shengkai Lin, Shizhen Zhao, Yusheng Zheng, Yiwei Yang, Wei Zhang
TL;DR
SAIR tackles autoscaling of multi-stage ML pipelines by deploying an in-context reinforcement learning controller that leverages an LLM to learn scaling policies online without gradient updates. The approach combines Pareto-frontier reward shaping, surprisal-based experience retrieval, and lightweight CUDA-based GPU rate control to coordinate across preprocessing, inference, and postprocessing stages. Key theoretical contributions include regret bounds that decompose errors into retrieval coverage and LLM selection terms, plus frontier-separation guarantees, while practical results show SAIR achieving the best or tied-best P99 latency and substantial cost reductions across four pipelines and three workload patterns, with 86% bottleneck-detection accuracy and zero offline training. This combination enables zero-shot deployment, robust generalization to distribution shifts, and fine-grained resource control suitable for shared GPU environments.
Abstract
Multi-stage ML inference pipelines are difficult to autoscale due to heterogeneous resources, cross-stage coupling, and dynamic bottleneck migration. We present SAIR, an autoscaling framework that uses an LLM as an in-context reinforcement learning controller, improving its policy online from reward-labeled interaction histories without gradient updates. SAIR combines Pareto-dominance reward shaping with a provable separation margin, surprisal-guided experience retrieval for context efficiency, and fine-grained GPU rate control via user-space CUDA interception. We provide regret analysis decomposing error into retrieval coverage and LLM selection components. On four ML serving pipelines under three workload patterns, SAIR achieves the best or tied-best P99 latency and effective resource cost among deployed baselines, improving P99 by up to 50% and reducing effective cost by up to 97% (under GPU rate-control assumptions), with 86% bottleneck detection accuracy and no offline training.
