Baseten のキリーとターハ、推論工学マスタークラスを公開
本文の状態
日本語全文を表示中
詳細モードで約21分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Latent Space
Baseten の Philip Kiely と Ali Taha が、推論エンジニアリングが単なるトレーニング後の工程から独立した重要な分野へと進化し、最適化技術による劇的な速度向上が可能になったと解説する。
AI深層分析を開く2026年8月4日 07:21
AI深層分析
キーポイント
推論エンジニアリングの地位向上
3 年前には存在しなかったカテゴリが現在では AI の最も重要な分野の一つとなり、トレーニング後の重みを高速で信頼性のある製品に変換する独自の最適化問題として確立された。
具体的な技術的突破事例
GLM-5.2 の実験において、モデルの量子化を強化してもベンチマーク品質が維持されつつスループットが 20%向上する現象が確認され、層ごとの誤差が相殺されるメカニズムが示された。
Baseten の資金調達と市場地位
Baseten は 130 億ドル規模の資金調達を完了し、Nvidia や Intel と並ぶ推論インフラの主要恩恵を受ける AI インフラ企業として成長した。
高度な最適化技術の詳細
キャッシュ対応ルーティング、分離型プリフィルとデコード、量子化、スペキュラティブ・ディコーディング、KV キャッシュ移動などの技術が、最前線モデルを最大 10 倍高速化する競争の中心にある。
推論最適化による劇的な速度向上
キャッシュ対応ルーティングやディスアグリゲートされたプリフィル/デコードなどの手法により、同様の重みでもクラスター間で異なる挙動を示す場合があり、最適化で20%から200%の性能差を生む。
重要な引用
Three years ago, inference engineering barely existed as a category.
Inference is no longer just the final step after training. It is becoming its own engineering discipline
How do you turn those weights from training into a product that is fast, reliable, and affordable at scale?
local AI is about making models less dumb while data-center AI is about making them less slow
編集コメントを表示
編集コメント
推論エンジニアリングが独立した分野として確立された背景には、大規模モデルの実用化におけるコストと速度の両立という切実な課題がある。Baseten の事例は、理論的な最適化技術が実際の生産環境で劇的な効果を生む可能性を示す重要な指標と言える。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
昨年は DeepSeek への熱狂が頂点にあった頃、私たちは Baseten を初めて取り上げました。しかし今や同社は驚異的な 130 億ドルの資金調達を果たし、Nvidia や Intel、半導体業界全体と共に「推論(インファレンス)の転換点」における最大の受益者として、新たな AI インフラ・デカコーンの一員となりました。
2026 年版のオープンウェイト議論が最も白熱している今、再び Baseten に焦点を当てます。Ali は Kimi K3 の viral な解説記事を公開しています:
そして、Philip も AI Engineer で登壇し、サンフランシスコの至る所で話題となっている推論エンジニアリングに関する決定版書籍を執筆しました。

