SCAFFOLD: Self-Improving Web Agents via Recursive Parametric Skill Abstraction

Bowei He, Xiaokun Zhang, Meng Ding, Xue LiuarXiv 2026

TL;DR

SCAFFOLD is a self-improving framework for visual web agents that structures learned behaviors into a clean, recursive hierarchy of executable skills and distills them directly into the model's weights. By combining multi-instance induction, Minimum Description Length (MDL) library compaction, and weight-level fine-tuning, it prevents library bloat and achieves state-of-the-art performance across major web automation benchmarks.

What Problem Does This Paper Address?

Building autonomous web agents that can navigate complex, long-horizon web interfaces remains a major challenge. Most current agents treat every task as an isolated episode; an agent might figure out how to navigate a complex checkout page on an e-commerce site, only to completely discard that procedural knowledge before starting the next task.

Recent "skill-augmented" frameworks try to solve this by saving successful action sequences into a prompt-side cache. However, these frameworks suffer from three major limitations:

  1. Flat Libraries: They treat the skill library as a flat or simple two-tier pool, meaning skills cannot call other skills recursively.
  2. Library Bloat: The libraries grow monotonically, accumulating near-duplicate skills with no principled way to compress or prune them.
  3. Frozen Base Policies: The accumulated knowledge lives entirely within the prompt context. The underlying model weights are never updated, meaning the base agent remains just as weak as it was at the beginning.

Methods

SCAFFOLD introduces a five-stage self-improvement loop that systematically addresses these gaps:

Figure 1: Overview of SCAFFOLD framework. The five stages are executed sequentially in each iteration: rollout, multi-instance induction, recursive composition, MDL-driven compaction, and distillation. The library growing in both depth and width is periodically compressed.
  1. Rollout: The agent collects interaction trajectories on a set of training tasks using its current policy and skill library.
  2. Multi-Instance Skill Induction: Instead of creating a skill from a single trajectory (which often leads to overfitting on hardcoded element IDs), SCAFFOLD clusters successful trajectories and only induces a parametric skill if it is supported by at least $n_{min}$ instances.
  3. Recursive Composition: When creating a new skill, the system is allowed to call any previously learned skill. This creates an organic, hierarchical skill tree where higher-level workflows invoke lower-level routines.
  4. MDL-Driven Library Compaction: To prevent library bloat, SCAFFOLD periodically optimizes the library using a Minimum Description Length (MDL) objective. It applies three greedy operators: Merge (combining behaviorally equivalent skills), Refactor (extracting common action subsequences into new mid-level skills), and Prune (deleting unused skills).
  5. Distillation Back into Weights: Successful trajectories are converted into plan-augmented training data. The base model is then fine-tuned via LoRA, internalizing the skill abstractions directly into its weights so that the base policy itself becomes stronger over time.

Datasets

The authors evaluated SCAFFOLD across three challenging web agent benchmarks:

  • WebArena: 812 long-horizon tasks across four self-hosted sites (E-commerce, Social Forum, GitLab, and CMS).
  • VisualWebArena (VWA): 910 tasks built on WebArena that explicitly require visual reasoning.
  • Online-Mind2Web (OM2W-X): A web automation dataset spanning 136 real-world websites. The authors partitioned this by sites to create a strict cross-site transfer evaluation split.

Key Insights and Ideas

  • Compounding Self-Improvement: Distilling skills back into model weights creates a virtuous cycle. As the base policy improves, it pushes the frontier of solvable tasks higher in the next iteration, which in turn furnishes even richer, higher-depth skills to induce.
  • Composition and Compaction are Synergistic: Unbounded recursive composition allows the agent to handle long-horizon tasks without runaway prompt lengths. Meanwhile, MDL compaction prevents this depth from collapsing into a redundant mess.
Figure 3: Library growth dynamics across iterations on WebArena. Top: total skill count without compaction (dashed) the library balloons; with compaction (solid) it stabilizes near 180 skills. Bottom: mean abstraction depth, which grows monotonically as recursive compo- sition kicks in.
  • Semantic Grounding Beats Brittle Selectors: Instead of hardcoding specific DOM element IDs, SCAFFOLD's skills use a small vision-language model (VLM) to ground element references dynamically at runtime (e.g., locating "the search input"). This makes the skills highly robust to website layout changes.

Key Results

SCAFFOLD significantly outperforms existing zero-shot, memory-augmented, and skill-induction baselines:

Success rate comparison across benchmarks
  • Sustained Scaling: While flat skill caches plateau after 2–3 iterations due to library bloat, SCAFFOLD continues to improve monotonically across 5 iterations.
Figure 2: Success rate vs. self-improvement iteration on WebArena. SCAFFOLD continues to improve through K=5 while baselines saturate around k=2–3. Shaded regions are 1 std over 3 seeds.
  • Robustness to Environmental Noise: When subjected to adversarial perturbations like random latency injections or DOM attribute shuffling (which breaks hardcoded selectors), SCAFFOLD's success rate dropped by at most 2.1 points, exhibiting roughly half the sensitivity of competing methods.
  • Efficiency Gains: By trading expensive LLM planning calls for cheaper, modular skill executions, SCAFFOLD reduced total token consumption from 224K to 79K per successful task compared to a standard ReAct baseline.

Limitations and Future Work

The authors note several limitations that pave the way for future research:

  • Inducer Dependence: The framework relies heavily on a strong proprietary model (GPT-4o) to handle the skill induction and refactoring steps, accounting for roughly 70% of the total API cost.
  • Verifier Dependence: It assumes access to a per-task verifier to determine trajectory success during rollouts, which is difficult to guarantee in unconstrained, wild web environments.
  • Distillation Forgetting: While LoRA fine-tuning successfully internalizes skills, the authors observed a minor regression ($\le 1.2$ points) on a small subset of simple tasks that the original base model could already solve.

Summary updated

BibTeX
@misc{he2026scaffold,
  author = {Bowei He and Xiaokun Zhang and Meng Ding and Xue Liu},
  title = {{SCAFFOLD: Self-Improving Web Agents via Recursive Parametric Skill Abstraction}},
  year = {2026},
  eprint = {2609.05511},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.05511},
}
Figure