DeepSeek-V4 の提供:百万トークンコンテキストは推論システムの問題である理由
Together AI は、DeepSeek-V4 の百万トークンコンテキスト機能が単なるモデル仕様ではなく、推論エンジンのキャッシュ管理やバッチ処理能力に依存するインフラ課題であることを示し、アーキテクチャ変更がシステム設計に与える影響を分析した。
キーポイント
KV キャッシュの圧縮とコンテキスト軸への焦点
DeepSeek-V4 は従来のモデルとは異なり、トークン軸(token axis)を圧縮するハイブリッド注意機構を採用し、キーバリューキャッシュのサイズと読み込み負荷を同時に削減している。
推論システムの実装が成否を分ける
モデル側の圧縮技術は有効だが、その恩恵を引き出すには推論エンジンが新しいキャッシュレイアウトの管理、ローカル状態の回復、ワークロードに合わせたエンドポイント選択を適切に行う必要がある。
NVIDIA Blackwell 環境での経済性への影響
Blackwell アーキテクチャ上では、KV キャッシュの圧縮が並行処理(concurrency)とスループットを向上させ、長文コンテキスト推論のコストパフォーマンスを劇的に改善する可能性を示している。
既存技術との比較とアーキテクチャの転換点
GQA や MLA などの既存の圧縮技術が異なるパラメータに焦点を当てる中、V4 はトークン軸そのものを圧縮する点で重要な転換点となり、推論エンジンの設計思想を見直す必要性を提起している。
影響分析・編集コメントを表示
影響分析
この記事は、LLM の性能向上が単にパラメータや学習データの規模だけでなく、それを支える推論インフラの設計思想と密接に関わっていることを浮き彫りにしています。業界全体として、長文コンテキスト対応モデルの実装においては、モデル開発とシステム最適化の境界線が曖昧になりつつあり、両者の統合的なアプローチが競争優位性の鍵となることを示唆しています。
編集コメント
モデルの仕様表だけでは見えない、推論インフラ側のボトルネックと解決策に焦点を当てた非常に示唆に富む分析です。長文コンテキスト対応が普及する中で、システムアーキテクチャの見直しが急務であることを痛感させる内容となっています。
ベンチマーク表は DeepSeek-V4 の本質を見落としています。重要な変化はアーキテクチャにあります。V4 は、100 万トークンというコンテキストをインフラシステムの問題へと転換させました。
このモデルは、ハイブリッドアテンション設計を通じて 1M トークンのコンテキストウィンドウをサポートします。具体的には、キーバリュー(KV)ストレージ前にコンテキストを圧縮し、圧縮されたパスとローカルアテンションパスを混合し、プレフィックスの再利用方法を根本から変更しています。これらの選択は KV の負荷を軽減しますが、その節約効果が真価を発揮するのは、推論エンジンが結果として生じるキャッシュレイアウトを管理でき、ローカル状態を復元し、リクエストを効果的にバッチ処理し、ワークロードに適合するエンドポイントプロファイルを選択できる場合に限られます。
本稿では、Together による NVIDIA HGX B200 での初期動作検証に基づき、V4 の圧縮スパースアテンション(CSA)/ 重度圧縮アテンション(HCA)/ スライディングウィンドウアテンション(SWA)というアテンション設計のサービングへの影響に焦点を当てます。V4 には他にもアーキテクチャやトレーニングに関する変更が含まれており、例えばマニフォールド制約ハイパー接続(mHC)残差接続や Muon オプティマイザの採用などがありますが、これらは本稿の主要な範囲外です。
V4 は KV キャッシュのトークン軸を圧縮する
自己回帰推論では、過去のコンテキストは KV キャッシュに保存されます。デコード中、生成される各新しいトークンは、この保存された状態を読み取り、アテンションを適用します。キャッシュはシーケンス長に応じて成長します:
KV キャッシュ ∝ レイヤー数 × トークン数 × kv_heads × head_dim × バイト数
長いコンテキストにおいて、KV キャッシュはサービス処理を二重に制約します。各アクティブなリクエストがメモリを占有するため並行性が制限され、デコード時に保存されたコンテキストを毎ステップ読み込む必要があるためスループットも低下します。V4 はこの問題の両側面に対処する点で重要です:保存すべきキャッシュエントリ数を減らし、アテンションを通じて移動させるキャッシュエントリ数も減らすのです。
NVIDIA Blackwell において、そのキャッシュ圧力はサービス経済に直結します。長いコンテキストでの推論は、並行性を維持するために十分な KV をレジデント状態に保ちつつ、デコードのためにメモリ帯域幅を確保する必要があります。V4 のトークン軸圧縮はこのトレードオフをより有利にします:エンジンにはリクエストのバッチ処理やプレフィックスの再利用の余地が生まれ、長いコンテキストワークロードを効率的なサービスレジーム内に維持できるようになります。
最近のモデルアーキテクチャは、上記の積算項のうち異なる要素を削減してきました。Group Query Attention (GQA) は KV ヘッド数を減らし、Multi-Head Latent Attention (MLA) は KV を潜在表現に圧縮します。FP8、MXFP4、NVFP4 は要素あたりのバイト数を削減します。DeepSeek-V3.2 のスパースアテンションはデコード時に読み込む必要がある KV の量を減らしましたが、完全なキャッシュはまだレジデント状態である必要がありました。
DeepSeek-V4 はトークン軸を対象とします。KV 保存前にコンテキストを圧縮するのです。
それが重要な転換点です。
バニラな BF16 マルチヘッドアテンション計算では、70B クラスのモデルはトークンあたりメガバイト単位の KV キャッシュを必要とする可能性があります。正確な係数はレイヤー数、KV ヘッド数、ヘッド次元、および精度に依存します。1M トークンの場合、キャッシュは単一のリクエストに対して実用的ではありません。V4 のトークン軸圧縮は、MLA スタイルのヘッド圧縮と低精度 KV と組み合わさることで、リクエストあたりのキャッシュフットプリントを十分に削減し、非常に長いコンテキストを materially(実質的に)より実用的なものにします。
初期の立ち上げ段階では、V4 のサービング容量は圧縮された CSA/HCA キャッシュよりも、エンジンが SWA 状態をどのように処理するかによってより多く規定されていました。フル SWA 実装は、エンジンが完全なスライディングウィンドウ状態を保存していたため、V3 パスよりもトークンあたりの KV フットプリントが大きくなりました(約 3.8 KB/トークン対 3.4 KB)。
実用的な利点はキャッシュポリシーから生まれました。再利用される可能性が高い SWA 状態のみを保持することで、単一の NVIDIA HGX B200 ノード上の総 KV キャッシュ容量は、最小限の変更で約 120 万トークンから 370 万トークンに増加しました。これが主なサービングの教訓です。V4 のアーキテクチャは長文コンテキスト効率化の可能性を生み出しますが、実現される容量は、推論エンジンが異なるキャッシュタイプをどのように保存し、再計算し、エバクトするかにかかっています。
実用的な勝利は、100 万トークンのリクエスト全体に限定されるものではありません。このエンジンは、メモリ圧力によって退去やバッチ処理の制限を迫られる前に、より多くの KV バudget を利用可能にするため、20 万〜50 万トークンのワークロードにおいて、並行性を高め、脆弱性を低減します。以前の百万トークン・コンテキストを持つモデルは、依然としてメモリ、並行性、コストに関する主要なサービング課題を残していましたが、V4 はキャッシュレイアウトがサービングポリシーと一致する際に、実際のワークロードにこの範囲を近づけます。

