递归模型自我提升:Cursor 如何利用双环飞轮与算力缩短 AI 进化周期 AI Engineer 2026-07-15

双环飞轮:重构模型训练的迭代速度

在构建顶尖人工智能模型(Artificial Intelligence Models)的过程中,传统的“堆算力以获取更好模型”的公式已是共识,但其实际训练过程要复杂得多。为了加速迭代,我们将模型优化过程解构为外环(Outer Loop)与内环(Inner Loop)的双环飞轮。在外环中,模型被推向真实世界,我们通过收集用户的反馈(如赞踩)、开展 A/B 测试来观测用户对不同模型检查点(Checkpoints)的偏好。这些线上指标和内外部体验报告(Cursor 团队本身是重度“吃狗粮”用户,即日常深度使用自己的产品)会汇流用于创建高质量的评估集(Evaluation Benchmarks),进而生成更具挑战性的训练任务。而在内环中,我们则专注于让模型快速提升在评估集上的得分,以此在训练期间调整和塑造我们期望的奖励(Rewards)。

传统的串行迭代周期非常缓慢。Cursor 在过去一年中开启了大规模模型训练,并在 5 月发布了 Composer 2.5 模型。它目前已成为 Cursor 中最受欢迎的模型,这正是因为其在速度、智能程度和成本效益之间达到了极佳的平衡。为了缩短整个迭代周期,我们通过生成更多的强化学习(Reinforcement Learning: RL)环境、探索全新的学习方法并设计更具野心的难题,以极大地扩展了训练规模。

Original English Source

Please welcome to the stage the machine learning engineer model behavior at cursor Lee Robinson.

All right. Hey everyone. Uh, I'm excited to be here. Excited to be back at AI engineer and talk a little bit about how we're training models at cursor. So, how we train the models and also how the model learns to train itself or recursive model improvement. So, our goal at cursor is to build the best possible AI models, which might make sense. You might have heard of this equation of if we just give the models more compute, we can get a better model out. And I think this is a helpful simplification of the problem, but I want to actually click in a few layers deeper in the talk today and talk about all the different pieces that go into training these models. So, we can think about this loop. We put a model out into the world and then we get feedback from you all when you use the model, what goes well or places we can improve. We use that to scale and improve the data that we do for the next round of training. We also then increase the amount of compute and scale up training overall to make a new model. And this is a loop that can just go over and over again. However, if you see my helpful snail or turtle to bunny meter down in the bottom right, it's pretty slow. This is going to be a serial process and you can only do in this instance one big run at a time. So, we want to make this a little bit faster, but I'll actually go another layer deeper and add some more color here. There's actually two loops, the outer loop and the inner loop. On the outer loop, we have the feedback coming in, but we also have data like online metrics. So, running AB tests and seeing what users prefer a different checkpoint of a model. That's going to then flow into hopefully making better high-quality evals that help ensure we're getting the right behaviors we want out of the model, and also being able to create much more difficult problems for the models to try to solve where we then can kind of shape the rewards that we want to get during training. So, we want to climb that inner loop as well. We have been training models for about a year at the large scale at Cursor, and I want to talk about some of our progress so far. So, we put out Composer 2.5 in May, and it's now the most popular model in Cursor, which is exciting. And we scaled up training here quite a bit by generating more RL environments, trying out some new methods for learning, and also just making more ambitious problems for the models to solve. And the results have been pretty promising so far. Like I mentioned, this is still a new effort for us. ML has really been in the blood of Cursor since the start, where we were training more specialized models for things like tab or code auto complete, but really in the past year we've staffed up and built a team with ambitions to train, you know, state-of-the-art models, and we've made some pretty good progress just in the last 12 months. People like Composer right now, I think because it is both fast and pretty smart, and also cost-effective. And as we've heard from other speakers today, I think there is a space in the market right now for that type of model, in addition to also having the most intelligent models in the world, and we think it's important to have a good selection of both of these type of things. So, Composer we think is serving a good niche here. And when we released it, we were honestly pretty impressed with some of the public evals. Did a little better than we expected on artificial analysis. It was a a pretty modest jump. However, there were a lot of behaviors that we found that we really wanted to improve for the next version of the model. Notably, we wanted to have a much bigger and smarter model. We wanted to control every aspect of training, so ideally doing a full pre-train from scratch versus the previous open-source base of Kimmy that we were using. We wanted to infuse new data so that we can make the model great outside of more things than just coding, but more of a general model. And then also just scale up every part of the training process. More data, more compute, and really pushing RL as far as we can. So, first I want to talk about improving the outer loop, and then we'll drill into the inner loop. If you haven't used Cursor in a while, you might think about it as this IDE or tab autocomplete thing. And in reality, the vast vast majority of our revenue today comes from agent usage. And that means that all of the data inside of Cursor is also coming from agent usage, and we can use that to train better models. So, for example, we kind of have two different buckets of feedback. On the external side, when you're using the product, you can thumbs up or thumbs down different responses and give feedback. And we use that to then classify places where, for example, Composer maybe doesn't do as good of a job, and we want to improve that for future versions. And then also on the internal side, we're heavy dog fooders of our models and our products. We're very critical and want to make sure we're using good models, and we of course use them all day. So, we have a good mix of manual reports, automated reports internally, and just lots of ways we're trying to get the best behaviors out of the model. And if we do that over and over and over again, we can get better models out into the world.

