When DeepSeek released the V4 preview on April 24, 2026, the number everyone repeated was "one million tokens." But context capacity was never the hard problem. The hard problem was economics.
A standard Transformer reading a million-token codebase does something quietly devastating. When it processes the millionth token, it must re-evaluate that token's relationship to all 999,999 that came before it. This is O(N²) complexity — double the context, quadruple the work, sixteen-times the cost. Models with million-token windows have existed. Nobody uses them at scale because the compute bill is astronomical.
V4's answer is a hybrid attention architecture — what the technical report names CSA (Compressed Sparse Attention) and HCA (Heavily Compressed Attention) — alternating between two complementary mechanisms across its layers. The model stops being a speed-reader that re-reads the entire library for every sentence. It becomes a skilled research librarian: indexing first, reading selectively second.
CSA works in three deliberate steps. First, token-wise compression: every four tokens are condensed into one dense summary — a 4× reduction that preserves boundary information between logical segments. Second, a Sparse Indexer scans only the compressed summaries, estimates relevance, and selects the top 1024 most relevant chunks for full attention. The full token sequence is never re-read. Third, a 128-token sliding window of uncompressed context provides immediate local awareness.
Interspersed between CSA layers, HCA takes compression to the extreme — collapsing 128 tokens into a single keyword representation — then runs cheap dense attention over the result. This provides a low-resolution but global bird's-eye view of the entire document that complements CSA's detailed, selective reading.
The official preview launches with two MoE variants, both supporting the full 1M context window with dual Thinking/Non-Thinking modes:
| V4-Pro | 1.6T total / 49B active params · rivals top closed-source models · open-source SOTA in Agentic Coding |
| V4-Flash | 284B total / 13B active params · reasoning "closely approaches V4-Pro" · "on par with V4-Pro on simple Agent tasks" |
Both are accessible through the same API base URL — just swap the model name. The legacy deepseek-chat and deepseek-reasoner identifiers route to V4-Flash under the hood and will be retired after July 24, 2026.
1. 1M context becomes the default, not the premium tier. Previously, a code review agent had to chunk a codebase into fragments to fit in context — destroying cross-file relationships. With V4, you ingest entire repositories in one pass. The prompt shifts from "review these three files" to "review this change in the context of our entire 10,000-file monorepo."
2. The design pattern inverts. For two years, best practice for AI app developers was context-frugal: trim, summarize, fit. V4 rewards the opposite. Feed your debugging agent the stack trace, system specifications, recent log streams, and related documentation simultaneously. The million tokens are a tool, not a constraint.
3. Drop-in API compatibility. Same base_url, just change the model name to deepseek-v4-pro or deepseek-v4-flash. Both OpenAI ChatCompletions and Anthropic Messages API formats are supported.
DeepSeek describes V4-Pro as "open-source SOTA in Agentic Coding benchmarks" — leading all current open models while rivaling top closed-source alternatives. The benchmarks reveal a clear pattern: a world-class competitive programmer that ties the frontier on standard code repair, with a measurable gap in long-horizon agentic work.
| Benchmark | What It Measures | V4-Pro | Claude Opus 4.6 | GPT-5.4 |
|---|---|---|---|---|
| MRCR 1M | Long-form memory recall | 83.5 | 92.9 | — |
| CorpusQA 1M | Multi-hop reasoning on massive docs | 62.0 | 71.7 | — |
| SWE-bench Verified | Real GitHub issue resolution | 80.6 | 80.8 | — |
| SWE-bench Pro | Long-horizon multi-step fixes | 55.4 | 57.3 | 57.7 |
| LiveCodeBench | Competitive programming | 93.5 | 88.8 | — |
| Codeforces | Algorithmic rating | 3206 | — | 3168 |
| Terminal-Bench 2.0 | Complex CLI agent tasks | 67.9 | 65.4 | 75.1 |
Three things stand out. First, SWE-bench Verified is effectively tied across the frontier — V4-Pro (80.6), Opus 4.6 (80.8), Gemini 3.1 Pro (80.6), and K2.6 (80.2) are all within measurement noise. Second, V4-Pro leads on competitive programming — LiveCodeBench 93.5 and Codeforces 3206 are the strongest open-source scores on record. Third, the gap opens on long-horizon tasks: SWE-bench Pro has Opus 4.6 (57.3) and GPT-5.4 (57.7) ahead of V4-Pro (55.4), and Terminal-Bench 2.0 shows GPT-5.4 (75.1) with a clear lead.
Benchmarks measure accuracy. But for anyone running a coding agent at scale, the binding constraint is cost per productive session.
Most chatty code assistants fail on long tasks not because of accuracy but because the task history is the context. A complex debugging session generates hundreds of tool calls and results. With standard attention, cost grows quadratically — Uber CTO Praveen Neppalli Naga told The Information that the company's entire 2026 AI budget was exhausted in the first few months, driven by surging Claude Code usage. (Uber now sees ~1,800 AI-generated code changes per week, and ~11% of backend code is AI-written — up from under 1% three months prior.) V4's hybrid attention bends this curve toward near-linear.
The 1M-token workspace means users can point V4 at entire directories. Cross-file refactoring and architectural analysis become reliable operations rather than fragile experiments that hit "context full" mid-task.
Open-source coding agents now have a frontier-competitive brain at commodity pricing. Pair deepseek-v4-pro for complex debugging with deepseek-v4-flash for quick boilerplate — a sliding scale of cost vs. capability.
DeepSeek-V4's differentiator isn't that it's a strong coder — it's that it's an affordable and scalable foundation for agentic coding. The attention architecture lowers the computational barrier; the benchmarks show it can contend with the frontier at a fraction of the cost; and the explicit integration with Claude Code, OpenClaw, and OpenCode signals a strategic push to become native to the developer workflow.
By making million-token context a practical, low-cost default, V4 marks the transition from AI-powered autocomplete to an AI collaborator that can genuinely hold an entire codebase in working memory. The economics of attention have changed. The tools will follow.
Get new articles by email — no noise, just the writing.