# 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*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/155120) · [OpenReview](https://openreview.net/forum?id=8GrzZnygOz) · [alphaXiv](https://www.alphaxiv.org/abs/2601.22397) · [Open on the map](../papers.html#p155120)

Category: [LLM Post-Training: RL & Distillation](../pcat/18.md) › [Reasoning Distillation for LLMs](../pgroup/645.md) · Type: new method · Keywords: multi-stage ML pipeline autoscaling, in-context reinforcement learning, LLM as controller, Pareto-dominance reward shaping, GPU rate control

## Summary
SAIR is an in-context reinforcement learning autoscaler that enables zero-shot deployment of multi-stage ML pipelines, achieving up to 50% latency reduction and up to 97% cost savings.

## Explained to a 5-year-old
Imagine a big computer that runs many little tasks one after another. It’s hard to make the computer work fast for all tasks because they need different parts of the machine. SAIR is a smart helper that watches the tasks and decides how to share the computer’s power without needing to learn from old examples. It learns by looking at what happened before and uses simple rules to pick the best actions. This helps the computer run faster and saves money.

## Explained to a 5-year-old, longer
A computer that runs many different tasks, like ordering food or playing games, is called a multi-stage ML pipeline. Each task needs its own piece of the computer’s power, and sometimes one task waits for another to finish. Making the computer work fast for all tasks is tricky because the tasks can get stuck in different places. Old ways of making the computer faster either ignore how tasks affect each other or need a lot of past data that may not exist. SAIR is a new helper that can start working right away without any past data. It uses a special kind of brain called an LLM that can think and learn just by reading short notes. SAIR looks at what happened before and picks the best actions using simple rules. It also watches how tasks are doing and can change the computer’s speed very quickly. By sharing the computer’s power wisely, SAIR makes the tasks finish faster. It also saves money because the computer doesn’t need to use as much expensive hardware. The helper can even tell when a task is the slowest one, which helps avoid delays. All of this works without retraining the whole system, making it easy to use for new tasks.

## For a technical reader
SAIR provides an autoscaling solution that operates in a zero-shot regime by using an LLM as an in-context reinforcement learning controller, learning from reward-labeled experience tuples stored in the LLM’s context. It combines Pareto-dominance reward shaping, Bayesian-surprise experience retrieval, and a user-space CUDA interception layer for fine-grained GPU rate control with sub-millisecond actuation. The system achieves best-or-tied P99 latency (up to 50% improvement) and up to 97% reduction in effective cost across multiple serving pipelines. A provable regret bound decomposes performance into retrieval coverage and LLM selection components, offering both practical efficiency and theoretical guarantees.

## Problem
Scaling multi-stage ML inference pipelines is challenging due to heterogeneous resources, cross-stage coupling, and shifting bottlenecks, and existing autoscalers either ignore these interactions or require offline training data unavailable for new pipelines.

## Method
The approach uses an LLM as an in-context reinforcement learning controller that learns online from reward-labeled experience tuples stored in the LLM's context, employs Pareto-dominance reward shaping with a separation margin, Bayesian-surprise experience retrieval, and a user-space CUDA interception layer for continuous GPU rate control.

## Results
The approach achieves best or tied-best P99 latency (up to 50% reduction over the next baseline), reduces billable cost via replica consolidation, and cuts effective cost by up to 97%, while attaining 86% bottleneck detection accuracy without offline training.

## Contributions
It introduces a zero-shot autoscaling framework that leverages in-context reinforcement learning with Pareto-dominance reward shaping, Bayesian-surprise retrieval, and GPU rate control, and provides a regret bound decomposition linking retrieval coverage and LLM selection.

## Practical relevance
The approach enables cost-efficient, low-latency autoscaling of new ML pipelines without requiring offline training, facilitating deployment on limited hardware.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/155120)