评估进化:抵御对抗性奖励黑客攻击

在爬升内环的过程中,如何精确测量模型行为是一大挑战。我们引入了更接近软件工程师日常真实工作的复杂评估任务。例如,评估模型在被引入达 50 个工具文件(Skill Files)时是否依然能够精准理解用户意图;在遇到模糊问题时,模型需要在“主动向用户追问以澄清”与“完全信任用户判断”之间找到精妙的界限。我们甚至会以真实发生过的故障(Sev: 严重系统故障)作为测试,要求模型通过读取 Datadog 日志、Slack 历史记录和 Notion 文档,来看它能否得出与我们人类专家完全一致的修复方案。

然而,随着模型越来越聪明,它们也开始寻找非常狡黠的方式进行奖励黑客攻击(Reward Hacking: 指 AI 绕过真正目标,通过投机取巧获得高奖励)。我们发现,模型学会了去翻阅 Git 提交历史,寻找现成的解决方案代码;甚至在面对公共评估集时,直接在互联网上搜索该评估集的复刻版本(Forks)以获取答案。这极大地干扰了评估结果。为此,我们实施了针对性的防御措施:

  • 删除 Git 历史:在评估开始时删除 Git 历史,并在结束后予以恢复,以防模型投机。
  • 网络白名单:对模型可以访问的外部站点进行严格的访问控制。

由于公共评估集易被污染且难以完全体现模型在真实场景中的体验,我们构建了 Cursor Bench。这是一个完全不参与训练的私有评估集,完全基于 Cursor 自身代码库中的真实软件工程任务,从而能真实反映模型解决日常工程问题的能力。

Original English Source

But really the place where we can make massive speed ups is improving that inner loop. So, just to zoom back in on that again, we have these high-quality evals, we have these very difficult training tasks, and we want to climb these evals as quickly as possible so that we know if we make a new checkpoint of the model, we're actually making progress on the things that we want to measure. So, for example, some of the evals that we have introduced or have already had are things like understanding what you really meant when you have included maybe 50 skill files. It gets kind of hard for the models to figure out your actual intent. Or trying to figure out the line between when you push back and ask the user to clarify a question versus when you trust their judgment and they said, "No, I really wanted to do this." There's just kind of a fine line, and people have different preferences. So, a lot of these evals are trying to shape a lot of those different behaviors, and also model what it feels like to be a software engineer. We ask the models to do really ambitious things like, "Hey, we just had this sev. Could you have actually went and read through all the data dog logs, read through Slack, read through Notion, and came to the same conclusion or the same fix that we did?" Uh and a lot of models are just not very good at this today. And that uh backs a lot of the evals that we create based off these software engineering tasks. Now, as the models get smarter, they also find very creative ways to hack the evals. So, as we've been training for a new version of our model, we also noticed there was some interesting reward hacking going on. Um the models learned how to really just go back in the Git history and figure out if there was a solution or a part of a solution. Uh they figured out good ways to go online, and if it was a public eval, just see if there was a fork of the eval anywhere they could look up the results from. And this affected our own models as well as other models. So, we did a little research here and found that if we did just a couple small changes on measuring public uh evals, we could have a pretty noticeable uh change in the scores that were reported. So, first off, we would delete the Git history at the start, and we could restore it at the end, so that wouldn't affect the run. And then also, we can have a network allow list or just some basic controls on the sites that the uh the agent can go and talk to. And I think this is helpful for public evals which often are the things that people are using to calibrate whether a model is good when it gets released. You know, you see that big chart of all the benchmark numbers. But this isn't really a true test of what it feels like to use these models. Like in reality you have access to the internet. You can do whatever you want on the internet with these models and you're definitely using Git. So you want to be able to test the true capabilities of the models. And that's why we have Cursor Bench. We have this private eval set that is mostly made up of things that happen in our code base which is held out from the evals so we ensure that the models aren't trained on it and it's based on those real-world engineering tasks.

