Nvidia、AI モデル間引き継ぎコスト削減に成功
本文の状態
日本語全文を表示中
詳細モードで約12分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
VentureBeat AI
Nvidia の研究者は、異なる大規模言語モデル間で KV キャッシュを単純な線形計算で変換する手法を開発し、マルチモデルワークフローにおけるコストと遅延のボトルネックを解消した。
AI深層分析を開く2026年8月22日 01:46
AI深層分析
キーポイント
クロスモデル KV キャッシュ転送技術の提案
Nvidia の研究者は、ソースモデルからターゲットモデルへ KV キャッシュを直接マッピングする手法を導入し、会話履歴の再計算を不要にする。
線形数学による高速化と高精度の維持
この変換プロセスは複雑な深層学習モデルを使わず単純な線形計算で実行され、互換性のあるモデルペア間で 2.7 倍から 25 倍の速度向上を実現する。
マルチ LLM ワークフローにおけるボトルネック解消
従来の手法ではモデル切り替え時に KV キャッシュが無効化され再計算が必要だったが、新技術により長文コンテキストを持つセッションでもコストを抑えられる。
KV キャッシュ転送の双方向メリット
小型から大型への転送は出力品質を向上させ、複雑な推論問題を解決する。一方、大型から小型への転送は計算コストを削減し、会話後の迅速な処理を可能にする。
線形構造に基づく簡易マッピング手法
モデル間の KV キャッシュは本質的に線形構造であり、複雑な学習なしに単純な代数計算でマッピングできる。複数のソース層を組み合わせることで、キーとバリューの分散再現率がそれぞれ79%、65%に達する。
重要な引用
this linear mapping process runs 2.7 to 25 times faster than recomputing the conversation while retaining up to 98% of the target model's standalone accuracy
any model switch forces the receiving model to repay the entire prefill cost from scratch to recompute the KV cache for the accumulated context
The key finding of the Nvidia study is that cross-model KV cache is a significantly linear structure.
Once the heavy lifting is done, the session's KV cache is mapped down to a smaller, more economical model to handle the rapid-fire, conversational turns that follow.
編集コメントを表示
編集コメント
モデル間のキャッシュ共有を可能にする技術は、実運用におけるコスト削減の鍵となる。単純な線形計算で高い精度を維持できる点は、実装のハードルが低いことを示唆しており、今後のエージェンシー AI の普及に大きく寄与するだろう。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
エージェント型 AI システムが、小規模なモデルから大規模なモデルへタスクを引き継ぐ際(あるいはその逆の場合)、大きなコストが発生します。受け取った側は会話履歴を最初から再計算する必要があり、これにより計算リソースの消費とレイテンシが増大するのです。これは、長期にわたるマルチ LLM ワークフローを構築する企業にとって、重大なボトルネックとなっています。
この課題を解決するため、Nvidia の研究チームは「クロスモデル KV キャッシュ転送」技術を導入しました。これは、ソースモデルから事前計算済みの KV キャッシュをターゲットモデルへ直接マッピングする手法です。本技術は、多数のターンにわたって大規模なコンテキストが蓄積する、現実的なエージェント型アプリケーションの実態に即したものです。
実世界の AI アプリケーションにおいて、クロスモデル KV キャッシュ転送を用いれば、長期稼働するマルチ LLM ワークフローにおける計算コストとレイテンシを削減できます。しかも、高価な深層学習モデルを使うのではなく、単純な線形演算で実現可能です。
実験結果によると、互換性のあるモデルペア間では、この線形マッピングプロセスは会話の再計算に比べて 2.7 倍から 25 倍高速でありながら、ターゲットモデル単独での精度を最大 98% 維持できることが示されました。
なぜセッション中にモデルを切り替えるのが高コストなのか
LLM がどのようにメモリを処理するかを検証すれば、マルチモデルワークフローが実環境で性能の壁にぶつかる理由が理解できます。LLM がプロンプトを受け取ると、まず「プリフィル」ステージを実行する必要があります。これは入力トークンすべてのキーとバリューを計算し、Key-Value (KV) キャッシュを初期化するための最初の順方向パスです。
その後、モデルは「デコード」フェーズに入り、シーケンス内の次のトークンを計算して生成します。このフェーズでは、モデルはこの KV キャッシュから読み取り、新しいトークンを一つずつ予測します。これにより、各新しいトークンに対して会話の履歴全体を再評価する必要がなくなります。
多段階の対話や長期にわたるエージェントセッションでは、コンテキストは徐々に長くなっていきます。プリフェルフェーズの計算コストはモデルサイズと入力長の両方に比例して増大するため、これらの長いセッションを処理する費用は高騰し、KV キャッシュが無効化されると著しいレイテンシが発生します。
この無効化は、AI システムがセッション中にモデルを切り替えようとするたびに発生します。例えば、複雑な推論ステップをより大きなモデルにルーティングしたり、コスト削減のために小さなモデルに切り替えたりするケースです。異なる LLM はそれぞれ異なるアーキテクチャを持っているため、キャッシュの入力形式も異なります。
その結果、どのモデルを切り替えたとしても、受け取る側のモデルは蓄積されたコンテキストのための KV キャッシュを再計算するために、プリフェルコストをゼロから全額支払わなければなりません。
最初からやり直さずにモデル間でメモリをマッピングする
Nvidia の研究者たちは、クロスモデルの KV キャッシュ転送について調査しました。これは、開発者がプリフェルフェーズを再度実行することなく、あるモデルの KV キャッシュを別のモデルが期待する形式に変換する方法を探るものです。
クロスモデルの KV キャッシュ転送が実現されれば、双方向にメリットがあります。小規模から大規模へのモデル転送は出力品質を向上させます。例えば、安価な小規模モデルでエージェントワークフローの日常的な部分を処理し、複雑な推論問題に直面した際に KV キャッシュを大規模モデルへマッピングしてプロセスをシームレスに継続できます。
一方、大規模から小規模への転送は計算コストを削減します。セッション開始時に、高度な能力を持つ大規模モデルで膨大な複雑なシステムプロンプトを展開したり、密度の高い PDF を生成したりする場合があります。重い処理が完了したら、セッションの KV キャッシュをより小さく経済的なモデルへマッピングし、その後の連続的な対話ターンを高速で処理させます。
KV キャッシュ転送の問題に取り組む試みは過去にもありましたが、いくつかの重要な制約に直面していました。これには、高価な勾配ベースの学習が必要であったり、非常に厳しいアーキテクチャ上の制約があったりすることが含まれます。
今回の初期研究では、著者らは「ファミリー内」の転送に焦点を絞りました。具体的には、Qwen、Llama、Ministral の各ファミリ内で、異なるサイズのモデル間を移行するケースです。これらのモデルはトークナイザーやトレーニングデータの DNA、そしてコアとなるアーキテクチャのスタイルを共有していますが、サイズと深さが異なります。ただし、この枠組みには将来の実験に向けた余地が十分に残されています。研究チームは、将来的にこの手法を「ファミリー間」の転送や、KV ヘッド数の不一致への対応、あるいは標準的なアテンションと他のメモリ機構を組み合わせたハイブリッドアーキテクチャへの拡張も可能だと指摘しています。
Nvidia の研究における重要な発見は、モデル間の KV キャッシュが本質的に線形構造をしているという点です。つまり、重厚なニューラルネットワークの学習を必要とせず、単純な代数のトリックでマッピングが可能だということです。例えば、140 億パラメータの Qwen3 モデルから 320 億パラメータ版への KV キャッシュ転送を実験した際、あるソース層からターゲット層への単純な線形回帰マッピングを用いると、ターゲットのキーにおける分散の 56%、バリューにおける分散の 32% を再現できることが分かりました。複数のソース層を組み合わせると、これらの数値はそれぞれ 79% と 65% に向上します。
この線形関係を実用的なシステムに落とし込むため、研究チームは 3 つの主要コンポーネントを持つ閉形式のヘッド別リッジマッパーを設計しました。
ヘッドごとのリッジ回帰:複雑な深層学習でシステムを訓練するのではなく、数百のテキストシーケンスからなる小さな較正セットを用いて単純な線形回帰を適用します。この手法は、各アテンションヘッドごとに独立して「最良の直線近似」の問題を解決します。
クロスレイヤーソース選択:ソースモデルとターゲットモデルでは層数が異なるため、マッパーは予測性の高いソース層を評価・選別し、特定のターゲット層に供給します。これにより、システムは古いモデルから最も有益な記憶断片のみを選択して、新しいモデルの記憶を構築します。
コンテンツ空間マッピング:データを翻訳する前に、マッパーは RoPE 符号化を除去します。RoPE(回転位置埋め込み)は、シーケンス内のトークンの順序を理解させるためにデータに数学的な位置依存回転を適用する標準的なメカニズムです。RoPE の値を除去することで、マッパーが訓練データを超える長さのシーケンスにも一般化できるようになります。
線形マッパーの実験評価
この手法の有効性を検証するため、研究者たちは 6 つの「マッチド KV」モデルファミリー全体で転送パイプラインを評価しました。マッチド KV とは、ソースモデルとターゲットモデルが同じ KV ヘッド数とヘッドごとの次元数を共有していることを意味し、これは同一ファミリー内の異なるサイズのモデルでは一般的な構成です。
対象となったモデルファミリーには Qwen3、Llama 3.1、Ministral 3 が含まれており、30 億パラメータから 700 億パラメータまでの異なるサイズ間での KV キャッシュ転送テストが行われました。実験では特に、Llama 3.1 の 8B から 70B へとパラメータ数が約 8.8 倍に跳ね上がる大規模なケースも含まれています。
多様なタスクを網羅するため、研究チームは ARC-Challenge、HellaSwag、WinoGrande、MMLU、GSM8K の 5 つの主要な精度ベンチマークに加え、WikiText-2 における言語モデルのパラメータ(perplexity)評価、そして多段階対話タスクである CoQA を用いてモデルを検証しました。線形変換マッパーを適合させるため、1,024 トークンからなるテキストシーケンスが 500 個だけ収録された極めて小さなキャリブレーションデータセットを用意しています。
研究者たちは、このフレームワークを「ターゲットモデルが従来のフルプリフィル処理を行う場合の精度上限」と比較しました。さらに、選択するレイヤー数を減らす、あるいは異なるコンポーネントを無効化するといった、構成要素を削ったアブレーション実験の結果とも対比しています。加えて、線形手法が苦手とするペアにおいて、より重厚な深層学習(バックプロパゲーションで訓練されたニューラルネットワーク)を用いることで精度回復が可能かどうかも検証しました。
テストされた 6 つの組み合わせのうち 4 つでは、高速な閉形式の線形リッジマッパーが、ターゲットモデル単独でのプリフィル処理に対する精度を 73% から 98% の範囲で維持することに成功しました。これは Llama 3.1 の 8B から 70B への巨大なジャンプを含んだケースでも同様で、その場合でもターゲットの精度の 72.8% を保持しています。
マッパーは、再事前充填と比較して 2.7 倍から 25 倍高速に動作します。例えば、Qwen3 14B の 32,768 トークンの KV キャッシュを 32B モデルへ変換する際、転送にはわずか 278 ミリ秒しかかかりませんでした。一方、標準的な再事前充填では約 7 秒を要しています。
また、このシステムは多段階にわたるタスクにおいても高い安定性を示しました。複数回の対話テストでは、ターゲットの基準値と転送されたキャッシュとの間のドリフト(精度低下)が 10 ターンにわたり極めて小さく抑えられ、長時間の自律的なセッションでも失敗が連鎖するリスクがないことが証明されました。
ただし、単純な線形アプローチには特定のモデルペアにおいて限界もありました。Ministral の構成 2 つでは、単純な線形近似が較正データ外への外挿に失敗したため、マッパーの性能が急激に低下しました。これを解決するため、研究者らは線形マッパーを非線形の多層パーセプトロン(MLP)に置き換えました。これは同じデータで訓練された 1,024 ユニットの隠れ層を 2 つ持つネットワークです。この変更により設定の複雑さと学習コストは増えましたが、精度は 90% を超えるレベルまで回復しました。
一つの論文が解決できる以上の、業界全体の課題
クロスモデル転送の導入は、エンタープライズ AI のスケーリングにおける主要な障壁の一つとして浮上した「KV キャッシュのボトルネック」を解決するための、業界全体による広範な取り組みの一環です。開発者が大規模なドキュメントやコードベースの処理、長時間実行される推論タスクの実行のために LLM を活用するにつれ、このメモリ層の管理はモデルそのものと同様に重要になっています。
過去 1 年間、研究者たちは計算リソースとメモリの課題に対し、多角的にアプローチしてきました。例えば、Nvidia は最近、重要なトークン以外を KV キャッシュから賢く削除し、推論コストを最大 8 倍削減する技術「動的メモリスパース化(DMS)」を発表しました。
他の手法では、データ圧縮に注力しています。MIT の研究者たちは、品質を劣化させることなく KV キャッシュを 50 倍に圧縮できる代数圧縮技法「Attention Matching」を開発しました。同様に、Nvidia は「KV Cache Transform Coding(KVTC)」を導入し、メディア圧縮の概念を応用してモデルの重みを変更せずにメモリ使用量を 20 倍削減しています。
圧縮以外にも、メモリの検索に伴う計算オーバーヘッドの削減に取り組む動きもあります。IndexCache などの最適化手法は冗長な層計算を排除し、コンテキストが長いアプリケーションにおける最初のトークン生成までの時間を大幅に短縮します。また、DeepSeek や GLM シリーズといったモデルも、アーキテクチャの革新を通じて KV キャッシュの最適化を進めています。
AI システムがより長期のタスクや複雑なアーキテクチャを担うようになると、モデルそのものと同様に、背後にあるメモリインフラストラクチャの重要性も高まっています。クロスモデル KV キャッシュ転送は、マルチモデル・エージェントシステムをスケールさせる際にも推論コストを抑えるための新たな手段として開発者に提供されます。
原文を表示
When an agentic AI system hands a task from a small model to a larger one — or back down again — it pays a steep tax: the receiving model has to recompute the entire conversation from scratch, driving up compute costs and latency. This is a major bottleneck for enterprises building long-horizon, multi-LLM workflows.
To solve this challenge, researchers at Nvidia have introduced a cross-model KV cache transfer technique that directly maps the prefilled KV cache from a source model into the target model. This technique aligns with real-world agentic applications where large contexts accumulate across many turns.
For real-world AI applications, cross-model KV cache transfer can reduce compute costs and latency on long-running, multi-LLM workflows — and it does so with simple linear math, not an expensive deep learning model.
Experiments show that, on compatible model pairs, this linear mapping process runs 2.7 to 25 times faster than recomputing the conversation while retaining up to 98% of the target model's standalone accuracy.
Why swapping models mid-session is so expensive
Examining how LLMs handle memory helps understand why multi-model workflows hit a performance wall in production. When an LLM receives a prompt, it must first execute the “prefill” stage, which is the initial forward pass that computes the keys and values for all input tokens and populates the Key-Value (KV) cache.
After that, it enters the “decode” phase, where it computes and generates the next tokens in the sequence. During this phase, the model reads from this KV cache to predict new tokens one by one, bypassing the need to re-evaluate the entire history of the conversation for each new token.
In multi-turn conversations or long-horizon agentic sessions, the context gradually becomes longer. Because the computational cost of the prefill stage scales directly with both model size and input length, processing these long sessions becomes increasingly expensive and introduces significant latency if the KV cache is invalidated.
This invalidation happens whenever the AI system tries to swap models mid-session, such as routing a complex reasoning step to a larger model or dropping to a smaller model to save costs. Because different LLMs have different architectures, they expect their cache inputs in different formats.
As a result, any model switch forces the receiving model to repay the entire prefill cost from scratch to recompute the KV cache for the accumulated context.
Mapping memory between models without starting over
The Nvidia researchers studied cross-model KV cache transfer to see how developers can transform the KV cache of one model into the expected format of another without running the prefill phase again.
If solved, cross-model KV cache transfer has benefits in both directions. Small-to-large model transfer upgrades the quality of the output. For example, a cheap, small model handles the routine parts of an agentic workflow but struggles with a complex reasoning problem, and you map the KV cache to a larger model and continue the process seamlessly.
On the other hand, large-to-small model transfer reduces compute costs. A highly capable, large model might be used to unpack a massive, complex system prompt or synthesize a dense PDF at the start of a session. Once the heavy lifting is done, the session's KV cache is mapped down to a smaller, more economical model to handle the rapid-fire, conversational turns that follow.
There have been previous efforts to solve the KV cache transfer problem, but they suffer from a few key limitations. These include the need for expensive gradient-based training or very strict architectural constraints.
For this initial study, the authors restricted their focus to within-family transfers, such as transitioning between different-sized models in the Qwen, Llama, or Ministral families. These models share tokenizers, training data DNA, and core architectural styles but differ in size and depth. However, this framework leaves plenty of room for future experiments. The researchers note the technique could eventually be expanded to cross-family transfers, mismatched KV head counts, or hybrid architectures that blend standard attention with other memory mechanisms.
The key finding of the Nvidia study is that cross-model KV cache is a significantly linear structure. This means you can do the mapping with simple algebra tricks and without the need for heavy neural network training. For example, when experimenting on KV cache transfer from a 14-billion parameter Qwen3 model to a 32-billion parameter version, the authors discovered that a simple linear regression mapping from one source layer to a target layer can recover 56% of the variance in the target’s keys and 32% of the variance in its values. When combining multiple source layers, those numbers climbed to 79% and 65% respectively.
To translate this linear relationship into a practical system, the researchers designed a closed-form per-head ridge mapper with three key components:
Per-head ridge regression: Instead of using complex deep learning to train the system, they fit a simple linear regression using a tiny calibration set of a few hundred text sequences. This technique solves a classic line-of-best-fit problem independently for every attention head.
Cross-layer source selection: Because the source and target models have different numbers of layers, the mapper evaluates and selects the most predictive source layers to feed into each specific target layer. This way, the system picks only the most helpful pieces of memory from the old model to construct the new model's memory.
Content-space mapping: Before translating the data, the mapper strips away the RoPE encodings. RoPE, or Rotary Position Embedding, is a standard mechanism that applies a mathematical, position-dependent rotation to the data so the model understands the order of the tokens in a sequence. Stripping the RoPE values makes it possible for the mapper to generalize to sequences of lengths larger than its training data.
Putting the linear mapper to the test
To test whether the technique works, the researchers evaluated the transfer pipeline across six “matched-KV” model families. Matched-KV means the source and target models share the same KV head count and per-head dimensions, which is typical for different-sized models within the same family.
The model families included Qwen3, Llama 3.1, and Ministral 3, with tests for KV cache transfer across different sizes ranging from 3 billion to 70 billion parameters. Their experiments included a massive 8.8x parameter leap from Llama 3.1 8B to 70B.
To cover a wide range of tasks, they evaluated the models on five core accuracy benchmarks (ARC-Challenge, HellaSwag, WinoGrande, MMLU, and GSM8K) as well as language modeling perplexity on WikiText-2 and a multi-turn conversation task called CoQA. To fit the linear translation mapper, they used a tiny calibration dataset of just 500 text sequences of 1,024 tokens each.
The researchers compared the framework against the baseline ceiling accuracy where the target model does a full, traditional prefill. They also compared their full system against ablated configurations, such as reducing the number of selected layers or deactivating different components. Additionally, they compared their simple method against a deep neural network trained with backpropagation to see if heavier deep learning could recover accuracy on pairs where the linear method struggled.
For four of the six tested pairs, the fast, closed-form linear ridge mapper retained 73% to 98% of the target's standalone prefill accuracy — including the massive leap from Llama 3.1 8B to 70B, which retained 72.8% of target accuracy.
The mapper also runs between 2.7 and 25 times faster than re-prefilling. For example, when translating a 32,768-token KV cache from a Qwen3 14B to a 32B model, the transfer took just 278 milliseconds, compared to nearly 7 seconds for a standard re-prefill.
The system also demonstrated high stability on tasks that run across many steps. When tested on multi-turn conversations, the drift, or accuracy loss, between the target baseline and the transferred cache remained incredibly small across 10 turns, proving it will not cascade into failure during long agentic sessions.
However, the straightforward linear approach did run into limitations on specific model pairs. For two of the Ministral configurations, the linear mapper degraded sharply because the simple linear fit failed to extrapolate outside calibration data. To fix this, the researchers swapped the linear mapper for a nonlinear multi-layer perceptron (MLP) with two 1,024-unit hidden layers trained on the same data. This added a complexity and training tax to the setup, but it recovered their accuracy to above 90%.
A bigger industry problem than one paper can solve
The introduction of cross-model transfer is part of a broader, industry-wide push to solve the KV cache bottleneck, which has emerged as one of the key hurdles for scaling enterprise AI. As developers push LLMs to process massive documents or code bases and execute long-running reasoning tasks, managing this memory layer is becoming as important as the models themselves.
Over the past year, researchers have attacked this compute and memory problem from multiple angles. For instance, Nvidia recently introduced dynamic memory sparsification (DMS), a technique that intelligently evicts less important tokens from the KV cache to cut reasoning costs by up to 8x.
Other approaches focus on aggressive data compression. MIT researchers developed an algebraic compaction technique called Attention Matching that compresses the KV cache by 50x without degrading quality. Similarly, Nvidia introduced KV Cache Transform Coding (KVTC), which borrows media compression concepts to shrink memory by 20x without altering the underlying model weights.
Beyond compression, researchers are also attacking the computational overhead of memory retrieval. Optimizers like IndexCache strip away redundant layer calculations to deliver significantly faster time-to-first-token in long-context applications. And models like DeepSeek and the GLM series are optimizing the KV cache through architecture innovations.
As AI systems take on longer-horizon tasks and more complex architectures, the underlying memory infrastructure is becoming as important as the models themselves. Cross-model KV cache transfer gives developers one more tool for keeping inference costs down as they scale multi-model agentic systems.
関連記事
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み