V4 には複数の KV キャッシュレイアウトが必要
多くの既存のサービングパスは、単一の KV キャッシュレイアウトに近いものを前提としています。つまり、層ごとにトークンごとに 1 つのキャッシュオブジェクトがあり、スタック全体で同じ形状です。しかし、V4 では 3 種類の異なるキャッシュタイプが、層をまたいで混合して使用されます。
圧縮スパースアテンション(Compressed Sparse Attention: CSA)はストライド 4 でコンテキストを圧縮しますが、各圧縮エントリはわずかに広い受容野から構築されます。V4 の構成では、各エントリが 8 トークンの近傍を要約するため、隣接する圧縮エントリは境界部で重複します。クエリが 128 の圧縮エントリを選択する場合、それは孤立したトークン位置ではなく、局所的な近傍の要約を選択していることになります。これにより、保存されるキャッシュのフットプリントを削減しつつも、百万トークンのプレフィックス内の選択された領域へのより微細な粒度でのアクセス経路が CSA に与えられます。

重圧縮アテンション(HCA)は、同じ圧縮アイデアを用いますがストライドを 128 に設定しています。100 万トークンのコンテキスト長において、これによりキャッシュは 100 万トークン位置から約 8,000 の圧縮エントリに削減されます。これが CSA との決定的な違いです:圧縮キャッシュが十分に小さいため、モデルは特定の top-k サブセットを選択するのではなく、これを密にアテンション(注視)することができます。HCA はモデルに対してコンテキスト全体に対する粗いグローバル読み取りを提供し、一方 CSA は選択された領域に対するより微細なスパース読み取りを提供します。

スライディングウィンドウアテンション(SWA)は、ローカルパスを維持します。ウィンドウは短く、約 128 トークンであり、直近のコンテキストを正確に保持します。
スタック全体を通じて、エンジンでは CSA の圧縮状態、HCA の圧縮状態、SWA のローカル状態、および CSA と HCA の圧縮器によって使用される短く非圧縮されたテール状態を管理する必要があります。これらのオブジェクトは、サイズ、寿命、読み取りパターンが異なります。
新しいアテンションカーネルは作業の一部に過ぎません。より困難なサービングの問題はメモリ管理です:リクエストのバッチ処理、キャッシュページのエビクション(追放)、プレフィックスの再利用、そしてモデルの異なる部分が異なる種類の保存された状態を必要とする中でデコードスループットを安定して維持することです。