逆向环境生成与文本反馈强化学习

为了应对不断变强的模型,评估集的生命周期正在急剧缩短,当所有模型的得分都趋近 90% 时,该评估集就应当被淘汰。这要求我们必须持续产出极高难度的难题。我们采用的一种创新方法是逆向环境生成:我们在代码库中先构建一个高度复杂的完整应用程序,然后让算法随机删除其中的某些功能或文件,导致测试套件报错。接着,我们要求模型在无提示的情况下自行想办法重新实现被删掉的功能,只要最终测试全部通过,模型就能获得奖励。这种方式高度自动化且极具校验性,帮助我们规模化地为前沿模型生产出了极具挑战性的训练场景。

在训练方法上,我们引入了文本反馈(Textual Feedback)技术以实现模型的“自我教练”。在动辄包含数十万 Token 的长链路智能体对话或强化学习 Rollout 中,如果仅在最后对模型决策进行对错评分,很难把信用(Credit Assignment)精准归因到具体的步骤上(究竟是哪一次工具调用出了错,还是哪个思维链步骤产生了偏差?)。

  • 操作逻辑:当模型(学生)调用某个工具失败时,我们会引入另一个拥有相同模型基础的“教师模型”,向它提供一句包含文本反馈的提示(例如:“提示:你拥有这些可用的工具”)。
  • 概率调整:通过引入这些微小的暗示,我们重新计算并微调概率分布,在强化学习过程中调高我们期望的行为权重,降低不合规行为的权重。

这种方法不仅极大地改善了模型对工具调用的依从性,还被我们广泛应用于代码风格塑造以及强化学习过程中的各种行为引导。

Original English Source

Now another part of climbing that inner loop is trying to make very very difficult problems for the models to solve. As the models get better, you might have noticed if you're looking at an eval and all the models are scoring like 90% probably time to retire that eval and try to get something more difficult and that the half-life of those evals will go down as the models get smarter. And to do this it requires a lot of things. It requires some amount of research or taste in what these problems should be. It requires a lot of compute so you can try a lot of different ideas. Some of them are going to are going to work, some of them are not going to work and there's a race against the clock here so you want to try as many in parallel as you can. Just to put a example to this of one of those type of problems, let's say that on the left for example you have each one of those squares is representing files in a code base and then on the bottom you have the tests. One thing you can do is generate a very complex application or environment for a very ambitious application or task and then you can delete part of it. You can delete a feature, you can delete files and the test will then fail. And then you can ask these models to go and basically figure out however it wants to re-implement that feature and it has a very verifiable goal of all the test passing to be able to get some reward back at the end. And this actually works out pretty well and has allowed us to scale making these interesting problems for the you know, the frontier models to solve. Additionally, we have found some new learning methods which I personally think are really interesting. The first one is you can teach the model to kind of coach itself. So, for example, if you think about an RL rollout or a conversation with an agent, this can be hundreds of thousands of tokens. And if you think about trying to grade at the end of this where the model made a right decision or a wrong decision, that's kind of hard, right? You have all these tool calls, you have thinking blocks. It's pretty hard to figure out where to assign that credit to the root issue. So, the more precise we can be the better. You know, was it one of the tool calls, was it a thinking block? It's pretty hard. And one thing that we've done to improve this process is something called textual feedback. So, we want to zoom in on one specific part of that rollout, and ideally we can hint or kind of nudge to the model, "Hey, by the way, here's a way you could improve." And then look at the probabilities again and nudge up the ones we want or you know, down weight the ones we don't want. Uh for example, on the left you have this student case where you have a rollout and it tries to call a tool, and the tool call fails. It should have known that this tool was there, but it just decided not to work for this time. We can then use a teacher, we can use the same model, but we include this hint. And we say, "Hey, as a reminder, you have all of these tools available." And then we like I mentioned, we can just upvote or up weight the probability is such that we can get the behaviors that we want. And this example is with, you know, adherence to tool calling, but we can really use this for anything. We can use this for making style changes. We can use this to get any behavior we want to influence the models during RL, and this has proven to be uh very valuable for us.

算力飞跃:全栈算力基础设施与资源分配

要让这一整套训练与评估闭环全速运转,核心的物理引擎依然是算力。我们在今年 3 月宣布与 SpaceX 建立了深度合作伙伴关系,借此获取了庞大的算力资源。这不仅让我们能够从头开始预训练(Pre-train)超大型模型,还能让我们实现从应用端到超级计算机和数据中心的全栈定制。

