Agents Learn From Bad Luck: LLM-Written Lessons Carry Random Failures Into Later Decisions

Researcher Kazuki Nakayashiki tested whether self-improving agents carry randomness over into their own "lessons." In 256 synthetic worlds, a model wrote a lesson after a run, and a fresh session of the same model then chose the first tool for the next run. When the best tool failed by chance, the lesson from that failure pushed the agent toward the worst tool 11.6% of the time. With an irrelevant memory entry or a lesson from a success, the rate was 0.4% in each case. The study collected 90 084 responses from 11 LLM endpoints. • If the log did not state that failures are independent, the effect was +0.181. If it did, the effect was +0.042. • A note on decision quality cut the rate to 7.5%, and a "change nothing" option cut it to 3.1%.

AI-processed from arXiv cs.LG; edited by Hamidun News
Agents Learn From Bad Luck: LLM-Written Lessons Carry Random Failures Into Later Decisions
Source: arXiv cs.LG. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourcearXiv cs.LG ↗
Editor-in-Chief
Key metric #1If the log did not state that failures are independent, the effect was +0.181. If it did, the effect was +0.042.
Key metric #2A note on decision quality cut the rate to 7.5%, and a "change nothing" option cut it to 3.1%.
Key metric #3With an irrelevant entry, the rate was 0.4%. With a lesson from a success, it was also 0.4%.

An agent failed a task not because it picked a bad tool, but because the tool got unlucky. The agent writes a "lesson" into memory, and on the next run that lesson pushes it toward a mistake. Kazuki Nakayashiki measured how often this happens in a registered study of 90 084 responses from 11 LLM endpoints. When a reliable tool broke by chance, model-written lessons carried that randomness into the next choice 11.6% of the time. In the control conditions, such choices occurred 0.4% of the time.

How the randomness was caught at the memory-to-decision handoff

Self-improving agents, like those built on ReasoningBank, write short notes after their runs and load them into future sessions. When an outcome is noisy, a note can lock in luck or bad luck as if it were a pattern. The author tested only one link in this chain: whether a finished lesson affects the next choice.

The design works like this. The study used 256 synthetic worlds. In each, one task repeats and there are two interchangeable tools with known reliability.

The previous run was scripted: it used either the more reliable tool (a good decision) or the less reliable one (a bad decision). The outcome was also set in advance: success or a temporary failure. The model wrote a lesson following the ReasoningBank instruction.

Then a fresh session of the same model received an authoritative log and the result of the previous run, and chose the first tool. The memory held exactly one entry out of four: a lesson from this run, a lesson from the opposite outcome, an irrelevant entry, or a directive with no explanation of reasons.

The protocol was frozen, published, and timestamped in a Bitcoin block before the first confirmatory call. The run records are open.

What the numbers showed

  • After a random failure of the best tool, the interaction was +0.112 (95% interval from +0.097 to +0.126). In the "luck-carrying" condition, the readers named the worst tool in 11.6% of subsequent runs that had a lesson from that failure.
  • With an irrelevant entry, the rate was 0.4%. With a lesson from a success, it was also 0.4%.
  • When the log explicitly stated that failures are independent, the effect was +0.042. When it did not, the effect was +0.181 (descriptive data).
  • After a lucky success of the worst tool, the interaction was +0.002 and was bounded above by 0.10. The author stresses that this is a bound, not proof that no harm occurs.
  • In an exploratory analysis, 6 endpoints carried randomness over, and one of them showed an effect as high as +0.352. The other 5 endpoints stayed within the 0.10 threshold.

The result varies across models. The effect shows up in the panel as a whole, but not every model shows it.

Can an instruction fix it?

The author tested two edits to the instruction for writing a lesson. A three-sentence note about decision quality cut the share of worst-tool choices after a random failure to 7.5%. A single instruction for both outcomes, with a "change nothing" option, cut it to 3.1%. Neither variant passed the registered harm-reduction rule on every endpoint, so this is a partial remedy. These comparisons are secondary.

The work has limits. The worlds are synthetic, there are only two tools, the failures are temporary, and the effect was measured on the first choice of the next run. The study did not test how the effect accumulates over many iterations of memory.

Practical takeaways for anyone building agents with memory

First: if your agent has a reflection layer, write more than the outcome into the log. Add an explicit statement about the nature of failures, for example that they are independent. The gap between +0.042 and +0.181 shows this is the cheapest safeguard. Second: give the model that writes the lesson the option to answer "change nothing." Third: test memory on noisy outcomes, where a good choice ended in failure, and don't limit yourself to fully deterministic scenarios. Fourth: don't generalize from a single model, because for 5 of 11 endpoints the effect did not exceed the threshold.

Story

Key Questions Answered

Can an instruction fix it?

The author tested two edits to the instruction for writing a lesson. A three-sentence note about decision quality cut the share of worst-tool choices after a random failure to 7.5%. A single instruction for both outcomes, with a "change nothing" option, cut it to 3.1%. Neither variant passed the registered harm-reduction rule on every endpoint, so this is a partial remedy. These comparisons are secondary. The work has limits. The worlds are synthetic, there are only two tools, the failures are temporary, and the effect was measured on the first choice of the next run. The s

How the randomness was caught at the memory-to-decision handoff?

Self-improving agents, like those built on ReasoningBank, write short notes after their runs and load them into future sessions. When an outcome is noisy, a note can lock in luck or bad luck as if it were a pattern. The author tested only one link in this chain: whether a finished lesson affects the next choice. The design works like this. The study used 256 synthetic worlds. In each, one task repeats and there are two interchangeable tools with known reliability. The previous run was scripted: it used either the more reliable tool (a good decision) or the less reliable one

What the numbers showed?

After a random failure of the best tool, the interaction was +0.112 (95% interval from +0.097 to +0.126). In the "luck-carrying" condition, the readers named the worst tool in 11.6% of subsequent runs that had a lesson from that failure. With an irrelevant entry, the rate was 0.4%. With a lesson from a success, it was also 0.4%. When the log explicitly stated that failures are independent, the effect was +0.042. When it did not, the effect was +0.181 (descriptive data). After a lucky success of the worst tool, the interaction was +0.002 and was bounded above by 0.10. The au

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Autonomous AI Execution · Nomad Agent

Delegate Deep Research, Coding & Multi-Step Workflows to Nomad Agent

Deploy autonomous task execution with Nomad Agent (agent.nomadnet.ai) — automated web research, data synthesis, code generation, and MCP tool orchestration.

Launch Nomad Agent →Nomad AI Workspace
What do you think?
Loading comments…