A new paper from independent researcher Borja Odriozola Schick derives a single governing principle for persistent AI systems from two axioms. The implications are uncomfortable for almost every architecture in production today.


In March 2026, a paper appeared on arXiv with an unusual pedigree. It was not reverse-engineered from a product. It was not borrowed from an adjacent field. It was not assembled from literature review. The author derived the result by living inside the system it describes, failing, compressing, persisting, and recognizing the pattern that emerged. The paper is called "The Root Theorem of Context Engineering," and it makes a precise claim: any system that maintains an LLM conversation beyond a single session faces two inescapable constraints, and from those two constraints, a single principle follows with the force of a theorem.

The principle is this: maximize signal-to-token ratio within bounded, lossy channels.

That sentence does a lot of work. Let me break it apart.

Two Axioms, One Theorem

The paper starts from two facts that anyone building persistent AI systems already knows, even if they haven't formalized them.

Axiom 1: The context window is finite. Every model has a hard token limit. You can make it larger, but you cannot make it infinite. This is not a temporary limitation of current hardware. It is a structural property of attention-based architectures. The computation cost of attention scales quadratically with sequence length. Even as context windows grow from thousands to millions of tokens, they remain bounded.

Axiom 2: Information quality degrades with accumulated volume. A model processing a 90% full context window does not produce output that is 10% worse. It produces output generated from the degraded tail of the attention curve. The model is not running out of room. It is running out of the computational capacity that produces coherent, high-fidelity output.

From these two axioms, Odriozola Schick derives what he calls the Root Theorem: in any system maintaining understanding through a bounded, lossy channel, the governing objective is to maximize the signal-to-token ratio of the channel's contents.

This is not a heuristic. It is not a best practice. It is a derived consequence of the constraints. Any system that violates it will fail. Systems that satisfy it by accident will work without knowing why. Systems that satisfy it by design will work and know their limits.

The Quality Equation

The paper expresses the degradation formally. Let P denote the cumulative tokens consumed at a given position in the context window. Let D be the model's degradation rate, defined as the fractional fidelity loss per 100,000 tokens of accumulated context. The fidelity at any position is:

F(P) = 1 − (D × P) / 100,000

This is a first-order linear approximation. Real degradation is likely sublinear early, where the model maintains near-full fidelity on a functional plateau. Then it goes superlinear late, a steep collapse as attention mechanisms saturate. The paper calls this the cliff. The linear model captures the essential relationship: fidelity decreases monotonically with position.

This reframes the context window entirely. It is not a container. It is a quality budget. The remaining context window is not empty space. It is the computational budget for the next response. Every token you put into the context window is a tax on every future response the model generates.

This is the insight that most practitioners miss. They think of the context window as storage. The Root Theorem says it is a communication channel with a fidelity function. The tokens already present in the channel degrade the fidelity of everything that comes after.

Five Consequences

From the Root Theorem, the paper derives five consequences without any additional assumptions. This is the part that should make architects of current systems uncomfortable.

Consequence 1: The Quality Function Is Independent of Window Size

The degradation function F(P) depends on the volume of tokens injected, not on the size of the window. Making the window larger does not change the fidelity at position P. It gives you more positions before you hit the cliff, but each position still suffers the same degradation.

This has a sharp practical implication: bigger context windows delay the failure. They do not prevent it. A 200K-token window gives you more runway than a 128K-token window, but you still hit the degradation curve at the same rate per token. The failure is inevitable in finite time for any append-only system.

Consequence 2: Signal and Token Count Are Independent Optimization Variables

You can reduce token count without reducing signal. The author discovered this experientially: switching a memory file from Spanish to English reduced the token count significantly while carrying identical information. The signal was the same. The encoding cost was different.

This means compression is possible without information loss. This is not a vague hope. It is a structural property of the optimization landscape. The two variables, signal S and tokens P, can be optimized independently. You can increase signal without increasing tokens, and you can decrease tokens without decreasing signal, at least up to the point where further compression becomes lossy.

Consequence 3: The Gate Must Be Fidelity-Triggered, Not Capacity-Triggered

Most systems that attempt context management trigger compression when the context window approaches its capacity limit. The Root Theorem says this is exactly wrong.

The compression operation itself consumes context window. If you trigger compression when the window is nearly full, the compression runs in the degraded region of the fidelity curve. The output of the compression, which becomes the new compressed state, is produced with degraded fidelity. That lossy output then propagates forward into every future interaction.

