Sculptor: Empowering LLMs with Cognitive Agency via Active Context Management

Mo Li, L.h. Xu, Qitai Tan, Long Ma, Flood Sung, Ting Cao, Yunxin Liu

TL;DR

Current Large Language Models (LLMs) struggle with long contexts because earlier, irrelevant information often drowns out what’s actually important—a phenomenon known as proactive interference. Sculptor solves this by giving LLMs a toolkit to actively manage their own working memory, allowing them to fragment, hide, and search their conversation history to focus attention only on what matters.

The Problem: Proactive Interference

Simply expanding context windows hasn't solved the "long-context" problem. LLMs frequently suffer from proactive interference, where outdated or irrelevant information from the beginning of a prompt disrupts the model's ability to reason or recall facts later on. This is akin to a human being distracted by old notes while trying to solve a new problem.

Existing solutions, such as Retrieval-Augmented Generation (RAG) or external memory systems, often rely on "lossy" or irreversible filtering. Once information is filtered out, the model cannot retrieve it if it becomes relevant later. The authors argue that LLMs need Cognitive Agency: the ability to actively "sculpt" their internal working memory by deciding what to keep, what to summarize, and what to temporarily hide.

The Solution: Active Context Management (ACM)

To address this, the authors introduce a framework called Active Context Management (ACM), implemented through the Sculptor tool suite.

The Sculptor framework enables LLMs to actively manage their context through fragmentation, summarization, and precise search.

This suite provides deterministic tools that allow the model to manipulate its own context:

  1. Context Fragmentation: Breaking long histories into manageable pieces with unique IDs.
  2. Summarize, Hide, and Restore: Models can generate summaries of fragments, "fold" (hide) irrelevant sections to reduce clutter, and crucially, "restore" folded content if it's needed again.
  3. Precise Search: A "Ctrl+F" style tool for exact keyword matching and a detail-retrieval tool to pull surrounding context.

Training the Model: A Novel RL Approach

While frontier models like Claude-4-Sonnet can use these tools "out of the box" with strong prompting, smaller or specialized models require specific training. The researchers developed a specialized Reinforcement Learning (RL) approach adapting Group Sequence Policy Optimization (GSPO) with two novel components:

  • Conditional Trajectory Collection: Because calling a tool (like fold) fundamentally changes the context, new training instances are created at every modification point.
  • Incremental Loss Assignment: This ensures the model only learns from new completions after a context change, preventing "training collapse" where the model might otherwise learn to repeatedly trigger tools without making actual progress.

Key Insights and Results

The models were trained and evaluated on challenging long-context benchmarks, including PI-LLM, NeedleBench, MRCR, LongBenchV2, and FRAMES.

  • Reversibility is the Key: Unlike traditional compression, Sculptor’s fold and restore operations are non-destructive. This allows the model to "clean its desk" without throwing away its notes, perfectly balancing focus and information access.
  • Folding Improves Physical Attention: A "Value-Specific Attention Analysis" revealed that explicitly hiding irrelevant text doesn't just save tokens; it forces the model’s internal attention mechanism to focus more intensely (yielding a ~10% improvement) on the remaining critical tokens.
Sculptor maintains high accuracy across massive context lengths, preventing the steep degradation seen in baseline models.
  • Massive Accuracy Gains: On the PI-LLM benchmark, the RL-trained Sculptor-M3 model jumped from a 22.5% baseline to 99.4% accuracy. As shown above, applying Sculptor to Claude-4-Sonnet also prevents severe performance drops at 128k context lengths.
  • Efficiency at Scale: Sculptor achieved dramatic context reductions: 89% fewer tokens on PI-LLM and 76% fewer on NeedleBench. Because LLM attention cost grows quadratically with length, this represents massive computational savings.
  • Outperforming Baselines: Sculptor consistently beat other memory-management methods like Mem0 and MemAgent, largely because it maintains the ability to "undo" its memory management decisions.

Limitations and Future Work

While Sculptor excels at tasks involving "noise" and interference, its performance on extremely complex, multi-hop reasoning tasks like LongBenchV2 remains modest. The current system is also primarily optimized for long-context scenarios.

Future work aims to apply Active Context Management to other domains, such as mathematical reasoning and coding. In these areas, "folding" early errors could help the model reset its reasoning trajectory and avoid the "prefix lock-in" that often leads to cascading mistakes.

Summary updated

Abstract

Large Language Models (LLMs) suffer from significant performance degradation when processing long contexts due to proactive interference, where irrelevant information in earlier parts of the context disrupts reasoning and memory recall. While most research focuses on external memory systems to augment LLMs' capabilities, we propose a complementary approach: empowering LLMs with Active Context Management (ACM) tools to actively sculpt their internal working memory. We introduce Sculptor, a framework that equips LLMs with three categories of tools: (1) context fragmentation, (2) summary, hide, and restore, and (3) precise search. Our approach enables LLMs to proactively manage their attention and working memory, analogous to how humans selectively focus on relevant information while filtering out distractions. Experimental evaluation on diverse long-context benchmarks demonstrates that Sculptor significantly improves performance even without specific training, leveraging LLMs' inherent tool-calling and instruction-following capabilities. To further optimize these strategies, we introduce a novel dynamic context-aware reinforcement learning (RL) approach, advancing the training of an agent that actively modifies its own conversational history. By enabling Active Context Management, Sculptor not only mitigates proactive interference but also provides a cognitive foundation for more reliable reasoning across diverse long-context tasks—highlighting that explicit context-control strategies, rather than merely larger token windows, are key to robustness at scale.
BibTeX
@inproceedings{li2026sculptor,
  author = {Mo Li and L.H. Xu and Qitai Tan and Long Ma and Flood Sung and Ting Cao and Yunxin Liu},
  title = {{Sculptor: Empowering LLMs with Cognitive Agency via Active Context Management}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=HPeiH7da0Z},
}
Figure