SAMULE: Self-Learning Agents Enhanced by Multi-level Reflection

Yubin Ge, Salvatore Romeo, Jason Cai, Monica Sunkara, Yi Zhang

TL;DR

This paper introduces SAMULE, a novel framework for self-learning AI agents that significantly improves their ability to learn from failures. By synthesizing reflections across multiple levels of granularity (micro, meso, macro) and training a retrospective model, SAMULE enables agents to perform more robust error analysis and generate targeted corrections, leading to substantial performance gains on complex planning tasks.

What Problem Does This Paper Address?

Modern AI agents, particularly those powered by Large Language Models (LLMs), excel at generating text and following instructions. However, they struggle to autonomously improve from experience, especially in complex, failure-prone environments. Existing methods often rely on rare successful trajectories for learning, fail to generate actionable reflections due to inadequate error analysis, or are sensitive to the quality of synthesized reflections. This limits their utility in real-world scenarios where failures are common and learning from them is crucial for long-term success. The paper aims to bridge this gap by enabling agents to learn effectively from their mistakes.

Methods

SAMULE introduces a two-stage approach:

Stage I: Multi-Level Reflection Synthesis This stage focuses on generating high-quality reflection data by analyzing past agent trajectories. It comprises three levels:

  • Single-Trajectory Learning (Micro-level): Analyzes individual failed trajectories to identify immediate errors and generate specific corrective strategies by comparing the agent's output to a reference plan.
  • Intra-Task Learning (Meso-level): Examines multiple trajectories from the same task query to categorize common failure patterns and build an error taxonomy. This allows for richer, pattern-based feedback.
  • Inter-Task Learning (Macro-level): Clusters similar errors across diverse task queries to extract high-level, transferable insights that improve future decision-making across tasks.

These multi-level reflections are then merged to form a final reflection.

Stage II: Retrospective Model Training A smaller language model, the "retrospective model," is trained using supervised fine-tuning (SFT) on the synthesized multi-level reflections. This model can then generate trajectory-specific reflections during inference without needing access to reference outputs.

Foresight-based Reflection (Interactive Setting): For interactive scenarios, SAMULE extends its framework to allow agents to proactively reflect and adapt during user interactions. It compares the agent's predicted user response with the actual response, triggering a reflection if significant deviations occur.

Datasets

The paper evaluates SAMULE on three challenging benchmarks:

  • TravelPlanner: A benchmark for travel planning scenarios with millions of data records and curated queries.
  • NATURAL PLAN: Assesses LLM planning capabilities using real-world tools, focusing on structured reasoning.
  • Tau-bench: Used to evaluate agent performance in interactive and non-interactive settings, simulating user conversations.

Key Insights and Ideas

  • Failure is a Richer Signal: The research strongly suggests that focusing on failures, rather than solely on successes, provides more informative signals for learning, especially in complex environments where success is rare.
  • Multi-Level Reflection is Crucial: Synthesizing reflections from micro (instance-specific) to macro (general, conceptual) levels leads to more robust and transferable insights than single-level reflection.
  • Structured Reflection Enhances Agents: Well-designed reflection synthesis, even when combined with simple SFT, can yield superior results compared to more complex RL-based methods, highlighting the importance of the quality of reflection data.
  • Reference Guidance is Key at the Micro-Level: Providing reference plans is particularly useful for detailed error analysis at the micro-level. However, over-reliance on references at higher levels can hinder generalization.

Key Results

  • Significant Performance Gains: SAMULE consistently and substantially outperforms existing reflection-based baselines across all three benchmarks. For example, on TravelPlanner, SAMULE achieved a 20% pass rate, significantly higher than Reflexion (5.56%) and Inter-Task Error Reflection (9.44%). On NATURAL PLAN, SAMULE reached 60.31% accuracy, compared to Reflexion's 50% and Inter-Task Error Reflection's 51.56%.
  • Robustness in Complex Tasks: The method shows particular strength in complex, failure-dense environments where other methods struggle.
  • Interactive Learning: The foresight-based reflection mechanism enables real-time adaptation and improved outcomes in interactive settings.
  • Error Reduction: SAMULE significantly improves the agent's ability to address identified error types, as shown by error reduction rates.

Limitations and Future Work

  • Static Error Taxonomy: The current error taxonomy is static and constructed offline. The authors suggest future work could explore incremental taxonomy construction and online adaptation for lifelong learning in dynamic environments.
  • Computational Overhead: The multi-level reflection synthesis process can be computationally intensive, especially for large datasets with long trajectories. Future research could focus on more scalable synthesis techniques or efficient memory management.
  • Reference Dependency: While references are beneficial at the micro-level, their absence in some benchmarks and the potential for degraded performance with over-reliance at higher levels are noted. Future work might explore methods to mitigate this dependency or optimize reference usage.

Summary updated

BibTeX
@inproceedings{ge2025samule,
  author = {Yubin Ge and Salvatore Romeo and Jason Cai and Monica Sunkara and Yi Zhang},
  title = {{SAMULE: Self-Learning Agents Enhanced by Multi-level Reflection}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
}
Figure