Agents that learn from their own mistakes — without weight updates. Reflexion's verbal reinforcement learning, Self-Refine's critic loops, Tree of Thoughts' deliberate search over reasoning paths, and Language Agent Tree Search (LATS) which combines them all.
A bare ReAct agent that fails has no way to recover. The next time it sees a similar problem, it makes the same mistake. Self-improvement techniques fix this without retraining the model — they let the agent inspect its own trajectory, write a critique, and use the critique as additional context on the next attempt.
Four techniques dominate:
The meta-insight: for many tasks, more inference-time compute on a smaller model beats more training-time compute on a larger model. Self-improvement is the most effective way to spend that inference compute.
This chapter covers:
Click any topic to jump in
Write a paragraph of self-critique, feed it into the next attempt. Gradient-free policy improvement.
Same trajectory (Self-Refine) or search the tree (ToT)
Generate, critique, revise — single-shot self-improvement for one-off generation tasks.
Search the tree of reasoning paths with LLM-as-judge scoring.
MCTS over agent trajectories — combines ReAct, Reflexion, and ToT into one framework.
A priority order for inference-time techniques when your agent is failing.
Reflexion (Shinn et al., 2023) showed that an agent can dramatically improve its success rate on multi-step tasks just by writing a paragraph of self-critique after each failed attempt and feeding that paragraph into the next attempt's prompt. No weight updates, no fine-tuning — just an episodic memory of what went wrong.
The technique is so simple it sounds like a magic trick. It works because LLMs are very good at learning from textual feedback in context — much better than they are at planning a perfect trajectory on the first try.
Reflexion factors the agent into three roles, each played by an LLM call:
The reflection is appended to an episodic memory buffer. On the next attempt, the actor's prompt includes the most recent reflections (typically the last ). The actor reads the reflections and adjusts its strategy.
Reflexion's improvement can be framed as policy improvement under a textual representation. The reflection is a hint sampled from — the conditional distribution over hints given the failed trajectory. The next attempt's policy is . This is policy iteration in prompt space rather than parameter space — gradient-free, but it works because the in-context conditioning of strong LLMs is approximately as expressive as a small fine-tune.
An agent attempts a coding task and fails the test suite. What does Reflexion add to the next attempt?
Classical RL gives the policy a scalar reward and updates parameters via backprop. For agentic tasks this is hard:
Verbal RL sidesteps all of this. The reflection IS the credit assignment — written in natural language by an LLM that is much better at counterfactual reasoning ('what if I had done X instead?') than a value function is at backing up scalars. And because the reflection is text, it can be highly specific to the task: 'don't forget to escape SQL strings' is a much more useful signal than 'reward = -0.3'.