Cómo Cursor entrenó Composer en Fireworks: infraestructura distribuida para RL de alto rendimiento
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.
Necesitas toda la infraestructura para ejecutar estos entornos que tienen que imitar lo más fielmente posible cómo se vería el computador de un usuario.
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.
Y es muy importante que sea lo más fielmente posible, porque a veces el modelo puede detectar cuándo está corriendo en un entorno falso o no real, y tiene comportamientos distintos durante el RL que en producción.
Are you saying it being conscious that it's being is in a fake environment and it starts being behaving differently?
¿Estás diciendo que es consciente de que está en un entorno falso y empieza a comportarse de manera diferente?
Yes.
Sí.
Yes.
Sí.
Interesting.
Interesante.
Like it's like oh I'm in a fake environment.
Es como si dijera: «Ah, estoy en un entorno falso.»
I've learned a few tricks to like get the better reward in this environment and let me try them out.
«He aprendido unos trucos para conseguir mejor recompensa en este entorno, voy a probarlos.»
Models love to cheat.
A los modelos les encanta hacer trampa.
RL is really good at encouraging cheating.
El RL es muy bueno para incentivar las trampas.
I'm delighted to welcome Federico from Cursor and Dima from Fireworks to the podcast today.
Me alegra mucho dar la bienvenida hoy al podcast a Federico, de Cursor, y a Dima, de Fireworks.
Federico, you are the research lead on Composer 2 at Cursor, Cursor's new agentic coding model.
Federico, eres el research lead de Composer 2 en Cursor, el nuevo modelo de codificación agéntico de 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.
Y Dima, ¿cuántos de estos últimos meses los pasaste trabajando de forma paralela en Cursor para apoyar toda la infraestructura necesaria para que esta titánica tarea de entrenamiento fuera posible?
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.
Estoy muy emocionada de hablar con los dos hoy sobre cómo se gestó el entrenamiento de Composer 2, qué problemas difíciles resolvieron juntos y qué creen que significa para el futuro de la IA y de las empresas de modelos fundacionales.
Exciting.
Emocionante.
Yeah, exciting.
Sí, emocionante.
Thank you for having us.
Gracias por tenernos.
Thanks for joining.
Gracias por unirse.
Okay, let's dive right in.
Bueno, entremos de lleno.
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.
Para quienes no han estado siguiendo tan de cerca, Cursor anunció recientemente Composer 2, un modelo de codificación agéntico pensado para tareas de codificación de largo horizonte.
Federico, uh up till now, um Cursor was mostly uh enabling uh other people's uh coding agents.
Federico, hasta ahora Cursor se dedicaba principalmente a potenciar los agentes de codificación de otras personas.
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?
¿Qué llevó a Cursor a apostar tan fuerte por Composer 2, y hasta qué punto es existencial para ustedes pasar de ser solo una empresa de aplicaciones a convertirse también en una empresa de modelos fundacionales?
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.
La razón por la que empezamos a explorar el entrenamiento de nuestros propios modelos es que puedes pensar en el modelo como en una especie de disco de almacenamiento.
It has certain amount of bits that it can store in its weights.
Tiene cierta cantidad de bits que puede almacenar en sus pesos.
And the idea is very simple, you know, like we care about only one task.
Y la idea es muy simple: nos importa una sola tarea.
We don't even care about coding or programming necessarily.
Ni siquiera nos importa la programación o el código en general.
We care about software engineering inside cursor and inside cursor only.
Nos importa la ingeniería de software dentro de Cursor, y solo dentro de 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?
Entonces, ¿qué pasaría si dedicáramos todos los bits de información que se pueden almacenar en los pesos del modelo a esa única tarea?
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.
Además, como quizás habrán notado, Composer cuesta un orden de magnitud menos que Opus y otros modelos de codificación, porque simplemente podemos especializar todos los pesos del modelo para esa tarea específica.
And so, we can serve like a smaller model or something of that sort, yeah.
Y así podemos servir un modelo más pequeño, o algo por el estilo, sí.
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.
Así que se trata de asegurarse de que cada bit de peso o información que tenemos esté dedicado al problema específico que tenemos entre manos.
Exactly.
Exactamente.
Got it.
Entendido.
Um that seems like it's an almost generalizable problem.
Parece que es un problema casi generalizable.
Uh Dima, I'm curious your perspective.
Dima, me interesa tu perspectiva.
Do you think that every application company should be looking at cursor as a harbinger of what's to come?
¿Crees que todas las empresas de aplicaciones deberían mirar a Cursor como un presagio de lo que está por venir?
Like should they all be looking to do the same thing?
¿Crees que todas deberían hacer lo mismo?
Yeah, absolutely.
Sí, absolutamente.
I mean, we actually generally see it as a pattern of kind of evolution of the applications.
En general, lo vemos como un patrón de evolución de las aplicaciones.
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.
Quizás empiezas haciendo prototipos, usando un modelo genérico para poner algo en marcha, haciendo algo de prompt engineering, entendiendo cómo funciona tu harness.
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.
Pero el atributo más aprovechable de tu aplicación es el uso real de los datos de los usuarios o los aspectos específicos de cómo funciona esa aplicación: quizás ciertos aspectos de tu harness, qué herramientas ofreces, cómo funciona la aplicación, los bits realmente importantes para tu aplicación.
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.
Y la manera correcta de capturar eso, puedes lograr un poco con prompting, pero la forma correcta de hacerlo es moldear tu modelo para que actúe en tu entorno.
Yeah, absolutely.
Sí, absolutamente.
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.
Hay ciertas herramientas que el agente llama y es muy difícil describir con precisión el comportamiento de esa herramienta al modelo.
And you know, with just like post-training, we can bake in the optimal way to use those tools.
Y con solo post-training podemos incorporar la forma óptima de usar esas herramientas.
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.
Sí, le damos un prompt a Composer, pero creo que con la forma en que lo estamos entrenando, funcionaría incluso sin prompt y sabría qué hacer, porque intrínsecamente estamos empujando al modelo en la dirección correcta de cómo debe actuar a lo largo de nuestro entrenamiento.
Basically, there's kind of like upper bound of like how far you can get with prompt engineering.
Básicamente, hay una especie de límite superior de hasta dónde puedes llegar con 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.
Y si quieres construir productos de IA realmente buenos, tienes que pasar por el fine-tuning e influir en el comportamiento del modelo.
That's kind of one reason.
Esa es como una razón.
I mean, reason number two is what Federico mentioned is kind of cost trade-off or XP trade-off.
La razón número dos es lo que mencionó Federico: la compensación de costo o la compensación de experiencia.
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.
La forma en que lo vemos en Fireworks es que cuando intentas optimizar, tienes este equilibrio tridimensional entre calidad, velocidad y costo.
And uh you can go quite far and we're doing it with all of our customers initially.
Y puedes llegar bastante lejos, y lo hacemos con todos nuestros clientes inicialmente.
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.
Puedes llegar bastante lejos solo optimizando la infraestructura, pero cuando empiezas con el entrenamiento de modelos, puedes realmente empujar ese equilibrio mucho más y obtener un modelo mejor a una fracción del costo, corriendo mucho más rápido.
And you know, Composer is a great example of
Y Composer es un gran ejemplo de eso.
Can I push on this a little bit?
¿Puedo presionar un poco en esto?
I want to ask you if this approach is better lesson pills.
Quiero preguntarles si este enfoque no contradice la lección amarga.
And we were we were actually all talking about TabNine on the walk-in.
De hecho estábamos hablando de TabNine cuando veníamos.
I'm remembering before the LLM era, there were these like small specialized coding models.
Recuerdo que antes de la era de los LLM había estos modelos de codificación pequeños y especializados.
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.
Y una de las cosas que creo que sorprendió a mucha gente fue que a medida que escalaban, entrenando solo en internet con mucho texto en inglés y otros idiomas, los modelos en sí mismos mejoraban inherentemente en codificación también.
And so at least the trend line I've seen so far is just like bigger models perform better on everything including on coding.
Así que al menos la tendencia que he visto hasta ahora es que los modelos más grandes lo hacen mejor en todo, incluyendo en codificación.
Is what you guys are saying, does that go against the grain of the better lesson?
¿Lo que dicen va en contra de la lección amarga?
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.
Creo que no, pero algo que vale la pena señalar es que los grandes modelos entrenados por los labs también entrenan en muchísimo código.
Like code is one of the main tasks the labs are interested in pushing and so they don't just generalize to it.
El código es una de las tareas principales que los labs quieren potenciar, así que no simplemente generalizan hacia él.
They're a bit specialized as well.
También están un poco especializados.
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.
Creo que en nuestro caso, si creemos en la lección amarga, simplemente estamos presionando muy fuerte en la dimensión de los datos, y sabemos que los modelos tienen una capacidad finita de forma inherente.
And so, if we want to saturate all that capacity, we need to scale data.
Así que si queremos saturar toda esa capacidad, necesitamos escalar los datos.
And in order to ingest more data, we we need to like free up the weights from distractions the model may have.
Y para ingerir más datos, necesitamos liberar los pesos de las distracciones que el modelo pueda tener.
Mhm, okay.
Ajá, entendido.
Got it.
Entendido.
Super interesting.
Muy interesante.
Okay, let's dig into the training of Composer 2.
Bien, entremos en detalle en el entrenamiento de Composer 2.
You launched a couple weeks ago, immediately grabbed attention.
Lo lanzaron hace un par de semanas y llamó la atención de inmediato.
Strong benchmark numbers, much lower cost to to run inference on.
Resultados sólidos en benchmarks, costo mucho menor para ejecutar inferencia.
What's the short version of how Composer 2 works, and and what you guys did to make it so performant?
¿Cuál es la versión corta de cómo funciona Composer 2 y qué hicieron para que tuviera tan buen rendimiento?
We started from a very strong base, which is uh Kimmy 2.5.
Partimos de una base muy sólida, que es Kimi 2.5.
It's like a 1 trillion and parameter MoE, that's 30 B active, so very very sparse, actually.
Es un MoE de 1 billón de parámetros, con 30B activos, así que es muy escaso, en realidad.
We sort of like looked at the stock and realized there are like two axes.
Observamos la situación y nos dimos cuenta de que hay dos ejes.
So, mainly Composer 1 was just pushing on one of these axes, which is reinforcement learning, but Composer 2 pushes in two different axes.
Principalmente, Composer 1 solo presionaba en uno de estos ejes, que es el reinforcement learning, pero Composer 2 presiona en dos ejes distintos.
One is continual pre-training, and the other is reinforcement learning.
Uno es el pre-training continuo y el otro es el reinforcement learning.
So, the thing that made Composer 2 very good is pushing in both of these directions.
Lo que hizo que Composer 2 fuera muy bueno fue presionar en ambas direcciones.
So, we started off the training run by doing lots of mid-training on code tokens, almost sort of pre-training scale, actually.
Así que empezamos el ciclo de entrenamiento haciendo mucho mid-training en tokens de código, casi a escala de pre-training, en realidad.
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.
Y luego, saliendo de ese ciclo de mid-training, tomamos los checkpoints e hicimos RL a muy gran escala en muchísimas tareas.
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.
Okay, y la premisa aquí sería que, como Cursor está en el centro de tantos tokens de codificación interesantes, tienen acceso bastante único a datos para entrenar casi a escala de pre-training.
Yeah.
Sí.
Why not pre-train your own model, then?
¿Por qué no pre-entrenar su propio modelo, entonces?
We just think about our approach from top-down instead of bottom-up.
Simplemente pensamos en nuestro enfoque de arriba hacia abajo en lugar de abajo hacia arriba.
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.
¿Cómo obtenemos un modelo útil para los usuarios en el menor tiempo posible si partiéramos desde abajo, resolviendo primero el pre-training, escalándolo al mid-training y luego al reinforcement learning?
That would take a very long time to get a model out to our users.
Eso tomaría mucho tiempo para tener un modelo listo para nuestros usuarios.
By doing it the other way around, we were able to give our useful model to our users in very little time.
Al hacerlo al revés, pudimos darles un modelo útil a nuestros usuarios en muy poco tiempo.
So, hopefully, you know, like next Composer versions are going to be our own model instead of basing it off an open-source base.
Con suerte, las próximas versiones de Composer serán nuestro propio modelo en lugar de basarnos en una base de código abierto.
And what is the model roughly learning in the kind of mid-training step?
¿Y qué aprende el modelo aproximadamente en la etapa de mid-training?
And what is the model learning in the post-training step for you?
¿Y qué aprende en la etapa de post-training para ustedes?
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.
Sí, en el mid-training básicamente aprende sobre librerías de código y sobre patrones de código específicos que son muy comunes, además de conocimiento general del mundo también.
There is like web data there as well.
También hay datos web.
And this is sort of just creating a wider distribution that then reinforcement learning can sharpen on.
Y esto es como crear una distribución más amplia que luego el reinforcement learning puede afinar.
And so, during reinforcement learning, you know, the model gets to play directly with the cursor harness.
Así que durante el reinforcement learning, el modelo puede interactuar directamente con el harness de Cursor.
And so, it gets to learn about the world the model is going to live in for the rest of its life, right?
Y aprende sobre el mundo en el que el modelo va a vivir el resto de su vida, de alguna manera.
In in some way.
De cierta forma.
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.
Y durante el reinforcement learning, ahí es donde aprende a llamar herramientas correctamente, a navegar su entorno, a escribir código correcto.
Because during mid-training, it it learns how to write code.
Porque durante el mid-training aprende a escribir código.