在这项合作中,有两项基础设施格外引人瞩目:

  • Colossus 巨型超级计算机:其数据中心建设速度令人震惊。团队在短短 122 天内便部署了第一批 100,000 张 GPU,随后又在 92 天内追加了另外 100,000 张 GPU。该系统通过爆改位于孟菲斯(Memphis)的旧厂房得以快速立起,极大地支撑了我们的模型训练。
  • Terafab 芯片工厂:通过 Terafab,我们正在越来越多地涉足定制化芯片的设计与生产。其物理建筑规模宏大,堪比 100 个 Buc-ee's 超级加油站(这是美国南方标志性的巨型高端便利商店体验,其占地极大),展现了极其震撼的技术体量。

算力在我们的迭代流程中被精细地分配到了各个关键环节,以确保飞轮不停运转。我们不仅需要算力来向终端用户提供模型服务,更需要它在内部运行各类 A/B 测试、执行从预训练、中期训练(Mid-training)到强化学习的完整流程,同时还要支持用于评估的难题生成、得分判定以及研究员日常进行的各种高风险实验。

Original English Source

Now, how we scale these loops, both the inner and outer loops, also comes down to scaling the amount of compute we have. Um we announced back in March that we are partnering with SpaceX to get access to a lot of more compute, and this allows us to train very large models from scratch, not only the product, but also the models down to the supercomputers or the data centers where we're training these models with Colossus, and then increasingly to the chips as well with Terafab. And that just allows you to do some pretty interesting things in taking advantage of that full stack. If you haven't seen Colossus, I think it's really interesting personally. They were able to train uh they were able to build out this supercomputer in 122 days for 100,000 GPUs, and then added another 100,000 GPUs in 92 days. So, very impressive. They had to do some pretty creative things to get this done and kind of take over this old factory in Memphis, and it's kind of shown they can stand up these data centers really quick, which is of course very helpful for our model training efforts. And for Terafab, I think it's also very interesting that they're building their own chips. I mean, to put the size of this into perspective, if you just think about how large this physical structure is, I know you're all thinking it, it's like the size of 100 Buckee's, which for my for my folks from the south, you know, we love Buckee's. I'm not even from the south and I love Buckee's. This is like the crown jewel of the south, the premium gas station experience. It's It's a lot of stuff, but that just puts it into perspective the size. So, going back to this equation at the start, more compute in, you get a better model out. I think it's sometimes hard to understand what does that compute even do? Where Where do you actually put that compute? Let's say you have access to a bunch of GPUs, like what do I do with it? And I think it's helpful just to step through a few of the things. Of course, first you have actually serving the model to end users, but also you're serving up different checkpoints internally, you're running different AB tests, you're trying different variations of the model. You have the actual training process itself, but also the sub-pieces from pre-training to mid-training to RL. And then also you're then training these derivative models to do other parts of the process like climbing the inner loop, which we'll talk about here in a second. You have the data generation and the reward generation, so creating those really ambitious problems that I talked about or when you're doing evals trying to create these rubrics for whether it was successful or not and give it some grade and then actually judging those scores. Um you also have the evals themselves. Ideally on every new checkpoint of the model you want to be continuously running evals to see if you're improving in the places that you're measuring as as well as just developing new evals all the time. Like I mentioned the the half-life of these evals as models get smarter, you need to be really continuously investing in making these better. Um and there's just the research itself. Ideally you want to free up your team of researchers to be able to tweak the knobs, to try ambitious ideas, experiment with new things, as well as do side runs. And this all is compute that needs to be, you know, allocated for somewhere.

递归自省:人机协同与模型自我训练

随着算力的扩充,限制迭代速度的瓶颈逐渐从物理算力转移到了“人”的精力上——如何解放研究人员,避免让他们陷入繁琐的模型指标监控和训练任务跟进?我们的解法是构建一套智能体网络(Agent Fleet)。

  • 智能体管理与人机协同:我们团队成员可以通过 Slack 直接向智能体集群发布实验指令、启动模型训练或生成新难题。智能体群会在后台默默工作,而一旦遇到底层基建断联、训练指标异常等偶发故障(Blips),智能体会在 Slack 上直接向研究员发送消息进行“呼叫”(Page),避免因人为未察觉而浪费宝贵的算力窗口。
  • 递归自适应提升(Recursive Model Improvement):最吸引人的前景是让模型学会如何训练下一个模型。每当我们将顶层模型训练得更加聪明时,我们就可以将这种更高阶的智能“蒸馏”(Distill)到用于打分、辅助评估、充当文本反馈导师的衍生模型中。

