PolySkill: Learning Generalizable Skills Through Polymorphic Abstraction

Simon Yu, Gang Li, Weiyan Shi, Peng QiarXiv 2025 · DOI

Abstract

Large Language Model (LLM) agents often struggle with "brittleness" when navigating the web, where skills learned on one site fail to generalize to others. We present PolySkill, a framework that applies the software engineering principle of polymorphism to web agent skill induction. By separating a skill's abstract intent from its site-specific execution, PolySkill enables agents to learn reusable, compositional workflows that generalize across websites. Our evaluation shows that PolySkill improves task success rates by up to 13.9% on unseen sites, increases skill reusability by 1.7x, and effectively prevents catastrophic forgetting in continual learning scenarios.

Introduction

While LLM agents show promise in web navigation, they frequently suffer from over-specialization. When an agent induces a skill—such as "adding an item to a cart"—it often generates code tightly coupled to a specific website's HTML structure. This "hardcoding" leads to low generalization; a skill learned on Amazon typically breaks on Target. Furthermore, as agents learn to navigate new sites, they often experience "catastrophic forgetting," where performance on previously mastered domains degrades. PolySkill addresses this fundamental tension between specificity and generalizability by decoupling the "what" of a skill from the "how."

Polymorphic Skill Induction

The core of PolySkill is a domain-driven hierarchy that organizes skills into abstract classes and concrete implementations.

  1. Abstract Classes: The agent induces a high-level schema for a domain (e.g., AbstractShoppingSite). This class defines method signatures for essential actions like search_product(query) or checkout() without site-specific code.
  2. Concrete Implementations: For a specific site (e.g., AmazonWebsite), the agent inherits from the abstract class and implements the specific UI interactions (clicks, keystrokes) required.
  3. Compositional Skills: High-level workflows (e.g., purchase_item) are defined in the abstract class. Since they call other abstract methods, they automatically function on any site with a concrete implementation.
Figure 4: Overview of the Polymorphic Skill framework, showing how abstract skills like 'search' and 'add_to_cart' are implemented across different shopping sites.

The framework employs a "Verify-then-Add" pipeline to ensure quality: the agent completes a task, an LLM proposes a programmatic skill, and the skill is only added to the library if the agent can successfully re-solve the task using it.

Experimental Setup

PolySkill was evaluated on several benchmarks:

  • Mind2Web: General web navigation across 137 websites and 31 domains.
  • WebArena: Complex, multi-step tasks in realistic environments (e-commerce, forums, git).
  • Continual Learning Tasks: Custom sets for Amazon/Target and GitHub/GitLab to measure cross-site transfer and long-term memory.

Results and Discussion

PolySkill demonstrates significant improvements over state-of-the-art baselines like ASI and SkillWeaver.

Figure 5: Performance metrics showing (1) improved skill usage and utility across success rate and reusability, and (2) the prevention of catastrophic forgetting during continual learning.

Superior Generalization and Reusability

PolySkill improved success rates by 9.4% on Mind2Web and 13.9% on unseen websites. Learned skills were reused 1.7x more frequently on seen websites. On unseen websites, PolySkill achieved a 31% reuse rate, nearly double that of prior methods (under 18%).

Preventing Catastrophic Forgetting

In continual learning experiments (WebArena -> Amazon -> Target), PolySkill maintained stable performance on the initial WebArena tasks, achieving a 4.9% advantage over baselines that saw performance plummet due to over-specialization.

Efficiency Gains

By separating concerns, PolySkill allows agents to navigate the "open web" with human-like conceptual understanding. This abstraction leads to amortized efficiency: the framework reduces the number of steps to complete tasks by over 20% and decreases inference token consumption by 10.2% during action generation.

Limitations and Future Work

Current limitations include reliance on predefined domain categories. Future research will explore autonomous skill clustering to let agents discover abstract classes based on functional similarity. Additionally, the authors aim to scale PolySkill to smaller, specialized models using Reinforcement Learning to optimize the trade-off between exploration and reusability.

Summary updated

BibTeX
@misc{yu2025polyskill,
  author = {Simon Yu and Gang Li and Weiyan Shi and Peng Qi},
  title = {{PolySkill: Learning Generalizable Skills Through Polymorphic Abstraction}},
  year = {2025},
  eprint = {2510.15863},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.15863},
}
Figure