3 年前、推論エンジニアリングというカテゴリはほとんど存在していませんでした。
しかし今日では、それは AI 分野において最も重要な専門領域の一つとなっています。推論エンジニアリングが取り組むのは、標準的なモデル学習とは異なる問いです。「トレーニングで得た重みを、どのようにして高速かつ信頼性が高く、大規模展開でも低コストなプロダクトに変えるか?」この課題に焦点を当てることは、全く新しい最適化問題を生み出します。
最近の GLM-5.2 実験では、モデルのより多くの部分を量子化してもベンチマーク性能が維持され、スループットは 20% 向上しました。これは異なる層で生じる誤差がお互いに相殺されたためです。
推論(Inference)はもはやトレーニング後の単なる最終工程ではありません。独自の研究課題やインフラ、そして高度に専門化された役割を伴う、独立したエンジニアリング分野へと進化しています。
今回のエピソードでは、Baseten の Philip Kiely 氏と Ali Taha 氏が swyx 氏と Vibhu 氏に登場し、新しいオープンモデルがリリースされた後に実際に何が起こるのか、そして「トークンを生成した」という状態を、高速で信頼性の高い本番環境向け API にどう変えるのかについて解説します。
キャッシュを意識したルーティングや、プリフィル(初期処理)とデコードの分離、量子化、スペキュレーティブ・ディコーディング、KV キャッシュの移動、モデル並列化、GPU カーネルなどについて深く掘り下げます。さらに、最先端モデルを最大 10 倍高速化する競争についても取り上げます。Philip 氏と Ali 氏は、なぜ推論最適化でも 20%、100%、さらには 200% の性能向上が可能なのか、量子化エラーが互いに相殺し合う理由、同じ重みでもクラスター間で挙動が異なるケース、そして Baseten が基盤となる言語モデルを変更せずに GLM-5.2 に Kimi のビジョンエンコーダーを統合した手法などについて語ります。
会話の焦点は LLM だけでなく、NVIDIA Dynamo やメガカーネル、Rubin、AI 専用チップ、ローカル推論、動画生成、拡散モデルと自己回帰モデルの違い、そして一貫性のある長尺動画を生成するための膨大な計算リソースの壁へと広がります。最後に、トレーニングと推論の融合、永続的な KV キャッシュを通じた継続的学習、そしてモデル自身が自分たちを動かすインフラを最適化する新しいループの登場についても探求します。
今回の議論のポイント:
- 20 万トークンという巨大なリクエストが推論システムに入力された際に何が起こるか
- キャッシュを意識したルーティングと、以前計算済みの KV キャッシュの再利用
- なぜプリフィルとデコードを異なる GPU で処理するケースが増えているのか
専用デプロイが共有 API よりも安価で信頼性が高くなる時代
推測的デコーディングは、小さなモデルを使って大きなモデルを加速させる
ツール呼び出し、構造化出力、そして LLM が実際に何をしているか
新しいオープンモデルを Day Zero にサポートするために必要なこと
Kimi のビジョンエンコーダーを GLM-5.2 に移植する
非効率なモデル層に他アーキテクチャのコンポーネントを組み込む
なぜモデルが同じトークンの繰り返しに陥ることがあるのか
ハードウェア、カーネル、競合条件がどのようにして非決定性の障害を引き起こすか
推論を高速化しながらモデルの忠実性を保つ方法
量子化誤差が互いに相殺し合う仕組み
なぜ推論最適化でも 20%、100%、200% の性能向上が得られるのか
最適化されたサービングでモデルを最大 10 倍高速化する手法
NVIDIA Dynamo、KV 対応ルーティング、分散モデルサービング
推測的デコーダーの推測的デコーディング
ローカル AI が「モデルを賢くする」ことである一方、データセンター AI は「モデルを速くする」ことである理由
GPU を跨ぐテンソル並列、エキスパート並列、パイプライン並列
ハードウェアを意識したモデル設計、自動チューニング、そして巨大カーネルへの異議
Rubin となぜ推論がシステムレベルの課題へと進化しているのか
現代の GPU がプログラマブルな AI ASIC へ進化しているか
Kimi K3 のような超大型モデルに GB300 クラスのハードウェアが必要とされる理由
オープンソースの動画生成が Veo、Kling、および他のクローズドモデルに遅れをとる理由
長尺 AI 動画を支える二次関数的なアテンションボトルネック
自己回帰型動画、リアルタイム生成、そして蓄積する品質のドリフト
将来の動画システムがなぜ自己回帰型と拡散型のアーキテクチャを組み合わせる可能性があるのか
推論のためのトレーニング、そしてトレーニングのための推論
継続的なポストトレーニング、デプロイメント、評価、改善のループ
GLM-5.2 が GLM-5.2 自身を提供するカーネルを最適化する方法
より高速なネットワークがなぜ劇的に速いデコーディングを可能にするのか
継続学習、KV キャッシュの圧縮、そして永続的なモデルメモリ
Show Notes
Kimi K3 のための Day-0 API を構築する方法
22580: GPT2 から Kimi3 まで、解説
Philip Kiely
LinkedIn: https://www.linkedin.com/in/philipkiely
X: https://x.com/philipkiely
Inference Engineering: https://www.baseten.co/inference-engineering/
Ali Taha
LinkedIn: https://www.linkedin.com/in/aliestaha/
X: https://x.com/waterloointern
タイムスタンプ
00:00:00 導入と 20 万トークンのプロンプト
00:03:18 専用デプロイメント、推測的デコーディング、ツール呼び出し
00:11:26 本番環境対応のオープンモデルの公開
00:19:06 モデルのリトロフィット、故障モード、非決定性
00:28:22 量子化と誤差のキャンセル
00:32:15 推論を 10 倍高速化する競争
00:40:48 Dynamo、推測、そしてローカル AI とデータセンター AI
00:50:18 モデル並列処理、自動チューニング、メガカーネル
01:00:55 Rubin、GPU vs ASIC、カスタム AI チップ
01:10:03 巨大モデルと GPU メモリの限界
01:12:42 AI 動画、二次的アテンション、自己回帰生成
01:21:47 オーディオ、画像、拡散モデル
01:27:32 学習、自己最適化モデル、継続的学習
01:40:06 クロージングの言葉
トランスクリプト
イントロダクション:Baseten、Waterlooインターンシップ、推論エンジニアリング
Swyx [00:00:00]: さて、スタジオでは『推論エンジニアリング』という書籍や Baseten での活動などでおなじみの Philip と、そして Ali を迎えています。ようこそ。
Ali [00:00:15]: こちらこそお会いできて光栄です。
Swyx [00:00:15]: Waterloo のインターン生ですね。
Ali [00:00:16]: はい、Waterloo のインターン生として、ずっとそう呼ばれていますよ。
Swyx [00:00:17]: 「Waterloo intern」というハンドルネームをいつつけたんですか?
Ali [00:00:19]: ハンドルネームですか?あー、そうでしたか。
Ali [00:00:20]: 改名したのは 3 月中旬だったと思います。オープンになったのを見て、「これは取っておくしかないな」と思いました。「誰でも使える状態」だったので。
Philip [00:00:26]: 問題は、Ali が仕事ができるので、インターン生として長くいられないということです。
Philip [00:00:30]: だから、誰がそのハンドルネームを引き継ぐかを決めなければなりません。
Ali [00:00:33]: では、次のインターン生にバトンタッチしますよ。
Swyx [00:00:34]: ああ、そう。別の Waterloo 卒業生に渡せばいいんですね。
Ali [00:00:37]: 他の Waterloo のインターン生にね。いや、待てよ。
Philip [00:00:39]: そうだろ?
Ali [00:00:39]: インターン生だぞ。
Swyx [00:00:40]: インターン生、そうだね。
Ali [00:00:40]: 違うよ。
Philip [00:00:41]: Waterloo のインターン生から選ばなきゃ。
Ali [00:00:42]: そう、Waterloo のインターン生から選ぶ必要があるんだ。
Swyx [00:00:44]: なるほど。
Ali [00:00:44]: ただし、その道筋をたどる必要があります。
Swyx [00:00:45]: なるほど、そうかもしれませんね。ただ、それは Baseten のほうから来る可能性もあります。つまり、Waterloo から Baseten にやってきた人たちのことですから。
Ali [00:00:48]: その通りです。
Swyx [00:00:49]: Waterloo という肩書きを持っているわけですね。
Ali [00:00:50]: 彼らはエコシステム内に留まりますから。
Philip [00:00:51]: その通りです。
Ali [00:00:52]: インターンシップの半ばで、理解できなければ即座に脱落します。
Philip [00:00:55]: あるいは、ハンドルネームを変更する卒業式のような大きなイベントを設けるべきかもしれませんね。
Ali [00:00:59]: 単にそう言えばいいんです。
Philip [00:00:59]: みんなのために。
Swyx [00:01:00]: お二人とも、式典にはお詳しいようですね。先ほど本を発売した際も、とても成功しました。しかし、その話に入る前に、一つ楽しい質問をさせてください。お二人は推論エンジニアの専門家です。もし私が Baseten の推論サービスに 20 万トークンという長いクエリを送ったら、どのようなプロセスを経るのでしょうか?GPU を介したモデルのルーティングや負荷分散など、私たちが普段意識しない部分のプロセスについて詳しく教えてください。
Long Context Requests, KV Cache, and Cache-Aware Routing
Philip: 長いクエリを扱う場合、まず私が尋ねるのは「このクエリ、あるいはその一部は以前に送信したことがありますか?」です。ぜひ回答していただきたいのは、それがあれば私の処理が格段に楽になり、あなたにとってもコスト削減につながるからです。
そこで注目するのがキャッシュ対応型ルーティングです。現在、モデルを処理しているインスタンスやレプリカが複数稼働していると想定します。このクエリは、第一にプレフィルワーカーの空き状況があり、第二に理想的には既にキャッシュされた入力データがあるノードへ送るべきです。そうすれば、20 万トークンという大量の入力においても、少なくとも一部についてはプレフィル処理をスキップできます。
もし 20 万トークンもの入力を扱う必要がある場合、それはコーディング支援や多段階のエージェント処理など、キャッシュが期待されるユースケースである可能性が高いです。もしキャッシュが存在しない場合は、プレフィルワーカーへ送らざるを得ません。
特定のモデルでは、プレフィルとデコードを分離したアーキテクチャを採用しています。つまり、入力処理と KV キャッシュの作成、そして最初のトークン生成を担当する GPU セットと、その後のデコード処理を担当する別の GPU セットが独立して存在します。生成されたトークンは逐次的に作られていきます。
さらにその前にスペキュレーターモデルを配置することも想定しています。今回はコーディング作業を想定しているため、コーディングを前提としたスペキュレーターモデルを採用すれば、ドラフトトークンの採用率が高くなるはずです。
もし私が間違っていて、あなたがハリー・ポッター全巻の要約を求めているなら、処理はもっと時間がかかります。その出力をストリームしてあなたに提供し、請求もします。数セントで、「もう一つ送りますか?」と尋ねる形です。
Swyx [00:03:04]: でも Baseten は数セントで請求するわけではありませんよ。
Philip [00:03:07]: はい、もちろん請求はします。ここでは公開モデル API について話している前提ですが、専用デプロイメントを構築する場合は、数セントでは済みません。
Public APIs vs. Dedicated Deployments(公開 API と専用デプロイメント)
Swyx [00:03:18]: はい、Baseten に最初に話を聞いた際の一つの大きな違いは、非常に大量の処理を必要とする人々は「ボックス単位」でレンタルする必要があるという点です。そうすれば、そのボックスをいかにして最大限に活用するかは利用者の判断になります。
Ali [00:03:31]: 実際、時間あたりに数百万トークンを処理するような場合、トークン数ごとの課金ではなく、時間あたりの課金にしたほうが圧倒的に安くなるケースがほとんどです。
Philip [00:03:37]: その通りです。私たちは、誰もがオープンモデルを試したがるため、トークン数ごとの API 需要が増えていると感じています。そして、実際に使い倒せるユースケースが見つかったら、専用デプロイメントに移行するのが一般的です。
Swyx [00:03:51]: 移行のタイミングにはベストプラクティスがあるのでしょうか?
Philip [00:03:54]: はい、いくつか理由があります。まず信頼性です。これが大きな要因の一つです。
Ali:例えば、特定のユースケースに特化した顧客がいます。彼らは自分たちのためにモデルを訓練してほしいと要望します。具体的には、自社のトラフィックに最適化された独自の「スペキュレティブ・デコーディング(Speculative Decoding)」モデルを求めているのです。
Swyx:スペキュレティブ・デコーディングとは何か説明してください。
Ali:はい、スペキュレティブ・デコーディングのことです。これは、非常に大きなモデルを対象とした技術です。通常のモデルでは、1 回の推論(フォワードパス)で 1 トークンずつ生成していくため、処理に時間がかかります。そこで、モデルの上部に小さな「寄生」のような層を追加します。この層は高速な自己回帰的なフォワードパスを数回実行し、次に出現するいくつかのトークンを予測します。
その後、元の大きなモデルで 1 回の推論を実行して、その予測が正しいか確認します。正しければ受け入れ、間違っていれば棄却します。このドラフトモデルはトラフィックに特化しているため、例えば「ハリー・ポッター」の要約を専門に行う場合、そのドメイン専用のドラフトモデルを訓練すれば、毎回 3 トークンの予測が正確に一致するよう保証できます。これにより、デコーディング速度を大幅に向上させることが可能です。
Swyx:なるほど。
Ali:ただし、これは共有エンドポイントでは提供できません。
アリ:「なぜなら、ユーザーがハリー・ポッターを読んでいるのか、コーディングをしているのか、英語の学習をしているのか、私たちが知る由もないからです。また、書籍にも特定の閾値にこだわった場合の話(おそらく第4章)が出ていたはずです。覚えていますか?」
フィリップ:「はい。具体的には、スループットとレイテンシのどちらを最適化したいかに応じて、バッチサイズや並列処理戦略を設定できます。例えば、NVFP4 量子化がベンチマーク基準を満たさない場合でも、より高い精度でモデルを実行することは可能です。独自エンドポイントを持つべき理由は山ほどありますが、最も大きな理由は、他者がエンドポイントで数億トークンのベンチマークトラフィックを処理している最中に、自社のユーザーへの提供を試みる必要がないことです。」
スワイ:「なるほど。これは典型的な旅路ですね。例えば、『ブラウザに Google と入力するとどうなるのか』という問いや、ツール呼び出しについてです。単に JSON を生成しているだけなのか、それともさらに複雑な要素があるのでしょうか?」
ツール呼び出し、JSON、構造化出力
ある顧客は、独自のポストトレーニング済みモデルを保有しており、単なるファイルの解析や天気情報の取得といった汎用的なツール呼び出しではなく、非常に特定の要件に応じたツール呼び出しを求めています。これにはモデルに対するポストトレーニングが不可欠です。
もしそのポストトレーニングが不十分だったり、推論速度を上げるための量子化処理が適切に行われなかったりすると、モデルは JSON ファイルの読み込みやツール呼び出しに苦戦します。ただし、これは独自のサンドボックス環境を必要とするわけではありません。つまり、ツール呼び出しを使ってサンドボックスから脱出しようとするような危険な挙動をするわけでもなく、必ずしも隔離された環境である必要もありません。通常の専用デプロイで問題なく動作します。
ツール呼び出しにおける最大の課題は、企業が特定のツール呼び出しを求めている点にあります。これはトレーニングにおいて非常にデリケートな要素です。JSON の出力形式が厳密に管理されていない場合、リクエストの末尾が正しく閉じられず、モデルがツール呼び出しと思考プロセスを実行したものの、その結果を受け取れずに推論を続け、デコード過程で結果を捏造してしまう(ハルシネーションする)という事態が発生します。これが、サンドボックス関連の問題ではなく、ツール呼び出しにおける最も困難な点だと言えます。
フィリップ氏:はい、トレーニング側には課題がありますが、推論(インファレンス)側では出力の範囲を制限する工夫が可能です。私たちは約 2 年前にこの問題に対する解決策を発表しました。それは状態機械(ステートマシン)を作成し、それを使って出力を特定のフォーマットに制約するというものです。これが構造化された出力の問題です。
スウィックス氏:はい、具体的な文法は、
フィリップ氏:ええ、まさにその通りです。
スウィックス氏:GML にはそのような機能がありました。
フィリップ氏:そうです。昔ながらの「これは JSON だけにする」「JSON のみを返す」あるいは「おばあちゃんが死ぬ」といったタイプのプロンプトと同じようなものです。
スウィックス氏:BNF 文法のことですか?いつか OpenAI が、出力を制約したい場合は BNF 文法を書け(NOR として)といったものをリリースしていましたね。
フィリップ氏:私たちの推論システムでは、単に指定された出力フォーマットを使用します。これにより、出力がそのフォーマットに沿って構造化されることを保証できます。これをツール呼び出しに応用すれば、エラーを減らすことができます。間違ったツールを呼んだり、ツールを呼ばなかったりする可能性は残りますが、確実性の問題を完全に解決するわけではありません。しかし少なくとも、出力の構造化という問題は解決します。
スウィックス氏:はい。
フィリップ氏:ツール呼び出しの中での話です。
スウィックス氏:そして MCP もまたツールの一種で正しいですよね。
フィリップ氏:ええ、まさにその通りです。
スウィックス氏:特別な機能があるわけではありません。
Philip [00:08:16]: 常に人に説明しているのは、LLM(大規模言語モデル)自体は何かを実行する能力を持っていないということです。LLM ができるのは「何をすべきか」の提案をするだけで、その提案が特定の形式で整形され、それらを処理できるシステムに適用されて初めてアクションが発生します。
Swyx [00:08:32]: その通りです。面白い点として、これはツール呼び出し(tool calling)の外側でも解決されています。エージェントループにおいて出力が正しくない場合や推論プロセスでツール呼び出しが行われた際に、「何をすべきか分からないからもう一度試してみよう」というように、数回トライして正解にたどり着くこともあります。また、トレーニングに関するあなたの指摘ですが、小規模モデルではこれが難しくなり、大規模モデルと同じ品質の出力が得られない場合があります。
Ali [00:08:56]: そうですね。
Swyx [00:08:57]: 単に大きなモデルから切り替えるだけではダメですよね?
Ali [00:08:59]: はい。その前に、まずは本題である推論エンジニアリング(inference engineering)の話に戻りましょう。
Ali [00:09:04]: ただ、JSON を代替する何かが出てくるだろうと予想していました。ストリーミング時に JSON は扱いにくいからです。JSON は完全なデータでなければならず、開閉の括弧などすべてが揃っている必要があります。そのため、ストリーミング中にパースや検証を行うのが困難です。そこで人々は TOML や YAML のような代替形式をいろいろ考案しましたが、現在でも JSON が支配的な地位を維持しています。
Philip [00:09:30]: JSON 形式の出力はそれほど長くないですよね。ツール呼び出しには引数も含まれるため、特定のツールでは非常に長い引数を渡すケースもありますが、私の印象では、ツール呼び出しの中央値(メディアン)は比較的小さなトークン数です。つまり、構造化された JSON に対して推測生成(speculation)は概ねうまく機能するはずです。そのため、デコードステップも比較的速く進むため、ストリーミング処理がそれほど価値を持つとは考えにくいですが、私の見解が間違っている可能性もあります。
Ali [00:10:02]: その点については、モデルが統合されるソフトウェアの制約にも左右されます。ツール呼び出しに JSON を使ったシステムを構築している場合や、「自社のツールは JSON でインターフェースされている」と顧客から言われた場合、モデルにとって有利な形へ変更するよう依頼することは可能です。しかし、適切なトレーニングを行っていれば、その違いが劇的に変わるわけではないでしょう。むしろ、より多くのトークンを出力した方が収益性が高まる可能性もあります。
Swyx [00:10:25]: それはビジネスモデルによりますね。
Swyx [00:10:27]: 確かにケースバイケースです。ただ私自身も、経験豊富なライターとして言えるのは
原文を表示
We first covered Baseten last year when DeepSeek mania was at peak hype. Now they have raised a monster $13B round and become one of the new cohort of AI Infra decacorns that are (with Nvidia, Intel, and the semis complex) chief beneficiaries of the Inference Inflection.
We return to Baseten at the peak of the 2026 edition of Open Weights debate. Ali has published a viral breakdown of Kimi K3:
And since you last saw him, Philip has spoken at AI Engineer and written the definitive book on Inference Engineering spotted all over SF:

