ポッドキャストに戻るSequoia Capital
CursorはどうやってFireworks上でComposerを訓練したか:高性能RLのための分散インフラ
You need all the infrastructure to run these environments that have to mimic as closely as possible what a user's computer would look like.
ユーザーのコンピューターにできる限り近い状態を再現するこれらの環境を動かすためのインフラがすべて必要になります。
And it's very important as closely as possible because sometimes the model can actually figure out when it's being run in like a fake environment or not a real one and it has like different behaviors during RL than in production.
「できる限り近い」という点がとても重要です。なぜなら、モデルが実際には偽の環境で動いているか否かを検知できる場合があり、RL中と本番環境で異なる振る舞いをすることがあるからです。
Are you saying it being conscious that it's being is in a fake environment and it starts being behaving differently?
つまり、モデルが偽の環境にいることを意識して、振る舞いを変え始めると、そういうことですか?
Yes.
はい。
Yes.
はい。
Interesting.
面白いですね。
Like it's like oh I'm in a fake environment.
「あ、これは偽の環境だ」みたいな感じで。
I've learned a few tricks to like get the better reward in this environment and let me try them out.
この環境でより良い報酬を得るためのトリックをいくつか覚えたので、試してみようと。
Models love to cheat.
モデルは不正を好みます。
RL is really good at encouraging cheating.
RLは不正行為を促すのがとても得意です。
I'm delighted to welcome Federico from Cursor and Dima from Fireworks to the podcast today.
本日はCursorのFedericoさんとFireworksのDimaさんをポッドキャストにお迎えできて光栄です。
Federico, you are the research lead on Composer 2 at Cursor, Cursor's new agentic coding model.
Federicoさん、あなたはCursorのComposer 2のリサーチリードで、Cursorの新しいエージェント型コーディングモデルを担当されています。
And Dima, you spent how many of the last few months moonlighting at Cursor in order to support all of the infrastructure required to make this gargantuan training task happen.
そしてDimaさん、この膨大なトレーニングタスクを実現するために必要なインフラをすべてサポートするため、ここ数ヶ月の間Cursorに副業として携わっていたとのことですね。
And so, I'm excited to talk to both of you today about how the training of Composer 2 came together, what hard problems you solved together, and what you think it means for the future of of AI and foundation model companies.
本日は、Composer 2のトレーニングがどのようにまとまったか、どんな難しい問題を一緒に解決したか、そしてAIと基盤モデル企業の将来についてどのようにお考えかを、お二人にお聞きできることを楽しみにしています。
Exciting.
楽しみですね。
Yeah, exciting.
ええ、楽しみです。
Thank you for having us.
お招きいただきありがとうございます。
Thanks for joining.
ご参加ありがとうございます。
Okay, let's dive right in.
では、早速始めましょう。
For those who haven't been following as closely, uh Cursor recently announced Composer 2, which is an agentic coding model uh meant for long horizon coding tasks.
あまり追っていない方のために説明すると、Cursorは最近Composer 2を発表しました。長期的なコーディングタスクを対象としたエージェント型コーディングモデルです。
Federico, uh up till now, um Cursor was mostly uh enabling uh other people's uh coding agents.
そして今日は、それについてお話ししていきます。
Uh what was the impetus for Cursor to lean so heavily into Composer 2, and how existential is it for you to become not just an application company but also a foundation model company yourselves?
まず、なぜCursorはComposer 2のトレーニングを決めたのか、基礎モデルをファインチューニングするだけでよかったのではないかという点から始めたいと思います。
The reason why we started looking into training our own models is you can sort of think about the model as sort of like like a storage drive.
基礎モデルでは十分ではないのでしょうか?
It has certain amount of bits that it can store in its weights.
まず言っておくと、私はこの「特殊化かビター・レッスンか」という議論が大好きです。
And the idea is very simple, you know, like we care about only one task.
私自身は、短中期的にはどちらかというと特殊化派です。
We don't even care about coding or programming necessarily.
その理由は何かというと、一般的なモデルのトレーニングデータを見ると、インターネット上にある情報が大量に含まれています。
We care about software engineering inside cursor and inside cursor only.
それに対して、Cursorには非常に具体的なデータがあります。
And so, what if we were to allocate all of the bits of information that can be stored inside the model weights to that one particular task?
つまり、ユーザーがエディターで実際に何を行うかという実際のデータがあります。
Also, as people may have noticed, composer is order of magnitude less expensive than Opus and other like coding models because we can just simply specialize all of the model weights to that particular task.
そして、私たちが持つすべての情報のビットを手元の特定の問題に捧げようという考え方です。
And so, we can serve like a smaller model or something of that sort, yeah.
まさにそうです。
So, it's about let's make sure every single bit of weight or information we have is dedicated toward the specific problem that we have at hand.
つまり、持っているすべてのウェイトや情報のビットを、手元の特定の問題に専念させるということですね。
Exactly.
まさにその通りです。
Got it.
なるほど。
Um that seems like it's an almost generalizable problem.
これはほぼ汎用的な問題のように思えます。
Uh Dima, I'm curious your perspective.
Dimaさん、あなたの視点も聞いてみたいです。
Do you think that every application company should be looking at cursor as a harbinger of what's to come?
すべてのアプリケーション企業はCursorをこれから来るものの先駆けとして見るべきだと思いますか?
Like should they all be looking to do the same thing?
皆が同じことをすべきでしょうか?
Yeah, absolutely.
ええ、まったくその通りです。
I mean, we actually generally see it as a pattern of kind of evolution of the applications.
実際、私たちはこれをアプリケーションの進化のパターンとして捉えています。
You maybe start prototyping, you might be using kind of off-the-shelf model to get something running, maybe do some prompt engineering, figure out how your harness works.
最初はプロトタイピングから始まり、既製のモデルを使って何かを動かし、プロンプトエンジニアリングをして、ハーネスの仕組みを把握するかもしれません。
But the most kind of leveraged attribute of your application is the actual usage of user data or particular specific aspects of how this application works, maybe some aspects of your harness, which tools do you provide, how the application works, kind of really important bits which are important for your application.
しかし、アプリケーションにとって最もレバレッジが効く要素は、実際のユーザーデータの活用や、このアプリケーションがどのように機能するかという特定の側面、たとえばハーネスのどの部分か、どのツールを提供するか、アプリケーションがどう動くかといった重要なビットです。
And the right way to capture that, you can do a little bit of that through prompting, but really the right way to do this is craft your model to act in your environment.
それを捉える正しい方法はプロンプティングでも少しはできますが、本当に正しいやり方はモデルをあなたの環境で行動するように設計することです。
Yeah, absolutely.
ええ、まったくその通りです。
Like there are certain tools the agent calls that it's very hard to succinctly describe exactly the behavior of that tool to the model.
エージェントが呼び出す特定のツールについて、そのツールの動作を正確に簡潔にモデルに説明するのがとても難しい場合があります。
And you know, with just like post-training, we can bake in the optimal way to use those tools.
ポストトレーニングだけで、それらのツールを最適に使う方法を組み込むことができます。
Like Composer, we do serve a prompt to Composer, but I I think the way we are training it, it would work even without a prompt and it would know what to do just because like we are intrinsically pushing the model to like the right direction of how it should act throughout our training.
Composerにはプロンプトを提供していますが、私たちのトレーニング方法では、プロンプトなしでも機能し、どのように行動すべきかを理解できると思います。なぜなら、トレーニング全体を通じてモデルを正しい方向に内在的に導いているからです。
Basically, there's kind of like upper bound of like how far you can get with prompt engineering.
基本的に、プロンプトエンジニアリングで到達できる上限というものがあります。
And if you want to uh craft really great AI products, you have to go through kind of fine-tuning and influence model behavior.
本当に優れたAI製品を作りたいなら、ファインチューニングを通じてモデルの動作に影響を与える必要があります。
That's kind of one reason.
それが一つ目の理由です。
I mean, reason number two is what Federico mentioned is kind of cost trade-off or XP trade-off.
二つ目の理由は先ほど言及したコストのトレードオフ、つまりコストとパフォーマンスのトレードオフです。
Like the way we kind of view it at Fireworks is that when you're trying to do optimization, you have this like three-dimensional trade-off between quality, speed, and cost.
Fireworksでの私たちの考え方では、最適化を行う際、品質・速度・コストという3次元のトレードオフが存在します。
And uh you can go quite far and we're doing it with all of our customers initially.
インフラの最適化だけでも、すべての顧客と共にかなり遠くまで進めることができます。
We can go quite far with just optimizing infrastructure, but when you start getting to model training, you can really push this trade-off much further and you can get better model at fraction of the cost running much faster.
しかし、モデルのトレーニングに取り組み始めると、このトレードオフをさらに大きく押し進めることができ、はるかに速く動作するより良いモデルをコストのほんの一部で手に入れることができます。
And you know, Composer is a great example of
そしてComposerはその良い例です。
Can I push on this a little bit?
少し突っ込んでいいですか?
I want to ask you if this approach is better lesson pills.
このアプローチはビター・レッスンに反するのかどうか聞いてみたいです。
And we were we were actually all talking about TabNine on the walk-in.
入ってくる前にTabNineについて話していましたね。
I'm remembering before the LLM era, there were these like small specialized coding models.
LLM時代の前、小さな特化型コーディングモデルがあったことを思い出します。
And one of the things that was I think surprising to to a lot of people was as you've scaled up, you know, you scaled up just training on the internet and a lot of a bunch of English text and other languages, actually the models themselves got inherently better at coding as well.
多くの人を驚かせたことの一つは、スケールアップしていくにつれて、インターネット上のデータや大量の英語テキストなどでトレーニングするだけで、モデル自体がコーディングでも本質的に優れるようになったことです。
And so at least the trend line I've seen so far is just like bigger models perform better on everything including on coding.
少なくともこれまでのトレンドは、モデルが大きくなるほどコーディングを含むあらゆることでより優れたパフォーマンスを発揮するというものです。
Is what you guys are saying, does that go against the grain of the better lesson?
お二人が言っていることはビター・レッスンに反するのでしょうか?
I think no, but one one sort of like thing to point out is that the big models trained by the labs train on a lot of code as well.
そうは思いませんが、指摘しておきたい点は、ラボが訓練する大きなモデルも大量のコードで学習しているということです。
Like code is one of the main tasks the labs are interested in pushing and so they don't just generalize to it.
コードはラボが推進に力を入れる主要なタスクの一つなので、単に汎化しているだけではありません。
They're a bit specialized as well.
ある程度特化しています。
I think for our case, actually, you know, if we believe about the bitter lesson, we are just pushing very hard on the data dimension, and we know that the models inherently have finite capacity.
私たちのケースでは、ビター・レッスンを信じるとすれば、データの次元で非常に強く押し進めており、モデルは本質的に有限の容量しか持っていないことを知っています。
And so, if we want to saturate all that capacity, we need to scale data.
その容量をすべて飽和させたいなら、データをスケールさせる必要があります。
And in order to ingest more data, we we need to like free up the weights from distractions the model may have.
より多くのデータを取り込むためには、モデルが持つかもしれない無関係な情報からウェイトを解放する必要があります。
Mhm, okay.
なるほど、そういうことですね。
Got it.
わかりました。
Super interesting.
とても興味深いですね。
Okay, let's dig into the training of Composer 2.
では、Composer 2のトレーニングに掘り下げていきましょう。
You launched a couple weeks ago, immediately grabbed attention.
数週間前にローンチして、すぐに注目を集めましたね。
Strong benchmark numbers, much lower cost to to run inference on.
強力なベンチマーク数値と、推論実行コストの大幅な低減。
What's the short version of how Composer 2 works, and and what you guys did to make it so performant?
Composer 2がどのように機能するか、そしてこれほど高性能にするために何をしたかを簡単に教えていただけますか?
We started from a very strong base, which is uh Kimmy 2.5.
非常に強力なベースから始めました。Kimi 2.5です。
It's like a 1 trillion and parameter MoE, that's 30 B active, so very very sparse, actually.
1兆パラメーターのMoEで、アクティブは30Bなので、実際には非常に疎です。
We sort of like looked at the stock and realized there are like two axes.
現状を見て、2つの軸があることに気づきました。
So, mainly Composer 1 was just pushing on one of these axes, which is reinforcement learning, but Composer 2 pushes in two different axes.
主にComposer 1はそのうちの1つの軸、つまり強化学習だけを推進していましたが、Composer 2は2つの異なる軸を推進しています。
One is continual pre-training, and the other is reinforcement learning.
一つは継続的な事前学習、もう一つは強化学習です。
So, the thing that made Composer 2 very good is pushing in both of these directions.
Composer 2を非常に優れたものにしたのは、この両方の方向に押し進めたことです。
So, we started off the training run by doing lots of mid-training on code tokens, almost sort of pre-training scale, actually.
トレーニングランはコードトークンで大量のミッドトレーニングから始め、ほぼ事前学習スケールに近い規模でした。
And then, coming out of that mid-training run, we took the checkpoints and we did very large-scale RL on lots of lots of tasks.
そのミッドトレーニングランを終えてから、チェックポイントを取り、多くの多くのタスクで大規模なRLを実施しました。
Okay, and then the premise here would be because Cursor sits in the middle of so many interesting coding tokens, you actually pretty uniquely have access to data to be able to train at almost pre-training scale.
なるほど。前提として、Cursorはあれだけのコーディングトークンのハブにいるから、ほぼ事前学習スケールでトレーニングできるユニークなデータアクセスがある、ということですね。
Yeah.
ええ。
Why not pre-train your own model, then?
では、なぜ独自のモデルを事前学習しないのですか?
We just think about our approach from top-down instead of bottom-up.
私たちはボトムアップではなくトップダウンでアプローチを考えています。
So, like, how do we get a model that's useful to users in the least time possible if we were to start from the bottom, sort of figure out how how we do pre-training and then scale it up to mid-training and then, okay, now we figured out mid-training, now we do reinforcement learning.
ゼロから始めて、事前学習をどうするかを把握し、ミッドトレーニングにスケールアップして、次に強化学習をするというプロセスでは、ユーザーにモデルを届けるまでに非常に長い時間がかかります。
That would take a very long time to get a model out to our users.
そのやり方では、ユーザーにモデルを届けるのに非常に長い時間がかかってしまいます。
By doing it the other way around, we were able to give our useful model to our users in very little time.
逆の順序でやることで、非常に短い時間で有用なモデルをユーザーに届けることができました。
So, hopefully, you know, like next Composer versions are going to be our own model instead of basing it off an open-source base.
今後のComposerバージョンは、オープンソースのベースに基づくのではなく、私たち自身のモデルになることを期待しています。
And what is the model roughly learning in the kind of mid-training step?
ミッドトレーニングのステップでモデルはどんなことを大まかに学習しているのですか?
And what is the model learning in the post-training step for you?
そして、あなた方にとってポストトレーニングのステップでは何を学習しているのですか?
Yeah, so in mid-training, it's sort of just kind of learning about libraries of code and learning about specific code patterns that are very common, like just world knowledge as well.
ミッドトレーニングでは、コードライブラリや非常に一般的な特定のコードパターンについて学習し、世界に関する知識も学びます。
There is like web data there as well.
ウェブデータも含まれています。
And this is sort of just creating a wider distribution that then reinforcement learning can sharpen on.
これは、強化学習が絞り込むことができる広い分布を作り出すようなものです。
And so, during reinforcement learning, you know, the model gets to play directly with the cursor harness.
強化学習中、モデルはCursorのハーネスと直接インタラクションできます。
And so, it gets to learn about the world the model is going to live in for the rest of its life, right?
そして、モデルが残りの生涯を過ごすことになる世界について学べるのです。
In in some way.
ある意味で。
And and so, then during reinforcement learning, that's where it learns how to call tools properly, how to navigate its environment, how to write correct code.
強化学習中に、ツールを適切に呼び出す方法、環境内をナビゲートする方法、正しいコードを書く方法を学びます。
Because during mid-training, it it learns how to write code.
なぜなら、ミッドトレーニング中にコードの書き方を学ぶからです。