PolySkill: Learning Generalizable Skills Through Polymorphic Abstraction For Continual Learning

Simon Yu, Gang Li, Weiyan Shi, Peng QiICLR 2026

TL;DR

PolySkill introduces a framework that allows LLM-based web agents to learn generalizable skills by borrowing the concept of polymorphic abstraction from software engineering. By decoupling a skill’s abstract goal (what to do) from its site-specific implementation (how to do it), agents can transfer knowledge across different websites, achieving up to a 1.7x improvement in skill reuse and significantly higher success rates on unseen environments.

What Problem Does This Paper Address?

While Large Language Model (LLM) agents have shown promise in navigating the web, they struggle with efficiency and generalization. To avoid solving every task from scratch, researchers have developed "skill induction" methods where agents save successful action sequences as reusable "skills."

However, existing skills are often brittle and over-specialized. A skill learned for Amazon (e.g., "click the yellow button with ID #123") will break on Target because the UI layout and element IDs are different. This leads to "catastrophic forgetting" or a massive library of redundant, site-specific scripts that fail to capture the underlying logic of a task (like "searching for a product"). The challenge is: how can we enable agents to learn skills that are robust enough to work across the entire open web?

Methods

The authors introduce PolySkill, which organizes agent knowledge into a hierarchical, object-oriented structure.

Polymorphic Abstraction Concept
  1. Polymorphic Abstraction: Inspired by Object-Oriented Programming (OOP), PolySkill separates skills into two layers:
  2. Abstract Classes: These define a "schema" for a domain (e.g., AbstractShoppingSite). They contain method signatures like search_product(query) and add_to_cart(item_id) without site-specific code.
  3. Concrete Subclasses: These contain the "how-to" for specific sites (e.g., AmazonSite or TargetSite), implementing the abstract methods using the site's unique HTML elements.
  4. Compositional Skills: High-level logic (e.g., purchase_item) is written once in the abstract class using other abstract methods. Because the high-level logic doesn't depend on specific UI elements, it automatically works on any new site once the agent implements the basic "primitive" methods for that site.
  5. Induction Pipeline: When an agent succeeds at a task, an LLM-based "Inductor" analyzes the trajectory. Instead of just saving a script, it first checks if the goal fits an existing abstract signature. If it's a new site, the agent uses the abstract class as a "blueprint" to guide its exploration, specifically trying to find implementations for the required abstract methods.

Datasets

The researchers evaluated PolySkill across several demanding benchmarks:

  • Mind2Web: A large-scale dataset for general web navigation spanning 137 websites and 31 domains.
  • WebArena: A realistic, functional environment including categories like Shopping, Reddit, GitLab, and Maps.
  • Custom Real-World Tasks: The authors curated 50 specific tasks each for Amazon and Target, and 75 tasks for GitHub, specifically to test cross-website transfer and continual learning.

Key Insights and Ideas

  • The "Blueprint" Effect: The abstract class acts as a curriculum. When the agent visits a new store, it doesn't wander aimlessly; it knows it needs to find a way to "search" and "add to cart," which makes self-exploration much more efficient.
  • Decoupling Prevents Forgetting: In continual learning, agents often lose performance on "Site A" after learning "Site B." PolySkill prevents this because site-specific implementations are stored in separate subclasses, while the core logic remains safely in the parent class.
  • Code as the Best Representation: Building on prior work (like ASI and SkillWeaver), the paper reinforces that representing skills as executable code is far more robust than natural language descriptions or raw action traces.
  • New Evaluation Metrics: The authors argue that "Success Rate" isn't enough. They introduced Skill Reusability (how often a learned skill is actually used again) and Task Coverage to better diagnose why agents fail to transfer knowledge.

Key Results

PolySkill consistently outperformed state-of-the-art baselines (ASI and SkillWeaver) across multiple LLMs, including GPT-4.1, Claude-3.7-Sonnet, and open-source models like Qwen3-Coder.

PolySkill Performance and Continual Learning
  • Generalization: Success rates increased by 9.4% on Mind2Web and 13.9% on unseen websites.
  • Efficiency: The agent completed tasks using 20% fewer steps on average by leveraging high-level skills.
  • Transferability: On unseen websites, PolySkill achieved a 31% skill reuse rate (a 1.7x improvement), compared to less than 18% for previous methods. Task coverage and skill compositionality also saw massive gains (1.6x and 1.8x respectively).
  • Continual Learning: As shown in the results, PolySkill prevents catastrophic forgetting. When moving from WebArena Shopping to Amazon and Target, PolySkill maintained a +4.9% performance gap over ASI.
  • Cost: Long-term token usage for inference was reduced by 10.2% because the agent solved tasks more precisely with fewer "trial and error" steps.

Limitations and Future Work

  • Manual Domain Definition: Currently, a human must define the initial abstract classes (e.g., "this is a shopping site"). The authors aim to move toward autonomous skill clustering, where the agent uses soft-clustering on execution traces to "discover" abstract categories on its own.
  • Dynamic UI Elements: While polymorphism handles layout changes between sites, extremely dynamic websites (where elements change within a single session) still pose a challenge for static code-based skills.
  • Reinforcement Learning: The authors suggest that the next step is integrating this polymorphic structure into Reinforcement Learning (RL) frameworks, allowing smaller models to acquire these skills through environmental feedback rather than just prompting.

Summary updated

BibTeX
@inproceedings{yu2026polyskill,
  author = {Simon Yu and Gang Li and Weiyan Shi and Peng Qi},
  title = {{PolySkill: Learning Generalizable Skills Through Polymorphic Abstraction For Continual Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=KdEsujyiSV},
}
Figure