プレフィックスキャッシングはストレージポリシーとなる
プレフィックスキャッシングは通常、共有プレフィックスには共有 KV(Key-Value)状態という単純なルールから始まります。V4 においては、どのキャッシュを使用するかという問いが浮上します。
共有プレフィックスには、CSA(Compressed State Attention)の状態、HCA(Hybrid Context Attention)の状態、SWA(Sliding Window Attention)の状態、および CSA および HCA コンプレッサーによって使用される非圧縮されたテール状態が含まれます。CSA と HCA はコンパクトであり、効率的に保存可能です。一方、SWA は正確なローカル状態であるため、特にキャッシュ階層が GPU メモリを超えた場合、長いプレフィックスに対して保存コストが高くなります。
DeepSeek の論文では 3 つの SWA 戦略が記述されています。
最初の戦略は、完全な SWA キャッシュを保存するものです。再利用は単純で、エンジンが完全なプレフィックス状態を直接復元できるためです。ただし、ストレージ容量と書き込み帯域幅は急速に増加します。
2 つ目の戦略は、定期的な SWA チェックポイントを保存するものです。エンジンは K トークンごとに状態を保存し、キャッシュヒット時にはギャップ(差分)を再計算します。
3 つ目の戦略は、ヒット時に SWA を再計算するものです。エンジンは圧縮された CSA/HCA 状態のみを保存し、プレフィックスが再利用される際に SWA パスを再構築します。コストはウィンドウサイズとレイヤー数の積によって制限されます。128 トークンのウィンドウと 61 レイヤーの場合、再計算量は約 8K トークンとなります。1M トークンのプレフィックスと比較すると、このトレードオフは妥当な選択となり得ます。
現在の V4 の立ち上げでは、最初の戦略である SWA キャッシュのフル保存を使用しています。これにより、プレフィックスの再利用が単純に保たれ、残りのサービングパスがまだ成熟する過程にある間に再計算の複雑さを追加する必要がありません。その代償としてキャッシュフットプリントが増大するため、コンテキスト長と同時実行性が高まるにつれて、キャッシュポリシーや_eviction_(退去)動作の重要性が増します。
V4 では、プレフィックスキャッシングをキャッシュオブジェクト全体にわたるポリシー決定へと転換しました。CSA と HCA を保存し、SWA の扱い方を決定し、各タイプごとに独自のコストに基づいてエビクションを行います。
V4 のパフォーマンスはレジーム依存である
V4 の利点は、まず KV キャッシュが支配的な領域で現れます。
長コンテキストでデコード中心のワークロードでは、時間の多くをキャッシュからの読み取りに費やします。V4 の圧縮キャッシュレイアウトはこの負荷を軽減します。
短コンテキストでプリフェッチ中心のワークロードは異なるパスに直面します。CSA のトップ k 選択、HCA の圧縮読み取り、および SWA は、成熟した密なアテンションカーネルパスの外側での操作を導入します。カーネルの成熟度が重要です。精度フォーマットもまた重要であり、V4 は MoE 重みに MXFP4 を使用しますが、これは NVIDIA Blackwell GPU 上の NVFP4 とは異なる性能特性を持ちます。これにより、短コンテキストのプリフェッチは特にカーネルの成熟度に敏感になる一方、長コンテキストのデコードは KV キャッシュ削減からより直接的に恩恵を受けます。
これにより、運用体制の分裂が生じます。長文コンテキストワークロードは、V4 のキャッシュ節約効果によって早期に恩恵を受けます。一方、短文コンテキストワークロードは、カーネルの立ち上げと事前計算(prefill)最適化により依存します。これは新しいアーキテクチャにおいて典型的な現象です:最初の実装で正しさを確立し、次の反復でハードウェア効率とのギャップを埋めていきます。
Together は、事前計算パスとデコードパス全体にわたって V4 のカーネル開発を継続しています。
開発者は、自らの実際の運用体制において V4 をベンチマークすべきです。100 万トークンコンテキストのコーディングエージェントと短文コンテキストのチャットアシスタントは、サービングスタックの異なる部分を負荷します。
同じ重みでも異なるサービングプロファイルが必要
V4 はワークロード形状間のギャップを拡大します。
長文コンテキストのエージェントは、アーキテクチャから最も直接的な恩恵を受けます。デコード時に大量のキャッシュを読み込むため、V4 の圧縮 KV レイアウト、大規模なテンソル並列構成(tensor-parallel)、バッチ処理、プレフィックス再利用がすべて重要となります。これはモデルの長文コンテキスト設計が最初に現れるべき運用体制です。
共有リポジトリを介したコーディングエージェントは関連しますが、サービングの問題はよりプレフィックス依存型になります。同じプロジェクトファイル、リポジトリの状態、またはタスクのスキャフォールドがリクエスト間で繰り返される可能性があるため、キャッシュティアリングと SWA(Sliding Window Attention)再計算ポリシーが最優先の選択肢となります。ボトルネックには、長文コンテキストと反復するコンテキストの再利用の両方が含まれます。
短いチャットは、その反対の端に位置します。これらのワークロードは、百万トークンのキャッシュ圧縮から大きな恩恵を受けず、むしろプレフィルレイテンシ、小バッチオーバーヘッド、カーネルの成熟度が露呈されます。これらを適切にサーブするには、より小さなテンソル並列グループ、最小限のバッチ待ち時間、短いコンテキストパス向けにチューニングされたカーネルが必要になる可能性があります。
RL ロールアウトは、異なる経済単位を重視します:長期トジェクトあたりのコストです。長文コンテキストエージェントと同じサーブ基盤を共有する可能性がありますが、最適化の目標は実験スループット、つまりトレーニング予算あたりで生成できる長期ホライゾンのロールアウト数であり、単一リクエストのレイテンシのみではありません。
同じ重み(weights)がこれらのすべてのワークロードに使用できます。各ワークロードは異なるエンドポイント設定の下で最もよく機能します。これらを同時に評価するには、異なるバッチ処理、並列化、キャッシュポリシーを持つエンドポイントプロファイルの評価が必要です。
V4 移行前にベンチマークすべきこと
百万トークンサーブが最も重要となるのは、長期タスクにわたって状態を蓄積するシステムです:コーディングエージェント、研究エージェント、およびその他の長期間ホライゾンのタスクです。これらのワークロードでは、コストモデルはトークンあたりの価格から、完了したトジェクトあたりのコストへとシフトすることがよくあります。
V4 へのトラフィック移行前に、以下の 4 つをベンチマークしてください:コンテキスト長レジーム、プレフィックス再利用、キャッシュポリシー、およびエンドポイントプロファイルです。
長文コンテキストエージェントの場合、キャッシュヒット率、デコードスループット、完了したタスクあたりのコストを測定してください。トークン初出までの時間は、状況の一部しか捉えていません。
短いチャットの場合は、実際のコンテキスト長とバッチサイズにおけるレイテンシを比較してください。V4 のロングコンテキストによる利点は、まず短時間チャットのレイテンシには現れない可能性があります。
共有プレフィックスを持つワークロードでは、SWA フルストアとヒット時の再計算をテストしてください。プレフィックス長、キャッシュ層のレイテンシ、再利用頻度が答えを決定します。
RL ロールアウトの場合は、トークン価格だけでなく、軌跡の長さと実験ごとのロールアウト数に基づいてコストを計算してください。
混合トラフィックの場合、トレードオフが予想されます。1 つのエンドポイントで混合ワークロードを処理することも可能ですが、ワークロードの形状が明確になれば、プロファイル固有のエンドポイントの方が通常はより高いパフォーマンスを発揮します。
品質はまだ測定する必要があります。コンテキストが長くなることは、有用な状態のための余地が増える一方で、検索ノイズ、圧縮アーティファクト、レイテンシも増大させます。また、コンパクション戦略も変化します:ビルダーは、生の状態を保持するか、要約するか、リセットするかのタイミングについてより多くの制御権を得ます。
結論
DeepSeek-V4 の効率性はシステムプロパティです。アーキテクチャはトークン軸に沿った圧縮によって KV プレッシャーを低減しますが、サービングエンジンはその選択に伴うキャッシュタイプ、プレフィックスポリシー、カーネルパス、エンドポイントプロファイルを管理する必要があります。
ここがフルスタックの共設計において重要となる点でもあります。モデルはキャッシュレイアウトを変化させます。推論エンジンはメモリ管理とプレフィックスポリシーを変更します。カーネルは新しいアテンションおよび精度パスに適応します。NVIDIA Blackwell プラットフォームは、これらの作業のうちどれほどが実現されたスループット、並行性、トークンあたりのコスト削減として現れるかを決定します。
V4 の実行は出発点です。アーキテクチャ上の節約を、より低いレイテンシ、高い同時接続数、そして低コストの長文コンテキスト処理ワークロードに変えるには、キャッシュポリシーの設計、カーネル最適化、およびワークロード固有のサービングプロファイルが必要です。次のステップは計測です:トークンごとの KV(Key-Value)フットプリント、コンテキスト長におけるスループット曲線、プレフィックスキャッシュポリシーの影響、そして異なるトラフィック形状に対するエンドポイントプロファイルについてです。V4 のカーネルとキャッシュポリシーが成熟するにつれて、これらの数値を公開していきます。
FAQ
DeepSeek-V4 のコンテキストウィンドウはどのくらいですか? DeepSeek-V4 は 100 万トークンのコンテキストウィンドウをサポートしています。これは、キーバリュー(KV)ストレージ前にコンテキストを圧縮し、圧縮されたパスとローカルアテンションパスを混合し、プレフィックスの再利用方法を根本から変更するハイブリッドアテンション設計によって実現されています。このアーキテクチャ上の革新こそが、100 万トークンという長文コンテキストを実際のサービングワークロードとして成立させる鍵となっています。
DeepSeek-V4 における Compressed Sparse Attention (CSA) とは何か? CSA はストライド 4 でコンテキストを圧縮します。各圧縮エントリは 8 トークンの近傍領域を要約しており、隣接するエントリは境界部で重複しています。クエリはこれらの圧縮エントリから約 128 を選択し、モデルがプレフィックスの特定領域に対して微細なスパースパスを持つようにしつつ、保存されるキャッシュフットプリントを削減します。
Heavily Compressed Attention (HCA) とは何か? HCA は、CSA と同じ圧縮メカニズムを使用しますが、ストライド(stride)が 128 です。1M トークンのコンテキストにおいて、これによりキャッシュは 1M 位置から約 8K の圧縮エントリに削減され、モデルがそのすべてに対して密に注意を向けるのに十分な小ささになります。HCA は粗いグローバルな読み取りを提供し、CSA は選択された領域に対する細かいスパースな読み取りを提供します。
DeepSeek-V4 は、以前のモデルと比較して KV キャッシュサイズをどのように削減しているのか? DeepSeek-V4 は、KV キャッシュのトークン軸に沿って圧縮を行います。以前の技術は、キャッシュ積算内の異なる項を削減しました:Group Query Attention は KV ヘッド数を減らし、Multi-Head Latent Attention はヘッド次元を圧縮し、FP8/MXFP4/NVFP4 は要素あたりのバイト数を削減します。DeepSeek-V3.2 は、フルキャッシュをレジデントに保ちながら、デコード時に読み取る必要があるキャッシュ量を削減しました。一方、V4 は保存されるトークンエントリ自体の数を削減します。
なぜ DeepSeek-V4 のサービングには複数の KV キャッシュレイアウトが必要なのか? このモデルは、層全体にわたって混合された 3 つのアテンションパス(CSA、HCA、および Sliding Window Attention)を使用しています。それぞれが異なるサイズ、ライフタイム、読み取りパターンを持つキャッシュオブジェクトを生成します。推論エンジンは、リクエストごとにこれら 3 つを同時に管理する必要があり、単一のキャッシュ設計下よりもメモリ管理、エビクション(退去)、およびプレフィックスの再利用が困難になります。
DeepSeek-V4 でプレフィックスキャッシングはどのように機能しますか? プレフィックスキャッシングは、キャッシュタイプごとのポリシー決定となります。CSA と HCA の状態はコンパクトで保存可能です。SWA 状態は正確なローカル状態であり、長いプレフィックスではコストが高騰します。DeepSeek の論文では3つのオプションが説明されています:SWA を完全に保存する、定期的なチェックポイントを保存する、またはキャッシュヒット時に SWA を再計算するです。キャッシュヒット時の再計算は、ウィンドウサイズとレイヤー数の積によって制限され、100 万トークンのプレフィックスに対して約 8K トークンの再計算が必要となります。
どのワークロードが DeepSeek-V4 から最も恩恵を受けますか? 長文コンテキストでデコード中心のワークロードが最初に恩恵を受け、これにはコーディングエージェント、研究エージェント、および長いタスクにわたって状態を蓄積する RL ロールアウトが含まれます。これらの場合、コストモデルはトークンあたりの価格から完了したトジェクトあたりのコストへとシフトします。短文コンテキストのチャットワークロードでは、KV キャッシュ圧力よりもプリフェッチレイテンシやカーネルの成熟度がより顕著に現れるため、恩恵は限定的です。
短文チャットのトラフィックを DeepSeek-V4 へ移行すべきでしょうか? まずベンチマークを実行してください。V4 の恩恵は KV キャッシュが支配的な場所で顕著になります。短文コンテキストでプリフェッチ中心のワークロードでは、新しいカーネルパス(CSA のトップ k 選択、HCA の密な読み取り、MXFP4 MoE 重みなど)が使用されますが、これらはまだ成熟段階にあります。切り替える前に、実際のコンテキスト長とバッチサイズにおけるレイテンシを比較してください。長文エージェントと短文チャットは、同じ重みであっても異なるエンドポイントプロファイルが必要になる可能性があります。
なぜ Together は DeepSeek V4 のサービングに NVIDIA HGX B200 を選んだのでしょうか?
NVIDIA HGX B200 は、DeepSeek V4 の運用コストを支配する要素、すなわち長文コンテキストのデコード時の KV キャッシュ圧力と、プリフェッチ時の MoE 重み帯域幅と見事に整合しています。Blackwell の 推論パフォーマンス により、単一の HGX B200 ノードで V4 の圧縮された CSA / HCA / SWA キャッシュレイアウトを多数の並行する長文コンテキストリクエストにわたって常駐させることが可能となり、ネイティブ MXFP4 サポートは DeepSeek が V4 の MoE 重みとして出荷しているフォーマットと一致するため、モデルの量子化を再キャストステップなしでエンドツーエンドで実行できます。Together の HGX B200 デプロイメントも同様の MXFP4 パスと KV 圧縮の余地を引き継いでおり、これが V4 のローンチプラットフォームとしてこれを選定した理由です。
原文を表示
Benchmark tables miss the main point of DeepSeek-V4: the important change is architectural. V4 turns million-token context into a serving-systems problem.
The model supports a 1M-token context window through a hybrid attention design that compresses context before key-value (KV) storage, mixes compressed and local attention paths, and changes how prefix reuse works. Those choices reduce KV pressure, but the savings only matter if the inference engine can manage the resulting cache layouts, recover local state, batch requests effectively, and choose endpoint profiles that match the workload.
This post focuses on the serving implications of V4's Compressed Sparse Attention (CSA) / Heavily Compressed Attention (HCA) / Sliding Window Attention (SWA) attention design, based on Together's early bring-up work on NVIDIA HGX B200. V4 also includes other architecture and training changes, including Manifold-Constrained Hyper-Connections (mHC) residual connections and Muon optimizer choices, but those are outside the main scope here.
V4 compresses the token axis of KV cache
Autoregressive inference stores prior context in KV cache. During decode, each new token generated reads from and attends to that stored state. The cache grows with sequence length:
KV cache ∝ layers × tokens × kv_heads × head_dim × bytes
At long context, KV cache hits serving twice. It caps concurrency because each active request occupies memory, and it lowers throughput because decode has to read stored context every step. V4 matters because it attacks both sides of that problem: fewer cache entries to store and fewer cache entries to move through attention.
On NVIDIA Blackwell, that cache pressure maps directly to serving economics. Long-context inference depends on keeping enough KV resident for concurrency while preserving memory bandwidth for decode. V4’s token-axis compression makes that tradeoff more favorable: the engine has more room to batch requests, reuse prefixes, and keep long-context workloads inside an efficient serving regime.
Recent model architectures have reduced different terms in the product above. Group Query Attention (GQA) reduces KV heads. Multi-Head Latent Attention (MLA) compresses KV into a latent representation. FP8, MXFP4, and NVFP4 reduce bytes per element. DeepSeek-V3.2 sparse attention reduced how much KV had to be read during decode, while the full cache still had to stay resident.
DeepSeek-V4 targets the token axis. It compresses context before KV storage.
That is the important shift.
Under a vanilla BF16 multi-head attention calculation, a 70B-class model can require megabytes of KV cache per token. The exact coefficient depends on layer count, KV heads, head dimension, and precision. At 1M tokens, the cache becomes impractical for a single request. V4's token-axis compression, combined with MLA-style head compression and low-precision KV, reduces the per-request cache footprint enough to make very long context materially more practical.
In early bring-up, V4’s serving capacity was governed less by the compressed CSA / HCA cache and more by how the engine handled SWA state. A full-SWA implementation actually had a higher per-token KV footprint than our V3 path — roughly 3.8 KB per token versus 3.4 KB — because the engine was storing the full sliding-window state.
The practical gain came from cache policy. By keeping only the SWA states most likely to be reused, we increased total KV-cache capacity on a single NVIDIA HGX B200 node from roughly 1.2M tokens to 3.7M tokens with minimal changes. That is the main serving lesson: V4’s architecture creates the opportunity for long-context efficiency, but the realized capacity depends on how the inference engine stores, recomputes, and evicts the different cache types.
The practical win extends beyond full 1M-token requests. It makes 200K–500K-token workloads more concurrent and less fragile, because the engine has more KV budget to work with before memory pressure forces eviction or limits batching. Earlier million-token-context models still left major serving challenges around memory, concurrency, and cost. V4 moves that range closer to an actual workload when the serving policy matches the cache layout.

