Bible Network Crypto DeFi Onchain RWA AI Agent Stablecoin Chain SAFU CryptoTax DeFAI AGI Claude Me Claude Skill Claude Design Claude Cowork
Independent Media
Not affiliated with any project
Deconstructing Autonomous Agents in Crypto
aiagent-bible.com
LATEST
Gas Abstraction Isn't Free: How to Calculate What Markup Your Agent System Actually Pays  ·  Why Does an Agent Suddenly "Forget" a Rule You Set Earlier, Halfway Through a Task?  ·  Designing Memory Architecture for a Support Agent: Decide Which Type First, Then How to Protect It  ·  Why Do Almost No AI Agent Payment Products Let You Use a Password Anymore?  ·  How Do You Know a Trusted MCP Tool's Content Has Been Quietly Swapped?  ·  Applying the Rule of Two to Your Agent Architecture: Three Implementation Tradeoffs
beginners

Why Does an Agent Suddenly "Forget" a Rule You Set Earlier, Halfway Through a Task?

30-Second Version · For the impatient
Without any memory mitigation, an agent's rule-compliance rate drops from 73% at turn 5 to 33% at turn 16 — it won't tell you it forgot, it'll just start doing the wrong thing.

Full Explanation +
01 · Why did this happen?

If I write a rule more explicitly and in more detail, will it survive longer before getting forgotten?

Writing it more explicitly does help, but only to a limited degree, because the root of the problem isn't "how clearly the rule is written" — it's the rule's relative position within the entire input. No matter how carefully you write a rule, as long as it was stated early in the conversation, its position within the overall input keeps getting pushed toward the middle as later content accumulates, and the "lost in the middle" phenomenon affects position, not the clarity of the content itself. Even a rule written with perfect clarity still sees its attention decline once it gets pushed into the middle of the input.

