TL;DR
A new paper proposes Experience Memory Graph (EMG): instead of making an LLM agent "reflect" after failures and retry, compute the exact error offline using graph matching, then let the agent correct itself in a single shot at test time.
Paper: Experience Memory Graph: One-Shot Error Correction for Agents arXiv: 2607.13884 Authors: Wenjun Wang, Yuchen Fang, Fengrui Liu, Zibo Liang, Kai Zheng Links: https://arxiv.org/abs/2607.13884 | https://arxiv.org/html/2607.13884v1
The Problem with Reflect-Retry Loops
The typical pattern — agent fails, reflects ("I should have gone to the kitchen"), retries, fails again — has three hard flaws:
- Reflection ability scales with model size. Small models (e.g., Qwen3-4B) get stuck in failure loops; they can't diagnose their own mistakes.
- Inference cost explodes. Each reflection round means extra API calls; 5 iterations = 5x cost, which is infeasible in real-time settings.
- Experience doesn't transfer. Lessons learned from one task rarely apply to the next.
- Trajectory → decision graph. The agent's trajectory is converted into a directed graph: nodes are actions (e.g., "pick up apple", "open microwave"), edges are observations between actions. Repeated actions are merged into one node, turning a linear log into a reusable decision structure.
- Graph matching → exact correction. The failed graph is matched against an expert graph using Fused Gromov-Wasserstein optimal transport. The matching yields (1) a common subgraph — what the agent did right, and (2) a graph edit path — which nodes to delete, insert, or relabel. This yields precise corrections like "given the observation 'standing before the fridge', replace 'open microwave' with 'open fridge'" instead of vague reflection text.
- Experience Memory Graph. Each training task becomes a node storing its intra-task correction insight; edges connect semantically similar tasks and store cross-task patterns extracted from common subgraphs of expert trajectories.
- One-shot test time. At inference, the agent retrieves the most relevant nodes/edges via embedding similarity, injects the insights into the prompt, and executes once — no loops, no reflection.
Key points
Results
On ALFWorld / ScienceWorld with Qwen3-4B:
| Method | ALFWorld | ScienceWorld | |--------|----------|--------------| | ReAct | 29.29% | 11.86% | | Reflexion (5 rounds) | 34.29% | 14.95% | | ExpeL (5 rounds) | 38.57% | 13.40% | | EMG (one-shot) | 53.57% | 17.53% |
With DeepSeek-V4-Flash: EMG reaches 96.43% (ALFWorld) and 28.87% (ScienceWorld), beating ReAct (86.43% / 17.53%) and Reflexion (82.86% / 12.89%). Notably, Qwen3-4B + EMG matches the DeepSeek memory-free baseline on ScienceWorld. Since EMG runs only once, its test-time latency and API cost are far below iterative methods.
Ablations
| Variant | ALFWorld Seen | ScienceWorld Unseen | |---------|---------------|---------------------| | No memory (ReAct) | 29.29% | 8.53% | | Node memory only | 48.57% | 9.48% | | Full EMG | 53.57% | 16.11% |
Node memory (intra-task correction) drives most gains; edge memory (cross-task transfer) nearly doubles small-model performance on unseen tasks. Large models benefit less from edges since they generalize on their own.
Commentary
1. Paradigm shift: from "letting the AI think" to "computing it for the AI." Graph matching is deterministic — same input, same output, no 5-round token burn. When a task requires precise causal diagnosis, a deterministic algorithm is simply a better tool than probabilistic LLM introspection. 2. Offline distillation, online use. Expensive matching happens at build time; test time is retrieve + execute, echoing the RAG philosophy — but the retrieved knowledge is distilled error-correction experience rather than external documents. 3. Graphs vs. sequences as agent memory. A sequence logs what happened; a graph encodes which action is correct under which observation — that conditional decision structure is the transferable knowledge. 4. Limitations. EMG requires expert trajectories (problematic for open-ended tasks); matching is O(|V|^3), which could matter for long-horizon tasks; and all evaluations are on the structured ALFWorld/ScienceWorld environments — open-web settings remain unverified.
Conclusion
The core lesson: match the tool to the task. LLMs are good at generation and intuition, not precise causal diagnosis. Let algorithms diagnose and LLMs execute — a 4B model with a well-built memory graph can punch above its weight without more parameters.