ParetoBandit: Budget-Paced Adaptive Routing for Non-Stationary LLM Serving
ParetoBandit is an open-source, adaptive routing system for non-stationary LLM serving that utilizes cost-aware contextual bandits with online primal-dual pacing and geometric forgetting to dynamically enforce dollar-denominated budgets while rapidly adapting to model price and quality shifts or integrating new models at runtime with minimal latency.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you run a busy restaurant kitchen. You have three chefs:
- Chef Cheap: Fast and cheap, but sometimes makes simple mistakes.
- Chef Mid: A bit more expensive, but very reliable.
- Chef Fancy: The most expensive, a genius, but costs a fortune.
In the world of AI, these are "Large Language Models" (LLMs). Companies want to use them to answer questions, but they have a strict daily budget. They can't just hire "Chef Fancy" for every order, or they'll go bankrupt. But they also can't use "Chef Cheap" for everything, or the food (the answers) will be bad.
The problem is that the kitchen is chaotic. Sometimes Chef Fancy gets a price cut. Sometimes Chef Cheap suddenly starts burning the toast (quality drops) without telling anyone. And sometimes a brand new chef joins the team.
ParetoBandit is the new, super-smart Head Waiter designed to solve this chaos.
The Problem: The "Set and Forget" Mistake
Old systems were like waiters who memorized a menu once a month and then never looked at it again.
- If Chef Fancy dropped their prices, the old waiter kept charging the same high price.
- If Chef Cheap started serving burnt toast, the old waiter kept sending orders there because they thought he was still good.
- If a new chef joined, the old waiter didn't know how to handle them.
The Solution: ParetoBandit (The Adaptive Waiter)
ParetoBandit is a waiter that learns in real-time and never breaks the budget. It uses three clever tricks:
1. The "Smart Wallet" (Budget Pacer)
Imagine your wallet has a magical alarm.
- Old Way: You try to guess how much you can spend all day. If you overspend in the morning, you might be broke by noon.
- ParetoBandit: It checks your wallet after every single order.
- If you just spent a lot on Chef Fancy, the waiter immediately tightens the belt and says, "Okay, for the next few orders, we can only afford Chef Cheap."
- If Chef Fancy suddenly drops their price, the waiter instantly notices, "Hey, we have extra cash now! Let's treat ourselves to the Fancy chef for this order."
- The Magic: It ensures you never go over your daily budget, no matter how the prices change.
2. The "Short Memory" (Geometric Forgetting)
Imagine you are trying to learn a new dance.
- Old Way: You remember every step you've ever taken, even the ones from 10 years ago. If the music changes, you keep trying to dance to the old song because your memory is too full.
- ParetoBandit: It has a "short memory." It remembers the last few hundred orders very clearly, but it slowly forgets what happened 1,000 orders ago.
- Why? If Chef Cheap suddenly starts burning toast (quality drops), the waiter doesn't wait for a month to realize it. Because it "forgets" the old good data, it quickly realizes, "Wait, Chef Cheap is bad right now," and stops sending orders there. It adapts instantly to changes.
3. The "Trial Run" (Hot-Swapping)
Imagine a new chef walks in.
- Old Way: You either ignore them or hire them immediately without testing.
- ParetoBandit: It gives the new chef a strict, short trial. "You get 20 orders. If you are good, you stay. If you are bad or too expensive, you're out."
- It tests them carefully without blowing the budget. If the new chef is actually terrible, the system kicks them out automatically. If they are great, it starts using them more.
How Fast is It?
This system is incredibly fast.
- Making a decision (which chef to pick) takes 22 microseconds. That is faster than a blink of an eye.
- The whole process (including reading the order) takes less than 10 milliseconds.
- To put that in perspective: The AI model itself takes about 1,000 milliseconds (1 second) to cook the meal. The waiter's decision takes up less than 1% of the total time. You won't even notice the waiter is there.
The Results
The paper tested this waiter in four scary scenarios:
- Staying on Budget: It never went over the spending limit, even when prices changed wildly.
- Price Drops: When the expensive chef got cheaper, the waiter immediately started using them more, getting better food for the same money.
- Silent Failures: When a chef's quality silently got worse, the waiter noticed the bad food, stopped ordering from them, and switched to the others—all while staying within budget.
- New Hires: It successfully tested and onboarded a new chef without crashing the system or breaking the budget.
The Bottom Line
ParetoBandit is like a self-driving car for your AI budget. It doesn't just follow a map; it watches the road, adjusts to traffic jams (price changes), avoids potholes (bad quality), and makes sure you never run out of gas (money), all while driving faster than you can blink.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.