interwhen: A Generalizable Framework for Steering Reasoning Models with Test-time Verification

Vishak K Bhat, Vijval Ekbote, Prateek Chanda, Ashmit Khandelwal, Maitreyi Swaroop, Subbarao Kambhampati, Vineeth N. Balasubramanian, Nagarajan Natarajan, Amit SharmaNeurIPS 2026

TL;DR

Reasoning models generate massive streams of intermediate thoughts and tool calls, meaning a single early slip-up can quietly derail an entire task or trigger irreversible real-world errors. interwhen is a plug-and-play framework that translates plain-English rules into formal code verifiers and runs them asynchronously alongside a model's live thought process. By gently nudging a single reasoning trajectory back on track only when it breaks a rule, it boosts smaller models' success rates by up to 55 percentage points—without finetuning or the massive compute bills of tree-search methods.

What Problem Does This Paper Address?

Imagine deploying an AI agent to manage customer refunds or telecom plans. Checking only the final answer is too late if the agent already executed an unauthorized database write halfway through its chain of thought. Not just the final output, the process itself must follow the rules.

Existing ways to supervise reasoning at test-time hit two walls:

  1. Compute bloat: Either you wait for the whole trace to finish and retry from scratch upon failure (high latency), or you branch out into a massive tree of candidate thoughts (multiplying token costs). Worse, forcing models into rigid, predefined "steps" for checking cramps their natural, messy reasoning style.
  2. Verifier scarcity: Math and coding have built-in reality checks like compilers. Real-world workflows—like following an airline's operational rulebook—lack ready-made, reliable verifiers, and asking another LLM to "just check the work" fails to guarantee strict safety.

Methods

The authors introduce a paradigm called LLM-Process-Modulo, implemented in interwhen, which splits supervision into two clean phases:

Figure 1: LLM-Process Modulo has two phases: an offline phase consisting of verifier code generation based on a task policy, and an online phase that steers a single reasoning trajectory and ensures policy compliance. The interwhen system monitors the reasoning trace and decouples verification from generation: at regular intervals, verifiable states are extracted by a forked execution of the same model, which are then inputted to verifiers. Verifier feedback is used to steer the model’s reasoning.
  • Offline Auto-Formalization: Instead of hand-coding checks, a frontier LLM reads a natural-language policy document and synthesizes executable verifier code (in Python, Z3, or the Lean theorem prover) alongside a mapping of which variables each rule needs. Using Lean allows the LLM to generate machine-checked mathematical proofs that the verifier code faithfully matches the formal specification.
  • Online Asynchronous Steering: While the main model thinks, interwhen doesn't interrupt it. At periodic markers (like paragraph breaks or tool calls), it forks a parallel execution thread to extract structured state variables from the messy text trace (using a small model or regex) and feeds them to the code verifiers.
  • If everything looks good, the main model keeps streaming with zero latency overhead (except right before irreversible "write" tool calls, which pause briefly for clearance).
  • If a rule is violated, interwhen halts generation, rewinds back to the fork point, injects specific text feedback (e.g., "Wait, refunds must go to the original payment source"), and lets the model course-correct.

Datasets

interwhen is evaluated (training-free) across eight existing benchmarks—no new benchmarks are introduced:

  • Agentic tasks: $\tau^2$-bench (telecom and retail workflows in solo and dual user-agent modes), AgentSafetyBench (safety failure modes), and VitaBench (complex interactive tasks).
  • Non-agentic reasoning: Spatial navigation (MAZE, SPATIALMAP), arithmetic (GAMEOF24), logic puzzles (ZEBRALOGIC), and code/specification generation (VERINA).

Key Insights and Ideas

  • Checking can actually save tokens: Counterintuitively, adding verification often uses fewer total tokens than standard Chain-of-Thought (CoT). Catching bad assumptions early stops the model from spiraling down long, repetitive dead ends.
  • One-size-fits-all verifiers: Because verifiers are compiled from the task policy rather than tailored to model weights, the exact same verifier suite boosts Qwen3, Claude Haiku 4.5, and GPT-5.4-Mini alike.
  • Written policies have blind spots: Relying strictly on official policy documents isn't always enough. Inspecting a handful of failed traces revealed implicit rules (e.g., an environment expecting exactly 2GB of data refueling when the policy text said at most 2GB). Augmenting policy verifiers with trace-derived and prompt-specific checks unlocked the biggest gains.
  • Forgiving math on imperfect extraction: Using a theoretical Markov chain analysis, the authors prove that even if the LLM state-extractor occasionally misses a violation, steering still improves compliance over standard execution—as long as it avoids false alarms on valid steps.