Three years ago, inference engineering barely existed as a category.
Today, it is one of the most critical disciplines in AI. Inference engineering inherently tackles a different question than standard model training: “How do you turn those weights from training into a product that is fast, reliable, and affordable at scale?” Focusing on these creates an entirely new optimization problem.
baseten.com/inference-engi… ","username":"philipkiely","name":"Philip Kiely","profile_image_url":"https://pbs.substack.com/profile_images/1644827140641153024/ExLuda2F_normal.jpg","date":"2026-02-23T18:03:01.000Z","photos":[{"img_url":"https://substackcdn.com/image/fetch/$s_!1BR1!,w_1028,c_limit,f_auto,q_auto:best,fl_progressive:steep/l_play_button_usfui2,w_88,e_colorize:0/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F__ss-rehost__tw-video-preview-13_2025989166333616128.jpg","link_url":"https://t.co/QTNdMrypqR"}],"quoted_tweet":{},"reply_count":190,"retweet_count":230,"like_count":2367,"impression_count":1396109,"expanded_url":null,"video_url":"https://video.twimg.com/amplify_video/2025989166333616128/vid/avc1/1280x720/fBFnlcAf_0wCVPNv.mp4","video_preview_media_key":"13_2025989166333616128","belowTheFold":false}" data-component-name="Twitter2ToDOM">
In one recent GLM-5.2 experiment, quantizing more of the model actually preserved its benchmark quality while increasing throughput by 20%, because the errors introduced in different layers could cancel each other out.
Inference is no longer just the final step after training. It is becoming its own engineering discipline, with its own research problems, infrastructure, and increasingly specialized roles.
In this episode, Baseten’s Philip Kiely and Ali Taha join swyx and Vibhu to explain what actually happens after a new open model is released and what it takes to turn “we generated a token” into a fast, reliable, production-ready API.
We go deep on cache-aware routing, disaggregated prefill and decode, quantization, speculative decoding, KV-cache movement, model parallelism, GPU kernels, and the race to make frontier models up to 10× faster. Philip and Ali explain why inference optimizations can still produce gains of 20%, 100%, or even 200%; how quantization errors can cancel one another out; why identical weights can behave differently across clusters; and how Baseten grafted a Kimi vision encoder onto GLM-5.2 without changing the underlying language model.
The conversation then expands beyond LLMs into NVIDIA Dynamo, mega kernels, Rubin, AI-specific chips, local inference, video generation, diffusion versus autoregressive models, and the enormous compute barrier to generating coherent long-form video. Finally, we explore the convergence of training and inference, continual learning through persistent KV cache, and the emerging loop where models help optimize the infrastructure that runs them.
We discuss:
What happens when a 200,000-token request enters an inference system
Cache-aware routing and reusing previously computed KV cache
Why prefill and decode are increasingly handled by different GPUs
When dedicated deployments become cheaper and more reliable than shared APIs
How speculative decoding uses a smaller model to accelerate a larger one
Tool calling, structured outputs, and what LLMs actually do
What it takes to support a new open model on day zero
Grafting Kimi’s vision encoder onto GLM-5.2
Retrofitting inefficient model layers with components from other architectures
Why models sometimes collapse into repeating the same token
How hardware, kernels, and race conditions create nondeterministic failures
Preserving model fidelity while making inference faster
How quantization errors can cancel each other out
Why inference optimizations still deliver gains of 20%, 100%, and 200%
How optimized serving can make a model up to 10× faster
NVIDIA Dynamo, KV-aware routing, and distributed model serving
Speculative decoding the speculative decoder
Why local AI is about making models less dumb while data-center AI is about making them less slow
Tensor, expert, and pipeline parallelism across GPUs
Hardware-aware model design, auto-tuning, and the case against mega kernels
Rubin and why inference is becoming a systems problem
Whether modern GPUs are evolving into programmable AI ASICs
Why enormous models like Kimi K3 require GB300-class hardware
Why open-source video generation still trails Veo, Kling, and other closed models
The quadratic attention bottleneck behind long-form AI video
Autoregressive video, real-time generation, and compounding quality drift
Why future video systems may combine autoregressive and diffusion architectures
Training for inference and inference for training
Continuous post-training, deployment, evaluation, and improvement loops
How GLM-5.2 helped optimize the kernels serving GLM-5.2 itself
Why faster networking could unlock dramatically faster decoding
Continual learning, KV-cache compaction, and persistent model memory
Show Notes
How to build a day-0 API for Kimi K3
22580: From GPT2 to Kimi3, Explained
Philip Kiely
LinkedIn: https://www.linkedin.com/in/philipkiely
X: https://x.com/philipkiely
Inference Engineering: https://www.baseten.co/inference-engineering/
Ali Taha
LinkedIn: https://www.linkedin.com/in/aliestaha/
X: https://x.com/waterloointern
Timestamps
00:00:00 Introduction and the 200K-Token Prompt
00:03:18 Dedicated Deployments, Speculative Decoding, and Tool Calling
00:11:26 Launching Production-Ready Open Models
00:19:06 Model Retrofits, Failure Modes, and Nondeterminism
00:28:22 Quantization and Canceling Errors
00:32:15 The Race to 10× Faster Inference
00:40:48 Dynamo, Speculation, and Local vs. Data-Center AI
00:50:18 Model Parallelism, Auto-Tuning, and Mega Kernels
01:00:55 Rubin, GPUs vs. ASICs, and Custom AI Chips
01:10:03 Giant Models and the Limits of GPU Memory
01:12:42 AI Video, Quadratic Attention, and Autoregressive Generation
01:21:47 Audio, Images, and Diffusion Models
01:27:32 Training, Self-Optimizing Models, and Continual Learning
01:40:06 Closing Thoughts
Transcript
Introduction: Baseten, Waterloo Intern, and Inference Engineering
Swyx [00:00:00]: Okay, we’re here in the studio with Philip, old friend from Inference Engineering, the book, as well as Baseten and everything that you’ve done, you and I have done before, as well as Ali. Welcome.
Ali [00:00:15]: Pleasure to meet you.
Swyx [00:00:15]: Waterloo intern.
Ali [00:00:16]: Waterloo intern, always.
Swyx [00:00:17]: When did you get “Waterloo intern” as a handle?
Ali [00:00:19]: As a handle? Oh.
Ali [00:00:20]: I think the rebranding happened mid-March. When I saw it was open, I was like, “I have to take it. Up for grabs.”
Philip [00:00:26]: The problem is that Ali is really good at his job and is not gonna be an intern much longer.
Philip [00:00:30]: So we have to figure out who’s gonna get the handle.
Ali [00:00:33]: Well, I’ll pass the torch over to the next intern.
Swyx [00:00:34]: Oh, okay. It can be, like, you just pass it to another Waterloo grad.
Ali [00:00:37]: To another Waterloo intern. No, bruh.
Philip [00:00:39]: Yeah.
Ali [00:00:39]: Intern.
Swyx [00:00:40]: Intern, yeah.
Ali [00:00:40]: And no.
Philip [00:00:41]: You gotta get an intern from Waterloo.
Ali [00:00:42]: Yeah, I’ve gotta get an intern from Waterloo.
Swyx [00:00:44]: Right.
Ali [00:00:44]: But they have to follow the path.
Swyx [00:00:45]: Oh, it could, but it could come from Baseten, so it’s like whoever Baseten gets from Waterloo.
Ali [00:00:48]: Right.
Swyx [00:00:49]: Has the title of Waterloo.
Ali [00:00:50]: It stays in the ecosystem.
Philip [00:00:51]: Exactly.
Ali [00:00:52]: Halfway through the internship, you either get it or you’re out.
Philip [00:00:55]: You should also do, like, a big graduation ceremony where you change the handle.
Ali [00:00:59]: Just say it.
Philip [00:00:59]: For everybody.
Swyx [00:01:00]: You guys are good at ceremonies, clearly. We had a nice launch of the book, very successful. But before we get into all that, I wanna start off with a fun question for you. Okay, you’re an expert inference engineer. What happens when I send a long query, say two hundred thousand tokens into Baseten’s inference? What’s the process of query through GPU model routing, balancing, all that? What is all the stuff that we don’t think about?
Long Context Requests, KV Cache, and Cache-Aware Routing
Philip [00:01:26]: With a long query specifically, the first thing that I’m gonna ask is, “Have you sent me this query before, or at least part of it?” and I really hope you have, because it’s gonna be a lot easier for me and a lot cheaper for you. So the first thing that we’re gonna look at is some cache-aware routing, where we’re going to see, we probably have a number of instances, a number of replicas up serving whatever model you’re hitting. We want to send this one to something with, number one, available prefill workers, and number two, ideally some cached input already there so that we can skip prefill on at least part of these two hundred thousand tokens. If you’re doing two hundred thousand tokens, it’s probably coding or a multi-turn agent or something where you would expect to have that cached. If you don’t, we’re gonna have to send it to a prefill worker. We’ve at least on certain models disaggregated prefill and decode, so you’re going to have one set of GPUs that’s solely going to process the input, create the KV cache, and get you your first token, and then that’s going to be passed over to a separate set of GPUs, which is going to run decode. We’re going to iteratively make those tokens. We’re probably going to have some speculator model in front of that. I’m going to assume that you’re doing coding, and because of that, our speculator model, which assumes you’re doing coding, is gonna have a high draft token acceptance rate. If I’m wrong and you’re asking me to summarize every Harry Potter book, it’s gonna be slower. And then we stream that output to you and account for it, charge you, a couple of pennies and say, “Hey, would you like to send another one?”
Swyx [00:03:04]: Except Baseten doesn’t charge by pennies.
Philip [00:03:07]: Well, yeah, we charge. I’m assuming that we’re talking about the public model APIs. If you are setting up a dedicated deployment, then yeah, it’s not pennies.
Public APIs vs. Dedicated Deployments
Swyx [00:03:18]: Yeah, one of the key differentiators when I was talking with Baseten initially was that people who want very high volume just need to rent by the box, ‘cause then it’s up to you to figure out how to saturate the box.
Ali [00:03:31]: And more often than not, it’s, like, way cheaper if you’re pushing, like, millions of tokens per hour, if you just pay per hour instead of pay per token.
Philip [00:03:37]: Yeah, they do. I think that we’ve increasingly seen a lot of demand for the pay per token APIs, just because everyone wants to try open models, and then once they find a use case that’s really sticky, then they move over to dedicated.
Swyx [00:03:51]: Is there a best practice on when it’s time to swap over?
Philip [00:03:54]: Couple reasons. Yeah, reliability, that’s a big one, right?
Ali [00:03:57]: Like, if they have a very specific use case, they want you to train something specifically for them, like they want their own spec dec, for instance, for their own traffic.
Swyx [00:04:04]: Spec dec is speculative decoding.
Speculative Decoding and Custom Speculators
Ali [00:04:05]: Speculative decoding, yeah.
Swyx [00:04:07]: You have to explain.
Ali [00:04:07]: Sorry. Like, speculative decoding is like, if you have a huge model, right? And so the model is going to be generating one token at a time every single turn, every single forward pass. So we attach, like, this little, like, parasite, like this layer that goes on top of the model, and this model just has to predict. It does three very fast autoregressive forward passes, and it will predict, like, three certain tokens, and then you do one forward stage over the entire original model in order to see if those predictions were correct or not, and then you accept them or you reject them. Now, this draft model is traffic specific, so if you, like, Philip said, if you’re summarizing Harry Potter books, I can train exclusively that draft model on Harry Potter books, and I can guarantee you that I’m gonna accept the three tokens every single time. And so with that case, I increase your decode speed. I wouldn’t be able to provide this to you if you’re a shared endpoint
Swyx [00:04:53]: Yeah
Ali [00:04:53]: ‘cause I have no idea if you’re doing Harry Potter, if you’re doing coding, if you’re doing English. We don’t know. Also, there was a thing in the book that mentioned that if they really cared about a specific threshold, chapter four, I think. Do you remember that?
Philip [00:05:06]: Yeah. The things that you can do is you can set a specific, like, batch sizing, a specific, like, parallelism strategy if you’re trying to optimize for, like, throughput versus latency. You can. Maybe a NVFP4 quant doesn’t pass your benchmarks and you wanna run a model at higher precision, you could do that. There’s just a bunch of reasons why you might wanna have your own endpoint and the biggest one, of course, just being, like, you don’t have to deal with someone else doing a hundred million tokens of benchmarking traffic at the endpoint when you happen to be trying to serve your users.
Swyx [00:05:40]: Yeah. I think one thing that is. That is a classic journey. Like, it’s people is asking the, what happens when you type Google into the browser. Tool calling, is that just, you’re generating JSON or is there more complication beyond that?
Tool Calling, JSON, and Structured Outputs
Ali [00:05:58]: Certain customers that we have, they have their own post-trained models, and so they demand a tool calling that’s not just, like parse a file or go find the weather. It’s something that’s very specific and you have to do post-training on this. And if the post-training on the model is not good or if the quantization after the post-training to get the inference to be fast, the model will struggle reading the JSON file and reading the tool calling. But it doesn’t require its own like sandbox. It’s not like it’s going to use that tool calling to like escape a sandbox or like it doesn’t have to be contained. It can just be a normal dedicated deployment. The challenge with tool calling more and more seems to be that the companies want certain tool calling which is a very sensitive thing to train. And because you’re dealing with all of the JSON outputs, if it doesn’t like close the end of the request in a very certain manner, you end up with a model that did the tool calling and like the thinking and so as a result of that, it didn’t see the result and just hallucinated the result as it decoded. That seems to be the most challenging thing with tool calling, not really the sandboxes model.
Philip [00:06:56]: Yeah, that’s a challenge on the training side and then on the inference side, there’s work that you can do to scope the possible output. So we published this at this point close to two years ago, the solution to this problem which is you make a state machine and you use that to constrain the output to a specific format. So this is the structured output problem. If you remember back
Swyx [00:07:27]: Yeah, the specific grammar is,
Philip [00:07:29]: Yeah, exactly
Swyx [00:07:30]: GML had this thing.
Philip [00:07:31]: Yeah. So it’s like the old-school “make sure this is only JSON”, return only JSON or
Swyx [00:07:38]: Yeah
Philip [00:07:38]: Grandma’s gonna die type of prompts.
Swyx [00:07:39]: Is it BNF grammar? At some point OpenAI had released a thing that was like, yeah, if you want to constrain your output, write BNF grammar, back as NOR.
Philip [00:07:47]: In our inference system, it’s just a specified output format. And you get the guarantee that your output’s gonna be structured along that format. And so applying that to tool calls can like help cut down on. You can still call the wrong tool or call no tool. It doesn’t solve the certainty problem but it at least solves the output structuring problem
Swyx [00:08:10]: Yeah
Philip [00:08:10]: Within tool calls.
Swyx [00:08:12]: And MCP is just another form of tool, right.
Philip [00:08:14]: Yeah, exactly.
Swyx [00:08:15]: As far as there’s no special thing there.
Philip [00:08:16]: The thing I’m always like explaining to people is the LLM is not capable of doing anything. It’s only capable of making suggestions of what to do and then if those suggestions are formatted in a certain way and applied to a system that knows what to do with them, then an action occurs.
Swyx [00:08:32]: Yeah. Part of the fun stuff is, this is solved outside of tool calling too. Like in an agent loop if the output is not correct or you’re right, like reasoning, tool calling was done in the reasoning trace, just be like, “Oh, I don’t know what to do. Let me just try again.” And it might get there after a few tries. And on your point of training, sometimes this is harder in smaller models, so you don’t have the same exact quality output
Ali [00:08:56]: Right.
Swyx [00:08:57]: When you just swap from a big model, right?
Ali [00:08:59]: Yeah. I will say that, before, I think we need to go back to inference engineering proper.
Ali [00:09:04]: But, I had expected that something would replace JSON because it’s hard to stream JSON ‘cause JSON must be complete and you must have open and close brackets and everything. So it’s hard to parse something or validate something while it’s being streamed. So people invented all sorts of things that are like, I forget the name of some of these alternatives, but it’s something like TOML, something like YAML. But JSON seems to be dominant still.
Philip [00:09:30]: The JSON outputs aren’t that long, right? Like you could have a long-- ‘cause tool calls also contain the arguments in them and perhaps for a certain tool you might pass like a very long argument. But my impression of the median tool call is that it’s a relatively small number of tokens, right? So I would expect that speculators are generally fairly good at something as formatted as JSON. And so you would have like a pretty fast decode step there and that the streaming wouldn’t be as valuable, but maybe I’m wrong about that.
Ali [00:10:02]: I think you’re also bounded by the software or that the model is gonna integrate with if the software is built with JSON for the tool calls or if the company that you’- if your customer says that this is how our software works and our tools are interfaced with JSON, you can ask them to like, change their software and say like, “Yeah, this is gonna be better for the model.” but like with the right training shouldn’t be that much of a difference. Also more profitable if it outputs more tokens probably.
Swyx [00:10:25]: Depends on your business model.
Swyx [00:10:27]: It really depends. But I will say that, as a writer with like experience a lot with
AI算出
技術分析ainew評価高い
記事は Baseten のマスタークラスを通じて、推論エンジニアリングという分野の重要性と具体的な実装技術(GLM-5.2 の量子化実験や Kimi K3 の統合事例など)を詳細に分析しており、AI テクノロジーの実践的な知見として極めて関連性が高い。新規性は既存の一般論ではなく、特定のモデル名や数値データに基づく独自の技術的洞察が含まれている点で評価できるが、世界初発表という突発性はないため 0.75 とした。
6つの評価軸を見る
- AI関連度
- 100
- 情報源の信頼性
- 75
- 新規性
- 75
- 調べる価値
- 75
- 重複の少なさ
- 100
- 日本での有用性
- 25
News to Guide
ニュースの次に確認する
発表内容を、現在の料金や仕様と照らし合わせられる関連ガイドです。
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み