What actually works is usually changing how the rule gets placed, not just improving its wording: writing high-risk rules into a system-level instruction, for instance (this kind of instruction is often architecturally treated specially and doesn't simply get mixed into conversation history and pushed back along with everything else), or designing the rule to be automatically re-inserted as a reminder every few turns, keeping it repeatedly returning to a relatively early position in the input, rather than expecting one sufficiently clear version to hold up all the way through.

02 · What is the mechanism?

"Context rot" and "lost in the middle" sound similar — are they the same thing?

The two are closely related, but they describe things at different levels. "Lost in the middle" refers to a more foundational, purer technical phenomenon — regardless of the quality of the conversation content, simply because a piece of content's position in the input falls in the middle, the model's attention to it declines. This is a position-related effect. "Context rot" is a more practical, more comprehensive description — it covers not just the position problem, but also the stale instructions, failed attempts, and noise-like tool output that accumulate throughout a conversation. As these keep growing, the ratio of "useful signal" to "noise" keeps worsening, and even if some critical information is technically still within the window's capacity, it can effectively get diluted by too much surrounding noise.

You can think of the two as different layers in a causal chain: lost in the middle is one specific, measurable cause; context rot is the overall phenomenon reflected in an agent's actual behavior once causes like this add up together. What you observe as "the agent suddenly going wrong" is often several mechanisms like lost in the middle stacking on top of each other at once.

03 · How does it affect me?

If the agent won't proactively tell me it forgot, how do I notice this problem in actual use?

The most direct signal is behavioral inconsistency over time: if an agent starts repeating an approach that already failed before, mixes old and new requirements together, or suddenly stops following a rule it had been consistently following, these are all concrete signs that context rot is happening — worth stopping to re-confirm, rather than assuming it's a one-off fluke. Another method you can actively test is, once a conversation has run to a certain depth, directly asking the agent "what were the rules I set at the beginning" — if it answers vaguely, incompletely, or obviously misses a point you genuinely stated, that's a concrete, verifiable warning sign.

For tasks involving real consequences, a safer approach is not to rely solely on passive detection like "watch for abnormal behavior," but to proactively and periodically re-confirm key rules within the conversation — especially after completing several important steps, or right before executing an irreversible action. This habit itself requires no technical background at all — it just turns the fact that "an agent's memory becomes unreliable as conversation depth grows" into a concrete checkpoint you control yourself.

04 · What should I do?

Are there signs this problem is being solved, or do I just have to deal with it myself?

The mainstream direction the industry is currently pursuing is clearly splitting "working memory" from "persistent memory" into two layers, rather than simply trying to make the context window bigger — researchers broadly point out that expanding window capacity doesn't genuinely solve the forgetting problem; it just trades "cross-conversation forgetting" for a new problem of "in-window performance degradation and higher input cost." It doesn't actually eliminate forgetting, it just changes its form. The more effective approach is actively managing what content should stay in the current working window, what should be summarized and condensed, and what should be moved entirely out of the window into persistent memory retrieved only when needed — this is also how the memory-type classification covered in another entry on this site actually gets applied in engineering practice.

There's also a more cutting-edge research direction proposing that models periodically "consolidate" short-term context into some persistent representation — conceptually similar to how human sleep consolidates memory. This kind of research is still in an early stage and hasn't become a widely adopted industry standard yet. For an ordinary user, the more practical attitude right now is understanding that this limitation hasn't been fully solved yet, and proactively building the periodic-confirmation habit mentioned earlier, rather than waiting for some technical breakthrough to make the problem disappear entirely.

Full Content +

At the start of a conversation, you tell an agent "don't auto-send emails, let me review the draft first." It follows the rule for the first several turns, but by turn fifteen or so, it suddenly starts sending automatically, as if it never heard the instruction at all. This isn't the agent suddenly "breaking" — it's a technical phenomenon with a name and quantified research behind it. Without understanding it, it's hard to judge when to trust an agent and when to double-check it still remembers a rule.

The Model Fundamentally Remembers Nothing Unless You Re-Tell It Every Time

To understand this phenomenon, you first need to know something counterintuitive: a language model is fundamentally stateless — it doesn't "remember what was said last time" the way a person does. Every time it generates a response, all the model sees is the complete text you send this time, including the reassembled past conversation. If an agent appears "coherent," that's because the system reassembles prior conversation content and sends it into the model's context window along with the new input, letting the model "read through the whole history again" — producing the illusion that "it remembers." This means the rule you set isn't something the model "learned" — it's suspended in the conversation history, held up only by the fact that it's "still sitting in the window."

"Forgetting" Doesn't Wait Until the Window Is Full — It Starts Earlier

You might assume that as long as a conversation hasn't exceeded the advertised window capacity, a rule stays intact and effective. But independent research found it's not that simple: a model's attention to content buried in the middle of the input declines as more surrounding text accumulates — a phenomenon called "lost in the middle," first proposed and quantified by a Stanford and UC Berkeley research team in 2023. They found retrieval accuracy follows a U-shaped curve — content placed right at the very beginning or the very end of the input gets picked up most accurately, while content buried in the middle gets noticeably deprioritized. The rule you set at the start of a conversation starts out in that relatively safe "beginning" position, but as the conversation keeps accumulating, that rule's relative position within the entire input keeps getting pushed further toward the middle, and attention to it declines accordingly.

Research Has Directly Quantified How Fast This Decay Happens

A 2026 study tested across six different conversation depths, totaling 4,416 trials, to specifically quantify this phenomenon's impact on actual agent behavior: without any memory mitigation mechanism, an agent's rule-compliance rate dropped from 73% at turn 5 to 33% at turn 16. This isn't the model suddenly "breaking," and it isn't random error — it's a curve that predictably worsens with conversation depth. The industry also calls this phenomenon "context rot" — as conversation history, stale instructions, tool output, and failed attempts keep accumulating, the ratio of useful signal to noise keeps dropping, and model performance degrades accordingly. This doesn't need to wait until the window is genuinely full to happen — degradation quietly begins before the window even fills up.

Why Your Agent Won't Tell You It "Forgot"

The most disorienting part of this phenomenon is that it doesn't produce any error message. Most production agent systems, when context exceeds capacity, silently discard the oldest content — the agent doesn't crash, doesn't throw a warning, it just keeps going, confidently continuing forward with a wrong assumption. You get no signal at all that "I forgot something" — you'll only notice its behavior suddenly going off, repeating an approach that already failed once, mixing old and new requirements together, or, as in the example that opened this article, simply no longer following a rule you already set.

What This Means for Your Money

If you're using an agent for any task with real consequences (sending emails, modifying data, executing transactions), understanding this phenomenon helps you build a concrete usage habit: don't assume "I said it once, so it'll remember forever," especially once a conversation has run for a dozen-plus turns, or a task involves heavy tool calls and document reads. For high-risk rules ("don't auto-send," "ask me first if the amount exceeds a certain number"), a more practical approach is periodically re-stating the rule within the conversation, or confirming whether the product you're using writes rules like this into a more front-loaded, system-level instruction less prone to getting pushed toward the middle — rather than simply letting it sit mixed into conversation history, hoping it holds until the task finishes.

Diagram
規則遵守率隨對話深度下滑折線圖顯示從第五輪 73% 到第十六輪 33%的規則遵守率下滑趨勢,反映上下文腐化的量化研究結果Rule Compliance Drops With Conversation Depth73%33%Turn 5Turn 164,416 trials, 6 conversation depths, no memory mitigationAI Agent Bible · aiagent-bible.com
Feel free to share. Please credit the source.
Ask a Question
Please enter at least 10 characters
Related Articles
Designing Memory Architecture for a Support Agent: Decide Which Type First, Then How to Protect It
developers · Aug 03
Why Do Almost No AI Agent Payment Products Let You Use a Password Anymore?
beginners · Jul 31
When an AI Agent Spends Your Money, the Key to Your Wallet Isn't Actually in Its Hands
beginners · Jul 31
Why Agents Can't Tell Instructions from Data: An Old Problem from the Database Era
beginners · Jul 30
More Related Topics