MoE-Context: Letting Models Read Only the Context They Need

MoE-Context dynamically selects chunked context, greatly improving accuracy, but the model's own selection ability remains a bottleneck.
MoE-Context mimics human memory by chunking AI Agent context and using a quick yes/no judgment at each step to decide which chunks to show, compressing the rest into one-line summaries without deletion. On Qwen3-1.7B and a synthetic lookup task, showing only needed chunks raised accuracy from 93/120 to 119/120, with masked chunks equivalent to deleted ones. However, the model's own chunk-selection accuracy is only 80/120; a supervised linear probe can raise it to 110/120 but cannot transfer to a second task, while simple keyword search performs perfectly. The mechanism also supports undoing failed attempts and running sub-agents without new context. Future work needs to combine simple methods with learned selectors to improve generalization.
AI Agents read the entire history at every step, which is both inefficient and unlike how humans work. We remember the information we currently need, keep the rest as rough notes, and recall it when necessary. MoE-Context brings this idea to language models: it chunks the context, uses a quick yes/no judgment before each step to decide which chunks are needed, and keeps the remaining chunks as one-line summaries without deleting them. On Qwen3-1.7B and a synthetic lookup task, showing only the needed chunks raised accuracy from 93/120 to 119/120, and masked chunks performed the same as deleted chunks. The model's own selection ability is the weak link; a supervised linear probe can raise its accuracy from 80/120 to 110/120, but keyword search performs perfectly on this task, and the probe cannot transfer to a second task. This article also reports two cheap usage patterns: undoing failed attempts and running sub-agents without new context.

Why MoE-Context Is Needed
Traditional AI Agents read the full conversation history at every step, which brings two major problems: first, computational cost grows linearly with history; second, irrelevant information may interfere with model decisions. Humans do not work this way—we focus only on currently relevant memories and keep the rest as vague impressions. MoE-Context mimics this mechanism by splitting context into chunks and using a dynamic selection mechanism to show the model only the chunks necessary for the current step.
Core Mechanism: Chunking and Dynamic Selection
MoE-Context divides context into multiple chunks. Before each step, a quick yes/no judgment module evaluates whether each chunk is relevant to the current step. Relevant chunks are shown in full, while the rest are compressed into one-line summaries (called "notes") and are not deleted. These notes can be recalled in later steps, ensuring no information is lost. In implementation, all chunks share a single key-value cache, and hidden chunks are handled by masking rather than removal, which guarantees that masked chunks and deleted chunks are equivalent in effect.
KV Cache is a key optimization in Transformer inference: during autoregressive generation, the model must recompute attention over all previous tokens for each new token, with cost growing quadratically with sequence length. KV Cache stores the already-computed key and value matrices and reuses them in subsequent steps, reducing per-step computation to a single query against the current token. MoE-Context lets all chunks share the same KV Cache; hidden chunks are not removed from the cache but instead have their key/value participation masked out during attention computation. The benefit is that chunks can be "recalled" in later steps without re-encoding, and undo operations merely flip mask bits at extremely low cost.
Attention Mask was originally used for variable-length sequences and causal constraints, but here it is extended into a context selection mechanism: tokens at masked positions are invisible to the current query, equivalent to not existing. Therefore, masked chunks and physically deleted chunks are mathematically equivalent in effect, but masking preserves the ability to restore them at any time.
Experimental Results: Significant Accuracy Improvement
Tested on a laptop with the Qwen3-1.7B model and a synthetic lookup task, showing only the needed chunks raised task accuracy from 93/120 to 119/120. This validates the effectiveness of "showing only necessary information." The conclusion that masked chunks and deleted chunks have the same effect was also confirmed, showing that the masking mechanism does not introduce extra information leakage or interference.
Bottleneck: The Model's Own Selection Ability
The model's selection ability becomes the system's weak link. On the same task, the model's own judgment accuracy was only 80/120. Researchers tried a supervised linear probe (written into idle output rows) to improve it, raising accuracy to 110/120. But the probe could not transfer to a second task, indicating limited generalization ability. In addition, simple keyword search performed perfectly on this task (120/120), suggesting that for some tasks, traditional methods may be more effective.
Linear Probe is a lightweight evaluation method commonly used in representation learning: freeze the internal representations of the backbone model and train only a linear classifier on the activations of a certain layer to perform a downstream task. It can test whether the required information is already linearly encoded in that layer's representation. In this article, the probe is used to predict whether each context chunk is relevant to the current step—if probe accuracy is high, it means the model internally "knows" which chunks are useful but does not explicitly use this during generation. Writing the probe output into idle output rows is equivalent to externalizing this implicit knowledge into an executable judgment. The probe's inability to transfer to a second task shows that "relevance" in different tasks does not share the same linear direction in representation space, which is a microcosm of the difficulty of generalizing learned selectors.
Practical Patterns: Undo and Sub-agents
The chunk-switching mechanism also enables two cheap usage patterns: first, undoing failed attempts by simply re-hiding the relevant chunks to roll back state; second, running sub-agents without creating new context by directly reusing existing chunks. These patterns lower the implementation cost of complex workflows.
Limitations and Future Directions
MoE-Context demonstrates the promise of dynamic context selection, but the model's insufficient selection ability and the probe's non-transferability remain challenges. Future work may need to combine simple methods such as keyword search with learned selectors, or explore more general selection strategies.

Related articles

VP ≠ VNP: A Major Breakthrough in Computational Complexity Theory
A study claiming to prove VP ≠ VNP over every field sparks heated discussion on Hacker News. This article analyzes the algebraic complexity background of VP and VNP, the proof approach, community controversy, and its potential impact on computational complexity theory.

Developer Naming Woes: The Technical Names That Drive Us Crazy
Why is technical naming so maddening? From Nginx and Vite to Qt and Sudo, a YouTube creator rants about the chaos of developer naming and pronunciation, revealing the tug-of-war between creators' intentions and community habits, and the cultural roots behind spelling traps like PyPI and GNOME.

Figma Workplace Scandal: Employee Sues CEO for Forcing Confrontation with Harasser
Figma and its CEO are sued by a current employee alleging sexual harassment and discrimination, and forcing the victim to confront her harasser. This article outlines the background, potential impact, and industry reflection.