V4 requires multiple KV-cache layouts
Many existing serving paths assume something close to a single KV cache layout: one cache object per layer per token, the same shape across the stack. V4 requires three different cache types, mixed across layers.
Compressed Sparse Attention (CSA) compresses context with stride 4, but each compressed entry is built from a slightly wider receptive field. In V4's configuration, each entry summarizes an 8-token neighborhood, so adjacent compressed entries overlap at the boundaries. When a query selects 128 compressed entries, it is selecting summaries of local neighborhoods rather than isolated token positions. That gives CSA a finer-grained path into selected regions of the million-token prefix while still reducing the stored cache footprint.

Heavily Compressed Attention (HCA) uses the same compression idea but with stride 128. At a 1M-token context length, that reduces the cache from 1M token positions to roughly 8K compressed entries. That is the key difference from CSA: the compressed cache is small enough that the model can attend over it densely instead of selecting a top-k subset. HCA gives the model a coarse global read over the whole context, while CSA gives it a finer sparse read over selected regions.

Sliding Window Attention (SWA) preserves the local path. The window is short, around 128 tokens, and keeps recent context exact.
Across the stack, the engine has to manage CSA compressed state, HCA compressed state, SWA local state, and short uncompressed tail states used by the CSA and HCA compressors. These objects have different sizes, lifetimes, and read patterns.
New attention kernels are only part of the work. The harder serving problem is memory management: batching requests, evicting cache pages, reusing prefixes, and keeping decode throughput stable while different parts of the model depend on different kinds of stored state.

