Abstract
Large Language Model (LLM) agents often remain static during inference, failing to learn from unsuccessful attempts. We present SAMULE (Self-learning Agents enhanced by MUlti-LEvel reflection), a framework that enables agents to autonomously improve by training a retrospective model on multi-level reflections. By synthesizing feedback at the micro (individual trial), meso (task-specific taxonomy), and macro (cross-task insights) levels, SAMULE significantly outperforms existing reflection-based baselines on complex planning and interactive benchmarks.
1. Introduction
While Large Language Model (LLM) agents have become increasingly capable at reasoning and tool use, they remain fundamentally limited in their ability to learn from experience. Most current agents are "static" during inference; if they fail a task, they often repeat the same mistakes in subsequent attempts. Existing self-reflection methods, such as Reflexion, frequently produce generic, unhelpful feedback because they lack a deep diagnostic mechanism. Furthermore, many methods suffer from "success bias," relying heavily on rare successful trajectories while ignoring the rich information embedded in unsuccessful attempts.
To address these challenges, we propose SAMULE, which systematically extracts knowledge from failures across multiple granularities to fine-tune a specialized retrospective model.
2. Methodology
The SAMULE framework operates in two primary stages: reflection synthesis and model training.
2.1 Multi-Level Reflection Synthesis
Instead of relying on free-form reflection, SAMULE synthesizes high-quality data across three granularities:
- Micro-Level (Single-Trajectory): The agent compares a failed trajectory against a reference plan to identify immediate errors and generate targeted corrections.
- Meso-Level (Intra-Task): The system examines multiple trials of the same task to build a structured error taxonomy (e.g., "Budget Constraint Violation" or "Travel Time Scheduling Error").
- Macro-Level (Inter-Task): It clusters similar error types across different tasks to extract high-level, transferable insights that improve future decision-making.
2.2 Retrospective Model Training and Inference
The synthesized reflections are used to fine-tune a smaller "retrospective model" (specifically Qwen 2.5 3B) via Supervised Fine-Tuning (SFT). During inference, this model takes the agent's current trajectory and generates specific, actionable reflections without needing access to ground-truth reference plans. For interactive settings, a "foresight" mechanism is introduced where the agent predicts user responses; significant deviations trigger a reflection step to proactively adapt the plan.
3. Experimental Evaluation
We evaluated SAMULE on three challenging benchmarks: TravelPlanner (complex itinerary management), NATURAL PLAN (Trip and Meeting planning), and Tau-bench (interactive retail and airline domains).
3.1 Performance Results
SAMULE demonstrated substantial performance gains across the board using Claude 3.5 Sonnet as the actor. As shown in the performance trajectories below, SAMULE consistently improves its accuracy and pass rates over successive trials, significantly outperforming static baselines like ReAct and existing reflection methods like Reflexion.
Key results include:
- TravelPlanner: Achieved a 20.00% pass rate, nearly quadrupling the performance of the standard Reflexion baseline (5.56%).
- NATURAL PLAN: On the "Trip" domain, SAMULE reached 60.31% accuracy, compared to 50.00% for Reflexion.
- Tau-bench: In interactive settings, SAMULE significantly improved pass rates (e.g., 75.97% in Retail vs. 69.75% for Reflexion), proving the efficacy of foresight-based reflection.
4. Discussion and Key Insights
Our analysis yields several critical insights for agentic learning:
- Failures as Teachers: In "failure-dense" environments, diagnosing why an agent failed provides a more robust learning signal than mimicking rare successful paths.
- The Power of Taxonomy: Moving from free-form reflection to structured error classification (meso-level) forces the model to integrate conceptual knowledge with procedural steps.
- SFT vs. RL: Surprisingly, simple SFT on high-quality, structured reflections outperformed more complex Reinforcement Learning methods like Retroformer, suggesting that reflection data quality is the primary driver of performance.
5. Conclusion
SAMULE provides a scalable framework for teaching LLM agents to learn from their own mistakes. By bridging the gap between failure and future success through multi-level reflection, it enables agents to become dynamic learners. Future work will investigate incremental taxonomy construction to support lifelong learning in evolving environments.
Summary updated