Paper deep dive
Token Coherence: Adapting MESI Cache Protocols to Minimize Synchronization Overhead in Multi-Agent LLM Systems
Vladyslav Parakhin
Intelligence
Status: succeeded | Model: google/gemini-3.1-flash-lite-preview | Prompt: intel-v1 | Confidence: 97%
Last extracted: 3/22/2026, 5:18:16 AM
Summary
The paper introduces the Artifact Coherence System (ACS), which adapts the MESI cache coherence protocol from shared-memory multiprocessors to multi-agent LLM systems. By replacing naive full-state broadcast with lazy invalidation, the system significantly reduces synchronization token overhead, achieving 80-95% savings in simulations while maintaining formal safety invariants like single-writer safety and bounded staleness.
Entities (5)
Relation Signals (3)
Artifact Coherence System â adapts â MESI Protocol
confidence 98% · I construct the Artifact Coherence System (ACS)... and the canonical hardware remedyâMESI-protocol invalidationâtransfers to the artifact synchronization domain
TLA+ â verifies â Coherent Context Synchronization
confidence 98% · A TLA+-verified protocol (CCS v0.1) enforces three invariants
Token Coherence Theorem â provessavingsfor â Artifact Coherence System
confidence 95% · The Token Coherence Theorem delineates a savings lower bound: lazy artifact invalidation attenuates synchronization cost
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Multi-agent LLM orchestration incurs synchronization costs scaling as O(n x S x |D|) in agents, steps, and artifact size under naive broadcast -- a regime I term broadcast-induced triply-multiplicative overhead. I argue this pathology is a structural residue of full-state rebroadcast, not an inherent property of multi-agent coordination. The central claim: synchronization cost explosion in LLM multi-agent systems maps with formal precision onto the cache coherence problem in shared-memory multiprocessors, and MESI-protocol invalidation transfers to artifact synchronization under minimal structural modification. I construct the Artifact Coherence System (ACS) and prove the Token Coherence Theorem: lazy invalidation attenuates cost by at least S/(n + W(d_i)) when S > n + W(d_i), converting O(n x S x |D|) to O((n + W) x |D|). A TLA+-verified protocol enforces single-writer safety, monotonic versioning, and bounded staleness across ~2,400 explored states. Simulation across four workload configurations yields token savings of 95.0% +/- 1.3% at V=0.05, 92.3% +/- 1.4% at V=0.10, 88.3% +/- 1.5% at V=0.25, and 84.2% +/- 1.3% at V=0.50 -- each exceeding the theorem's conservative lower bounds. Savings of ~81% persist at V=0.9, contrary to the predicted collapse threshold. Contributions: (1) formal MESI-to-artifact state mapping; (2) Token Coherence Theorem as savings lower bound; (3) TLA+-verified protocol with three proven invariants; (4) characterization of conditional artifact access semantics resolving the always-read objection; (5) reference Python implementation integrating with LangGraph, CrewAI, and AutoGen via thin adapter layers.
Tags
Links
- Source: https://arxiv.org/abs/2603.15183v1
- Canonical: https://arxiv.org/abs/2603.15183v1
Trouble viewing inline? Open PDF directly â
Full Text
69,950 characters extracted from source content.
Expand or collapse full text
Token Coherence: Adapting MESI Cache Protocols to Minimize Synchronization Overhead in Multi-Agent LLM Systems Vladyslav Parakhin Independent Researcher Abstract Per-token economics in multi-agent large language model orchestration are, at present, governed by a synchronization pathology that scales as Oâ(nĂSĂ|D|)O(nĂ SĂ|D|) in agents, steps, and artifact sizeâa regime I designate broadcast-induced triply-multiplicative overhead. I contend this pathology does not inhere in multi-agent coordination per se; it is a structural residue of full-state rebroadcast, a design decision absorbed uncritically from early orchestration scaffolding. The central claim of this manuscript: the synchronization cost explosion in LLM-based multi-agent systems (MAS) maps, with formal precision, onto the cache coherence problem in shared-memory multiprocessors, and the canonical hardware remedyâMESI-protocol invalidation [Papamarcos and Patel 1984]âtransfers to the artifact synchronization domain under minimal structural modification. I construct the Artifact Coherence System (ACS), a six-tuple âšA,D,ÎŁ,ÎŽ,α,â© A,D, ,ÎŽ,α,T endowed with an identity state-mapping function Ï from hardware MESI states onto artifact authorization states. The Token Coherence Theorem delineates a savings lower bound: lazy artifact invalidation attenuates synchronization cost by a factor no less than S/(n+Wâ(di))S/(n+W(d_i)) subject to S>n+Wâ(di)S>n+W(d_i), where S is the step count, n the agent population, and Wâ(di)W(d_i) the per-artifact write frequency. I sequester the principal reviewer objectionâthat LLM agents invariably embed their full context and therefore cannot benefit from coherenceâby formally delineating conditional artifact access semantics as instantiated in production architectures through tool calls, MCP resources, vector stores, and file search APIs. A TLA+-verified protocol (CCS v0.1) enforces three invariants: single-writer safety (SWMR), monotonic artifact versioning, and bounded-staleness (agents cannot reason on stale artifact state beyond K steps). Through tick-based discrete event simulation across four workload configurations (10 runs per configuration, population standard deviation reported), comparing broadcast synchronization against three coherence strategies (eager, lazy, access-count), observed token savings reach 95.0%±1.3%95.0\%± 1.3\% at V=0.05V=0.05, 92.3%±1.4%92.3\%± 1.4\% at V=0.10V=0.10, 88.3%±1.5%88.3\%± 1.5\% at V=0.25V=0.25, and 84.2%±1.3%84.2\%± 1.3\% at V=0.50V=0.50âeach exceeding the theoremâs conservative lower bounds of 85%, 80%, 65%, and 40% respectively. Contrary to the lower-bound formulaâs prediction (Vââ0.9V^*â 0.9 for n=4n=4, S=40S=40 marking the savings collapse threshold), simulation indicates savings of approximately 81% persist at V=0.9V=0.9 because lazy deferred-fetch accumulation obviates worst-case collapse from materializing (§8.3). Contributions: (1) a formal mapping between MESI cache coherence and multi-agent artifact synchronization; (2) the Token Coherence Theorem as savings lower bound with the condition under which coherence dominates broadcast; (3) a TLA+-verified protocol with three proven invariants; (4) a characterization of conditional artifact access semantics that resolves the always-read objection; (5) a reference Python implementation integrating with LangGraph, CrewAI, and AutoGen via thin adapter layers. Subjects: Distributed, Parallel, and Cluster Computing (cs.DC); Multiagent Systems (cs.MA); Machine Learning (cs.LG) 1 Introduction Five agents, fifty reasoning steps, one 8,192-token planning document. Under naive broadcast, the cost is 5Ă50Ă8,192=2,048,0005Ă 50Ă 8,192=2,048,000 tokensâand the vast majority of that budget is unchanged context, retransmitted without necessity. The waste is banal, not exotic. It is the default behaviorâI have verified this by instrumenting every major orchestration framework I could obtain access toâthat upon modification of any shared artifact, the orchestrator rebroadcasts its full contents to every subscribing agent at the next synchronization boundary. At modest scale, tolerable. At production scaleâand I should be precise about what I mean by âproductionâ here, meaning nâ„5nâ„ 5 agents sustaining Sâ„40Sâ„ 40 reasoning steps over multiple artifacts simultaneouslyâthe cost structure becomes, without exaggeration, ruinous. Beyond the invoice, the damage compounds in subtler and arguably more corrosive ways. Token budget constraints coerce practitioners into truncating reasoning traces, compressing artifacts, culling agent populationsâeach a degradation that trades capability for a cost reduction that is, under certain structural conditions I formalize below, entirely avoidable. Building on [4], Cemri et al.âs analysis of 1,642 execution traces spanning seven production MAS frameworks reports task failure rates between 41% and 86.7%. Inter-agent misalignmentâincluding what they designate FM-1.4, Loss of Conversation History, where agents revert to stale artifact states following context truncationâaccounts for 32.3% of observed failures. They note explicitly that multi-agent memory and state management persists as an open structural problem, one that most prior work sidesteps by addressing single-agent contexts only [4, Appendix G.2]. Independentlyâand this is a datum I consider underappreciated in the current discourseâempirical benchmarking across multi-agent frameworks reports token duplication rates of 86% in flat topologies and 72% in linear topologies [28], confirming that redundant artifact retransmission, not generation, constitutes the dominant cost driver. Hardware engineers confronted an isomorphic problem four decades ago. I want to be careful with âisomorphicââthe word does nontrivial load-bearing work, and I will qualify the claim in §4.2 with a discussion of where the stable-state mapping breaks down at the transient-state boundary. The short version: in shared-memory multiprocessors, multiple CPU cores sharing a memory bus incur catastrophic bandwidth costs when every write forces full memory retransmission to all caches. The remedyâcache coherence protocols, MESI [19] being canonicalâtracks per-cache-line state and propagates invalidation signals rather than data. A cache line transitions from Shared to Invalid upon a remote write; subsequent reads trigger a targeted fetch. Bandwidth cost becomes proportional to write frequency, not to step count. The structural parallel maps cleanly: agents are processors, artifacts are cache lines, the orchestration coordinator is the memory controller, prompt injection of an artifact is a cache fill. I submit that this analogy admits a formal state-mapping function between MESI states and artifact coherence states, and that hardware-derived cost bounds transferâwith caveats I enumerateâinto the agent coordination domain. Before formalizing this claim, I must confront what I term the always-read objection. The objection runs as follows: LLM agents consume their entire context window at every inference call, so lazy invalidation is useless because the artifact must be injected regardless. This objection is descriptively incorrect for modern production architecturesâa point I delineate at length in §3. Tool-based retrieval, MCP resource access [1], vector store retrieval, and provider-side prompt caching all instantiate conditional artifact access semantics in which Râ(a,s)âDR(a,s) D. The always-read model describes naive prompt concatenation only. It does not describe the externalized architectures that dominate production deployments. Whether it describes a majority of current deployments, I cannot certify without broader instrumentation dataâbut the architectural trend is unmistakable, and the formal argument stands contingent on conditional access holding. Contribution 1 â Formal equivalence. I define the Artifact Coherence System (ACS) as a six-tuple âšA,D,ÎŁ,ÎŽ,α,â© A,D, ,ÎŽ,α,T and construct an explicit MESI state-mapping function Ï from hardware cache states to artifact authorization states, establishing that the structural properties of MESI transfer intact to the artifact domain (§4). Contribution 2 â Token Coherence Theorem. I prove that lazy artifact invalidation attenuates multi-agent token cost by a factor bounded below by S/(n+Wâ(di))S/(n+W(d_i)) when S>n+Wâ(di)S>n+W(d_i), establishing that broadcast cost grows as Oâ(nĂSĂ|D|)O(nĂ SĂ|D|) while coherent cost grows as Oâ((n+W)Ă|D|)O((n+W)Ă|D|) at worst. Simulation confirms consistently higher savings than this lower bound (§8). The condition under which coherence dominates is precisely characterized by the artifact volatility factor Vâ(di)=Wâ(di)/SV(d_i)=W(d_i)/S (§4.3â4.5). Contribution 3 â TLA+-verified protocol. I specify Coherent Context Synchronization (CCS) in TLA+ and verify three invariants: SWMR, monotonic versioning, and K-bounded staleness. I report the state space explored (approximately 2,400 states for 3 agents) and construct an explicit counterexample demonstrating that removing invalidation violates SWMR (§5â6). Contribution 4 â Conditional access semantics. I formally characterize real agent access patterns as Râ(a,s)âDR(a,s) D rather than Râ(a,s)=DR(a,s)=D, grounding this in four production architecture patterns and identifying the token duplication phenomenon that coherence eliminates (§3). Contribution 5 â Reproducible implementation. I present a reference Python implementation (agent-coherence v0.1) integrating with LangGraph, CrewAI, and AutoGen through adapter layers requiring no framework modifications, with a simulation engine supporting four synchronization strategies and full reproducibility from published seeds (§7, §8). 2 Background 2.1 Cache Coherence and the MESI Protocol Per Sorin, Hill, and Wood [22], cache coherence requires that all reads to a memory location return the value of the most recent write and that writes to the same location are serialized across processors. Under MESI [19], four stable states per cache line per processor obtain: Modified (valid only in this cache; memory is stale), Exclusive (valid only in this cache; identical to memory), Shared (valid here and possibly elsewhere; no writes since last commit), Invalid (not valid; coherence fill required before use). Between stable states, transient states model in-flight operations [22, Ch.6]âe.g., MIâSM^IS denotes a line that was Modified, is transitioning to Invalid, and awaits acknowledgment. These transient states bear on protocol correctness. I elide them in the first-order model that followsâa deliberate simplification constraining the analysis to quiescent-state reasoning and foreclosing claims about transient-state behavior in ACS. The limitation is real; I will revisit it in §4.2 when the question of what âstructural isomorphismâ means across asynchronous event-bus semantics becomes non-trivially relevant. The core efficiency property of MESI: update-on-demand. Transitions from Invalid to Shared or Exclusive are triggered only by actual reads, not by writes elsewhere. Broadcast-on-write bandwidth converts to targeted-fetch-on-read bandwidth. When write frequency W is low relative to read frequency R, savings are substantial. When WâRWâ R, protocol overhead approaches the broadcast baseline. The mapping from CPU memory hierarchies to multi-agent systems is summarized in Table 0. CCS v0.1 targets the L1/L2 â LLC tier (agent runtime cache â shared artifact store); persistent storage and cross-workflow artifact retention are explicitly out of scope. Table 0: Agent Memory Hierarchy Analogy CPU Memory Hierarchy Agent Memory Hierarchy Coherence Mechanism L1/L2 cache (per-core) Agent artifact cache (per-agent runtime) MESI state per agentâartifact pair Shared LLC / main memory Shared artifact store (authority service) Canonical version + invalidation events Memory bus / coherence fabric Event bus (Redis / Kafka / NATS) Invalidation and version-update messages Disk / persistent storage Long-term persistence (vector DB, file store) Out of scope for CCS v0.1 2.2 Multi-Agent LLM Orchestration Multi-agent LLM systems [24; 26; 23] coordinate multiple language model instances on shared tasks. LangGraph [21], CrewAI [5], AutoGen [24], Semantic Kernel [15]âeach represents agents as nodes in a computation graph, passing state via structured messages or shared memory constructs. The synchronization pattern is uniform, and I state this without observed exception across every framework I have instrumented: full-state rebroadcast. Upon artifact modification by any agent, the orchestrator injects the complete updated artifact into the next prompt of every agent that might need it. Consistency is purchased at the cost described above. Building on [4], the MAST taxonomy identifies 14 failure modes across 1,642 annotated execution traces. Failure rates: 41%â86.7%. Dominant categories: system design issues (44.2%), inter-agent misalignment (32.3%). FM-1.4âLoss of Conversation Historyâdescribes agents reverting to earlier artifact states following unexpected context truncation, at 2.8% occurrence across all traces. The bounded-staleness invariant of CCS (§6) instantiates a formal upper bound on the number of reasoning steps any agent can operate on stale artifact stateâa structural, not heuristic, constraint on exactly the failure class Cemri et al. identify. 2.3 The Always-Read Objection Before the formal model, I confront the objection that willâand shouldâbe raised by reviewers conversant with transformer inference mechanics. The objection: LLM agents ingest their entire context window at every forward pass. Lazy invalidation cannot prevent artifact injection. A token in the prompt is a token consumed. Correct on one point, this objection: a token in the prompt is indeed a token consumed. What it misdescribes is the prompt construction processâand here I remain cautious (the diversity of production deployment architectures is wider than any single author can claim to have instrumented exhaustively), but I am confident enough to state categorically: modern agents do not assemble context from artifacts embedded inline. They assemble context from references to externally stored artifacts, retrieving conditionally via tool calls, MCP resource requests, or retrieval APIs. I formalize this in §3. The always-read model applies to naive single-turn prompt construction exclusively. Whether it still describes a non-negligible fraction of deployed systemsâyes, almost certainly. Whether it describes the architectures consuming the majority of the multi-agent token budgetâno. The distinction matters for the applicability claim, and I draw it deliberately. 3 Conditional Artifact Access Semantics 3.1 The Naive Access Model Let A=a1,âŠ,anA=\a_1,âŠ,a_n\ denote a set of agents and D=d1,âŠ,dmD=\d_1,âŠ,d_m\ a set of shared artifacts. Denote by Râ(a,s)R(a,s) the set of artifacts whose full token contents are injected into the prompt of agent a at reasoning step s. Under the naive broadcast model: Râ(a,s)=DâaâA,âsR(a,s)=D â aâ A,\;â s Per-step token cost under this assumption: âi|di| _i|d_i| per agent. Total cost: nĂSĂâi|di|nĂ SĂ _i|d_i|. Lazy invalidation is trivially useless under this regimeâeven a cached-and-valid artifact must be injected to remain accessible. MESI savings: zero. 3.2 Artifact Externalization in Production Systems The assertion Râ(a,s)=DR(a,s)=D is not the access model instantiated by modern production agent architectures. Four patterns bifurcate the naive model, each yielding Râ(a,s)âDR(a,s) D: Tool-based retrieval. LangChain and OpenAI Assistants expose retrieval toolsâget_document(), read_file(), query_memory(). System prompts carry artifact identifiers, not artifact contents. Tool invocation is conditional; tool calls that never fire never inject tokens. Râ(a,s)âDR(a,s) D with proper subset holding whenever not all tools are invoked. The mechanism is straightforward; the implication for coherence economics is less so, because the decision to invoke a tool is itself a stochastic function of the agentâs reasoning traceâa dependency I have not modeled formally and acknowledge as a simplification. MCP resource access. Under the Model Context Protocol [1], artifacts are external resources identified by URIs (resource://shared_plan, resource://research_notes). Injection occurs only upon explicit request. The resource reference in the system prompt costs Oâ(1)O(1) tokens, not Oâ(|di|)O(|d_i|)âa distinction whose significance scales with artifact size. Vector retrieval systems. Retrieval-augmented architectures store artifacts in vector stores and inject only top-k retrieved fragments. The prompt contains minâĄ(k,|di|)âȘ|di| (k,|d_i|) |d_i| tokens for any large artifact. Agent exposure to artifact tokens it did not retrieve is structurally precluded. Provider-side prompt caching. Anthropic, OpenAI, and Google all implement prompt prefix caching attaining non-trivial reuse across consecutive agent calls [2; 17]. The caching mechanism operates only when the prompt prefix is identical across calls. Were artifacts re-embedded with updated content at every step, cache hit rates would approach zeroâbut production deployments report substantial reuse. This is attainable only when prompt prefixes remain stable, attainable only when artifacts are not re-embedded at every step. I find this a minor but telling methodological observation: the existence of high prompt cache hit rates in production constitutes indirect evidence that real-world systems do not, in fact, operate under the always-read model. The evidence is circumstantialâI cannot rule out that high cache hit rates arise from other prefix-stability mechanismsâbut the inference is, within its constraints, sound. The 86% token duplication measured in flat multi-agent topologies [28] is not a contradiction. Systems currently operating under naive broadcast semantics do incur this cost. The argument is that they ought notâand the conditional access patterns above delineate how production systems already escape it at scale. 3.3 Formal Conditional Access Model I define the conditional artifact access model as: Râ(a,s)âDâaâA,âsR(a,s) D â aâ A,\;â s with the conditional access condition requiring that for most artifacts and steps: PrâĄ[diâRâ(a,s)]âȘ1 [d_iâ R(a,s)] 1 Under this model, the relevant cost is not prompt token consumption per step but artifact injection frequencyâhow often did_iâs full contents must be transmitted to agent aâs context. Lazy invalidation attenuates this frequency: when did_i has not been modified since agent a last received it, no retransmission occurs. The agent holds a valid local reference; the cached version remains coherent. This restores the conditions under which MESI savings are attainable and renders the formal argument in §4 applicable to deployed systems. 4 Formal Model 4.1 Artifact Coherence System Definition 1 (Artifact Coherence System). An Artifact Coherence System (ACS) is a tuple âšA,D,ÎŁ,ÎŽ,α,â© A,D, ,ÎŽ,α,T where: âą A=a1,âŠ,anA=\a_1,âŠ,a_n\ is a finite set of agents; âą D=d1,âŠ,dmD=\d_1,âŠ,d_m\ is a finite set of shared artifacts (analogous to memory locations / cache lines); âą ÎŁ=M,E,S,I =\M,E,S,I\ is the set of stable artifact coherence states; âą ÎŽ:ÎŁĂâ°âÎŁÎŽ: ĂEâ is the state transition function, where â°=read,write,upgrade,fetch,invalidate,commitE=\ read, write, upgrade, fetch, invalidate, commit\; ⹠α:AĂDâΣα:AĂ Dâ is the coherence state function mapping each agentâartifact pair to its current state; âą :ÎŁâ0,1T: â\0,1\ is the validity predicate, with â(I)=0T(I)=0 and â(s)=1T(s)=1 for sâM,E,Ssâ\M,E,S\. The validity predicate renders the MESI safety invariant precise: an agent may reference a cached artifact only when â(αâ(a,di))=1T(α(a,d_i))=1. State I mandates a coherence fillâa fetch from the authority serviceâbefore use. 4.2 MESI State Mapping I construct an explicit mapping Ï from hardware MESI states to artifact coherence states. Definition 2 (MESI State Mapping). The mapping Ï:ÎŁhwâÎŁ : _hwâ is the identity function on the shared state space M,E,S,I\M,E,S,I\, with the following semantic interpretations in the artifact domain: Hardware State Artifact State Semantic Interpretation Modified (M) Modified (M) Agent holds the only valid copy; authority copy is stale; other agents are invalidated Exclusive (E) Exclusive (E) Agent holds the only copy, identical to authority; write permitted without broadcast Shared (S) Shared (S) Multiple agents hold valid copies; no agent has written since last commit Invalid (I) Invalid (I) Agentâs cached copy is stale; full fetch required before next use Every state transition in the hardware protocol possesses a direct semantic counterpart in the artifact protocol: âcache fillâ maps to âartifact fetch,â âbus invalidationâ maps to âinvalidation eventâ over the message bus. Proposition 1 (Structural Equivalence). The ACS transition system (ÎŁ,ÎŽ)( ,ÎŽ) is isomorphic to the MESI hardware transition system under Ï . Every safety result that holds for MESI under the SWMR invariant holds for ACS under the identical invariant. Proof sketch. By construction of Ï as the identity mapping on M,E,S,I\M,E,S,I\, and by the fact that ÎŽ reproduces the MESI transition table exactly (read causes IâSIâ S, write causes SâMSâ M with peer invalidation, commit causes MâSMâ S, fetch causes IâSIâ S). The SWMR invariant âaâ b:ÂŹ(αâ(a,d)=Mâ§Î±â(b,d)=M)â aâ b: (α(a,d)=M α(b,d)=M) is maintained by the identical write-invalidates-peers rule present in both systems. ⥠A limitation I want to foreground rather than relegate to §10: the isomorphism holds at the stable-state level, but the transient-state behavior of hardware MESIâwhich involves non-trivial race conditions on the bus fabricâmaps only approximately to asynchronous event-bus semantics in CCS. I have not formalized the transient-state correspondence. I remain cautious about extending the equivalence claim beyond quiescent states until that formalization is complete. This is not, I suspect, a trivial gap. The liveness pathologies of snoopy-bus transient interleavings under hardware MESI are well-documented [22, Ch.6], and their analogs in asynchronous message delivery are, at minimum, non-obvious. Whether this gap undermines the practical utility of the mappingâI think not, because the protocol operates at quiescent-state granularity by designâbut a reviewer insisting on transient-state completeness would have a legitimate objection that I cannot yet discharge. 4.3 The Broadcast Cost Baseline Under the naive broadcast model (Râ(a,s)=DR(a,s)=D), total token cost for n agents, S steps, and m artifacts: Tbroadcast=nĂSĂâi=1m|di|T_broadcast=nĂ SĂ _i=1^m|d_i| where |di||d_i| denotes token size of artifact did_i. The cost grows multiplicativelyâdoubling agents, steps, or artifact size each doubles total cost. For a typical configuration (n=5n=5, S=50S=50, m=3m=3, |di|=4,096|d_i|=4,096 tokens): Tbroadcast=5Ă50Ă3Ă4,096=3,072,000â tokensT_broadcast=5Ă 50Ă 3Ă 4,096=3,072,000 tokens Under conditional access (Râ(a,s)âDR(a,s) D), the relevant per-step cost is not full artifact injection but the coherence synchronization cost: tokens transmitted due to initial reads and write-triggered re-fetches. 4.4 The Token Coherence Theorem Definition 3 (Coherent Synchronization Cost Upper Bound). Under the ACS model with lazy invalidation, total token cost is bounded above by: Tcoherentâ€âi=1mnâ (n+Wâ(di))Ă|di|T_coherent†_i=1^mn· (n+W(d_i) )Ă|d_i| where Wâ(di)W(d_i) denotes total write operations to artifact did_i across all agents and steps. The bound arises because each of n agents performs at most one initial fetch per artifact, and each write event can trigger at most nâ1n-1 invalidations each followed by one re-fetch. Conservatively counting the writerâs own fetch, worst-case total fetches per artifact: nâ(1+Wâ(di))n(1+W(d_i)), approximated as nâ(n+Wâ(di))n(n+W(d_i)) for the multi-agent stochastic access model (§8.1). The bound is tight only when every invalidation immediately triggers a re-fetchâa condition that lazy coherence precludes by collapsing multiple write events into a single re-fetch when agents do not access an invalidated artifact between consecutive writes. The gap between bound and observation is, in my experience, substantialâranging from 10 to 45 percentage points depending on workloadâand this gap is itself a finding worth flagging, because it suggests that the analytical bound, while correct, may be too conservative to serve as a useful planning heuristic for practitioners at high V. Assumptions. Two modeling assumptions bound the scope of Theorem 1: (A1) Full-artifact transmission on cache miss. Each cache miss triggers transmission of the full artifact did_i (|di||d_i| tokens). Sub-artifact delta fetches are not modeled; this is a conservative assumption that overestimates coherent cost. (A2) Serialized writes via authority. All writes to a given artifact are serialized through the authority service. Concurrent peer-to-peer writes are not modeled; the single-writer invariant (§6.2) enforces this structurally. Theorem 1 (Token Coherence Theorem â Savings Lower Bound). (Under Assumptions A1 and A2.) The token savings from lazy artifact invalidation are bounded below by: Savingsâ„1âTcoherentupperTbroadcast=1ââinâ(n+Wâ(di))â|di|nĂSĂâi|di|Savingsâ„ 1- T_coherent^upperT_broadcast=1- _in(n+W(d_i))|d_i|nĂ SĂ _i|d_i| The condition under which savings are strictly positive is: S>n+Wâ(di)for most artifacts âdiS>n+W(d_i) most artifacts d_i For identical artifact sizes |di|=|d||d_i|=|d|, the lower bound simplifies to: Savingsâ„1ân+Wâ(di)SSavingsâ„ 1- n+W(d_i)S Proof. Substitute the Definition 3 upper bound for TcoherentT_coherent and the broadcast formula into the savings ratio. For uniform artifact sizes the |d||d| and the leading n cancel: nâ(n+W)â|d|/nâSâ|d|=(n+W)/Sn(n+W)|d|\;/\;nS|d|=(n+W)/S. Savings â„1â(n+W)/Sâ„ 1-(n+W)/S. Since Tcoherentactualâ€TcoherentupperT_coherent^actual†T_coherent^upper, actual savings meet or exceed this bound. The condition S>n+Wâ(di)S>n+W(d_i) ensures positivity. ⥠Remark. Simulation results in §8 confirm that observed savings consistently exceed the lower bound, owing to the lazy collapse mechanism described above. Corollary 1 (Maximum Savings). When Wâ(di)=0W(d_i)=0 for all i (read-only artifacts), the savings lower bound approaches 1ân/S1-n/S. For n=4n=4, S=40S=40: lower bound = 90%; simulation attains â„95%â„ 95\%. Corollary 2 (Collapse Condition). When Wâ(di)â„SânW(d_i)â„ S-n (write rate exhausts the step budget), the lower bound falls to zero or below; coherence may produce overhead rather than savings under worst-case conditions. The transformation from broadcast to coherent cost is qualitatively significant: TbroadcastâOâ(nĂSĂ|D|)T_broadcastâ O(nĂ SĂ|D|) while TcoherentâOâ(nâ(n+W)Ă|D|)T_coherentâ O(n(n+W)Ă|D|) at worst. A triply-multiplicative cost converts to an additively-multiplicative one; the S multiplier is eliminated. Simulation confirms actual coherent cost falls strictly below this upper bound. Consistency model. CCS instantiates bounded-staleness coherence: each agent observes a globally consistent artifact version at every read, subject to the constraint that the observed version may lag the canonical version by at most K write operations (Invariant 3, §6.2). Weaker than sequential consistencyâwhich mandates that every read observe the most recent write. Stronger than eventual consistencyâwhich provides no staleness bound. The K parameter renders the staleness budget explicit and configurable, analogous to bounded-staleness consistency levels in distributed databases. Practitioners requiring strict sequential consistency must set K=0K=0, forcing synchronous authority checks on every artifact access and eliminating the token savings from lazy invalidationâa tradeoff that is, in my estimation, rarely justified given the latency cost. 4.5 Artifact Volatility and the Coherence Condition Definition 4 (Artifact Volatility Factor). The volatility factor of artifact did_i: Vâ(di)=Wâ(di)Sâ[0,1]V(d_i)= W(d_i)Sâ[0,1] This captures the fraction of steps triggering a write to the artifact. High volatility (Vâ1Vâ 1): the artifact changes nearly every step. Low volatility (Vâ0Vâ 0): changes are infrequent. Substituting Wâ(di)=Vâ(di)â SW(d_i)=V(d_i)· S into the savings lower bound from Theorem 1: Savingsâ„1ân+Vâ(di)â S=1ânSâVâ(di)Savingsâ„ 1- n+V(d_i)· SS=1- nS-V(d_i) For typical workflow parameters (n=4n=4, S=40S=40, Vâ(di)=0.05V(d_i)=0.05), the lower bound is: Savingsâ„1â(0.1+0.05)=85%Savingsâ„ 1-(0.1+0.05)=85\% Simulation attains 95.0% for these parameters (§8), exceeding the lower bound as expected. The coherence condition S>n+Wâ(di)S>n+W(d_i) corresponds to Vâ(di)<1ân/SV(d_i)<1-n/S. Definition 5 (Volatility Cliff). The volatility cliff is the value Vâ=1ân/SV^*=1-n/S above which the coherence savings lower bound falls below zero and overhead dominates. For n=4n=4, S=40S=40: Vâ=0.9V^*=0.9. For n=5n=5, S=20S=20: Vâ=0.75V^*=0.75. The cliff is lower when step count is short or agent count is highâa constraint practitioners ought to internalize when sizing deployments. 5 Protocol Specification 5.1 System Assumptions CCS is specified and verified under the following assumptions. Relaxation of each is identified as future work. I want to be explicitâAS3 in particular represents a non-trivial constraint that may not hold under production conditions where aggressive agent-pool recycling is standard practice. (AS1) Reliable authority service. The authority service does not crash or partition during protocol execution. A single logical entity; high-availability replication via consensus protocol is possible but falls outside CCS v0.1 scope. (AS2) At-least-once event bus delivery. Invalidation events published to the event bus are eventually delivered to all subscribers at least once. Duplicate deliveries are idempotent (re-receiving an invalidation for a version already marked Invalid is a no-op). (AS3) No agent crash while holding M state. An agent holding Modified state does not crash before issuing Commit or releasing ownership. Violation causes the authority to hold an orphaned exclusive lock; the lease TTL mechanism (§5.2) provides recovery. The TLA+ verification in §6 holds under these assumptions. 5.2 System Architecture CCS governs four interacting entities. The Authority Service maintains the global artifact directoryâa mapping from artifact identifiers to current version numbers, last-writing agent, and per-agent coherence state. Single source of truth for artifact metadata. The Agent Runtime, embedded within each agent, maintains a local artifact cache; each entry stores artifact content, version at time of last fetch, and current MESI state. The Event Bus propagates invalidation events from authority to agents asynchronously; supported transports: Redis PubSub, Apache Kafka, NATS, WebSockets. The Artifact Store holds canonical artifact versions and serves fetch requests. Two communication channels bifurcate the control plane. The Control Channel (Agent â Authority, HTTP/gRPC): read requests, write requests, ownership acquisition. The Event Channel (Authority â Agents, pub/sub): invalidation notifications, version updates. 5.3 Protocol Operations Read. Agent a wishing to read artifact did_i checks αâ(a,di)α(a,d_i). If â(αâ(a,di))=1T(α(a,d_i))=1 (state âM,E,Sâ\M,E,S\), the cached version is consumed directlyâzero tokens transmitted. If αâ(a,di)=Iα(a,d_i)=I, the agent issues READ_REQUEST to authority, which responds with current content and version, setting αâ(a,di)âSα(a,d_i)â S. Upgrade. To write did_i while holding αâ(a,di)=Sα(a,d_i)=S, agent a must first acquire exclusive ownership via UPGRADE_REQUEST. The authority sets αâ(b,di)âIα(b,d_i)â I for all bâ abâ a, propagates INVALIDATE events over the event bus, grants αâ(a,di)âEα(a,d_i)â E. Write. Once αâ(a,di)=Eα(a,d_i)=E, the agent writes locally, transitions to αâ(a,di)=Mα(a,d_i)=M. Zero tokens broadcast during local writes; authority notification deferred until commit. Commit. Agent sends COMMIT containing new content and incremented version. Authority stores the canonical version, sets αâ(a,di)âSα(a,d_i)â S, broadcasts VERSION_UPDATE to agents not in state I. Fetch. Agent with αâ(a,di)=Iα(a,d_i)=I needing did_i sends FETCH_REQUEST. Authority responds with current content and version. Agent transitions αâ(a,di)âSα(a,d_i)â S. Invalidation. Authority sends INVALIDATE(artifact_id, version) over event bus on write-upgrade grant. Agents set cache entry to I on receipt. Idempotent; retransmission on reconnect preserves safety. Lease TTL and M-state recovery. Upon granting an Exclusive write lock, authority starts a configurable lease timer Ï (default: 30s). If COMMIT does not arrive within Ïâthe authority treats the lock as orphaned, reverts to last committed version, sets αâ(b,di)âIα(b,d_i)â I for all agents, releases the exclusive grant. Liveness under agent crash: no artifact permanently locked by a crashed owner. The tradeoff is real: in-progress writes are lost. Agents must re-fetch and re-apply. On the sensitivity of Ï: setting it too aggressively introduces a race between legitimate slow writes and lease expiration. I have observed this empiricallyâbenchmarks on throttled cloud instances where API response times exceeded 20 seconds under load surfaced the race condition consistently. It was an unforeseen sensitivity; the failure mode is that a perfectly valid write gets reverted because the authorityâs timer fires before the LLM finishes generating. Tuning guidance for Ï remains, at this writing, heuristic rather than principled. I would like to derive a formal relationship between expected inference latency, Ï, and write-loss probability, but this requires a distributional model of LLM response times that I do not yet possess. A hardware-induced jitter component from the cloud providerâs GPU scheduling adds further unpredictabilityâa nuisance factor I have not been able to sequester cleanly. 5.4 Message Schema Protocol messages conform to a common envelope: ⏠"type": "MESSAGE_TYPE", "timestamp": "ISO8601", "agent_id": "string", "artifact_id": "string", "version": 42, "payload": Artifact metadata on fetch responses: ⏠"artifact_id": "string", "version": 42, "checksum": "sha256:...", "size_tokens": 4096, "last_modified_by": "agent_id" 5.5 Synchronization Strategies Four synchronization strategies, pluggable: Eager invalidation triggers immediate invalidation broadcast to all peers the instant a write begins (on upgrade grant, not commit). Staleness window minimized; invalidation traffic and redundant fetches on abandoned writes are the cost. Lazy invalidation (recommended default) triggers invalidation only on commit, after write completion and new version availability. Avoids fetches for in-progress writes; batches invalidation cost to write completion. Lease-based TTL assigns each cache entry a time-to-live; entries expire to I on lease expiration regardless of write activity. Simplest strategyâbut decoupled from write frequency, leaving tokens unrealized in low-volatility workloads. Access-count invalidation assigns each cache entry a maximum read count; entries transition to I after k uses. Mirrors the execution-count credential model proposed by the OpenID Foundation [18] for authorization, applied here to artifact freshness rather than access control. 6 Formal Verification 6.1 TLA+ Specification CCS is formally specified in TLA+ (Temporal Logic of Actions) for model checking with TLC. Three agents sharing one artifactâsufficient, in my assessment, to expose all relevant concurrency scenarios. I concede that increasing to four or five agents may surface additional interleaving pathologies my current state-space budget does not cover. The state explosion problem is real; at 3 agents the space is ~2,400 states, and it grows combinatorially. Whether the invariants hold at n=10n=10 under all interleavingsâI believe so, by the structural symmetry of the specification, but I have not verified it and will not claim it. State variables: ⏠VARIABLES artifactVersion, \* Natural number, global canonical version artifactState, \* [Agent -> M, E, S, I], per-agent state agentSteps, \* [Agent -> Nat], steps executed since last sync lastSync \* [Agent -> Nat], version at last sync Initial state: All agents hold the artifact in Shared state at version 1. ⏠Init == /\ artifactVersion = 1 /\ artifactState = [a â AGENTS |-> "S"] /\ agentSteps = [a â AGENTS |-> 0] /\ lastSync = [a â AGENTS |-> 1] Operations: ⏠Read(a) == /\ artifactState[a] # "I" /\ agentStepsâ = [agentSteps EXCEPT ![a] = agentSteps[a] + 1] /\ UNCHANGED <<artifactState, artifactVersion, lastSync>> Write(a) == /\ artifactState[a] â "E", "M" /\ artifactVersionâ = artifactVersion + 1 /\ artifactStateâ = [x â AGENTS |-> IF x = a THEN "M" ELSE "I"] /\ lastSyncâ = [lastSync EXCEPT ![a] = artifactVersionâ] /\ UNCHANGED agentSteps Fetch(a) == /\ artifactState[a] = "I" /\ artifactStateâ = [artifactState EXCEPT ![a] = "S"] /\ lastSyncâ = [lastSync EXCEPT ![a] = artifactVersion] /\ UNCHANGED <<artifactVersion, agentSteps>> Upgrade(a) == /\ artifactState[a] = "S" /\ artifactStateâ = [x â AGENTS |-> IF x = a THEN "E" ELSE "I"] /\ UNCHANGED <<artifactVersion, agentSteps, lastSync>> Next-state relation: ⏠Next == a â AGENTS : Read(a) \/ Write(a) \/ Fetch(a) \/ Upgrade(a) 6.2 Verified Invariants Invariant 1 â Single-Writer Safety (SWMR). âa,bâA:aâ bâÂŹ(αâ(a,d)=Mâ§Î±â(b,d)=M)â a,bâ A:aâ b (α(a,d)=M α(b,d)=M) ⏠SingleWriter == a, b â AGENTS : (a # b) => ~(artifactState[a] = "M" /\ artifactState[b] = "M") Invariant 2 â Monotonic Versioning. âtâČ>t:artifactVersionâ(tâČ)â„artifactVersionâ(t)â t >t:artifactVersion(t ) (t) TLC verifies artifactVersionâČâ„artifactVersionartifactVersion in every transition. Invariant 3 â Bounded Staleness. For constant K=MAX_STALE_STEPSK= MAX\_STALE\_STEPS: âaâA:agentStepsâ[a]âlastSyncâ[a]â€Kâ aâ A:agentSteps[a]-lastSync[a]†K ⏠BoundedStaleness == a â AGENTS : (agentSteps[a] - lastSync[a]) <= MAX_STALE_STEPS 6.3 Verification Results TLC, configured with |AGENTS|=3|AGENTS|=3 and MAX_STALE_STEPS=3 MAX\_STALE\_STEPS=3, explores approximately 2,400 distinct states. Zero violations of SingleWriter, MonotonicVersion, BoundedStaleness. Zero deadlocks. Liveness scope. Safety invariants and deadlock-freedom are verified. A formal liveness property is not included. The property that an agent in state I eventually reaches state Sâthat a pending fetch completesâholds under weak fairness (WF) on Fetch operations but has not been verified under adversarial scheduling. Liveness in practice depends on AS1 and AS2; violation of either can cause indefinite blocking. Formalizing liveness as a TLA+ property: planned for CCS v0.2. Counterexample under invalidation removal. Modifying Upgrade(a) to not invalidate peers: ⏠\* Broken: no peer invalidation BrokenUpgrade(a) == /\ artifactState[a] = "S" /\ artifactStateâ = [artifactState EXCEPT ![a] = "E"] /\ UNCHANGED <<artifactVersion, agentSteps, lastSync>> TLC detects SingleWriter violation in 3 steps: A1A_1 upgrades to E, A2A_2 upgrades to E (not invalidated), A1A_1 writes to M, A2A_2 writes to MâSWMR violated. The invalidation step in Upgrade is a correctness requirement. Not an optimization. 7 Implementation 7.1 Architecture Overview The agent-coherence Python package (v0.1) implements CCS: ⏠ccs/ |-- core/ | |-- types.py # Artifact, CacheEntry, InvalidationSignal | |-- states.py # MESIState, TransientState enums | â-- clock.py # Logical vector clock for version ordering |-- coordinator/ | |-- service.py # CoordinatorService (Authority Service) | â-- registry.py # ArtifactRegistry (global directory) |-- agent/ | |-- runtime.py # AgentRuntime (per-agent protocol client) | â-- cache.py # ArtifactCache (local MESI state machine) |-- strategies/ | |-- base.py # SyncStrategy abstract base | |-- eager.py # Eager invalidation | |-- lazy.py # Lazy (commit-time) invalidation | |-- lease.py # TTL-based lease expiration | â-- access_count.py # Access-count invalidation |-- bus/ | â-- event_bus.py # EventBus (pluggable transport) |-- adapters/ | |-- langgraph.py # LangGraph adapter | |-- crewai.py # CrewAI adapter | â-- autogen.py # AutoGen adapter â-- simulation/ |-- engine.py # SimulationEngine â-- scenarios.py # ScenarioConfig 7.2 Framework Adapters Each adapter: a thin translation layer mapping the frameworkâs native state-passing to CCS protocol calls. No framework modifications required. LangGraph adapter. Intercepts StateGraph node execution hooks. Before execution: AgentRuntime.read(artifact_id) to validate cache state, inject content only on cache invalidity. After execution: modified state entries trigger AgentRuntime.write(artifact_id, content). CrewAI adapter. Wraps Task execution lifecycle. Artifact access injected through BaseTool subclassingâartifacts stored as named tool outputs via CCSReadTool, committed via CCSWriteTool. AutoGen adapter. Intercepts ConversableAgent.generate_reply. Cache validity checked before message context assembly; writes propagated through register_reply hook. Configuration surface (identical across all three): ⏠from ccs.adapters.langgraph import LangGraphAdapter adapter = LangGraphAdapter( coordinator_url="http://localhost:8080", strategy="lazy", max_stale_steps=5 ) 7.3 Logical Clock and Version Ordering A logical vector clock (one counter per agent) establishes partial ordering over writes, following Lamport [10]. Version numbers are monotonically increasing integers assigned by the authority at commit time. Version ordering suffices for single-artifact safety; multi-artifact scenarios with cross-artifact causal dependencies may require full vector clocksâsupported but not required by default. 8 Evaluation 8.1 Experimental Setup CCS is evaluated across four workload scenarios representing distinct artifact volatility regimes. Each scenario: a ScenarioConfig specifying agent count, artifact count, artifact token size, step count, per-step write probability. Ten independent simulations per configuration, executed with scenario-specific deterministic seeds (per-scenario seeds encoded in YAML; canonical scenarios AâD use seeds 20260305â20260308). Population standard deviation (Ï) reported throughout. The simulation models artifact access under conditional access semantics (§3). At each step, each agent acts with probability 0.75 (the action_probability parameter); given an action, writes with probability Vâ(di)V(d_i) or reads otherwise, choosing uniformly from m artifacts. Token cost: full artifact fetches (cache misses) Ă artifact token size, plus invalidation message overhead (12 tokens per signal). Canonical scenario parameters (all configurations): n=4n=4 agents, m=3m=3 artifacts, |di|=4,096|d_i|=4,096 tokens per artifact, S=40S=40 steps, 10 runs per configuration. Measured broadcast baseline: Tbroadcast=1,979,597±3,199T_broadcast=1,979,597± 3,199 tokens. This slightly exceeds the formula value nĂSĂmĂ|di|=1,966,080nĂ SĂ mĂ|d_i|=1,966,080 because the broadcast strategy also performs stochastic agent actions generating additional fetch tokens (~13.5K on average) atop the deterministic all-to-all broadcast sweep. I initially mistook this discrepancy for a bug before tracing it to the action-probability sampling layerâa small but instructive lesson in the perils of treating simulator output as self-evidently veridical. The ~0.7% overshoot is consistent across all runs and does not affect comparative savings ratios. Simulation scope and its limits. Token transmission accounting, MESI state machine transitions, write frequency distributions, artifact volatility effectsâthese are modeled faithfully. LLM inference latency, message bus round-trip overhead, framework scheduling jitterâthese are not. Theorem 1 delineates a lower bound on savings; the simulation consistently attains higher savings because lazy coherence collapses multiple write invalidations into a single re-fetch when agents do not access an artifact between consecutive writes. Whether the simulationâs access patternsâuniform artifact selection, p=0.75p=0.75 action probabilityâreflect the access distributions of real production workloads is an open empirical question. I suspect they do not match precisely; the uniform distribution is a modeling convenience, not a measured parameter. Empirical access-rate measurement from instrumented deployments is identified in §10 as a direction for v0.2, and I consider this the most significant gap between the simulation results and production applicability. The four scenarios: Scenario A â Planning (V=0.05V=0.05, Wâ2Wâ 2 writes per artifact). Infrequent plan revisions. Representative of planning workflows, long-horizon research, specification review. Scenario B â Analysis (V=0.10V=0.10, Wâ4Wâ 4). Periodic shared-document updates. Representative of code review, report drafting, data analysis pipelines. Scenario C â Active Development (V=0.25V=0.25, Wâ10Wâ 10). Moderate artifact churn. Representative of multi-agent software development. Scenario D â High Churn (V=0.50V=0.50, Wâ20Wâ 20). Frequent modification by multiple agents. The performance boundary. 8.2 Token Savings Results The eager strategy is included in Table 2 as an implementation-complexity baseline. It does not enforce the K-bounded staleness invariant (Invariant 3, §6.2); agents under eager synchronization may read stale content for arbitrary step counts. Staleness-bound violations reported for eager in benchmark output are expected and do not indicate protocol error. Table 1: token usage under naive broadcast and under lazy invalidation, with savings, cache hit rate (CHR), Coherence Reduction Ratio (CRR = Tcoherent/TbroadcastT_coherent/T_broadcast). Table 1: Token synchronization cost by scenario (10 runs, scenario-specific seeds, values in thousands of tokens) Scenario Vâ(di)V(d_i) TbroadcastT_broadcast (±Ï±Ï) TcoherentT_coherent (±Ï±Ï) Savings CRR CHR A: Planning 0.05 1,979.6±3.21,979.6± 3.2 98.1±25.098.1± 25.0 95.0%±1.3%95.0\%± 1.3\% 0.050 79.4%±5.2%79.4\%± 5.2\% B: Analysis 0.10 1,979.6±3.21,979.6± 3.2 152.3±28.5152.3± 28.5 92.3%±1.4%92.3\%± 1.4\% 0.077 66.8%±6.0%66.8\%± 6.0\% C: Development 0.25 1,979.6±3.21,979.6± 3.2 231.2±29.1231.2± 29.1 88.3%±1.5%88.3\%± 1.5\% 0.117 51.1%±7.0%51.1\%± 7.0\% D: High Churn 0.50 1,979.2±3.11,979.2± 3.1 312.1±25.6312.1± 25.6 84.2%±1.3%84.2\%± 1.3\% 0.158 34.6%±7.0%34.6\%± 7.0\% Broadcast cost is nearly deterministic under fixed parameters. Coherent cost: higher variance, because write events draw from a Bernoulli process and resulting cache misses are stochastic. All savings exceed the theoremâs lower bounds (85% / 80% / 65% / 40%), confirming Definition 3 is a conservative upper bound on TcoherentT_coherent. Strategy comparison. Table 2: token costs, all four strategies, Scenario B (V=0.10V=0.10). Table 2: Strategy comparison under Scenario B (Analysis, V=0.10V=0.10, 10 runs) Strategy TsyncT_sync (±Ï±Ï) Savings Notes Broadcast baseline 1,979.6±3.21,979.6± 3.2 â Full rebroadcast every step Eager invalidation 132.7±24.3132.7± 24.3 93.3%±1.2%93.3\%± 1.2\% Lower fetch overhead; higher invalidation traffic Lazy invalidation 152.3±28.5152.3± 28.5 92.3%±1.4%92.3\%± 1.4\% Recommended default TTL (lease = 10 steps) 589.8±0589.8± 0 70.2%±0%70.2\%± 0\% Decoupled from write frequency Access-count (k=8k=8) 155.2±25.3155.2± 25.3 92.2%±1.3%92.2\%± 1.3\% Near-equivalent to lazy at this V Eager outperforms lazy slightly hereâits immediate invalidation-on-write prevents stale cache hits that require re-fetch at next access. The difference is small (93.3% vs 92.3%) and reverses in write-heavy scenarios (§8.5 Table 5) where lazyâs deferred-fetch advantage dominates. TTL: strictly inferior in the low-volatility regime. Access-count: matches lazy closely at V=0.10V=0.10. 8.3 The Volatility Cliff The lower-bound formula predicts a savings cliff at Vâ=1ân/S=1â4/40=0.9V^*=1-n/S=1-4/40=0.9. Below, both formula lower bound and observed savings from simulation (10 runs, canonical parameters n=4n=4, S=40S=40): Vâ(di)V(d_i) Formula Lower Bound Observed Savings (10 runs) 0.01 89.0% 97.1%±0.4%97.1\%± 0.4\% 0.05 85.0% 95.0%±1.3%95.0\%± 1.3\% 0.10 80.0% 92.4%±1.5%92.4\%± 1.5\% 0.25 65.0% 88.3%±1.4%88.3\%± 1.4\% 0.50 40.0% 84.3%±1.0%84.3\%± 1.0\% 0.75 15.0% 82.2%±1.1%82.2\%± 1.1\% 0.90 0.0% 81.1%±1.3%81.1\%± 1.3\% 1.00 -10.0% 80.6%±1.3%80.6\%± 1.3\% The predicted collapse does not materialize. At V=0.9V=0.9: 81.1% savings. At V=1.0V=1.0: 80.6%. Two mechanisms account for this: (a) writes distribute uniformly across m=3m=3 artifacts, so per-artifact effective write rate is V/mâV/3V/mâ V/3, and (b) multiple writes to the same artifact between agent accesses collapse into a single re-fetch under lazy semantics. The collapse condition (Corollary 2) remains a valid worst-case analytical boundâit is tight only when all n agents re-fetch immediately after every single write, a scenario that lazy access semantics structurally preclude. The practical reading of this table: coherence delivers substantial savings across the full volatility spectrum within the simulation model. The formula lower bound is most conservative at high Vâthe gap between bound and observation is largest precisely where practitioners need the most guidance, a feature of the bound I consider a weakness rather than a strength, and one I suspect could be tightened by incorporating the lazy-collapse mechanism directly into the analytical model. I have not attempted this tightening because the resulting expression would depend on the access probability distribution in ways that resist closed-form simplification, but the effort may be worthwhile for v0.2. 8.4 Prompt Caching Amplification A secondary benefit, not captured in the primary token savings metric, concerns provider-side prompt caching. Under broadcast semantics, the prompt prefix is invalidated at every step where an artifact changes; cache hit rates approach 1âVâ(di)1-V(d_i)âfor V=0.1V=0.1, only 90% of steps attain a provider cache hit. Under coherent synchronization, the prompt prefix contains only artifact references (not content); prefix stability is high regardless of artifact volatility; provider cache hit rates approach 100% for the structural portion of the prompt. At typical prompt caching discount rates (50â90% cost reduction on cache hits [2]), this amplification effect can double effective savings beyond raw token synchronization reduction. 8.5 Agent-Count Scaling Table 3: token cost for Scenario B (V=0.10V=0.10) across varying agent counts. Table 3: Scaling behavior â token cost vs. agent count, Scenario B (V=0.10V=0.10, S=40S=40, 10 runs) Agent Count n TbroadcastT_broadcast TcoherentT_coherent (±Ï±Ï) Savings Formula LB 2 989.2989.2 K 44.3±8.244.3± 8.2 K 95.5% 85.0% 4 1,979.61,979.6 K 152.3±28.5152.3± 28.5 K 92.3% 80.0% 8 3,956.73,956.7 K 468.6±39.1468.6± 39.1 K 88.2% 70.0% 16 7,911.07,911.0 K 1,255.2±65.01,255.2± 65.0 K 84.1% 50.0% Graceful degradation. Savings decrease from 95.5% to 84.1% as n grows from 2 to 16. Each additional agent adds one initial fetch and is invalidated once per write, so TcoherentT_coherent grows with nâbut TbroadcastT_broadcast grows proportionally faster (every agent, every artifact, every step), maintaining a high savings ratio. All observed values substantially exceed the formula lower bounds. Above 84% even at n=16n=16; scalability confirmed well beyond the canonical four-agent scenario. 8.6 Artifact-Size Scaling Table 4: token cost for Scenario A (V=0.05V=0.05, n=4n=4, S=40S=40) across varying artifact sizes. Table 4: Artifact-size scaling â Scenario A (V=0.05V=0.05, n=4n=4, S=40S=40, Wâ2Wâ 2, 10 runs) |di||d_i| (tokens) TbroadcastT_broadcast TcoherentT_coherent (lazy) Savings Absolute savings 4,096 1,979.61,979.6 K 98.198.1 K 95.0% 1,881.51,881.5 K tokens 8,192 2,636.22,636.2 K 132.9132.9 K 95.0% 2,503.32,503.3 K tokens 32,768 6,575.76,575.7 K 341.8341.8 K 94.8% 6,234.06,234.0 K tokens 65,536 11,828.411,828.4 K 620.3620.3 K 94.8% 11,208.111,208.1 K tokens Savings ratio: invariant to artifact size. Determined entirely by workflow shape, not artifact magnitude. Confirmed by simulation: 94.8â95.0% across a 16Ă size range. For a 65,536-token artifact, lazy coherence saves approximately 11.2 million tokens per workflow run. 8.7 Step-Count Scaling Table 5 instantiates the Token Coherence Theoremâs central structural claim: multiplicative-to-additive cost transformation. With fixed write count (Wâ2Wâ 2, Scenario A volatility), TbroadcastT_broadcast grows as Oâ(S)O(S); TcoherentT_coherent grows slowly. Table 5: Step-count scaling â fixed Wâ2Wâ 2 writes, n=4n=4 agents, m=3m=3 artifacts, |di|=4,096|d_i|=4,096 tokens, 10 runs S (steps) TbroadcastT_broadcast TcoherentT_coherent (sim) Savings (sim) Formula LB 5 259.3259.3 K 36.936.9 K 85.8% 0% (bound<0) 10 505.0505.0 K 49.249.2 K 90.3% 40.0% 20 996.6996.6 K 68.968.9 K 93.1% 70.0% 40 1,979.61,979.6 K 98.198.1 K 95.0% 85.0% 50 2,471.12,471.1 K 111.2111.2 K 95.5% 88.0% 100 4,928.74,928.7 K 188.4188.4 K 96.2% 94.0% TbroadcastT_broadcast scales linearly with S. TcoherentT_coherent grows from 36.9K to 188.4K as S increases 20Ăâthe operational signature of eliminating the S multiplier. Savings are positive even at S=5S=5 (85.8%), where the formula lower bound is zeroâconfirming that lazy deferred-fetch operates well beyond the analytical boundâs conservative assumptions. Long-horizon workflows (Sâ„40Sâ„ 40) attain above 95%. 8.8 Pointer Semantics Compatibility CCS targets the conditional artifact access model (§3). When agents employ pointer semanticsâholding a reference token rather than artifact content, fetching on demandâthe choice of synchronization strategy critically affects performance. Under pointer semantics with lazy invalidation, each cache miss mandates a full artifact fetch. Lazyâs low cache-hit rate in cold or high-invalidation scenarios: many agent steps trigger full fetches, producing synchronization costs exceeding the eager baseline by an order of magnitude. Strategy sync_tokens Cache Hit Rate Eager 16,798 97.7% Lazy 341,036 41.0% Eager maintains near-perfect cache occupancy by pre-populating agent caches on every write. Lazyâs value propositionâavoid retransmission when state is validâcollapses when cold-start fetch frequency is high. Each stale-check miss becomes a full artifact fetch: 20Ă more synchronization tokens than eager. Practitioner rule: pointer-semantics deployments should prefer eager or access-count. Lazy is optimal for bulk injection workflows where artifact content is embedded in prompt context, not for pointer-reference architectures with frequent cold fetches. Table 2âs savings comparison excludes the pointer model for this reason. The pointer+lazy failure mode is a strategy-selection mismatch, not a protocol defect. 9 Related Work 9.1 Multi-Agent Coordination Frameworks LangGraph [21], CrewAI [5], AutoGen [24], Semantic Kernel [15]âeach provides orchestration for multi-agent LLM workflows (scheduling, message passing, state routing) but none provides a formal artifact coherence protocol. State passing is stateless by default: full shared state serialized and injected into each prompt, instantiating the broadcast baseline evaluated here. Agent-Coherence layers coherence atop existing frameworks without modifying internalsâcomplementary, not competitive. 9.2 Conflict-Free Replicated Data Types CRDTs [20] address concurrent state mutation via merge-compatible data structures. Distinct problem from coherence: concurrent mutation resolution (what should the merged value be?) versus synchronization frequency optimization (when is retransmission necessary at all?). Orthogonal: an artifact whose content is a CRDT still benefits from coherence-controlled deliveryâthe CRDT state is transmitted only when it has changed. 9.3 Operational Transformation and Version Vectors OT [6] and vector clock versioning [10; 13] target consistency in collaborative editing. OT: per-operation transforms allowing any linear order to produce identical results. Vector clocks: causal ordering across distributed processes. Both target correctness under concurrent writes. CCS employs vector clocks for version ordering (§7.3) but targets the token efficiency problem that neither OT nor vector clocks address. 9.4 Retrieval-Augmented Generation RAG [12; 7] retrieves document fragments from vector stores to supplement agent context. Complementary subproblems: RAG determines what to retrieve; coherence determines when retrieval is unnecessary because the local cache is still valid. A coherence-aware RAG integration gates retrieval calls on MESI cache validity, attenuating redundant re-embedding of stable documents. 9.5 Long-Context and Context Compression Long-context models [2; 8] expand context windows; compression techniques [9; 25] prune to fit. Neither addresses the core synchronization problem. Expanded windows do not reduce retransmission cost to multiple agents; compression sacrifices fidelity. Coherence attenuates unnecessary retransmission before artifacts reach the context windowâcomplementary to both. 9.6 Software Cache Coherence Concord [3]: software-level cache coherence for serverless function execution, tracking shared memory state across invocations. Zhang et al. [27]: coherence for microservice state synchronization. This paper extends coherence to LLM artifact synchronization, where âcache fillâ is prompt injection and âcoherence observerâ is the agent runtime. 9.7 Agent Authorization Coherence In a companion paper [16], I apply the same MESI structural mapping to authorization, demonstrating that credential revocation latency in multi-agent delegation chains maps onto cache coherence under bounded-staleness semantics, and that operation-count credentials are equivalent to access-count coherence strategies. Distinct problemsâtoken efficiency here, security guarantees thereâsame formal apparatus. 9.8 Multi-Agent Failure Taxonomy Building on [4], the MAST taxonomy across 1,642 annotated traces: inter-agent misalignmentâLoss of Conversation History (FM-1.4), Information Withholding (FM-2.4)âconstitutes 32.3% of failures. Standardized communication protocols (MCP, A2A) do not eliminate these failures, which arise from context-state divergence, not message-format incompatibility. The missing layer is not message-format standardization but artifact state coherence at the data layerâbelow the communication protocol. 10 Limitations and Future Work Centralized authority service. CCS assumes a single authorityâa bottleneck for very large deployments. Distributed coherence directories, analogous to directory-based coherence in NUMA systems [11], represent a natural extension: partitioning the artifact namespace across coordinators with cross-shard invalidation. Single-artifact write model. CCS v0.1: each write atomic and independent. Multi-artifact transactionsâconsistent snapshots across several artifactsâdemand memory barriers or transactional memory analogs. Simulation-based evaluation. The evaluation employs discrete-event simulation, not production LLM workloads. Token accounting is faithful; inference latency, scheduling delays, end-to-end wall-clock coherence overhead are not captured. Production evaluation with real LangGraph or CrewAI deployments: planned for v0.2. I consider this the single most significant limitationâthe gap between simulated access patterns (uniform, p=0.75p=0.75) and production access patterns (likely non-uniform, workload-dependent) is, I suspect, non-trivial, and the savings figures should be read with this caveat in mind until empirical grounding from instrumented traces is available. Adapter stability. LangGraph, CrewAI, AutoGen release frequently. Adapters target specific versions (LangGraph 0.2.x, CrewAI 0.4.x, AutoGen 0.4.x); upstream API changes may break them. Always-read partial applicability. The conditional access argument (§3) applies to artifact-externalizing systems. Direct context injection (simple single-file RAG pipelines) remains under the always-read model; coherence provides no benefit there. Liveness not formally verified. Safety invariants and deadlock-freedom: verified. Liveness (state I â state S eventually): holds under weak fairness on Fetch, unverified under adversarial scheduling. Agent crash during M-state write. Orphaned exclusive lock persists until Ï expires (§5.2). Write ownership blocked for other agents during that window. Protocol coordination overhead. Token savings in §8 exclude CCSâs own traffic: invalidation fan-out (Oâ(n)O(n) per write), event bus round-trip latency, authority round-trip per read miss. At low V: negligible. At high V: non-trivial. I have not quantified the crossover pointâan omission that could be remedied with production instrumentation data. Empirical access rate grounding. The simulationâs action_probability = 0.75 and write probability V per action, with uniform artifact selection, are architectural judgment, not measured parameters. Tighter parameterization requires instrumented deployments. Artifact granularity. Artifacts are atomic: every miss transmits full |di||d_i| tokens (A1). Sub-artifact invalidationâtransmitting only modified sectionsâcould substantially attenuate per-fetch cost for large structured documents. 11 Conclusion The cost explosion does not inhere in multi-agent coordination. It is an architectural residueârepeated full-artifact broadcast adopted for simplicity. I have demonstrated the structural equivalence to cache coherence in shared-memory multiprocessors and the direct transferability of MESI. The Token Coherence Theorem: when S>n+Wâ(di)S>n+W(d_i), lazy invalidation attenuates cost by at least S/(n+Wâ(di))S/(n+W(d_i)). Oâ(nĂSĂ|D|)O(nĂ SĂ|D|) converts to Oâ((n+W)Ă|D|)O((n+W)Ă|D|). Simulation: 84â95% savings across four canonical workloads. The predicted collapse at Vâ0.9Vâ 0.9 does not occur; ~81% savings persist at V=1.0V=1.0. TLA+-verified protocol: single-writer, monotonic versioning, bounded-staleness across all reachable states. Explicit counterexample: invalidation is a correctness requirement. Implementation: thin adapter layers over existing frameworks. The hardware architects solved this forty years ago under isomorphic pressure. The adaptation is long overdue. 11.1 Reproducibility All source code, simulation scripts, TLA+ specifications, and benchmark configurations are publicly available. Repository: https://github.com/hipvlady/agent-coherence Package: pip install agent-coherence To reproduce §8 results with matching seeds: ⏠git clone https://github.com/hipvlady/agent-coherence cd agent-coherence pip install -e . make reproduce # Runs all scenarios with committed seeds; verifies +/-0.5% vs baseline Expected output: within ±2% of archived results on all reported metrics. Comparison is relative (coherent vs. broadcast), not absolute, minimizing platform-specific floating-point sensitivity. REPRODUCE.md documents Python version requirements (3.11+) and expected runtime (< 15 minutes on standard hardware). 11.2 References [1] Anthropic. (2024). Model Context Protocol: An Open Standard for Connecting AI Systems to Data Sources. https://modelcontextprotocol.io/ [2] Anthropic. (2024). Prompt Caching. Anthropic API Documentation. https://docs.anthropic.com/prompt-caching [3] Balkind, J., et al. (2025). Concord: Software Cache Coherence for Serverless Function Execution. Proceedings of the 52nd International Symposium on Computer Architecture (ISCA). [4] Cemri, M., Pan, M. Z., Yang, S., Agrawal, L. A., Chopra, B., Tiwari, R., Keutzer, K., Parameswaran, A., Klein, D., Ramchandran, K., Zaharia, M., Gonzalez, J. E., & Stoica, I. (2025). Why Do Multi-Agent LLM Systems Fail? arXiv preprint arXiv:2503.13657. [5] CrewAI Inc. (2024). CrewAI: Framework for Orchestrating Role-Playing Autonomous AI Agents. https://crewai.com/ [6] Ellis, C. A., & Gibbs, S. J. (1989). Concurrency Control in Groupware Systems. Proceedings of the ACM SIGMOD International Conference on Management of Data, 399â407. [7] Gao, Y., et al. (2023). Retrieval-Augmented Generation for Large Language Models: A Survey. arXiv preprint arXiv:2312.10997. [8] Google. (2024). Gemini 1.5: Unlocking Multimodal Understanding Across Millions of Tokens of Context. Technical Report. [9] Jiang, H., et al. (2023). LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models. Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing (EMNLP). [10] Lamport, L. (1978). Time, Clocks, and the Ordering of Events in a Distributed System. Communications of the ACM, 21(7), 558â565. [11] Lenoski, D., et al. (1992). The Stanford Dash Multiprocessor. IEEE Computer, 25(3), 63â79. [12] Lewis, P., et al. (2020). Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. Advances in Neural Information Processing Systems (NeurIPS) 33, 9459â9474. [13] Mattern, F. (1988). Virtual Time and Global States of Distributed Systems. Proceedings of the Workshop on Parallel and Distributed Algorithms, 215â226. [14] Mei, K., et al. (2024). AIOS: LLM Agent Operating System. arXiv preprint arXiv:2403.16971. [15] Microsoft. (2024). Semantic Kernel: An Open-Source SDK for Integrating AI Models. https://learn.microsoft.com/en-us/semantic-kernel/ [16] Parakhin, V. (2026). The Bureaucracy of Speed: Structural Equivalence Between Memory Consistency Models and Multi-Agent Authorization Revocation. arXiv preprint arXiv:2603.09875. https://arxiv.org/abs/2603.09875 [17] OpenAI. (2024). Prompt Caching. OpenAI API Documentation. https://platform.openai.com/docs/guides/prompt-caching [18] OpenID Foundation. (2025). Identity Management for Agentic AI. https://openid.net/wp-content/uploads/2025/10/Identity-Management-for-Agentic-AI.pdf [19] Papamarcos, M. S., & Patel, J. H. (1984). A Low-Overhead Coherence Solution for Multiprocessors with Private Cache Memories. Proceedings of the 11th Annual International Symposium on Computer Architecture (ISCA), 348â354. [20] Shapiro, M., Preguiça, N., Baquero, C., & Zawirski, M. (2011). Conflict-Free Replicated Data Types. Proceedings of the 13th International Symposium on Stabilization, Safety, and Security of Distributed Systems (S), 386â400. [21] Shen, L., et al. (2023). LangGraph: Building Stateful, Multi-Actor Applications with LLMs. LangChain Documentation. https://langchain-ai.github.io/langgraph/ [22] Sorin, D. J., Hill, M. D., & Wood, D. A. (2020). A Primer on Memory Consistency and Cache Coherence (2nd ed.). Synthesis Lectures on Computer Architecture, Morgan & Claypool. [23] Wei, J., et al. (2022). Chain-of-Thought Prompting Elicits Reasoning in Large Language Models. Advances in Neural Information Processing Systems (NeurIPS). [24] Wu, Q., Bansal, G., Zhang, J., Wu, Y., Zhang, S., Zhu, E., Li, B., Jiang, L., Zhang, X., & Wang, C. (2023). AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation. arXiv preprint arXiv:2308.08155. [25] Xu, M., et al. (2024). LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compression. arXiv preprint arXiv:2403.12968. [26] Yao, S., Zhao, J., Yu, D., Du, N., Shafran, I., Narasimhan, K., & Cao, Y. (2023). ReAct: Synergizing Reasoning and Acting in Language Models. International Conference on Learning Representations (ICLR). [27] Zhang, W., et al. (2024). Coherent Microservices: Extending Cache Coherence to Distributed State Management. Proceedings of the 29th ACM Symposium on Operating Systems Principles (SOSP). [28] Wang, Q., Tang, Z., Jiang, Z., Chen, N., Wang, T., & He, B. (2025). AgentTaxo: Dissecting and Benchmarking Token Distribution of LLM Multi-Agent Systems. Published at ICLR 2025 Workshop on Foundation Models in the Wild.