Inducing Programmatic Skills for Agentic Tasks

Zora Zhiruo Wang, Apurva Gandhi, Graham Neubig, Daniel Fried

TL;DR

This paper introduces ASI (Agent Skill Induction), a novel method for web navigation agents to learn and utilize programmatic skills on the fly. By representing skills as executable code, ASI agents achieve significantly higher success rates and efficiency compared to static or text-skill-based agents, demonstrating its effectiveness in complex and evolving web environments.

What Problem Does This Paper Address?

Modern digital tasks, like web navigation, require agents to perform a wide array of specialized actions, from searching for products to planning routes. While agents can learn from demonstrations, this is often an offline, data-intensive process that may not align with real-time task demands. Existing online learning methods often represent learned skills as text, lacking robust verification and composability. This paper addresses the challenge of enabling web agents to efficiently and accurately adapt to diverse and dynamic web environments by learning task-specific skills online and representing them in a verifiable and composable programmatic format.

Methods

The core of ASI is its Agent Skill Induction process. When an agent encounters a task, it first attempts to solve it using primitive actions. Based on successful trajectories, ASI induces new skills. The key innovation here is representing these skills as executable Python programs rather than free-form text. This programmatic representation allows for:

  • Verification: Induced skills can be programmatically verified for correctness by executing them within a test trajectory. This ensures that only reliable skills are added to the agent's repertoire.
  • Composability: Programmatic skills can be chained together and composed to form more complex behaviors, enabling higher-level abstractions (e.g., search_product instead of a sequence of clicks and fills).
  • Action Space Integration: Verified skills are directly integrated into the agent's action space, making them readily available for future tasks.

ASI also incorporates an episode cleaning step to remove execution errors and simplify thought processes before skill induction, further improving the quality of learned skills.

Datasets

The primary dataset used for evaluation is WebArena, a benchmark for web navigation agents that includes 812 test examples across five domains: e-commerce, social forum, software development, content management, and travel. The paper also mentions using sandboxed websites and their real-world counterparts for cross-website generalization experiments.

Key Insights and Ideas

  • Programs as Skills: Representing agent skills as executable programs, rather than text, is a significant advantage. This allows for rigorous verification and leads to more reliable and efficient skill utilization.
  • Online Verification is Crucial: The ability to programmatically verify induced skills before integrating them into the agent's action space dramatically improves induction quality and, consequently, overall task success.
  • Abstraction Drives Efficiency: Programmatic skills act as higher-level abstractions, allowing agents to perform complex sub-tasks in fewer steps by composing primitive actions. This is particularly impactful in long-horizon tasks.
  • Adaptability Beyond Static Skills: ASI agents can effectively transfer common skills across websites and, importantly, can adapt or update incompatible skills when encountering new website designs, showcasing true online learning.

Key Results

  • Improved Success Rate: ASI achieved a 23.5% higher success rate than a static baseline agent and an 11.3% higher success rate than a text-skill learning adaptive agent (AWM) on the WebArena benchmark.
  • Enhanced Efficiency: ASI reduced the number of steps required to complete tasks by 10.7–15.3% compared to baselines, with even greater efficiency gains (up to 85.2% reduction in one case study) in scaled-up, long-horizon scenarios.
  • Scalability: ASI demonstrated strong performance in scaled-up browsing activities, outperforming baselines in both success rate and efficiency, highlighting the benefit of programmatic skill composition.
  • Generalization: ASI agents could effectively transfer common skills to new websites and adapt to incompatible skills, showing promising generalization capabilities.

Limitations and Future Work

The authors acknowledge that while ASI can update incompatible skills, it might not always find the optimal way to adapt. They also suggest further investigation into:

  • Skill Granularity: Determining the most suitable conceptual or empirical granularity for induced skills.
  • Online Evolution Stability: Understanding the stability of the online skill induction and learning process.
  • Skill Quality: Further comparing the quality of ASI-induced skills against human expert-defined skills.

Summary updated

BibTeX
@inproceedings{wang2025inducing,
  author = {Zora Zhiruo Wang and Apurva Gandhi and Graham Neubig and Daniel Fried},
  title = {{Inducing Programmatic Skills for Agentic Tasks}},
  booktitle = {COLM},
  year = {2025},
  url = {https://openreview.net/forum?id=lsAY6fWsog},
}
Figure