arXiv:2610.20107cs.CLOct 2026

Manuscript Offprint

arXiv:2610.20107

Why Generate a Click? Plug-in Decision Heads for Web Agents

Chengguang Gan, Yunhao Liang, Hanjun Wei, Qinghao Zhang, Zhixi Cai, Shiwen Ni

Abstract

Web agents built on vision language models decide every action by generating text such as click(12), although most of that text encodes a choice among a few action types and a few dozen marked elements. We read these choices directly from the hidden states that the generator computes while it reads the goal and the screenshot. Plug-in decision heads on a frozen generator predict the action type, pool the visual tokens inside each numbered box to pick the target, and point at a listed text option or at a WRITE slot that leaves the writing of new text to the generator. A confidence cascade executes the heads' action when they are sure and otherwise lets the generator decode from the KV cache of the same forward pass. With Qwen3-VL 4B and 8B generators trained on 213k web steps, a strict threshold keeps the cascade between 0.3 points below and 1.4 points above the generator on seven offline test sets while the heads decide 12 to 64% of the steps. A looser threshold raises step success on unseen Mind2Web websites by 3.1 and 1.8 points, costs up to 2 points on GUIAct and MiniWoB++, and lifts WebArena task success from 12.5 to 13.8% (4B) and from 13.6 to 14.6% (8B) with less than half of the generated tokens. Training the heads jointly with the generator lowers the generator's own step success by up to 4.9 points; heads on a frozen generator avoid this cost.

1 Introduction

A web agent built on a vision language model acts by writing. At each step the model reads the goal and a screenshot whose elements carry numbered boxes, then generates a string such as click(6) or type(5, "chair") that a harness parses and executes (Zheng et al., 2024; Koh et al., 2024a; Xu et al., 2024; Qin et al., 2025). Most of this string records a choice from a short list: one of eleven action types and one of a few dozen boxes. Only the text of a typing or answering step is open ended.

Goal: Add a chair to my wish list.

WebArena task 513

5_nair

6

7

4

heads read

box 6 from

the prefill

Advanced Search

page at step 2 with its numbered boxes (crop)

Generator

click

6

end

5 generated tokens

Heads

click(6)

ptypepbox=.998×.998≥τ,0 tokensp_{\text{type}} p_{\text{box}} = .998 \times .998 \geq \tau, 0 \text{ tokens}

Whole episode (cascade, τ=0.5\tau = 0.5)

conf.

solved

1 type(5, "chair")

.993

heads: type, box 5

gen: text

2 click(6)

.996

heads act

3 click(40)

.452

below τ\tau: generator decodes

4 click(26)

.999

heads act

5 answer("done")

1.00

heads: answer

gen: text

Figure 1: WebArena task 513 as solved by our 4B cascade ( τ=0.5\tau = 0.5, seed 0). On the page of step 2 the generator would spell click(6) as five generated tokens, while the heads read the type and the box from the generator's prefill and act without generating a token. Over the episode the heads act alone twice, twice choose the action while the generator writes only the text, and hand one uncertain step to the generator (more episodes in Appendix I).

Writing a choice out token by token costs one sequential decoding pass per token, and it scores only the one string written, with no explicit distribution over whole alternative actions.

By the time the generator writes its first token, it has read the goal, the history and every box on the screen, and that first token already commits to an action type. Like other properties that probes recover from intermediate layers (Alain and Bengio, 2016), and like the knowledge that probing and editing studies locate inside large language and multimodal models (Jiang et al., 2026b, 2025a; Qi et al., 2025), the decision should therefore be readable from the hidden states of the prefill (Figure 1). This suggests a cheaper way to act: read the decision from those states with small heads, and generate only what the heads cannot express. Two

Figure

Figure 2: Overview. The frozen generator reads the goal, the history, the marked screenshot and the listed text options in one prefill. Decision heads read a learned mix of five of its layers and return a distribution over action types, boxes and options (with a WRITE slot). When the confidence ctc_t reaches τ\tau the agent acts at once or, for WRITE, lets the generator write only the text; otherwise the generator decodes the whole action from the same KV cache.

questions determine whether this is worth doing. On which steps do heads read the decision as reliably as the generator writes it? And can an agent use the heads on those steps and generation on the rest without paying for both?

Our answer is a set of plug-in decision heads (Figure 2). A type head pools the whole prefill, a target head pools the visual tokens inside each numbered box and scores the box against a learned query, and an argument head points at the text options listed in the prompt or at a WRITE slot that returns the writing of new text to the generator. The heads read a learned mix of five layers of a frozen generator and add about 0.1% to its parameters. A confidence cascade executes the heads' action when the product of their probabilities reaches a threshold τ\tau. Otherwise the generator decodes from the KV cache of the forward pass the heads already read.

We train Qwen3-VL generators of 4B and 8B parameters on 213k web steps from MiniWoB++, Mind2Web, GUIAct, UGround and WebLINX, and then train heads on each frozen generator. At τ=0.9\tau = 0.9 the cascade matches its generator on all seven offline test sets, from 0.3 points below to 1.4 above, while the heads decide 12 to 64% of the steps. At τ=0.5\tau = 0.5 step success on Mind2Web websites unseen in training rises by 3.1 (4B) and 1.8 (8B) points, and the four GUIAct test sets lose 1.0 to 1.9 points. On WebArena the cascade completes 13.8% and 14.6% of 174 test tasks, against 12.5% and 13.6% for the generators, and generates 3.1 and 3.3 tokens per step instead of 7.4 and 7.5; the gain comes from tasks whose intent template also occurs in training. Training the heads together with the generator in one adapter lowers the generator's own step success by 0.5 to 4.9 points, and on Mind2Web and WebArena this cost outweighs the stronger heads that joint training yields.

Decision heads give an existing web agent a second and cheaper way to act without retraining it. The generator stays untouched, so every step the heads hand back is decided exactly as before, and every step they decide comes with an explicit distribution over types, boxes and options that a harness can threshold, log or search over (Koh et al., 2024b). Decoding is then reserved for uncertain steps and for text that the option list does not contain.

References (48)