The paper calls this the Compression Paradox. The trigger must fire well before the degradation boundary, at a point where the model still has enough fidelity budget to produce a high-quality compression. The gate is not "the window is almost full." The gate is "fidelity is approaching the threshold below which compression produces unacceptable loss."

This is a fidelity threshold, not a capacity limit. Systems that trigger compression at capacity limits are compressing with degraded fidelity and embedding that degradation permanently into their compressed state.

Consequence 4: Homeostatic Persistence Is Inevitable

From the axioms and the quality equation, the paper derives that the only architecture capable of sustaining understanding indefinitely is one that implements four phases in a regulated cycle:

  • Accumulate: New information enters the channel.
  • Compress: Accumulated information is compressed at high fidelity.
  • Rewrite: The compressed representation replaces the verbose originals.
  • Shed: The originals are discarded, freeing channel capacity.

The paper calls this the homeostatic cycle. It is not a design pattern that might work. It is a derived necessity. Any system that does not implement this cycle will, in finite time, exceed its effective window and produce degraded output.

This is where the paper makes its most aggressive prediction: append-only architectures are necessarily divergent. They accumulate without compressing, without rewriting, without shedding. The divergence is not a possibility. It is a mathematical certainty given the axioms.

Consequence 5: The Compression Mechanism Operates Inside the Channel It Compresses

This is the strangest and most important consequence. The mechanism that compresses the context window operates within the context window itself. The LLM that is generating the compressed summary is using the same degraded channel that it is trying to compress.

This creates a self-referential loop. The compressor is part of the system it compresses. The paper argues that this self-reference requires an external verification gate. The system cannot verify its own compression fidelity from inside the channel. You need an external check, whether that is a human reviewer, a separate model evaluation, or some other mechanism that operates outside the bounded, lossy channel.

Without this external gate, compression errors compound across cycles. Each compression pass introduces small errors. Those errors become part of the channel state. The next compression pass operates on a state that already contains errors, and introduces more. Over sufficient cycles, the compressed representation drifts from the source material. The system does not just lose detail. It loses coherence.

What This Means for Systems You Use Today

The paper applies its framework to the architectures currently in production. The analysis is direct.

RAG Solves Search, Not Continuity

Retrieval-Augmented Generation answers the question "what relevant information exists?" It does not answer "what does this system understand, and how has that understanding evolved?" A RAG system can retrieve the same document a thousand times without ever compressing it into understanding. Each retrieval is independent. There is no trajectory. No compounding coherence. No mechanism by which the system's comprehension of the retrieved material improves over time.

The Root Theorem predicts this limitation precisely. Retrieval does not compress. It moves information into the context window at source density, not at the compressed density that persistence requires. Every retrieved passage consumes tokens at full cost, degrading fidelity for everything that follows it, without increasing the signal-to-token ratio.

This does not mean RAG is useless. It means RAG solves a different problem than continuity. If you need to find relevant documents, use RAG. If you need to maintain evolving understanding across sessions, you need something else.

MemGPT Accumulates Compression Error

MemGPT uses recursive summarization. When context overflows, it generates a new summary from the old summary plus evicted messages. The paper calls this "append-then-summarize," not homeostatic compression.

The distinction matters. Recursive summarization accumulates approximation error without a mechanism to rewrite the summary against fresh understanding. Over sufficient cycles, the summary drifts from the source trajectory. The Root Theorem predicts this failure mode: without a fidelity-gated rewrite cycle, summary quality degrades monotonically.

The paper acknowledges that MemGPT (now Letta) correctly identifies the core constraint. Context windows are finite. Information must be managed across that boundary. But its compression mechanism violates Consequence 5. The system compresses its own memory without an external verification gate. Compression errors compound.

Append-Only Systems Diverge in Finite Time

The paper's most uncomfortable prediction. OpenClaw, the fastest-growing open-source project on GitHub with over 250,000 stars as of March 2026, uses append-only markdown files as its memory architecture. Daily logs loaded at session start. A curated long-term memory file. Search tools for recall.

This is exactly the architecture the Root Theorem's divergence prediction describes. As conversations accumulate, the daily logs grow. The long-term memory file requires manual curation. The system has no built-in mechanism to compress its own history while preserving trajectory coherence.

The paper notes that OpenClaw's recent introduction of a pluggable Context Engine interface signals that the community is discovering the persistence problem experimentally. The leading plugin, lossless-claw, replaces sliding-window compaction with DAG-based hierarchical summarization. This is more sophisticated but remains within the same architectural family. Summarize hierarchically. Retrieve on demand. No homeostatic compression. No fidelity-gated rewrite cycles. No trajectory-preserving compression.