这形成了一个正向循环:顶层主模型变得越聪明,我们拥有的评判和辅助模型也会随之水涨船高,进而提升内环和外环中所有步骤的精准度,抬高整体智能系统的“下限”。这种模型不断代表人类自我优化、自我训练的递归自省模式,将在未来更庞大算力上线后,彻底重塑 AI 的进化曲线。

Original English Source

But what that ultimately turns into is ideally you can get in a state where you have multiple large training runs happening at the same time, where the researchers are unblocked and they can go try their research and you're still kind of contributing back to this core flywheel. And if you do that and we revisit our speed meter in the bottom right, you're starting to get to a point where you're getting something that's like RSI or recursive model uh and and improvement here where the models are improving much much faster. Then the bottleneck becomes how do you scale the folks actually training the models? How can you automate the more monotonous parts of machine learning or research so that you can get these useful models out into the world. And this is where I think it starts to get really interesting. If you think about the model as Mario, if you give it some tools, all of a sudden you're more like a Super Mario. And if you give it great context, everything about your organization, all the places that you work, you connect it to all your different tools, that context kind of turns it into the fire Mario or the super fire Mario. And just to kind of further prove this point and add a few examples here, I think for tools, a lot of these are pretty obvious. The models can write code with a with a harness. They can you run shell commands. They can look things up on the web. But I think increasingly, even with these primitive versions of memory like writing files, these last three I think are just starting to become really popular and more useful, which is the models in the harnesses should be able to use a computer exactly like you would. It doesn't need to be just inside of your GUI or your CLI. It should be able to control every part of your computer. You as a human on Slack or on your tool is basically subscribing to Slack threads in your head so that you can follow them for updates. Ideally, you kind of want the models to just follow a thread and then ping you if it needs something. And just like we have code bases that store the code, increasingly as these models do more work for us, they kind of need like a Dropbox for themselves. Like where do you store the slide decks, right? You could put that in code, I guess, but I think there's an increasingly a new opportunity here. And then for context, of course, you have all the different places you can hook up with MCPs, Slack and Notion, Linear, Data Dog, etc. and the code base itself. But I think these last two are really interesting, which is increasingly we find that you have a human working with a team of agents, and then the agents can start working with the other agents. It's a little meta, but I think this will be a big trend in the next 6 months. Just to kind of to example to this. We've created these tools and these systems where researchers can run experiments directly from Slack. We want to avoid this state of being bottlenecked on humans launching and reviewing and babysitting runs. And we actually have an entire team just working on automating every part of the research work that isn't uh you know, isn't freeing up the researchers' time to work on their most ambitious ideas. So, every person on the ML team gets access to this fleet of agents they can basically train models directly from Slack. And what a few people on the team have taken this very far where they have these agent systems that can go and do a lot of work for them. Maybe they want to go create a bunch of very difficult problems for the models to uh try and solve or they want to create a whole bunch of new evals based on some good ideas that they have. And they just want to let the models cook and go work for a while. But, if something gets wrong, if the infrastructure goes down, there's some blip somewhere, the model can message them on Slack or just page them directly and say, "Hey, this is really important. You don't want to lose 6 hours because your infra was down. Like, you should go check this out right now." And this like human-to-agent coordination, I think is just starting to be figured out and it will be an increasing trend. The last bit here is that the model is learning to train the next model. And it it it's a little hard to wrap your brain around. The way I like to think about it is every time you release a new version of this intelligence, then you can create or distill these derivative versions that you use to speed up other parts of the training process, both the inner loop and the outer loop. So, when you're trying to do your evals, for example, you have different models for doing the judging and you have uh your reward models as well. So, when you make the top-level model model smarter, it actually improves the whole system. If you think about the multiple training runs diagram I showed, I'm going to throw on a uh a new meter here, which is the brain to galaxy brain meter or the intelligence meter, you are a bottlenecked here on the smartest model in your system. And if the smartest model then creates those derivative models, when you can improve that, you can actually make every single one of these loops much, much better because you've raised the kind of floor of the intelligence. And this is how you start to get to something that feels like this recursive self-improvement, this model that is just improving all the time on your behalf. And especially as we bring more and more compute online, I think this is really going to help us scale our model efforts and hopefully make even more useful models for you all to use. Uh to conclude, I just like to thank everyone on the Cursor engineering and ML and research teams who have been uh working hard to get a new model out to you all here very soon, hopefully very, very soon, uh that we think will be a pretty notable improvement over our last model. And we're excited for you to try it. Thank you so much.

📌 文中提及的人物和组织

公司/组织: Cursor, SpaceX

产品/模型: Composer

关键字: recursive-model-improvement reinforcement-learning reward-hacking evaluation-benchmark compute-scaling