← Back to list2026-09-17 · Frozen edition

DeepSeek V4.1 architecture halves long-input prefill compute with novel causal encoder-decoder design aligned for long-running agent systems

Updated AI engineeringAI industryResearch1 min readVoting closed
0final votes

Editorial synthesis

DeepSeek V4.1 separates its 40-layer model into a 20-layer causal encoder and 20-layer decoder, both causal. Prompt tokens only go through the encoder, while generated tokens go through both, resulting in 8B active params for prefill vs. 16B for decode. The model uses a global KV cache shared and reused across layers via three modes: Full, Reindex, and Reuse, drastically reducing token cache size to 890 bytes from 389K in V1, improving memory efficiency. Post-training involves replaying only 128 encoder outputs, training the model to tolerate approximations inherent to serving. The architecture supports long context lengths (4K to 1M) with only ~25% increase in decode FLOPs per token. An evolving agent training system aligns model structure, caching, retrieval limits, and inference around long-running AI agents. Benchmark comparisons show DeepSeek V4.1 performs competitively on coding and automation tasks compared to contemporaries like Kimi-K3 and GPT-5.6-Sol. The design choices illustrate a principled approach to align training and serving for enhanced efficiency and agent-oriented applications.

Editorial history 2 revisions
  1. DeepSeek V4.1 architecture halves long-input prefill compute with novel causal encoder-decoder design aligned for long-running agent systems

    Owner approved batch story — swyx

  2. Agent Arena places DeepSeek-V4.1-Flash (Max) among its top open models at a reported $0.07 median cost per task

    Owner approved batch story — swyx

Suggest a related link