Abstract
Large Language Model (LLM) Agents have recently garnered increasing interest, yet they are limited in their ability to learn from trial and error, a key element of intelligent behavior. In this work, we argue that the capacity to learn new actions from experience is fundamental to the advancement of learning in LLM agents. While humans naturally expand their action spaces and develop skills through experiential learning, LLM agents typically operate within fixed action spaces, limiting their potential for growth. To address these challenges, our study explores open-action learning for language agents. We introduce a framework, LearnAct, with an iterative learning strategy to create and improve actions in the form of Python functions. In each iteration, the LLM revises and updates the currently available actions based on the errors identified in unsuccessful training tasks, thereby enhancing action effectiveness. Our experimental evaluations across Robotic Planning and AlfWorld environments reveal that after learning on a few training task instances, our approach to open-action learning markedly improves agent performance (by 32% in AlfWorld compared to ReAct+Reflexion), highlighting the importance of experiential action learning in the development of more intelligent LLM agents.
Introduction
While Large Language Models (LLMs) excel at reasoning and planning based on prior knowledge, they often struggle to learn from their own mistakes during task execution. Most current LLM agents operate within a fixed action space—a set of basic commands (like "pick up" or "move") that remains static. This creates a "mismatch" problem: while an LLM might conceptualize a high-level plan, executing it requires a tedious, error-prone sequence of low-level commands.
Humans, by contrast, develop "skills" or macro-actions through experience. For LLM agents to achieve true intelligence, they require the ability to expand their action sets dynamically—a concept termed open-action learning. This paper addresses this gap by introducing LearnAct, a framework that enables agents to iteratively create and refine their own action space.
The LearnAct Framework
LearnAct treats actions as executable Python functions (APIs), allowing the agent to handle complex logic like loops, conditional checks, and assertions. The framework operates through a two-stage pipeline: Action Creation and Iterative Action Learning.
Action Creation and Iteration
In the initial stage, the LLM generates high-level Python functions that wrap multiple basic actions. For example, instead of executing separate "pick" and "move" commands, it might create a carry_to(obj, destination) function.
The core of the framework is the Iterative Action Learning phase. The agent attempts training tasks using its new actions; if it fails, a SelectErrorCase module identifies the failure point. The framework then triggers an ActionLearn process to refine the action space.
As shown in the Action Learner details, the LLM can choose between two primary refinement strategies:
- Function Updating: Rewriting the Python code to fix logic errors (e.g., adding a check to see if a container is open).
- Writing Notes: Adding natural language annotations to the action's documentation to guide the agent on proper usage contexts.
To ensure stability, LearnAct employs a sampling strategy, generating multiple versions of an action and selecting the one that yields the highest success rate and efficiency on training instances.
Experimental Evaluation
The researchers evaluated LearnAct on two primary benchmarks:
- Robotic Planning: Tasks involving long-horizon robot manipulation, such as making cocktails (Barman) or moving objects between rooms (Gripper, Blockworld, Tyreworld).
- AlfWorld: A simulator for household objectives (e.g., "clean an apple and put it in the fridge") requiring exploration in partially observable environments.
Key Results
LearnAct consistently outperformed state-of-the-art baselines like ReAct, Reflexion, and Voyager:
- AlfWorld Success: Using GPT-4, LearnAct achieved a 72.2% success rate, a 32% relative improvement over the 54.7% achieved by ReAct+Reflexion.
- Robotic Planning: In the Barman task, LearnAct reached an 87.4% success rate, significantly higher than the 74.4% of the best baseline.
- Efficiency: Post-learning, agents called actions more accurately, indicating that the learned action space better aligned with the LLM's internal planning logic.
Insights and Discussion
Several key insights emerged from the study. First, code is an effective language for action, providing the robustness needed for complex logic that simple text-based macros lack. Second, the model strongly prefers updating code (90% of the time) over writing notes, though natural language usage examples remain highly influential on performance.
Crucially, LearnAct demonstrates transferability. Unlike methods that learn to solve a specific instance, LearnAct learns a general action space that can be applied to new, unseen problems within the same domain. However, the authors note that "prolonged learning" can lead to overfitting, where the agent over-optimizes code for specific training cases at the expense of general task rules.
Conclusion
LearnAct represents a significant step toward autonomous agents that can grow their own capabilities. By allowing LLMs to define and refine their own action APIs through trial and error, the framework bridges the gap between high-level reasoning and low-level execution. Future work will explore how agents might share and combine action spaces across different domains to move toward a more generalist artificial intelligence.
Summary updated