Why We Built Reflexive Role Routing (and Why Static Agent Loops Waste Your Compute)

Community Article
Published August 30, 2026

Author: Mikhail Borisenko (NitrAI)

Preprint DOI: 10.5281/zenodo.22171581

Running multi-agent setups in production means you're all too familiar with this workflow: an orchestrator starts a Coder, and then twiddles thumbs while the model cooks up 500+ tokens without anything being checked. When an upstream agent (maybe the Scientist) bungles the interface definition from the get-go, the Coder blindly outputs code for the broken specification, halting only when the token limit is met, with the problem only surfacing during the review step. Reflexive Role Routing (RRR) was built specifically to stop this needless spending.

The root of the problem is treating an agent's execution as an unreadable black box; as soon as one starts, you simply can't interfere until it's done. We wanted a straightforward way to cancel the process in its tracks.

Keeping Track of Progress Mid-Generation

RRR extracts the internal state as the generation is in progress. Rather than polling for each individual token, we examine the system state periodically, at discrete points C or obvious transition points in generation (e.g., when defining functions). A simple probe measures two numerical values:

  1. $\delta$-a measure of how far the prompt's target embedding deviates from the model's current generation trend.
  2. $c$-an estimate of whether the output will pass subsequent review stages without being rejected.

The probe itself has to be inexpensive in order to avoid just shifting the bottleneck from an long run time to an excessive rate of probing; ours relies on a single minimal linear layer and has a negligibly low per-check computational cost.

The Decision Loop

A frozen controller receives ($\delta$, $c$) and uses this information to make its next decision:

  • Keep the generation going if the system is progressing nicely.
  • Shut down the current generation and transfer the already produced context to either a Scientist or Planner for task clarification when a model seems to misunderstand a requirement.
  • Terminate the task entirely and hand it back to the Conductor if the generation's trajectory becomes thoroughly untenable.

We model this process as a SMDP (Semi-Markov Decision Process) to allow for middle-stream intervention while not sacrificing the value of the context produced thus far.

Contrast with Existing Work

While there's research on dynamic compute allocation, existing tools didn't address our specific need:

  • Mixture-of-Depths and MoR enable per-layer or per-token compute savings within an existing model, but don't extend beyond a single agent.
  • GRADE and Router-R1 support agent routing, but can only do so either before execution begins, or once it's concluded.

RRR targets precisely that interstitial step: the capability of stopping an active role mid-generation, based on signals derived from within that role.

It goes without saying that inter-generation process control has some potential downsides. The probes are very sensitive to the quality of the data they were trained on, and it's possible to prematurely terminate a valid generation with the wrong threshold choices. For more detail about how we handle such scenarios, the full SMDP formulation and derivation of falsification bounds, see our preprint: 10.5281/zenodo.22171581.

thumbnail

Community

Sign up or log in to comment