2026 Open-Source Models Claim 1M Context but Read It Selectively
Vladimir Lushin, who develops AI agents at Sber, broke down on Habr how attention works in 2026 open models. The advertised "1M context" is in practice read selectively: at each step GLM-5.3 takes 2048 tokens from history, DeepSeek-V4-Pro works with 1024 compressed blocks, and in Qwen3.8 and Kimi K3 only every fourth layer sees the full history. For agents, this means a rule from AGENTS.md can quietly stop working by the hundredth tool call. For most models, quality breaks down at 128–256K tokens, and Kimi K3 with compaction at 300K outperforms itself with the full 1M window. • Three families: sparse top-k, "3 linear + 1 full" hybrids, sliding window with global layers (Gemma 4) • What helps: pruning old tool output, query-based retrieval, progressive disclosure, state kept outside the window • Close hard prohibitions with hooks and access permissions
AI-processed from Habr: Сбер; edited by Hamidun News
The spec sheets of the latest open models of 2026 say "1M context." Inside, the picture is different: at each step GLM-5.3 selects 2048 tokens from history, DeepSeek-V4-Pro works with 1024 compressed blocks, and in Qwen3.8 and Kimi K3 only every fourth layer sees the entire history. Vladimir Lushin, who builds AI agents and code tools at Sber, broke down on Habr what this means in practice. His takeaway for anyone building agents: the advertised window size tells you how many tokens fit, not how many of them the model actually takes into account.
Three Selection Schemes Instead of Full Reading
Lushin divides recent open-source models into three families. He read some of the configurations directly from config.json on Hugging Face and took the rest from model cards and technical reports. The conclusions about what exactly a model "reads" are the author's own, drawn from the architecture: the model developers did not claim this.
- Sparse top-k: GLM-5.x, DeepSeek-V4, MiniMax M3. Each step selects only part of the history: for GLM-5.3 it is 2048 tokens, for DeepSeek-V4-Pro 1024 compressed blocks.
- "3 linear layers + 1 full" hybrids: Qwen3.5–3.8, Kimi K3, GLM-5.3-Flash. Full attention over the entire history exists only in every fourth layer.
- Sliding window plus global layers: Gemma 4.
All three schemes share one trait. Only the last few hundred tokens are guaranteed to be read accurately. Everything else must either win the relevance selection or survive in compressed form. For most models, quality breaks down somewhere around 128–256K tokens. Kimi K3 with compaction at 300K outperforms itself with the full 1M window. This matters for inference economics: a short context with good packing gives a better result and carries several times fewer tokens.
Why a Rule From AGENTS.md Disappears by the Hundredth Call
At every generation step, each layer decides anew which past tokens to look at and how heavily to weight them. Suppose that at the start of a session the agent was told not to touch a certain file. After 300 thousand tokens, it is about to run a command that will affect that file. For the prohibition to work, at least some of the layers must reach back to the line at the beginning and give it noticeable weight. Whether they do depends on probability, not on the fact that the text formally sits inside the window.
The author explains this with a poodle. At the start of a training session, the dog handler said "leave it, don't pick anything up from the ground," then ran through dozens of commands, and what remains in the dog's head is mostly the last one, "go play!" When there is a sausage on the ground, the outcome is predictable. The rule from AGENTS.md plays the role of that first command, while the handler's log of "what we've already practiced" corresponds to compaction and the progress file.
The Harness: Where to Put Text and What to Lock With Hooks
The article's main thesis: for the harness, where the text goes matters more than what it says. Five techniques work best:
- pruning old tool output so it does not clog the window;
- query-based retrieval instead of "dump everything in";
- progressive disclosure: the agent gets details as needed;
- state kept outside the window: a progress file, notes, external memory;
- repeating key rules at the end of the context, where attention is guaranteed to be stronger.
A separate category is what must never be violated. Such constraints should not be entrusted to the model's attention: they need to be enforced with hooks and access permissions. If a ban on deletion or writing is implemented as a check before a tool call, it does not matter whether some layer reached back to it at the 300,000th token.
The practical order for a team building an agent on open models is as follows. First, find out the architecture of the specific model from config.json. Then keep the working context within 128–256K tokens rather than chasing a million. Duplicate critical rules at the tail, compress long history, and move hard prohibitions out of the prompt text and into harness code.
- Oct 28, 2026DeepSeek Open-Sources DeepInfer as the US and China Prepare Controls on Open Models
- Oct 28, 2026Qwen 3.8 Routed Requests to an Alibaba Cloud Proxy, With Up to 4% Failures in Tests
- Oct 28, 2026DeepSeek open-sources DeepInfer: 155 trillion tokens a day and an 80% margin
- Oct 27, 2026Qwen3.8 Tried to Upload a File to Alibaba's Cloud in Beijing From Inside Cohere's Sandbox
Key Questions Answered
What are the key details on Three Selection Schemes Instead of Full Reading?
Lushin divides recent open-source models into three families. He read some of the configurations directly from config.json on Hugging Face and took the rest from model cards and technical reports. The conclusions about what exactly a model "reads" are the author's own, drawn from the architecture: the model developers did not claim this. Sparse top-k: GLM-5.x, DeepSeek-V4, MiniMax M3. Each step selects only part of the history: for GLM-5.3 it is 2048 tokens, for DeepSeek-V4-Pro 1024 compressed blocks. "3 linear layers + 1 full" hybrids: Qwen3.5–3.8, Kimi K3, GLM-5.3-Flash.
Why a Rule From AGENTS.md Disappears by the Hundredth Call?
At every generation step, each layer decides anew which past tokens to look at and how heavily to weight them. Suppose that at the start of a session the agent was told not to touch a certain file. After 300 thousand tokens, it is about to run a command that will affect that file. For the prohibition to work, at least some of the layers must reach back to the line at the beginning and give it noticeable weight. Whether they do depends on probability, not on the fact that the text formally sits inside the window. The author explains this with a poodle. At the start of a trai
What are the key details on The Harness: Where to Put Text and What to Lock With Hooks?
The article's main thesis: for the harness, where the text goes matters more than what it says. Five techniques work best: pruning old tool output so it does not clog the window; query-based retrieval instead of "dump everything in"; progressive disclosure: the agent gets details as needed; state kept outside the window: a progress file, notes, external memory; repeating key rules at the end of the context, where attention is guaranteed to be stronger. A separate category is what must never be violated. Such constraints should not be entrusted to the model's attention: they
Build & Ship Production AI Agents Without Boilerplate Code
Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.