Concept · Chapter 13: Agents
Agent Reflection
Reflection turns feedback from an attempt into a proposed lesson for subsequent attempts.
The problem
An agent may repeat the same unsuccessful strategy.
The solution
Record what failed and why, then make that information available for a revised attempt.
The consequence
Reflection helps only when its feedback and diagnosis are useful.
You should understand first
- Text as Data
- Probability and Distributions
- Conditional Probability and Bayes' Theorem
- Probability of Sequences
- Language Modeling
- Vectors
- Dot Product
- Embeddings
- Attention
- Softmax
- Self-Attention
- Causal Masking
- Entropy
- Loss Functions
- Cross-Entropy Loss
- Autoregressive Next-Token Prediction
- Pretraining at Scale
- GPT-1 → GPT-2 → GPT-3
- In-Context Learning
- The Turing Test
- Symbolic AI
- Logic and Rules
- Expert Systems
- Knowledge Representation
- The Knowledge-Acquisition Bottleneck
- From Rules to Learning
- Supervised, Unsupervised and Self-Supervised Learning
- Expected Value and Variance
- Reinforcement Learning
- MDPs, Policies and Value
- Decoding: Greedy, Temperature, Top-k, Top-p
- One-Hot Encoding
- Tokenization
- Chat Templates
- System Prompts and Instructions
- Structured Outputs and Constrained Decoding
- Tool Calling
- LLM Agents
- Agent Runtime
- Agent Memory
- Agent Reflection
Feedback before a lesson
In the cart lab, returning zero passes the empty-input case and fails ordinary carts. A useful reflection identifies overfitting to the reported example and calls for preserving the broader contract.
Reflexion stores linguistic feedback for later trials rather than changing model weights. This differs from optimizing a policy through gradient updates.
A critic is not a verifier
A reviewer can make the same mistake as the author. A test supplies an independently executable check, although its coverage can still be incomplete. Asking for repeated self-critique does not automatically add new information.
The effectiveness of reflection depends on the model, task, feedback and cost budget. Active research Evaluate an otherwise identical system with and without the reflection step, and inspect the failures. A longer explanation is not an outcome metric.
What to remember
- Reflection turns feedback from an attempt into a proposed lesson for subsequent attempts.
- Record what failed and why, then make that information available for a revised attempt.
- Reflection helps only when its feedback and diagnosis are useful.
Key papers
Reflexion: Language Agents with Verbal Reinforcement Learning
Noah Shinn et al. · 2023
Uses feedback and stored reflection to influence later trials without weight updates.
How to read it: Inspect the feedback sources and ablations, not just the final success rate.