Whose turn is it? Context-guided model routing for stateful agents

Anikesh Parashar, Avik Dutta, Vashu Chauhan, Sumit Gulwani, Priyanshu Gupta, Hosein Hasanbeig, Vu Le, Ashish Tiwari, Jack WilliamsarXiv 2026

TL;DR

This paper demonstrates that model routing for LLM agents is a sequential decision problem, not a series of independent choices. By providing routers with session history and accounting for the asymmetric costs of prompt caching, the authors show that agents can maintain "frontier model" performance while significantly reducing costs.

What Problem Does This Paper Address?

Model routing—the practice of sending "easy" queries to cheap models and "hard" ones to expensive ones—is a standard trick for saving money in LLM applications. However, most existing routers treat every request as an independent event.

Real-world AI agents don't work this way. They operate in stateful, multi-turn sessions where a single user request might trigger a dozen tool calls and internal reasoning steps. In these environments, two major issues arise:

  1. Contextual Dependency: A request like "Apply the same format to Q3" is impossible to route correctly without knowing what happened in previous turns.
  2. The Cache Penalty: Modern LLM providers use prompt caching to save money on long conversations. Switching models mid-session "breaks" this cache, forcing the new model to re-process the entire history at full price.

The authors set out to build a routing framework that respects these agentic realities, specifically in the challenging domain of spreadsheet manipulation.

Methods

The researchers focused on zero-shot, cost-aware routing at the "user-turn" boundary. Instead of routing every single LLM call, they route the entire "turn"—the complete loop of reasoning and tool use required to answer one user request.

They compared several strategies:

  • LLM Router (with/without history): A lightweight model acts as a classifier to pick the worker model.
  • Escalation/De-escalation: Starting a turn on a cheap model and "handing off" to an expensive one if it gets stuck (or vice versa).
  • Random Routing: A baseline to see if smart decisions actually matter.
Figure 1: Routing policies for multi-turn agents. (a) Before turn t, a zero-shot LLM router π reads the request ut and, when routing with history context, the serialized history ht (dashed). It assigns the whole turn to the cheap model mc (simple) or the expensive model me (complex, or on timeout, malformed output, or service failure); under escalation and de-escalation, every turn instead starts on mc or me, respectively. Routing without history drops the history input, and without routing, one model serves the whole session (dotted line). The selected model owns every LLM call and tool interaction of the turn, and the runtime appends the resulting messages, tool observations, errors, workbook state, and routing decision to form ht+1; models exchange no hidden states or provider-side KV tensors. (b) Illustrative assignments over a four-turn session.

Crucially, their evaluation "charges" the system for the cost of the router itself and the "cache miss" penalties incurred when switching models.

Datasets

The study used multi-turn versions of two spreadsheet benchmarks:

  • SheetCopilot: 112 tasks with multiple subtasks (avg. 2.88 turns).
  • SpreadsheetBench 2: 221 complex end-to-end business workflows (avg. 4.76 turns).

Spreadsheets are a "stringent test" for routing because they involve implicitly structured 2D state, hidden dependencies (formulas), and weak verification (a wrong formula often returns a number instead of an error).

Key Insights and Ideas

  • History is Non-Negotiable: Providing the router with session history improved task pass rates by 3.3 points on average compared to history-blind routing. Without context, follow-up requests look deceptively simple, leading the router to "under-power" the agent.
  • The "Realized Cost" Trap: A cheap model's list price might be 5x lower, but if it takes twice as many steps to solve a problem, your actual discount is only 2.5x. On longer sessions, the "per-task" discount of cheap models like Haiku 4.5 narrowed from 6.8x to just 3.2x.
  • Asymmetric Switching Costs: Because of prompt caching, switching "down" (expensive to cheap) is relatively safe—it pays for itself within two calls. Switching "up" (cheap to expensive) is a financial disaster; it can cost 10x more than a downward switch because you're paying to re-cache a long history on a premium model.
  • Sticky Routing: The best strategy is "sticky"—once you've committed to a model for a turn, stay there. Switching mid-turn (escalation) often costs more than just using the expensive model from the start.

Key Results

The history-aware LLM router was the clear winner. On SheetCopilot, it achieved a 28.3% pass rate—actually exceeding the "expensive-only" baseline (27.7%) while offloading over 20% of turns to cheaper models.

Figure 2: Cost–quality tradeoff of the decision rules in Tables 3 and 4; rows are benchmarks, columns are candidate pairs, axes are scaled per panel. Colour gives the rule (legend), abbreviated at each marker as Exp, Chp, R−, R+, Esc, De, and Rnd. The filled wedge is mc: empty = 0%, half = 50%, solid = 100%. The dashed curve traces all random mixes of the two pure candidates, and the shaded band above it is where a rule beats such a mix. A bold ring marks a Pareto-optimal rule and the dotted staircase joins them. Coincident markers are nudged apart for legibility.

As shown in the tradeoff plots, the history-aware router (dark blue squares) consistently sits on the Pareto frontier, offering near-peak quality at lower costs. Meanwhile, random routing and de-escalation strategies often performed worse than just using a single model.

Limitations and Future Work

The authors acknowledge several limitations:

  • Zero-Shot Focus: While they used zero-shot routers for ease of deployment, a trained (supervised) router would likely perform even better, though it would be much more expensive to build.
  • Session Length: The benchmarks averaged 3-5 turns. The "cache penalty" for switching models will likely become even more dominant in much longer (50+ turn) sessions.
  • Domain Specificity: While spreadsheet agents are a great stress test, the dynamics might differ in software engineering or creative writing agents where verification is easier or harder.

Future work could explore "context compaction" or summarization to mitigate the cache costs of switching models in very long-running agentic sessions.

Summary updated

BibTeX
@misc{parashar2026whose,
  author = {Anikesh Parashar and Avik Dutta and Vashu Chauhan and Sumit Gulwani and Priyanshu Gupta and Hosein Hasanbeig and Vu Le and Ashish Tiwari and Jack Williams},
  title = {{Whose turn is it? Context-guided model routing for stateful agents}},
  year = {2026},
  eprint = {2610.19292},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.19292},
}
Figure