The Pensieve Paradigm: Stateful Language Models Mastering Their Own Context
Not on the map. Why?
Abstract (arXiv)
In the world of Harry Potter, when Dumbledore's mind is overburdened, he extracts memories into a Pensieve to be revisited later. In the world of AI, while we possess the Pensieve-mature databases and retrieval systems, our models inexplicably lack the "wand" to operate it. They remain like a Dumbledore without agency, passively accepting a manually engineered context as their entire memory. This work finally places the wand in the model's hand. We introduce StateLM, a new class of foundation models endowed with an internal reasoning loop to manage their own state. We equip our model with a suite of memory tools, such as context pruning, document indexing, and note-taking, and train it to actively manage these tools. By learning to dynamically engineering its own context, our model breaks free from the architectural prison of a fixed window. Experiments across various model sizes demonstrate StateLM's effectiveness across diverse scenarios. On long-document QA tasks, StateLMs consistently outperform standard LLMs across all model scales; on the chat memory task, they achieve absolute accuracy improvements of 10% to 20% over standard LLMs. On the deep research task BrowseComp-Plus, the performance gap becomes even more pronounced: StateLM achieves up to 52% accuracy, whereas standard LLM counterparts struggle around 5%. Ultimately, our approach shifts LLMs from passive predictors to state-aware agents where reasoning becomes a stateful and manageable process.
Key facts. Cited by 8 papers in the map (data through 7 Oct 2026). Builds on 13 of its 17 references that are in the map. First posted on arXiv 12 Feb 2026.
Builds on
13 of 17 references.
References · 13
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
- 2025Qwen3 Technical Reportcited by 8,195
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,270
- 2024LongMemEval: Benchmarking Chat Assistants on Long-Term Interactive Memorycited by 656
- 2017The NarrativeQA Reading Comprehension Challengecited by 590
- 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 584
- 2024LongBench v2: Towards Deeper Understanding and Reasoning on Realistic Long-context Multitaskscited by 367
- 2025MemAgent: Reshaping Long-Context LLM with Multi-Conv RL-based Memory Agentcited by 235
- 2023L-Eval: Instituting Standardized Evaluation for Long Context Language Modelscited by 232
- 2025BrowseComp-Plus: A More Fair and Transparent Evaluation Benchmark of Deep-Research Agentcited by 183
- 2024A Human-Inspired Reading Agent with Gist Memory of Very Long Contextscited by 140
- 2025Scaling Long-Horizon LLM Agent via Context-Foldingcited by 136
1 more
Built on by
Citing papers per year: 2026: 8.
8 papers.
- 2026LongMemEval-V2: Evaluating Long-Term Agent Memory Toward Experienced Colleaguescited by 17
- 2026SAM: State-Adaptive Memory for Long-Horizon Reasoning Agentcited by 10
- 2026LightThinker++: From Reasoning Compression to Memory Managementcited by 4
- 2026Towards Generalization of Block Attention via Automatic Segmentation and Block Distillationcited by 0
- 2026Exploring Cross-Scenario Generality of Agentic Memory Systems: Diagnostics and a Strong Baselinecited by 0
- 2026ThinkReset: Learnable Intermediate Interface Construction for Bounded-Context Long-Horizon Reasoningcited by 0
- 2026ContextPilot: Teaching Agents for Proactive Context Management via Fine-grained RLcited by 0
- 2026Coding Agent Memory Post-training: Unlocking the Memory Potential of Pre-trained File Operations for Long-Horizon Tasks via Reinforcement Learningcited by 0
- 2026Coding Agent Memory Post-training: Unlocking the Memory Potential of Pre-trained File Operations for Long-Horizon Tasks via Reinforcement Learning28 Sep 2026
- 2026ContextPilot: Teaching Agents for Proactive Context Management via Fine-grained RL28 Aug 2026
- 2026Exploring Cross-Scenario Generality of Agentic Memory Systems: Diagnostics and a Strong Baseline3 Jun 2026
- 2026ThinkReset: Learnable Intermediate Interface Construction for Bounded-Context Long-Horizon Reasoning26 May 2026
- 2026SAM: State-Adaptive Memory for Long-Horizon Reasoning Agent23 May 2026
- 2026Towards Generalization of Block Attention via Automatic Segmentation and Block Distillation15 May 2026
- 2026LongMemEval-V2: Evaluating Long-Term Agent Memory Toward Experienced Colleagues12 May 2026
- 2026LightThinker++: From Reasoning Compression to Memory Management4 Apr 2026