---
title: "DeepSeek-V4: a million-token context that agents can actually use"
description: "DeepSeek-V4 (Pro: 1.6T total/49B active; Flash: 284B/13B active) is a MoE model family whose 1M-token context is made practical by a hybrid attention design that interleaves Compressed Sparse Attention (4x KV compression plus an FP4 lightning indexer selecting top-k blocks) with Heavily Compressed Attention (128x compression with dense attention), plus FP8 KV storage."
url: "https://swe.quest/articles/deepseek-v4-a-million-token-context-that-agents-can-actually-use-4aebeb5a933f7a88"
canonical: "https://huggingface.co/blog/deepseekv4"
source: "Hugging Face"
published: "2026-04-24"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 7
tags: ["llms","inference","ai-agents","model-training"]
---

# DeepSeek-V4: a million-token context that agents can actually use

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2026-04-24, 7 min read, Deep dive. Original: [https://huggingface.co/blog/deepseekv4](https://huggingface.co/blog/deepseekv4)

## Summary

DeepSeek-V4 (Pro: 1.6T total/49B active; Flash: 284B/13B active) is a MoE model family whose 1M-token context is made practical by a hybrid attention design that interleaves Compressed Sparse Attention (4x KV compression plus an FP4 lightning indexer selecting top-k blocks) with Heavily Compressed Attention (128x compression with dense attention), plus FP8 KV storage. At 1M tokens V4-Pro needs 27% of V3.2's per-token FLOPs and 10% of its KV cache, about 2% of a bf16 GQA-8 cache. Agent-focused post-training preserves reasoning across user turns when tools are involved, adds an XML-based |DSML| tool-call schema to reduce escaping and type errors, and relies on DSec, a Rust sandbox platform for RL rollouts. Agent benchmarks land near frontier closed models (SWE Verified 80.6, MCPAtlas 73.6), and MRCR 8-needle retrieval holds 0.59 at 1M tokens.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)

## Prerequisites

- transformer attention
- KV cache ([easy posts on Caching](https://swe.quest/tags/caching.md?difficulty=easy))
- mixture-of-experts models
- LLM agents and tool calling ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))

## Keywords

DeepSeek-V4, Compressed Sparse Attention, Heavily Compressed Attention, DeepSeek Sparse Attention, DSec, Firecracker, SWE-bench Verified, Hugging Face Hub

## Related posts

- [Serving DeepSeek-V4: why million-token context is an inference systems problem](https://swe.quest/articles/serving-deepseek-v4-why-million-token-context-is-an-inference-systems-problem-bfb1067f4f733f69.md): Together AI · 2026-05-11 · Hard · 11 min read · Inference & serving, LLMs, Caching, Performance engineering, Hardware
  DeepSeek-V4's 1M-token context comes from compressing the token axis of the KV cache: Compressed Sparse Attention (stride 4, top-k selection), Heavily Compressed Attention (stride 128, dense over ~8K entries) and a 128-token Sliding Window Attention path.
- [Accelerating Qwen3-8B Agent on Intel® Core™ Ultra with Depth-Pruned Draft Models](https://swe.quest/articles/accelerating-qwen3-8b-agent-on-intel-coretm-ultra-with-depth-pruned-draft-models-ea1317a126102827.md): Hugging Face · 2025-09-29 · Medium · 6 min read · Inference & serving, LLMs, AI agents, Performance engineering
  Speculative decoding with a Qwen3-0.6B draft model speeds up 4-bit Qwen3-8B on an Intel Lunar Lake integrated GPU by about 1.3× using OpenVINO.GenAI.
- [Open R1: Update #4](https://swe.quest/articles/open-r1-update-4-294f9020c2f9ead5.md): Hugging Face · 2025-03-26 · Medium · 8 min read · LLMs, Inference & serving, AI safety, Evaluation
  DeepSeek-V3 0324 keeps the original V3 architecture, moves to an MIT license, and posts large benchmark gains: AIME rises from 39.6 to 59.4, LiveCodeBench from 39.2 to 49.2 and GPQA from 59.1 to 68.4.
- [Context Management for Deep Agents](https://swe.quest/articles/context-management-for-deep-agents-dc1d776470c6aad5.md): LangChain · 2026-10-13 · Medium · 5 min read · AI agents, LLMs, Evaluation
  The Deep Agents SDK manages long-running agent context with three compression techniques triggered at fractions of the model's context window.
- [GLM-5.2: Built for Long-Horizon Tasks](https://swe.quest/articles/glm-5-2-built-for-long-horizon-tasks-22484eb2dd0aab06.md): Hugging Face · 2026-06-17 · Hard · 13 min read · LLMs, Inference & serving, Model training, AI for coding, Evaluation
  GLM-5.2 is Z.ai's MIT-licensed flagship model for long-horizon coding-agent work, with a 1M-token context and selectable thinking effort levels.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