Cognitive Architectures Converge on the Same Structure

The paper draws a striking parallel with cognitive architectures from a different tradition. Soar, developed starting in the 1980s, implements working memory, procedural memory, and long-term declarative memory with a chunking mechanism that compiles complex reasoning into production rules. That is compression. ACT-R models activation decay, where items become less accessible over time unless refreshed. That is the degradation function the Root Theorem formalizes as the D parameter.

Different substrates. Different research traditions. Different decades. Same structural requirements: multiple memory tiers, compression mechanisms, degradation functions, and gated transitions. The paper claims this convergence is not coincidence but necessity. Any bounded system that must persist will evolve these features because the constraints demand them.

The key difference is that cognitive architectures were designed to model human cognition and then applied to artificial agents. The Root Theorem derives the same requirements from information-theoretic first principles, without reference to biological systems. The convergence becomes evidence. When independent derivations from different starting axioms produce the same structure, that structure is likely necessary rather than contingent.

The 60+ Session Engineering Proof

The paper does not stop at formal derivation. It provides an engineering proof through a 60+ session persistent architecture that demonstrates stable memory footprint under continuous operation.

This is where the paper gets concrete. The divergence prediction is made tangible. The author built a system that implements the homeostatic cycle: accumulate, compress, rewrite, shed. Over more than 60 sessions of continuous operation, the system maintained a stable memory footprint. It did not diverge. It did not bloat. It did not lose coherence.

The proof is not a simulation or a benchmark score. It is a working system that ran for 60+ sessions and demonstrated the behavior the theorem predicts: stable memory, maintained fidelity, indefinite operation. The system worked because it satisfied the theorem's constraints by design.

Shannon Solved Transmission. Context Engineering Solves Continuity.

The paper's closing line frames the contribution precisely. Shannon's information theory solved the problem of reliable point-to-point transmission across a noisy channel. The Root Theorem addresses a different problem class: maintaining signal fidelity in a channel that loops back on itself, degrades with each cycle, resets between sessions, and must compress its own history to survive.

The formal relationship to rate-distortion theory is instructive. Rate-distortion theory establishes the minimum bits per symbol needed to represent a source within a distortion threshold. The Root Theorem applies this to a new channel type: one where the compressed output is re-injected as input, where distortion accumulates across cycles rather than being measured at a single decode point, and where the compressor operates inside the channel it compresses.

This self-referential structure has no direct analog in classical rate-distortion theory, where the encoder sits outside the channel. The paper notes that the fidelity function F(P) and the rate-distortion function R(D) are solving dual problems under different topological assumptions about the channel.

What This Means for Builders

If the Root Theorem is correct, and the engineering evidence suggests it is, then several common architectures will hit predictable failure modes:

Any append-only memory system will diverge. Not might. Will. The timeline depends on usage patterns, but the trajectory is mathematically guaranteed. If you are building an agent that accumulates context without homeostatic compression, you are building a system with an expiration date.

Any compression triggered at capacity limits will embed degradation. The trigger must fire at a fidelity threshold, not a capacity threshold. By the time the context window is nearly full, the model does not have enough fidelity budget left to produce a high-quality compression.

Any self-compression without external verification will compound errors. The LLM compressing its own context is inside the channel it compresses. Without an external check, small compression errors accumulate across cycles until the compressed representation drifts from the source material.

RAG alone will not give you persistent understanding. Retrieval solves search. It does not solve continuity. You need compression, not just retrieval, if you want a system whose understanding evolves over time.

Bigger context windows buy you time, not immunity. The degradation function F(P) depends on the volume of tokens, not the window size. A larger window gives you more positions before the cliff, but each position suffers the same degradation per token.

The paper is not prescribing a specific implementation. It is deriving constraints. Any architecture that satisfies these constraints will work. Any architecture that violates them will fail. The homeostatic cycle, accumulate-compress-rewrite-shed, with fidelity-gated compression and external verification, is the only pattern the theorem identifies as sustainable.

Where It Gets Interesting

The paper raises questions it does not fully answer.

The Compression Paradox creates a bootstrapping problem. You need high fidelity to compress well, but you need to compress well to maintain high fidelity. The author solved this in practice with a human-in-the-loop verification gate, but that does not scale. How do you implement an external verification gate that does not require human review for every compression cycle?

