SpecGUI: Co-Designing Phase-Specialised Speculative Decoding and Visual Token Pruning for Efficient GUI Agents

Guanxi Lu, Young D. Kwon, Miles Williams, Stylianos I. VenierisarXiv 2026

TL;DR

AI agents that click and type on your screen on your behalf are notoriously slow—spending minutes staring at accumulated screenshots and slowly thinking out loud before every single click. SpecGUI is a training-free, plug-and-play framework that tackles both bottlenecks at once, tailoring how tokens are guessed based on whether the model is thinking or acting, and trimming old screenshots using a lightweight helper model's attention. The result is an agent that runs more than twice as fast end-to-end while barely losing a step in accuracy.

What Problem Does This Paper Address?

Vision-Language Model (VLM) GUI agents operate in a loop: look at a screenshot, think about what to do (chain-of-thought reasoning), and output a structured command like click [852, 901]. Even on a beefy A100 GPU, a single turn with an 8B model takes several seconds. Over a multi-step task, you are left staring at your screen for minutes.

Unlike standard chatbots or video analyzers, GUI agents suffer from a two-headed latency monster:

  1. Decoding (generating text): Generating tokens one-by-one is slow, especially when the agent writes long reasoning monologues before acting.
  2. Prefill (processing inputs): High-resolution screenshots are needed to click exact pixel coordinates, and as turns pile up, historical screenshots bloat the input context.
Latency breakdown showing how speeding up decoding shifts the bottleneck to prefill in GUI agents.

If you only speed up text generation, image prefill becomes the bottleneck; if you only compress images, text generation drags you down. Furthermore, standard speculative decoding—where a tiny, fast "drafter" model guesses upcoming tokens in blocks for the big target model to verify in parallel—treats all text the same. In GUI agents, however, free-form reasoning is hard to guess, whereas rigid action commands are easy. Applying a one-size-fits-all guessing strategy wastes compute.

Methods

SpecGUI co-designs two training-free techniques to accelerate both decoding and prefill, implemented directly into the production-grade SGLang engine:

  1. Phase-Specialised Speculative Decoding (PS-SD): Instead of uniform drafting, PS-SD splits generation into two distinct modes using block-diffusion drafters (which predict a block of $B=16$ tokens at once):
  2. Survival-Guided Hybrid Drafting (for Reasoning): Agents repeat themselves a lot—restating goals from the last turn or using stock phrases ("The current screen shows..."). When the drafter's confidence drops, SpecGUI pulls $n$-gram matches from earlier in the current task or past tasks. It dynamically splits the 16-token draft budget between the drafter's guesses and retrieved history based on estimated "survival probabilities" (how likely the big model is to accept them).
  3. Schema-Constrained Decoding (for Actions): Because actions follow strict syntax (e.g., JSON or tool calls), SpecGUI uses a grammar automaton to auto-fill deterministic tokens (like brackets) and swap invalid guessed tokens (like a letter where a coordinate digit belongs) with valid ones before verification.
Figure 2. Illustration of Phase-Specialised Speculative Decoding. In a three-turn GUI task, Survival-Guided Hybrid Drafting retrieves reasoning tokens from t0 at t1 and improves acceptance length from 4 to 11; Schema-Constrained Decoding revises action tokens at t2.
  1. Drafter-Guided Historical Pruning (for Prefill): To shrink the growing pile of past screenshots without breaking prefix caching in serving engines, SpecGUI leaves the current screenshot untouched at 100% resolution, but aggressively prunes visual tokens from historical screenshots. To know which old pixels matter, it reuses the lightweight drafter's attention map from when that screenshot was originally acted upon, combined with a temporal decay that keeps more tokens from recent turns than ancient ones.

Datasets

No new benchmarks were introduced. The authors used existing datasets across two stages:

  • Drafter Preparation (Baselines): Diffusion drafters (DFlash and Domino) were trained on Open-PerfectBlend (1.42M general samples) and fine-tuned on AndroidControl (16K GUI samples) to compare out-of-the-box vs. GUI-adapted drafters.
  • Evaluation: Tested offline across three GUI navigation benchmarks—GUI-Odyssey and AITW (Android in the Wild) for mobile, and Mind2Web for desktop web browsing.

Key Insights and Ideas

  • The Reasoning–Action Asymmetry: Free-form reasoning yields short acceptance lengths, while structured actions yield long ones. Specializing for each phase lets SpecGUI recover 68% of the reasoning speedup and 61% of the action speedup of a GUI-fine-tuned drafter without any GUI training.
  • Immunity to Action-Space Shifts: When a drafter fine-tuned on mobile touch actions (swipe) is tested on web tasks (mouse_move), it stumbles. Test-time schema constraints immediately bridge this domain gap without retraining.
  • Current vs. Past Screenshot Sensitivity: Pruning the current screenshot wrecks speculative decoding—dropping token acceptance by up to 11.8% because the small drafter hallucinates spatial coordinates. Pruning historical screenshots (even down to 2%!) barely nudges acceptance length ($\le 1.7\%$ drop).
  • Drafter Attention is a Free Lunch: Pruning tokens inside the main LLM breaks KV-cache reuse, while pruning before the LLM is blind to the task. Reading the drafter's attention gives task-aware visual pruning before the target LLM ever sees the tokens, at near-zero extra cost.

Key Results

Evaluated across three 8B VLMs (GUI-Owl-1.5, MAI-UI, and Qwen3-VL):

  • Decoding Speedup: PS-SD boosts decoding speed by up to 3.35× over standard autoregressive decoding (raising average accepted tokens per step from 2.45 to 3.50 on general drafters, and 3.95 to 4.40 on GUI-adapted drafters).
  • Accuracy Under Heavy Pruning: Retaining just 10% of historical visual tokens (90% pruned), Drafter-Guided Historical Pruning preserves 96.8% of baseline step accuracy on average (losing just 1.8 percentage points, beating prior pruning methods).
  • End-to-End Acceleration: Combining both methods yields a 2.37× overall model speedup—far surpassing visual pruning alone (1.16×) or speculative decoding alone (1.87×)—while adding less than 0.7% latency overhead and 0 MB of extra GPU memory.
End-to-end normalized model time showing the 2.37x speedup when combining PS-SD and Guided Prune.

Limitations and Future Work

  • Offline & Single-Concurrency Scope: Experiments are conducted offline using ground-truth histories at a request concurrency of 1 with greedy decoding ($T=0$).
  • Cannot Recover Pruned Current Screens: Because neither hybrid drafting nor schema constraints can restore lost visual details, the current screenshot cannot be aggressively pruned without hurting accuracy and draft acceptance.
  • Future Directions: The authors note that phase-aware speculative decoding isn't limited to GUIs—it is a natural fit for broader AI agent workloads (like coding or tool-use agents) that alternate between messy, open-ended reasoning and strict, structured tool calls.

Summary updated

BibTeX
@misc{lu2026specgui,
  author = {Guanxi Lu and Young D. Kwon and Miles Williams and Stylianos I. Venieris},
  title = {{SpecGUI: Co-Designing Phase-Specialised Speculative Decoding and Visual Token Pruning for Efficient GUI Agents}},
  year = {2026},
  eprint = {2611.36290},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.36290},
}
Figure