Token Coherence: Adapting MESI Cache Protocols to Minimize Synchronization Overhead in Multi-Agent LLM Systems
Organizations: Independent Researcher
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.
Figures & tables
| 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 |
| Hardware State | Artifact State | Semantic Interpretation |
|---|---|---|
| Modified ( ) | Modified ( ) | Agent holds the only valid copy; authority copy is stale; other agents are invalidated |
| Exclusive ( ) | Exclusive ( ) | Agent holds the only copy, identical to authority; write permitted without broadcast |
| Shared ( ) | Shared ( ) | Multiple agents hold valid copies; no agent has written since last commit |
| Invalid ( ) | Invalid ( ) | Agent’s cached copy is stale; full fetch required before next use |
| Scenario | ( ) | ( ) | Savings | CRR | CHR | |
|---|---|---|---|---|---|---|
| A: Planning | 0.05 | 0.050 | ||||
| B: Analysis | 0.10 | 0.077 | ||||
| C: Development | 0.25 | 0.117 | ||||
| D: High Churn | 0.50 | 0.158 |
| Strategy | ( ) | Savings | Notes |
|---|---|---|---|
| Broadcast baseline | — | Full rebroadcast every step | |
| Eager invalidation | Lower fetch overhead; higher invalidation traffic | ||
| Lazy invalidation | Recommended default | ||
| TTL (lease = 10 steps) | Decoupled from write frequency | ||
| Access-count ( ) | Near-equivalent to lazy at this |
| Formula Lower Bound | Observed Savings (10 runs) | |
|---|---|---|
| 0.01 | 89.0% | |
| 0.05 | 85.0% | |
| 0.10 | 80.0% | |
| 0.25 | 65.0% | |
| 0.50 | 40.0% | |
| 0.75 | 15.0% |
| Agent Count | ( ) | Savings | Formula LB | |
|---|---|---|---|---|
| 2 | K | K | 95.5% | 85.0% |
| 4 | K | K | 92.3% | 80.0% |
| 8 | K | K | 88.2% | 70.0% |
| 16 | K | K | 84.1% | 50.0% |
| (tokens) | (lazy) | Savings | Absolute savings | |
|---|---|---|---|---|
| 4,096 | K | K | 95.0% | K tokens |
| 8,192 | K | K | 95.0% | K tokens |
| 32,768 | K | K | 94.8% | K tokens |
| 65,536 | K | K | 94.8% | K tokens |
| (steps) | (sim) | Savings (sim) | Formula LB | |
|---|---|---|---|---|
| 5 | K | K | 85.8% | 0% (bound<0) |
| 10 | K | K | 90.3% | 40.0% |
| 20 | K | K | 93.1% | 70.0% |
| 40 | K | K | 95.0% | 85.0% |
| 50 | K | K | 95.5% | 88.0% |
| 100 | K | K | 96.2% | 94.0% |
| Strategy | sync_tokens | Cache Hit Rate |
|---|---|---|
| Eager | 16,798 | 97.7% |
| Lazy | 341,036 | 41.0% |
Multi-Agent LLM Systems
Multi-agent large language model systems coordinate multiple AI agents to solve tasks through communication, specialization, shared tools, and memory.
See all 1,039 papers