The self-referential property of compression inside the channel is the most architecturally challenging consequence. It means the system cannot fully verify its own state. Some external reference is always needed. The paper identifies this requirement but leaves the implementation open.

The convergence with biological memory architectures is suggestive but not conclusive. The paper argues that independent derivation from different axioms producing the same structure is evidence of necessity, not coincidence. This is a strong claim. It would benefit from more formal analysis of the structural homologies.

The paper also acknowledges that the linear model of degradation F(P) is a first-order approximation. Real degradation curves likely have a plateau followed by a cliff. Characterizing the actual shape of the degradation function for specific models is an empirical question the paper identifies but does not resolve.

Final Thought

The Root Theorem of Context Engineering is not another prompt engineering technique. It is not a recipe for better RAG pipelines. It is a formal claim about the necessary architecture of any system that maintains understanding through a bounded, lossy channel over time.

The claim has teeth. It predicts failure modes for architectures that are widely deployed today. It derives requirements that most current systems do not satisfy. And it provides a framework for understanding why persistent AI systems fail silently and catastrophically, past a threshold that most practitioners never observe.

The paper's final line is worth sitting with: "Shannon solved point-to-point transmission. Context engineering solves continuity."

That is the scope of the claim. Not how to write better prompts. Not how to retrieve documents faster. How to maintain understanding over time in a system that degrades by default. If you are building persistent AI systems, this paper gives you the formal foundation for understanding why they fail and what it would take to make them not fail.

The alternative is continuing to build append-only systems and discovering the divergence prediction experimentally, which is exactly what the practitioner community is doing right now.


Citations

  • Odriozola Schick, B. (2026). "The Root Theorem of Context Engineering: Formal Derivation, Architectural Prediction, and Engineering Proof." arXiv:2604.20874 [cs.CC]. https://arxiv.org/abs/2604.20874
  • Shannon, C.E. (1948). "A Mathematical Theory of Communication." Bell System Technical Journal, 27(3-4).
  • Shannon, C.E. (1959). "Coding Theorems for a Discrete Source with a Fidelity Criterion." IRE National Convention Record, Part 4.
  • Berger, T. (1971). Rate Distortion Theory: A Mathematical Basis for Data Compression. Prentice-Hall.
  • Packer, C. et al. (2023). "MemGPT: Towards LLMs as Operating Systems." arXiv:2310.08560.
  • Lewis, P. et al. (2020). "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks." NeurIPS 2020.
  • Laird, J.E. et al. (1987). "Soar: An Architecture for General Intelligence." Artificial Intelligence, 33(1).
  • Laird, J.E. (2012). The Soar Cognitive Architecture. MIT Press.
  • Anderson, J.R. (1993). Rules of the Mind. Lawrence Erlbaum Associates.
  • Anderson, J.R. et al. (2004). "An Integrated Theory of the Mind." Psychological Review, 111(4).
  • Xu, Z. et al. (2025). "A-MEM: Agentic Memory for LLM Agents." arXiv:2502.12110.
  • Steinberger, C. (2025). OpenClaw. GitHub.

Suggested Title

The Theorem That Explains Why Your AI Agent Keeps Losing Its Mind

Word Count

~2,850 words (body text)

Fact-Check Notes

  • The arXiv paper identifier 2604.20874 is confirmed. The paper was submitted March 29, 2026, with the v2.5 revision dated March 23, 2026.
  • The characterization of F(P) = 1 − (D×P)/100,000 as a "first-order linear approximation" is directly from the paper. The paper acknowledges real degradation is likely sublinear early and superlinear late.
  • The claim that OpenClaw has "over 250,000 stars" is from the paper (§2.4), citing March 2026. This number may have changed since. Worth verifying before publication.
  • The "lossless-claw" plugin and OpenClaw's v2026.3.7 Context Engine interface are described in §2.4 of the paper. Verify these details against current OpenClaw documentation if possible.
  • The 60+ session engineering proof is claimed in the abstract and throughout the paper. The paper references §12 for the full proof, which I was unable to access from the truncated HTML. The specific metrics and methodology should be verified against the full paper.
  • The relationship to rate-distortion theory is described as "explored in a companion paper." This companion paper is cited but not included. The claim that F(P) and R(D) are "dual problems" should be characterized carefully until the companion paper is available.
  • Soar and ACT-R convergence claims are in §2.3 and are well-sourced to their original publications.
  • The claim that "append-only systems necessarily exceed their effective window in finite time" is a derived theorem result, not an empirical observation. The formal proof is in the paper but I was unable to access the full derivation sections.