Abstract
Reinforcement learning (RL) agents in text-based environments frequently attempt physically impossible moves or "hallucinate" objects, creating noise in training data. This paper introduces a failed action-aware objective that assigns zero reward to these specific blunders and a trajectory perturbation method that converts failed attempts into valuable "what-not-to-do" training examples. Evaluated on ALFWorld and ScienceWorld, this approach significantly boosts success rates, allowing smaller models to outperform much larger counterparts by effectively learning from their own mistakes.
Introduction
Training agents for real-world robotics is a slow and costly endeavor. Text-based simulators like ALFWorld provide a "gym" for high-level reasoning, yet agents often struggle with grounding. A common issue in standard RL is that every action within a successful episode is treated as "good." If an agent wanders aimlessly or attempts invalid actions before reaching a goal, the model may learn these inefficiencies as part of a winning strategy, leading to noisy and nonsensical policies.
Learning from Failure: The Failed Action-Aware Objective
To address this, the authors propose a Failed Action-Aware Objective ($\hat{J}$). Instead of a uniform reward for all steps in a successful trajectory, the model analyzes textual feedback from the environment. If the environment returns messages like "Nothing happens" or "Invalid action," the agent receives a return of zero for that specific step. This explicitly teaches the model that while the overall mission succeeded, specific moves were wasted effort.
Data Augmentation via Trajectory Perturbation
Beyond penalizing failures, the researchers introduce Trajectory Perturbation. This method salvages data from unsuccessful runs. By taking a successful trajectory and an unsuccessful one sharing the same goal, they "stitch" failed actions from the unsuccessful run into the successful one. These are annotated with failure messages, creating a "perturbed" successful trajectory. This teaches the agent how to recognize and recover from specific errors it encountered during exploration.
Experimental Results
The method was evaluated on two primary benchmarks: ALFWorld (household tasks) and ScienceWorld (elementary science curriculums).
Key findings include:
- ALFWorld Success: On challenging "Unseen" tasks with human-annotated goals, the proposed method (IAM-FA + DA) achieved a 55% success rate, a significant jump from the 37% baseline.
- ScienceWorld Performance: The agent nearly matched the performance of models trained on 100% expert demonstrations, despite learning primarily from its own interactions.
- Efficiency over Scale: A GPT-2 Medium (355M parameters) model using this method outperformed or matched much larger models like Llama-2-7B that relied on more complex reasoning or expensive GPT-4 annotations.
Conclusion
The research demonstrates that "zero is better than nothing." Retaining failed actions with zero reward allows agents to learn environment boundaries more effectively than simply filtering them out. While currently dependent on deterministic feedback, this approach offers a model-agnostic way to improve the grounding and efficiency of text-based agents, paving the way for more robust sequential decision-making in complex environments.
Summary updated