Prefix caching becomes a storage policy
Prefix caching usually starts with a simple rule: shared prefix, shared KV. With V4, the question becomes: which cache?
A shared prefix contains CSA state, HCA state, SWA state, and the uncompressed tail states used by the CSA and HCA compressors. CSA and HCA are compact enough to store efficiently. SWA is exact local state, which makes it more expensive to store for long prefixes, especially once the cache tier moves beyond GPU memory.
The DeepSeek paper describes three SWA strategies.
The first stores the full SWA cache. Reuse is simple because the engine can restore the complete prefix state directly, but storage and write bandwidth grow quickly.
The second stores periodic SWA checkpoints. The engine saves state every K tokens and recomputes the gap on a cache hit.
The third recomputes SWA on hit. The engine stores compressed CSA / HCA state and rebuilds the SWA path when a prefix is reused. The cost is bounded by window size times layer count. With a 128-token window and 61 layers, that is roughly 8K tokens of recompute. Against a 1M-token prefix, that trade can make sense.
In our current V4 bring-up, we use the first strategy: storing the full SWA cache. This keeps prefix reuse straightforward and avoids adding recompute complexity while the rest of the serving path is still maturing. The tradeoff is higher cache footprint, which makes cache policy and eviction behavior more important as context length and concurrency increase.
V4 turns prefix caching into a policy decision across cache objects: store CSA and HCA, decide how to handle SWA, and evict each type according to its own cost.
V4 performance is regime-dependent
V4's gains show up first where KV cache dominates.
Long-context, decode-heavy workloads spend much of their time reading cache. V4's compressed cache layout reduces that pressure.
Short-context, prefill-heavy workloads hit a different path. CSA top-k selection, HCA compressed reads, and SWA introduce operations outside mature dense-attention kernel paths. Kernel maturity matters. Precision format matters too: V4 uses MXFP4 for MoE weights, which has different performance characteristics than NVFP4 on NVIDIA Blackwell GPUs. That makes short-context prefill especially sensitive to kernel maturity, while long-context decode benefits more directly from KV-cache reduction.
That creates a regime split. Long-context workloads benefit from V4's cache savings early. Short-context workloads depend more on kernel bring-up and prefill optimization. This is typical for a new architecture: the first implementation establishes correctness; the next iterations close the gap to hardware efficiency.
Together is continuing V4 kernel work across the prefill and decode paths.
Developers should benchmark V4 in their actual regime. A 1M-context coding agent and a short-context chat assistant exercise different parts of the serving stack.
The same weights need different serving profiles
V4 widens the gap between workload shapes.
Long-context agents benefit most directly from the architecture. They read large amounts of cache during decode, so V4's compressed KV layout, larger tensor-parallel configurations, batching, and prefix reuse all matter. This is the regime where the model's long-context design should show up first.
Coding agents over shared repositories are related, but the serving problem is more prefix-heavy. The same project files, repository state, or task scaffolds may repeat across requests, so cache tiering and SWA recompute policy become first-order choices. The bottleneck includes both long context and repeated-context reuse.
Short chat sits at the other end of the spectrum. These workloads do not benefit much from million-token cache compression, and they expose prefill latency, small-batch overhead, and kernel maturity instead. Serving them well may require smaller tensor-parallel groups, minimal batching delay, and kernels tuned for the short-context path.
RL rollouts care about a different unit of economics: cost per long trajectory. They may share serving machinery with long-context agents, but the optimization target is experiment throughput, how many long-horizon rollouts can be generated per training budget, rather than single-request latency alone.
The same weights can serve all of these workloads. Each performs best under a different endpoint configuration. Together is evaluating endpoint profiles with different batching, parallelism, and cache policies.
What to benchmark before moving to V4
Million-token serving matters most for systems that accumulate state over long tasks: coding agents, research agents, and other longer horizon tasks. For these workloads, the cost model often shifts from price per token toward cost per completed trajectory.
Before moving traffic to V4, benchmark four things: context-length regime, prefix reuse, cache policy, and endpoint profile.
For long-context agents, measure cache hit rate, decode throughput, and cost per completed task. Time-to-first-token captures only part of the picture.
For short chat, compare latency at your real context lengths and batch sizes. V4's long-context gains may not appear in short-chat latency first.
For shared-prefix workloads, test SWA full-store against recompute-on-hit. Prefix length, cache-tier latency, and reuse frequency determine the answer.
For RL rollouts, calculate cost by trajectory length and number of rollouts per experiment, not by token price alone.
For mixed traffic, expect tradeoffs. One endpoint can serve mixed workloads, but a profile-specific endpoint will usually perform better once the workload shape is clear.
Quality still has to be measured. Longer context creates more room for useful state, retrieval noise, compression artifacts, and latency. It also changes compaction strategy: builders get more control over when to preserve raw state, summarize, or reset.
Conclusion
DeepSeek-V4's efficiency is a system property. The architecture reduces KV pressure by compressing along the token axis, but the serving engine has to manage the cache types, prefix policies, kernel paths, and endpoint profiles that follow from that choice.
This is also where full-stack co-design matters. The model changes the cache layout. The inference engine changes memory management and prefix policy. The kernels adapt to new attention and precision paths. The NVIDIA Blackwell platform determines how much of that work turns into realized throughput, concurrency, and cost-per-token gains.
Running V4 is the starting point. Turning its architectural savings into lower latency, higher concurrency, and cheaper long-context workloads requires cache-policy work, kernel work, and workload-specific serving profiles. The next step is measurement: per-token KV footprint, context-length throughput curves, prefix-cache policy impact, and endpoint profiles for different traffic shapes. We'll publish those numbers as the V4 kernels and cache policies mature.
FAQ
What is DeepSeek-V4's context window? DeepSeek-V4 supports a 1M-token context window. It achieves this through a hybrid attention design that compresses context before key-value (KV) storage, mixes compressed and local attention paths, and changes how prefix reuse works. The architectural change is what makes million-token context viable as a serving workload.
What is Compressed Sparse Attention (CSA) in DeepSeek-V4? CSA compresses context with stride 4, where each compressed entry summarizes an 8-token neighborhood, so adjacent entries overlap at the boundaries. Queries select roughly 128 of these compressed entries, giving the model a fine-grained sparse path into selected regions of the prefix while reducing the stored cache footprint.
What is Heavily Compressed Attention (HCA)? HCA uses the same compression mechanism as CSA but with stride 128. At a 1M-token context, this reduces the cache from 1M positions to about 8K compressed entries, which is small enough that the model attends densely over all of it. HCA provides a coarse global read, while CSA provides a fine sparse read over selected regions.
How does DeepSeek-V4 reduce KV cache size compared to earlier models? DeepSeek-V4 compresses along the token axis of KV cache. Earlier techniques reduced different terms in the cache product: Group Query Attention reduces KV heads, Multi-Head Latent Attention compresses the head dimension, and FP8/MXFP4/NVFP4 reduce bytes per element. DeepSeek-V3.2 reduced how much cache had to be read at decode while keeping the full cache resident. V4 reduces the number of stored token entries themselves.
Why does serving DeepSeek-V4 require multiple KV cache layouts? The model uses three attention paths (CSA, HCA, and Sliding Window Attention) mixed across layers. Each produces cache objects with different sizes, lifetimes, and read patterns. The inference engine has to manage all three concurrently per request, which makes memory management, eviction, and prefix reuse harder than under a single-cache design.
How does prefix caching work with DeepSeek-V4? Prefix caching becomes a per-cache-type policy decision. CSA and HCA state are compact enough to store. SWA state is exact local state and grows expensive at long prefixes. The DeepSeek paper describes three options: store full SWA, store periodic checkpoints, or recompute SWA on cache hit. Recompute-on-hit is bounded by window size times layer count, roughly 8K tokens of recompute against a 1M-token prefix.
What workloads benefit most from DeepSeek-V4? Long-context, decode-heavy workloads benefit first, including coding agents, research agents, and RL rollouts that accumulate state over long tasks. For these, the cost model shifts from price-per-token toward cost-per-completed-trajectory. Short-context chat workloads see smaller gains because they expose prefill latency and kernel maturity more than KV cache pressure.
Should I move short-chat traffic to DeepSeek-V4? Benchmark first. V4's gains show up where KV cache dominates. Short-context, prefill-heavy workloads exercise newer kernel paths (CSA top-k selection, HCA dense reads, MXFP4 MoE weights) that are still maturing. Compare latency at your real context lengths and batch sizes before switching. Long-context agents and short chats may need different endpoint profiles even on the same weights.
Why did Together pick the NVIDIA HGX B200 to serve DeepSeek V4?
NVIDIA HGX B200 lines up with the parts of DeepSeek V4 that dominate serving cost: KV-cache pressure during long-context decode and MoE weight bandwidth during prefill. Blackwell’s inference performance lets a single HGX B200 node hold V4's compressed CSA / HCA / SWA cache layouts resident across many concurrent long-context requests, and its native MXFP4 support matches the format DeepSeek ships for V4's MoE weights — so we run the model's quantization end-to-end without a re-cast step. Together's HGX B200 deployment inherits the same MXFP4 path and KV-compression headroom, which is why we picked it as the launch platform for V4.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み