# Reflexion: an autonomous agent with dynamic memory and self-reflection

**Authors:** Noah Shinn, Beck Labash, Ashwin Gopinath  
**arXiv:** [2303.11366](https://arxiv.org/abs/2303.11366)  
**Date:** 2023-03-20  
**Summary page:** https://www.summarizepaper.com/en/paper/2303.11366v1/

## Key points

- Recent advancements in large language model (LLM) agents have shown remarkable performance across various benchmarks.
- A team of researchers proposed Reflexion to address the limitation of LLM agents lacking certain qualities inherent to human decision-making processes, such as the ability to learn from mistakes through self-reflection.
- Reflexion endows an agent with dynamic memory and self-reflection capabilities to enhance its existing reasoning trace and task-specific action choice abilities.
- The team introduced a heuristic that enables the agent to pinpoint hallucination instances, avoid repetition in action sequences, and construct an internal memory map of the given environment for full automation.
- The team evaluated their approach by assessing the agent's ability to complete decision-making tasks in AlfWorld environments and knowledge-intensive search-based question-and-answer tasks in HotPotQA environments. They observed success rates of 97% and 51%, respectively.
- The agent used ReAct to solve 97% of the given tasks in 12 trials out of 134 tasks while failing only four times in AlfWorld environments.
- In HotPotQA environments equipped with a Wikipedia search engine, the agent had to perform relevant searches across multiple documents before providing EM answers given context.
- Reflexion demonstrates the emergent property of self-reflection in an agent's decision making process which could lead to more efficient problem solving through trial and error.

## Summary

Recent advancements in large language model (LLM) agents have shown remarkable performance across various benchmarks. To address the limitation of these agents lacking certain qualities inherent to human decision-making processes, such as the ability to learn from mistakes through self-reflection, a team of researchers proposed Reflexion. This approach endows an agent with dynamic memory and self-reflection capabilities to enhance its existing reasoning trace and task-specific action choice abilities. The team introduced a heuristic that enables the agent to pinpoint hallucination instances, avoid repetition in action sequences, and construct an internal memory map of the given environment for full automation. The team evaluated their approach by assessing the agent's ability to complete decision-making tasks in AlfWorld environments and knowledge-intensive search-based question-and-answer tasks in HotPotQA environments. They observed success rates of 97% and 51%, respectively. Notably, they demonstrated improved accuracy through self-improved learning rather than success by retry. In AlfWorld environments, the agent used ReAct to solve 97% of the given tasks in 12 trials out of 134 tasks while failing only four times. In HotPotQA environments equipped with a Wikipedia search engine, the agent had to perform relevant searches across multiple documents before providing EM answers given context. While recent works aimed at allowing natural language agents to exhibit reflective-like qualities have shown impressive performance due to their ability to explain mistakes within sub-tasks within trials or process next decisions within closed-loop feedback environments using inner monologue or self-generated solutions for LLM fine-tuning; they rely on immediate failure detection for sub-tasks and cannot explain mistakes that may have developed over a long range of actions and subtasks. Overall, Reflexion demonstrates the emergent property of self-reflection in an agent's decision making process which could lead to more efficient problem solving through trial and error.
