Textual Stochastic Gradient Descent: Discrete Optimization of External Memory for Reasoning Language Agents
Abstract
Lay Summary
Modern AI systems can reason well, but they do not easily learn from their own mistakes. Teaching them something new usually means expensive retraining. A popular alternative is to let the system keep a growing notebook of past examples to consult, but this tends to backfire: the notebook fills up with redundant or misleading entries, and performance gets worse as it grows. We take a different view. Instead of letting this notebook pile up, we treat it as something the system should actively improve, much like studying for an exam by refining your notes rather than just adding more pages. Our method lets the AI add a new note when it fails a problem, correct a note that led it astray, and remove ones that are redundant, all while keeping the notebook small. Every change is double-checked so that it helps on similar future problems, not just the single case at hand. On challenging math competition problems, this approach raises accuracy substantially while shrinking the notebook from hundreds of entries to about thirty well-chosen rules.