Key Results

  • Massive jumps for open models: On $\tau^2$-bench (telecom, solo mode), Qwen3-30B's task completion jumps from 32.17% to 87.70% while using slightly fewer tokens (96.93%) than baseline CoT. Dual-mode performance more than doubles from 24.56% to 55.26%.
  • Frontier models benefit too: On $\tau^2$-bench telecom (solo), Claude Haiku 4.5 leaps from 47.1% to 84.3%, and GPT-5.4-Mini climbs from 71.5% to 94.7%.
  • Provable Lean verifiers hold their own: Fully automated, formally proved Lean verifiers reach 83.77% on $\tau^2$-telecom, nearly matching manually validated Python verifiers (87.70%).
  • Crushing the compute-accuracy frontier: On non-agentic tasks like GAMEOF24, interwhen hits 97.2% accuracy using just 61.6% of CoT's token budget—whereas Tree-of-Thoughts burns 7–18$\times$ more tokens and struggles on logic/code tasks. State extraction errors were virtually nonexistent (0.04% on Maze; 0 out of 14.6K agentic tool calls).

Limitations and Future Work

  • Soundness vs. Completeness: Formal proofs guarantee soundness (if a solution passes, it obeys the coded spec), not completeness. If a natural-language policy leaves rules implicit or unwritten, the generated verifiers won't catch those hidden violations.
  • Over-cautious blocking on vague rules: When policies are fuzzy (like AgentSafetyBench's "don't call tools before getting necessary info"), synthesized verifiers err on the side of caution, boosting safety (+23.56 percentage points) at the cost of occasionally blocking valid, helpful actions. Handling implicit rules in messy, in-the-wild domains remains an open frontier.

Summary updated

Abstract

Reasoning models produce long traces of intermediate decisions and tool calls, making test-time verification increasingly important for ensuring correctness. Existing approaches either verify only the final answer, which misses early errors, or rely on branch-and-verify strategies that explore multiple trajectories at substantially higher compute cost. We introduce interwhen, a single-trajectory verification framework that steers model behavior by providing feedback on intermediate reasoning traces. It addresses two key challenges. First, given a set of verifiers, obtaining verifiable states from the reasoning trace typically requires prompt engineering or external task decomposition into fixed steps, which can constrain the model's reasoning strategy. Instead, we propose a monitoring system that periodically polls the reasoning trace and forks inference of the reasoning model to recover intermediate states. Verifiers are run asynchronously alongside generation, adding negligible overhead on correct executions and intervening only when violations occur. Second, beyond math and code, a central challenge for process verification is the scarcity of verifiers. interwhen addresses this through automatic verifier synthesis from natural-language policy documents. Given a policy, it can generate code-based verifiers, including provably correct verifiers in Lean and Z3. Together, these contributions yield a plug-and-play system for policy-grounded, formally verified process supervision of any reasoning agent. On reasoning benchmarks where policies encode mathematical or logical constraints, interwhen-based steering achieves near-perfect accuracy for reasoning models using a fraction of the token compute of test-time verification baselines. On agentic benchmarks with policy-based verifier generation, it enables significant improvements in task quality for SLMs without any finetuning; e.g., the task completion rate of Qwen3-30B jumps from 32% to 87% on the telecom domain in tau^2-bench.
BibTeX
@inproceedings{bhat2026interwhen,
  author = {Vishak K Bhat and Vijval Ekbote and Prateek Chanda and Ashmit Khandelwal and Maitreyi Swaroop and Subbarao Kambhampati and Vineeth N. Balasubramanian and Nagarajan Natarajan and Amit Sharma},
  title = {{interwhen: A Generalizable Framework for Steering Reasoning Models with Test-time Verification}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=Cl5QbTUZrf},
}
Figure