mlsanityData to 14 Oct 2026

The Missing Memory Hierarchy: Demand Paging for LLM Context Windows

arXiv 2603.09023 ↗First posted 9 Mar 2026cs.OS cs.AI cs.SEcited by 8

Not on the map. Why?

Abstract (arXiv)

The context window of a large language model is not memory. It is L1 cache: a small, fast, expensive resource that the field treats as the entire memory system. There is no L2, no virtual memory, no paging. Every tool definition, every system prompt, and every stale tool result occupies context for the lifetime of the session. The result is measurable: across 857 production sessions and 4.45 million effective input tokens, 21.8% is structural waste. We present Pichay, a demand paging system for LLM context windows. Implemented as a transparent proxy between client and inference API, Pichay interposes on the message stream to evict stale content, detect page faults when the model re-requests evicted material, and pin working-set pages identified by fault history. In offline replay across 1.4 million simulated evictions, the fault rate is 0.0254%. In live production deployment over 681turns, the system reduces context consumption by up to 93% (5,038KB to 339KB); under extreme sustained pressure, the system remains operational but exhibits the expected thrashing pathology, with repeated fault-in of evicted content. The key observation is that the problems the field faces, such as context limits, attention degradation, cost scaling, lost state across sessions, are virtual memory problems wearing different clothes. The solutions exist: working set theory (Denning, 1968), demand paging, fault-driven replacement policies, and memory hierarchies with multiple eviction-managed levels. We describe the architecture of a full memory hierarchy for LLM systems (L1 through persistent storage), report on the first three levels deployed in production use (L1 eviction, L2 fault-driven pinning, L3 model-initiated conversation compaction), and identify cross-session memory as the remaining frontier.

Key facts. Cited by 8 papers in the map (data through 14 Oct 2026). Builds on 6 of its 20 references that are in the map. First posted on arXiv 9 Mar 2026.

Builds on

6 of 20 references.

References · 6

  1. 2023MemGPT: Towards LLMs as Operating Systemscited by 1,389
  2. 2023LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compressioncited by 453
  3. 2025ACON: Optimizing Context Compression for Long-horizon LLM Agentscited by 136
  4. 2026SWE-Pruner: Self-Adaptive Context Pruning for Coding Agentscited by 44
  5. 2026Active Context Compression: Autonomous Memory Management in LLM Agentscited by 16
  6. 2026SideQuest: Model-Driven KV Cache Management for Long-Horizon Agentic Reasoningcited by 11

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 8.

8 papers.