DeepSeek-V4 brings agentic AI to 1M tokens
DeepSeek has introduced V4, a family of open models with a context window of up to 1 million tokens and an architecture designed for long-running agents. It reduces computing and memory costs, preserves reasoning across tool calls, and achieves results close to closed models on several programming and agent-use benchmarks.

DeepSeek has introduced DeepSeek-V4, a family of open models designed to keep AI agents working for long periods without running out of memory, losing track of the task, or making every step more expensive. Its context window reaches 1 million tokens, but the main change is that it can process them with far less consumption than the previous generation.
A token is a unit of text, such as a short word or part of a word. A 1 million token window lets you bring hundreds of terminal commands, tool outputs, code files, or web pages into a single session. That is useful for tasks such as repairing a software project, researching for hours, or running a workflow with many intermediate decisions.
The challenge is not just remembering, but doing it cheaply
Giving a model a huge context window does not guarantee that it can use it well. Every time the agent generates a response, it has to review what happened before. As the history grows, it needs more memory and computing power.
DeepSeek says that, with 1 million tokens, DeepSeek-V4-Pro uses 27% of the FLOPs required by DeepSeek-V3.2 for single-token inference. FLOPs are a way to measure computational work. The V4-Flash variant brings that figure down to 10%.
The memory savings also matter. V4-Pro uses around 10% of the KV memory used by V3.2, a temporary memory that stores context information so it does not have to be recalculated continuously. V4-Flash brings that down to 7%. Compared with a standard architecture using grouped attention, DeepSeek puts its consumption at approximately 2%.
Two forms of attention for long contexts
The model combines two attention mechanisms, meaning two ways of deciding which parts of the history it should consult:
- Compressed Sparse Attention (CSA): compresses every group of four tokens into one input and selects only the blocks most relevant to each query.
- Heavily Compressed Attention (HCA): compresses the context by up to 128 times and directly reviews that much smaller version.
The layers alternate between CSA and HCA. Both also preserve a window containing the most recent tokens, because in a conversation or terminal session, the latest information is usually especially important.
The architecture also uses smaller numerical formats, such as FP8 and FP4, to reduce the memory space required. The goal is to make a 1 million token context something that can be deployed on real hardware, not just a laboratory figure.
An agent that does not forget its reasoning
DeepSeek has also changed the model's behavior after training. In a tool-use task, V4 preserves its reasoning history even when the user sends a new message. So if the agent has already run commands, checked files, and tried several solutions, it does not have to reconstruct everything from scratch after an interruption.
In normal conversations without tools, the reasoning is discarded at the start of each turn to keep the context shorter. The difference comes down to the type of work: a brief chat does not need to accumulate every internal step, but a programming task lasting several hours does.
The model also moves away from tool calls based exclusively on JSON inside text strings and uses its own XML format, associated with the special token |DSML|. Text and structured parameters are handled differently, which reduces common errors involving numbers, Boolean values, and nested content.
Strong results on agent tasks
The published results show that the focus is on agents, not on leading every general knowledge and reasoning benchmark. V4-Pro-Max scores:
- 67.9 points on Terminal Bench 2.0, above
GLM-5.1andK2.6, though belowGPT-5.4-xHigh. - 80.6% on SWE Verified, practically level with
Opus-4.6-MaxandGemini-3.1-Pro. - 73.6 on MCPAtlas Public, one tenth of a point behind
Opus-4.6-Max. - 51.8 on Toolathlon, ahead of
K2.6,GLM-5.1, andGemini-3.1-Pro.
In an internal evaluation with 30 programming tasks in PyTorch, CUDA, Rust, and C++, it achieved a 67% success rate. In a survey of 85 DeepSeek developers, 52% said the model was ready to replace their primary programming model, while another 39% said they were inclined to do so.
The ability to retrieve information from great depths has limits. In the MRCR test, which requires locating eight items, accuracy stays above 0.82 up to 256,000 tokens, but drops to 0.59 at 1 million. Having room for more information does not mean you can always find it with the same level of reliability.
Four open models on Hugging Face
DeepSeek has published four checkpoints, which are versions ready to download and use:
DeepSeek-V4-Pro, with 1.6 trillion total parameters and 49 billion active per query.DeepSeek-V4-Flash, with 284 billion total parameters and 13 billion active.- The base versions of both models, intended for uses other than direct instruction following.
The instruct models offer three modes: Non-think, for fast responses; Think High, with explicit reasoning; and Think Max, which uses maximum effort and requires a window of at least 384,000 tokens.
For you, the most important change is that agents can work with much longer histories without making every step so expensive. That makes programming assistants, terminal automation, and systems capable of chaining many tools more practical. The open question is whether developers will adapt their tools to the |DSML| format, and whether these improvements hold up outside environments controlled by DeepSeek.