Reflexion
An AI technique where the model reflects on its own outputs, identifies errors, and iteratively improves its responses.
Also known as: Self-Reflection Prompting, Reflective AI, Self-Critique, Iterative Refinement
Category: Techniques
Tags: ai, prompting, reasoning, llm-techniques, self-improvement, ai-agents
Explanation
Reflexion is a prompting and agent architecture that enables AI systems to learn from their mistakes through verbal self-reflection. Instead of external feedback, the model critiques its own outputs and uses those reflections to improve subsequent attempts.
The Reflexion loop:
1. **Act**: Generate an initial response or take an action
2. **Evaluate**: Assess the quality/correctness of the output
3. **Reflect**: Generate verbal feedback about what went wrong and how to improve
4. **Retry**: Use the reflection as additional context for a new attempt
Key components:
- **Self-evaluation**: Model assesses its own output against criteria
- **Verbal reflection**: Natural language critique stored for future reference
- **Memory**: Reflections persist across attempts, building improvement context
- **Iterative refinement**: Multiple cycles of reflect-and-improve
Reflection prompt patterns:
- "What errors or weaknesses are in this response?"
- "How could this answer be improved?"
- "What did I miss or get wrong?"
- "What would I do differently next time?"
Applications:
- Code generation and debugging
- Complex reasoning tasks
- Writing improvement
- Decision-making processes
- Agent systems that need to recover from errors
Reflexion demonstrates that AI can improve through self-generated feedback, making it valuable for autonomous systems that can't rely on constant human oversight.
Related Concepts
← Back to all concepts