Vision-language agents, meaning models that look at images and then call software tools, often fail for a mundane reason: they write malformed tool calls. On the Agent-X benchmark, invalid JSON is one of the two leading causes of failure, and no frontier model completes more than half of its task chains end to end (Agent-X). The usual fix is constrained decoding. At each step the decoder blocks any next token that would break the required format. This local masking is cheap, but it is biased. It forces the model down prefixes that may have no good legal completion, and it distorts the answer distribution. The exact fix plans ahead with automata and costs 3.11x to 10.2x more inference time (Mitigating Bias in Locally Constrained Decoding via Tractable Proposals).
The proposal is to close that gap through training. We would add a short "protocol stage" to a staged vision-language post-training curriculum. In that stage the model is rewarded for emitting tool calls that parse and execute. Once the model's own distribution already puts almost all its probability on well-formed outputs, cheap local masking almost never has to intervene, and it becomes nearly identical to the exact constrained distribution. The research question is where in the curriculum this stage belongs. Placed wrongly, it should reproduce the known finding that forcing rigid formats while reasoning degrades reasoning. Placed rightly, the model should get reliable formatting at local-masking cost with no loss in visual reasoning.
Core Claim
Let $p(y \mid x)$ be the model's probability of output $y$ given image-and-text input $x$. Let $C$ be the set of outputs that satisfy the tool schema. The ideal constrained output distribution is
$$q(y \mid x) = \frac{p(y \mid x)\,\mathbf{1}[y \in C]}{Z(x)}, \qquad Z(x) = \sum_{y \in C} p(y \mid x),$$
where $Z(x)$ is the chance that an unconstrained sample is already valid. Local masking departs from $q$ only by the probability mass the model spends on prefixes that lead to dead ends. That mass cannot exceed $1 - Z(x)$. So as $Z(x) \to 1$, unconstrained sampling, local masking, and the exact global method all converge to the same distribution.
The first half of the claim is that a verifiable-reward protocol stage can push $Z(x)$ close to 1 on held-out tools. The second half is that this can be done without reducing goal accuracy, but only if the stage comes after perception training and before joint visual reasoning. That ordering matters because it keeps the format-learning signal from competing with the reasoning-learning signal.
This connects the three directions in specific roles. Structured output adherence supplies the object of study, the gap between local and global constraint. Multi-stage alignment supplies the lever, which is curriculum placement. Generalist models supply the reference point, since the result is only interesting if a staged 8B model approaches frontier generalist agents at the same inference cost.
Relation to Prior Work
Two lines of work motivate the proposal by exposing the gap.
- Agent-X diagnoses JSON errors as a dominant failure mode but proposes no intervention.
- VisualAgentBench shows open models collapse without trajectory fine-tuning.
- Neither separates syntax failures from the perception failures they may be hiding.
The method comes from two sources.
- Curriculum. From Seeing to Thinking trains perception with verifiable rewards, then textual reasoning, then visual reasoning. That ordering beats merged training on Qwen3-VL-8B by +1.46 math points with 20.8% shorter reasoning traces. Its outputs are entirely unconstrained. We insert a protocol stage into this curriculum and vary where it sits.
- Constraint. The tractable-proposals paper supplies the global decoder (GCD and its probabilistic variant) that we use as the exact-distribution reference. It reports 100% constraint satisfaction on xLAM, a function-calling benchmark. We do not improve that decoder. We try to make it unnecessary.
Three papers constrain the design.
- SafeDec finds that hard logit masking drops task success by 10–15% through deadlocks. This is the same failure we expect local masking to show on a model with low $Z(x)$.
- MiniGPT-v2 shows that mixing structured coordinate outputs with free text during multi-task training causes format confusion. It mitigates this with task tokens rather than grammars. We read this as a warning against merging protocol data into every stage.
- Deng, Bianchi and colleagues report that forcing schemas during reasoning degrades inference. This is the hypothesis our placement ablation tests directly.
The training-free orchestration systems (3DMedAgent; Training-Free Multimodal Large Language Model Orchestration) argue that an un-tuned generalist controller beats trained multimodal models. Both depend on the controller emitting valid protocol tokens, and both report pipeline breaks when it does not. We treat them as the generalist reference, not as competitors in the same compute class.
Research Program
Diagnostic. The first component asks whether format failures are really syntax failures. We take an open model, Qwen3-VL-8B, as used in From Seeing to Thinking, and run it on Agent-X three ways: unconstrained, with local masking, and with GCD. For every task that failed unconstrained because of invalid JSON, we record what happens once validity is forced. The outcome is either success or a relabelled perception or reasoning error. This decides how much of the Agent-X format problem can be solved by constraints at all.
Protocol stage. The second component is the stage itself. Rewards are verifiable and have three parts:
- the call parses against the tool schema;
- the call executes without error in a sandbox;
- where ground truth exists, the arguments are correct, for example bounding-box overlap for grounding tools or exact match for numeric tools.
The argument-correctness term keeps the stage from rewarding well-formed but empty calls. Training data combines three sources: xLAM-style text function calls, the training split of VisualAgentBench trajectories, and synthetic visual tool calls over DOCCI images. The tool schemas used in training are deliberately disjoint from Agent-X's 14 tools, so the Agent-X evaluation measures transfer to unseen schemas.
Placement ablation. The stage goes in one of four positions: before perception, between perception and textual reasoning, between textual and visual reasoning, or after visual reasoning. A fifth variant merges protocol data into every stage. The total number of training tokens is fixed across variants.
Measurements. For each variant we measure:
- $Z(x)$, estimated as the fraction of unconstrained samples that are valid;
- the distributional gap between local masking and GCD, computed as agreement on sampled tool calls and on final answers;
- decode-time overhead;
- goal and full-chain accuracy on Agent-X;
- success on VisualAgentBench;
- reasoning retention on MathVista, WeMath and RealWorldQA.
Baselines
The naive reference is the same staged-curriculum model decoded with no constraint. This is the published From Seeing to Thinking recipe, and it gives the floor for both validity and accuracy.
Local masking on the base model. The most obvious practical competitor is the unmodified staged model with local grammar masking, since this is what practitioners would deploy. It runs under the identical tool schemas and sampling temperature. Beating it means higher full-chain accuracy on Agent-X at equal decode cost.
GCD on the base model. The strongest method that needs no training is exact global constraint on the base model, run with the particle budget reported to reach full satisfaction on xLAM. The tractable-proposals paper reports 100% constraint satisfaction on xLAM for GCD and its probabilistic variant. There is no reported result on Lacuna for GCD on any multimodal agent benchmark. Our model beats this baseline only if it matches its Agent-X goal accuracy within noise at local-masking latency. If it merely matches validity, the contribution is purely one of cost, and we would report it that way.
Trajectory fine-tuning. VisualAgentBench reports that InternVL-2 (8B) reaches 16.0% success after fine-tuning on its trajectories. Our analogue fine-tunes Qwen3-VL-8B on the same protocol data by plain supervised learning at the protocol-stage position, with matched tokens. This isolates whether verifiable reward, rather than simply seeing formatted data, drives the gain.
Frontier generalists. For generalist superiority, the reference points are the reported Agent-X goal accuracies of o4-mini (45%), Gemini 2.5 Pro (40%) and GPT-4o (37%), and GPT-4o's 36.2% average success on VisualAgentBench. These are not compute-matched. They answer whether the staged small model closes the generalist gap.
Key ablation. The ablation that isolates our ingredient is the placement sweep, including the merged variant. If placement does not matter, the curriculum claim fails even if the protocol stage helps.
Why not just…?
Why not just use local masking at inference and skip training? This is the most serious threat. Local masking guarantees parseable JSON for free, and Agent-X never tested it. Its known weakness is bias toward dead-end prefixes. The tractable-proposals paper shows it falling short of full satisfaction on xLAM, and SafeDec's hard-masking deadlocks cost 10–15% task success. But neither result is on a vision-language agent. The diagnostic experiment settles this directly. If local masking on the base model already recovers most format-failed Agent-X tasks, then $Z(x)$ was not the bottleneck, and we would reframe the work around the perception errors that remain.
Why not just let the model reason freely and constrain only the final tool call? Splitting free reasoning from constrained emission directly addresses the reported reasoning-degradation effect. It may capture much of the benefit. We include it as a decoding mode crossed with every training variant. If the protocol stage adds nothing on top of it, we report that. Our expectation is that the split helps accuracy but does not raise $Z(x)$ for the call itself, so the local-versus-global gap remains.
Why not just fine-tune on formatted trajectories in one stage? From Seeing to Thinking shows that merged training underperforms staged training on reasoning, and MiniGPT-v2 documents format collisions under multi-task mixing. Both the merged variant and the supervised-only variant test this directly under matched tokens.
Why not just retry on parse errors? PRISM finds that resampling tends to reproduce the same mistakes on multimodal inputs, and the gap between Pass@k and Majority@k widens with budget (PRISM). We run a parse-error retry loop with up to three retries and report accuracy per unit of wall-clock time.
Proposed Experiments and Decisive Checks
Mechanism check. Across placement variants, the local-versus-GCD disagreement rate on Agent-X should fall monotonically as measured $Z(x)$ rises. The bound in the Core Claim predicts that disagreement shrinks toward zero as $1 - Z(x)$ does. If disagreement stays high even when $Z(x)$ is near 1, the mechanism is wrong.
Placement check. The mid-curriculum placement should match GCD-on-base goal accuracy on Agent-X while keeping MathVista and WeMath scores within noise of the unconstrained staged model. For reference, From Seeing to Thinking reports +5.2% on WeMath from staging. The early, late and merged placements should show either lower $Z(x)$ or a reasoning drop. If every placement performs the same, the curriculum claim is refuted, and the result reduces to the observation that verifiable format rewards help.
Honesty check. The diagnostic relabelling tells us whether forced validity converts format failures into successes or only into visible perception errors. It is reported regardless of outcome, because it determines how much of the frontier-generalist gap on Agent-X any constraint method can close.
Sanity checks. xLAM and GSM8K-Constrained confirm that the protocol stage does not break text-only function calling or math under schemas. VisualAgentBench tests whether the gains carry over to a second, interactive agent benchmark.
References
- Agent-X: Evaluating Deep Multimodal Reasoning in Vision-Centric Agentic Tasks
- Mitigating Bias in Locally Constrained Decoding via Tractable Proposals
- VisualAgentBench: Towards Large Multimodal Models as Visual Foundation Agents
- From Seeing to Thinking: Decoupling Perception and Reasoning Improves Post-Training of Vision-Language Models
- SafeDec: Constrained Decoding for Safe Autoregressive Generalist Robot Navigation Policies
- MiniGPT-v2: Large Language Model as a Unified Interface for Vision-Language Multi-task Learning
- 3DMedAgent: Unified Perception-to-Understanding for 3D Medical Analysis
- Training-Free Multimodal Large Language Model Orchestration
- PRISM: Structured Decomposition for Multimodal Physics and Mathematical Reasoning