Cursor is a next-generation code editor built as a fork of VS Code, designed to revolutionize AI-assisted programming. Inspired by the scaling laws in AI and early breakthroughs with models like Copilot and GPT-4, the team recognized a critical gap: while AI models improved, the tools around them remained stagnant. Cursor addresses this by embedding AI deeply into the editing workflow, introducing intelligent features like "Tab" that predict and execute the next code change—jumping ahead of the user in time and logic. This is powered by custom-trained models and techniques like speculative decoding, which drastically reduce latency and computational load. The editor also features a smart diff interface that highlights only relevant code changes, guiding developers through complex edits with less cognitive effort. Unlike traditional code review tools, Cursor leverages AI to anticipate developer intent, especially in multi-file or large-scale edits. A key insight is that real-world programming is messy and ambiguous, unlike the well-structured benchmarks used to evaluate AI models. As a result, human feedback and qualitative assessment remain essential. The team emphasizes that AI won’t replace human creativity or intuition, but will instead augment it—enabling faster iteration and more natural, less verbose communication between humans and machines. Cursor represents a shift from AI as a side tool to AI as an active, integrated partner in the development process.
The following is a conversation with the founding members of the cursor team, Michael Truel, Swaleassif, Arvid Lunmark, and Aman Sengar. Cursor is a code editor based on VS Code that has a lot of powerful features for AI-assisted coding. It has captivated the attention and excitement of the programming and AI communities. So I thought this is an excellent opportunity to dive deep into the role of AI in programming. This is a super technical conversation that is bigger than just about one code editor. It's about the future of programming, and in general, the future of human AI collaboration in designing and engineering, complicated, and powerful systems. And now a quick few second mention of each sponsor. Check them out in the description, it's the best way to support this podcast. We've got Encore for unifying your machine learning stack, masterclass for learning, Shopify for selling stuff online, NetSuite for your business, and AG1 for your health. Choose what is in my friends. Also, if you want to get in touch with me for whatever reason, or take a survey or submit questions for an AMA, all of that will be great. Go to lexframing.com/contact. And now, onto the full ad reads, I try to make them interesting, but if you skip them, please still check out our sponsors, I enjoy their stuff, maybe you will too. This episode is brought to you by Encore, a platform that provides data-focused AI tooling for data annotation, curation, management, and for model evaluation. One of the things I love about these guys is they have a great blog that describes clearly, I mean, it's technical, but it's not too technical, but it's sufficiently technical to where it's actually describing the idea, it's not BS. Blog posts on sort of the state of the art, like the OpenAI 01 model that was just released. So sometimes they integrate it into why this is a part of Encore, why this makes sense, and sometimes not. And so I love that, I recommend their blog just in general. That said, when they are looking at state-of-the-art models, they are always looking for ways to integrate it into their platform. Basically, it's a place to organize your data, and data is everything. This was true before the popularity and the explosion of attention methods of transformers, and it is still very much true now. Sort of the nonsynthetic, the human-generated data is extremely important. How you generate that data, how you organize that data, how you leverage it, how you train on it, how you fine tune on it, the pre-training, the post-training, all of it, the whole thing. It is extremely, extremely important. And so Encore takes data very seriously. Anyway, go try out Encore to create, annotate, and manage your AI data at encore.com/lex. That's encore.com/lex. This episode is also brought to you by Masterclass, where you can watch over 200 classes from the best people in the world in their respective disciplines. Carlos Santana and guitar, for example. I love that one. And there's a few guitarists Tom Morello too, great, great, great stuff, but Carlos Santana, his instrumental Europa. I haven't quite tried to play that, but as I might to do list, it's sort of one of those things you know for sure. This is the thing I will play, because it's too beautiful. It's too soulful. It feels like once you play, you understand something about the guitar that you didn't before. It's not blues. It's not. It is. It's some kind of dreamlike teleportation into a psychedelic world where the tone is warmer than anything else I've ever heard. And still the guitar can cry. I don't know. I love it. He's a genius. So it's such a gift that you can get a genius like that to teach us about his secrets. Get unlimited access to every masterclass and get an additional 15% off an annual membership at masterclass.com/legspod. That's masterclass.com/legspod. This episode is also brought to you by Shopify, a platform designed for anyone to sell anywhere with a great looking online store, or simple looking online store. Like the one I put together at lexframing.com/store, I have a few shirts on there in case you're interested. And speaking of shirts, I'm reminded of thrift stores, which I very much loved for a long time. I still love thrift stores or nice places to get stuff like kitchen stuff and clothing. And the kind of clothing you get at thrift stores is actually pretty interesting because there's shirts there that are just unlike anything else you would get anywhere else. So if you're sort of selective and creative minded, there's a lot of interesting fashion that's there. And in terms of t-shirts, there's just like hilarious t-shirts. T-shirts that are very far away from the kind of trajectories you have taken in life or are not, but you just haven't thought about it. Like a band that you love, but you've never would have thought to wear their t-shirt. Anyway, a little bit. I think it Shopify is the internet thrift store. Of course you can do super classy, you can do super fancy or you can do super thrift. All of it is possible. Sign up for a $1 per month trial period at Shopify.com/lex. That's all lower case. Go to Shopify.com/lex to take your business to the next level today. This episode is also brought to you by Netsuite and all in one cloud business management system. Sometimes I think that Netsuite is supporting this podcast because they're trolling me. They're saying, "Hey Lex, aren't you doing a little too much talking? Maybe you should be building more." I agree with you, Netsuite. I agree with you. And so every time I do an ad read for Netsuite, it is a chance for me to confront my Jung-in shadow. Some of the demons emerge from the subconscious and ask questions that I don't have answers to. There's about one's mortality and that life is short, and that one of the most fulfilling things in life is that I have a family and kids and all of these, things that I would very much like to have. And also the reality that I love programming and I love building, I love creating cool things that people can use and share and that would make their life better. All of that. Of course, I also love listening to podcasts. And I kind of think of this podcast as me listening to a podcast where I can also maybe participate by asking questions. So all these things that you love, but you ask the hard question of like, "Okay, while life is slipping away, it's short, it really, really is short. What do you want to do with the rest of the minutes and the hours that make up your life?" Yeah. So thank you for the existential crisis, Netsuite, I appreciate it. If you're running a business, if you have taken a leap into the unknown and started a company, then you should be using the right tools to manage that company. In fact, over 37,000 companies have upgraded to Netsuite. Take advantage of Netsuite's flexible financing plan at Netsuite.com/Lux, that's Netsuite.com/Lux. This episode is also brought to you by The Delicious, The Delicious AG1. It's an all-in-one daily drink to support better health and peak performance is basically a super awesome multivitamin that makes me feel like I have my life together, even whenever everything else feels like it's falling apart, at least I have AG1, at least I have that nutritional foundation to my life. So all the fasting I'm doing, all the carnivore diets, all the physical endurance events and the mental madness of staying up all night or just the stress of certain things I'm going through, all of that. AG1 is there, at least I have the vitamins. They sometimes wonder, they used to be called athletic greens, and now they're called AG1. I always wonder, is AG2 coming? Why is it just one? It's an interesting branding decision, like AG1. Me is an OCD kind of programmer type, it's like, okay, is this a versioning thing? Okay, is this like AG0.1 alpha? What's the final release? Anyway, the thing I like to say and to consume is AG1, they'll give you one month supply of fish oil when you sign up at drinkag1.com/lex. This is the Lex Freeman Podcast, to support it, please check out our sponsors in the description, and now, dear friends, here's Michael, Swale, Arvid, and Aman. All right, this is awesome, we have Michael, Aman, Swale, Arvid, here from the cursor team. What's the point of a code editor? So the code editor is largely the place where you build software, and today, or for a long time, that's meant the place where you text at a formal programming language, and for people who aren't programmers, the way to think of a code editor is like a really souped-up word processor for programmers, where the reason it's souped-up is code has a lot of structure, to the current world.
word processor, the code editor can actually do a lot for you, that word processors in the writing space haven't been able to do for people editing texts there. And so that's everything from giving you visual differentiation of the actual tokens in the code. So you can scan it quickly to letting you navigate around the code base, you're navigating around the internet with hyperlinks, you're going to definitions of things you're using to error checking, to catch rudimentary bugs. And so traditionally that's what a code editor has meant. And I think that what a code editor is is going to change a lot over the next 10 years as what it means to build software maybe starts to look a bit different. I think also a code editor should just be fun. - Yes, that is very important, that is very important. And it's actually sort of an underrated aspect of how we decide what to build. Like a lot of the things that we build and then we try them out, we do an experiment and then we actually throw them out because they're not fun. And so a big part of being fun is like being fast. A lot of the time, fast is funny. - Yeah, fast is, yeah, yeah, that should be a T-shirt. (laughing) - Fundamentally, I think one of the things that draws a lot of people to building stuff on computers is this like insane iteration speed where in other disciplines you might be sort of gate capped by resources or the ability, even the ability to get a large group together and coding is this like amazing thing where it's you in the computer and that alone, you can build really cool stuff really quickly. - So for people that don't know, cursors, this super cool new editor, that's the fork of VS Code. It would be interesting to get your kind of explanation of your own journey of editors. How did you, I think all of you were big fans of VS Code with co-pilot? How did you arrive to VS Code and how did that lead to your journey with Cursor? - Yeah, so I think a lot of us, well, all of us were originally FEM users. Pure VM, yeah, no need of them, just pure VM and a terminal. And at least for myself, it was around the time that co-pilot came out. So 2021, that I really wanted to try it. So I went into VS Code, the only platform, the only code editor in which it was available. And even though I really enjoyed using VM, just the experience of co-pilot with VS Code was more than good enough to convince me to switch. And so that kind of was the default until we started working on Cursor. - And maybe we should explain what co-pilot does. It's like a really nice autocomplete. It suggests, as you start writing a thing, it suggests one or two or three lines, how to complete the thing. And there's a fun experience in that, you know, like when you have a close friendship and your friend completes your sentences. Like when it's done well, there's an intimate feeling. There's probably a better word than intimate, but there's a cool feeling of like, holy shit, it gets me. - You can figure it out. - No, and then there's an unpleasant feeling when it doesn't get you. And so there's that kind of friction, but I would say for a lot of people, the feeling that it gets me overpowers that it doesn't. And I think actually one of the underrated aspects of getting a co-pilot is that even when it's wrong, it's like a little bit annoying, but it's not that bad because you just type another character and then maybe then it gets you or you type another character and then it gets you. So even when it's wrong, it's not that bad. - Yeah, you can sort of iterate and fix it. I mean, the other underrated part of a co-pilot for me was just the first real AI product. So the first language model consumer product. So co-pilot was kind of like the first killer app for the LEMs. - Yeah, and like the beta was out in 2021. - Right, okay. So what's the origin story of Cursor? - So around 2020, the scaling loss papers came out from OpenAI. And that was a moment where this looked like clear predictable progress for the field, where even if we didn't have any more ideas, it looks like you could make these models a lot better if you had more compute and more data. By the way, we'll probably talk for three to four hours on the topic of scaling loss, but just to summarize, it's a paper and a set of papers and set of ideas that say bigger might be better for model size and data size in the realm of machine learning. - It's bigger and better, but predictively better. - Okay, there's another topic of conversation anyway. So around that time for some of us, there were like a lot of conceptual conversations about what's this kind of look like? What's the story going to be for all these different knowledge work it feels better? How they're going to be made better by this technology getting better? And then I think there were a couple of moments where like the theoretical gains predicted in that paper started to feel really concrete and it started to feel like a moment where you could actually go and not do a PhD if you wanted to work on, do useful work in AI. Actually felt like now there was this this whole set of systems one could build. They were really useful. And I think that the first moment we already talked about a little bit, which was playing with the early bit of Copilot. Like that was awesome and magical. I think that the next big moment where everything kind of clicked together was actually getting early access to GP4. So it was sort of end of 2022 was when we were tinkering with that model and the step of in capabilities felt enormous. And previous to that, we had been working on a couple of different projects we had been because of Copilot, because of scaling odds, because of our prior interest in the technology. We had been tinkering around with tools for programmers, but things that are very specific. So we were building tools for financial professionals who have to work within a GP or notebook or playing around with, can you do static analysis with these models? And then the step of in GP4 felt like, look, that really made concrete the theoretical gains that we had predicted before. It felt like you could build a lot more just immediately at that point in time. And also, if we were being consistent it really felt like this wasn't just gonna be a point solution thing. This was gonna be all of programming was gonna flow through these models. It felt like that demanded a different type of programming environment, a different type of programming. And so we set off to build that sort of larger vision around then. - There's one that I distinctly remember. So my roommate is an IML gold winner and there's a competition in the US called a Putnam, which is sort of the IML for college people and it's this math competition. It's exceptionally good. So Shengtong and Aman, I remember it sort of June of 2022 had this bet on whether the mod, like 2024, June or July you were going to win a gold medal in the IML with like models. - IML is an International Math Olympian. - Yeah, IML is International Math Olympiad. And so Arvid and I are built there, you know, also competed in it. So it was sort of personal. And I remember thinking, Matt, this is not going to happen. This was like, even though I sort of believed in progress, I thought, you know, I'm a girl, just like Aman is just delusional, that was the, that was the, and to be honest, I mean, I was, to be clear, very wrong. But that was maybe the most prescient bet in the group. - So the newer is also in deep mind. It turned out that you were correct. - That's what this was, technically not. - Technically incorrect, but one point away. Aman was very enthusiastic about this stuff, yeah. And before Aman had this like scaling loss t-shirt that he would want to have the like charts and like the formulas on it. - So you like felt the Asia, or you felt the scale? - Yeah, I distinctly remember there is this one conversation I had with Michael, where before it hadn't taught super deeply and critically about scaling laws. And he kind of posed the question, why isn't scaling all you need? Or why isn't scaling in a result in massive gains in progress? And I think I went through like the stages of grief. There is anger, denial, and then finally at the end, just thinking about it, acceptance. And I think I've been quite hopeful and optimistic about progress since. I think one thing I'll caveat is, I think it also depends on like which domains you're going to see progress. Like math is a great domain because, especially like formal theorem proving because you get this fantastic signal of actually verifying if the thing was correct. And so this means something like RL can work really, really well. And I think like you could have systems that are perhaps very super human to math and still not technically have AGI. - Okay, so can we take it all the way to cursor? And what is cursor? It's a fork of VS code. And VS code is one of those popular editors for a long time. Like everybody found love with it. Everybody left VIM. I left DMACS for, sorry. So unified in some fundamental way the developer community. And then you look at the space of things. You look at the scaling laws, AIs becoming amazing. And you decided, okay, it's not enough to just write an extension fee of VS code because there's a lot of limitations to that. We need, if AIs gonna keep getting better, better, better, we need to really like rethink how the AIs gonna be part of the editing process. And so you decided to fork VS code and start to build a lot of the amazing features we'll be able to talk about. But what was that decision like? Because there's a lot of extensions, including co-pilot of VS code that are doing sort of AI type stuff. What was the decision like to just fork VS code? So they're just. decision to do an editor seemed kind of self evident to us for at least what we wanted to do in a chief, because when we started working on the editor, the idea was these models are going to get much better, their capabilities are going to improve and it's going to entirely change how you build software. Both in a you will have big productivity gains, but also radical and I like the active building software is going to change a lot. And so you're very limited in the control you have over a code editor if you're a plug into an existing coding environment and we didn't want to get locked in by those limitations. We wanted to be able to just build the most useful stuff. Okay. Well then the natural question is, you know, VS Code is kind of with co-pilot a competitor. So how do you win? Is it basically just the speed and the quality of the features? Yeah. I mean, I think this is a space that is quite interesting, perhaps quite unique where if you look at previous tech waves, maybe there's kind of one major thing that happened and I'll unlock a new wave of companies, but every single year, every single model capability, or jump you get in model capabilities, you now unlock this new wave of features, things that are possible, especially in programming. And so I think in AI programming, being even just a few months ahead, let alone a year ahead, makes your product much, much, much more useful. I think the cursor a year from now will need to make the cursor of today look obsolete. And I think Microsoft has done a number of fantastic things, but I don't think they're in a great place to really keep innovating and pushing on this in the way that a startup can. Just rapidly implementing features. And push, yeah, and kind of doing the research experimentation necessary to really push the ceiling. I don't know if I think of it in terms of features as I think of it in terms of like capabilities for programmers. It's that like, you know, as you know, the new or one model came out, and I'm sure there are going to be more, more models of different types, like longer context and maybe faster. Like there's all these crazy ideas that you can try and hopefully 10% of the crazy ideas will make it into something kind of cool and useful. And we want people to have that sooner to rephrase. It's like an underrated fact is we're making it for ourselves. When we started cursor, you really felt this frustration that, you know, models, you could see models getting better, but the cobalt experience had not changed. It was like, man, these guys, like the ceiling is getting higher. Like, why is they not making new things? Like they should be making new things. They should be like, he like, like, where's the worst, oh, there's all the alpha features. There were no alpha features, it was like, I'm sure it was selling well. I'm sure it was a great business, but it didn't feel I'm one of these people that really want to try and use new things and it was just, there's no new thing for like a very long while. Yeah, it's interesting. I don't know how you put that into words, but when you compare cursor with copilot, copilot pretty quickly became, started to feel stale for some reason. Yeah, I think one thing that I think helps us is that we're sort of doing it all in one where we're developing the UX and the way you interact with the model. At the same time as we're developing, like, how we actually make the model give better answers. So we're like, how you build up the prompt or like, how do you find the context and for a cursor tab? Like, how do you train the model? So I think that helps us to have all of it, like, sort of like the same people working on the entire experience and trend. Yeah. It's like the person making the UI and the person training the model, like sit to like 18 feet away. Okay. Same person even. Yeah. Often even the same person. You can create things that are sort of not possible if you're not talking, you're not experimenting. And you're using, like you said, cursor to write cursor. Of course. Oh, yeah. Yeah. Well, let's talk about some of these features. Talk about the all-knowing, the all-powerful praise beat to the tab for the, you know, autocomplete on steroids, basically. So how does tab work? What does tab to highlight and summarize at a high level? I'd say that there are two things that cursor is pretty good at right now. There are other things that it does. But two things that it helps programmers with. One is this idea of looking over your shoulder and being like a really fast colleague who can kind of jump ahead of you and type and figure out what you're, what you're going to do next. And that was the original idea behind, that was kind of the kernel of the idea behind a good autocomplete was predicting what you're going to do next. But you can make that concept even more ambitious by not just predicting the characters after your cursor, but actually predicting the next entire change you're going to make the next diff, next place you're going to jump to. And the second thing, cursor is pretty good at right now too, is helping you sometimes jump ahead of the AI and tell it what to do and go from instructions to code. And on both of those, we've done a lot of work on making the editing experience for those things ergonomic and also making those things smart and fast. One of the things we really wanted was we wanted the model to be able to edit code for us. That was kind of a wish and we had multiple attempts at it before, before we had a sort of a good model that could edit code for you. Then after we had a good model, I think there have been a lot of effort to make the inference fast for having a good, good experience. And we've been starting to incorporate, I mean, Michael sort of mentioned this ability to jump to different places. And that jumped to different places, I think, came from a feeling of, once you accept an edit, it's like, man, it should be just really obvious where to go next. It's like, I'd made this change. The model should just nail that like the next place to go to is like 18 lines down. Like if you're a wind user, you could press 1, 8, J, J, or whatever, but why am I doing this? The model should just know it. And then so the idea was, you just press tab, it would go 18 lines down and then make it so you show you the next edit and you would press tab, so as long as you could keep pressing tab. And so the internal competition was, how many tabs can we make the one press? Once you have like the idea, more sort of abstractly, the thing to think about is sort of like how are the edits sort of zero entropy? So once you've sort of expressed your intent and the edit is, there's no like new bits of information to finish your thought, but you still have to type some characters. To like make the computer understand what you're actually thinking, then maybe the model should just sort of read your mind and all the zero entropy bits should just be like tab away. Yeah. That was sort of the abstract version. There's this interesting thing where if you look at language model loss on different domains, I believe the bits per byte, which is kind of character normalized loss for code, is lower than language, which means in general there are a lot of tokens in code that are super predictable. A lot of characters that are super predictable. And this is I think even magnified when you're not just trying to autocomplete code, but predicting what the user is going to do next in their editing of existing code. And so the goal cursor tabs, let's eliminate all the low entropy actions you take inside of the editor. When the intent is effectively determined, let's just jump you forward in time. Skip you forward. Well, what's the intuition and what's the technical details of how to do next cursor prediction of that jump? That's not that's not so intuitive. I think the people. Yeah. I think I can speak to a few of the details on how to make these things work. They're incredibly low latency. So you need to train small models on this task. In particular, they're incredibly pre-filled token hungry. What that means is they have these really, really long prompts where they see a lot of your code. And they're not actually generating that many tokens. And so the perfect fit for that is using a sparse model, meaning an MLE model. So that was one breakthrough we made that substantially improved performance at longer context. The other being a variant of speculative decoding that we build out called speculative edits. These are two, I think, important pieces of what make it quite high quality and very fast. Okay. The mixture of experts, the input is huge, the output is small. Yeah. Okay. So like, what else can you say about how to make it like scashing, play a role in this? Oh, caching. Caching plays a huge role because you're dealing with this many input tokens. If every single keystroke that you're typing in a given line, you had to rerun the model on all of those tokens passed in. You're just going to one significantly great latency to you're going to kill your GPUs with load. So you need to design the actual prompts used for the models, such that they're caching aware. And then yeah, you need to reuse the KV cache across requests, just so that you're spending less work, less compute. Again, what are the things that Tab is supposed to be able to do kind of in the near term, just to like sort of linger on that, generate code, like fill empty space. So edit code across multiple lines and then jump to different locations at the same file. Yeah. And then like a lot. And then jump to different files also. So if you make an edit in one file and maybe, maybe you have to, maybe you have to go to another file to finish your thought.
should go to the second file also. And then the full generalization is like next action prediction. Sometimes you need to run a command in the terminal, and it should be able to suggest the command, based on the code that you wrote to. Or sometimes you actually need to suggest something, but it's hard for you to know if it's correct, because you actually need some more information to learn, like you need to know the type to be able to verify that it's correct. And so maybe it should actually take you to a place that's like the definition of something, and then take you back so that you have all the requisite knowledge to be able to accept the next completion. - So providing the human the knowledge. - Yes. - Right. - Yeah. - Can you integrate, like, I just gone to know a guy named Prime Gen who I believe has an SS, you can order coffee via SSH. - Oh yeah. - Oh, we did that. - We did that. - So can that also the model do that, like, eat you and my age, and provide you with caffeine. Okay, so that's the general framework. - Yeah, and the magic moment would be if, it is, programming is this weird discipline where, sometimes the next five minutes, not always, but sometimes the next five minutes, what you're gonna do is actually predictable from the stuff you've done recently. And so can you get to a world where that next five minutes either happens by you disengaging and it taking you through, or maybe a little bit more of just you seeing next step what it's gonna do. And you're like, okay, that's good, that's good, that's good, that's good. And you can just sort of tap, tap, tap through these big changes. - As we're talking about this, as you've mentioned, one of the really cool and noticeable things about Cursor is that there's this whole diff interface situation going on. So, like, the model suggests with the red and the green of like, here's how we're gonna modify the code. And in the chat window, you can apply, and it shows you the diff and you can accept the diff. So maybe can you speak to whatever direction of that? - We'll probably have like four or five different kinds of diffs. So we have optimized the diff for the autocomplete, so that has a different diff interface than, than when you're reviewing larger blocks of code. And then we're trying to optimize another diff thing for when you're doing multiple different files. And sort of at a high level, the difference is, for when you're doing autocomplete, it should be really, really fast to read. Actually, it should be really fast to read in all situations, but in autocomplete, it's sort of, you're really like your eyes focused in one area. You can't be in too many. The humans can't look in too many different places. - So you're talking about on the interface side? - On the interface side. - So it currently has this box on the side. So we have the current box. And if you try to delete code in some place and try to add other code, it tries to show you a box on the side. - You may be showing it if we pull it up and cursor.com. This is what we're talking about. - So that box, it was like three or four different attempts at trying to make this thing work, where first the attempt was like these blue crossed outlines. So before it was a box on the side, it's used to show you the code to delete by showing you like Google Doc style, you would see like a line through it. Then you would see the new code. That was super distracting. And then we tried many different, there was sort of deletions, there was trying to read highlight. Then the next iteration of it, which is sort of funny, would you would hold the on Mac the option button. So it would sort of highlight a region of code to show you that there might be something coming. So maybe in this example, like the input and the value would all get blue. And the blue would highlight that the AI had a suggestion for you. So instead of directly showing you the thing, it would show you that the AI, it would just hint that the AI had a suggestion. And if you really wanted to see it, you would hold the option button and then you would see the new suggestion. Then if you release the option button, you would then see your original code. - So that's by the way, that's pretty nice, but you have to know to hold the option button. - Yeah, by the way, not a Mac user, but I got it option. - It was it's a button I guess you people have. - It's again, it's just not intuitive. I think that's the key thing. - And there's a chance this is also not the final version of it. - I am personally very excited for making a lot of improvements in this area. Like we often talk about it as the verification problem where these divs are great for small edits, for large edits or like when it's multiple files or something. It's actually a little bit prohibitive to review these divs. And so there are like a couple of different ideas here. Like one idea that we have is, okay, you know, like parts of the divs are important. They have a lot of information. And then parts of the div are just very low entropy. They're like the same thing over and over again. And so maybe you can highlight the important pieces and then gray out the not so important pieces. Or maybe you can have a model that looks at the div and sees, oh, there's a likely bug here. I will like mark this with a little red squiggly and say like, you should probably like review this part of the div and ideas in that vein. I think are exciting. - Yeah, that's a really fascinating space of like UX design engineering. So you're basically trying to guide the human programmer through all the things they need to read and nothing more. Like optimally. - Yeah, and you want an intelligent model to do it. Like currently div algorithms are, they're like, like they're just like normal algorithms. There's no intelligence. There's like intelligence that went into designing the algorithm, but then there is no like, you don't care if it's about this thing or this thing, as you want the model to do this. - So I think the general question is like, Matt, these models are going to get much smarter as the models get much smarter. The changes they will be able to propose are much bigger. So the apps that changes gets bigger and bigger and bigger. The humans have to do more and more verification work. It gets more and more hard. Like you need to help them out. And it's sort of, I don't want to spend all my time reviewing code. - Can you say a little more across multiple files div? - Yeah, I mean, so GitHub tries to sell this, right? With code review. When you're doing code review, you're reviewing multiple diffs across multiple files. But like Arvid said earlier, I think you can do much better than code review. Code review kind of sucks. Like you spend a lot of time trying to grok this code that's often quite unfamiliar to you. And it often like doesn't even actually catch that many bugs. And I think you can significantly improve that review experience using language models. For example, using the kinds of tricks that Arvid had described. Maybe pointing you towards the regions that actually matter. I think also if the code is produced by these language models, and it's not produced by someone else. Like the code review experience is designed for both the reviewer and the person that produced the code. In the case where the person that produced the code is the language model, you don't have to care that much about their experience. And you can design the entire thing around the reviewer such that the reviewer's job is as fun, as easy as productive as possible. And I think that feels like the issue with just kind of naively trying to make these things look like code review. I think you can be a lot more creative and push the boundary in what's possible. Just one idea there is I think ordering matters. Generally when you review a PR, you have this list of files and you're reviewing them from top to bottom. But actually you actually want to understand this part first because that came logically first. And then you want to understand the next part. And you don't want to have to figure out that yourself. You want a model to guide you through the thing. - And is the step of creation going to be more and more natural language is the goal versus with actual writing? - I think sometimes I don't think it's going to be the case that all of programming will be natural language. And the reason for that is you know, if I'm programming with swallowing and swallowing is at the computer in the keyboard. And sometimes if I'm like driving, I want to say to swallowing, hey, like implement this function and that works. And then sometimes it's just so annoying to explain just what I want him to do. And so I actually take over the keyboard and I show him, I write like part of the example. And then it makes sense. And that's the easiest way to communicate. And so I think that's also the case for AI. Like sometimes the easiest way to communicate with AI will be to show an example and then it goes and does the thing everywhere else. Or sometimes if you're making a website, for example, the easiest way to show to the AI what you want is not to tell it what to do. But you know, drag things around or draw things. And yeah, and like maybe eventually we will get to like brain machine interfaces or whatever and kind of like understand what you're thinking. And so I think natural language will have a place. I think it will not definitely not be the way most people program most of the time. - I'm really feeling the age of AI with this editor. (laughing) It feels like there's a lot of machine learning going on underneath. Tell me about some of the ML stuff that makes it all work. - Well, cursor really works via this on.
example of custom models that we've trained alongside, you know, the frontier models that are fantastic at the reasoning and tense things. And so, cursor tab, for example, is a great example of where you can specialize as a model to be even better than even frontier models if you look at evels on the task we set it at. The other domain, which it's kind of surprising that requires custom models, but it's kind of necessary and works quite well, is in apply. So, I think these models are, like the frontier models are quite good at sketching out plans for code and generating rough sketches of the change, but actually creating diffs is quite hard for frontier models, for when you're training models. Like, you try to do this with SONnet, with '01, any frontier model, and it really messes up stupid things like counting line numbers, especially in super, super large files. And so, what we've done to alleviate this, is we let the model kind of sketch out this rough code block that indicates what the change will be, and we train a model to then apply that change to the file. And we should say that apply is the model looks at your code. It gives you a really damn good suggestion of what new things to do and the seemingly for human trivial step of combining it to, you're saying is not so trivial. Contrary to popular perception, it is not a deterministic algorithm. Yeah. I think like you see shallow copies of apply elsewhere, and it just breaks, like most of the time, because you think you can kind of try to do some deterministic matching, and then it fills, you know, at least 40% of the time, and that just results in a terrible product experience. I think in general, this regime of you are going to get smarter and smarter models. So one other thing that apply lets you do is it lets you use fewer tokens with the most intelligent models. This is both expensive in terms of latency for generating all these tokens, and cost. So you can give this very, very rough sketch, and then have your model models go and implement it, because it's a much easier task to implement. This very, very sketched out code. And I think this regime will continue where you can use smarter and smarter models to do the planning, and then maybe the implementation details can be handled by the less intelligent ones. Perhaps you'll have, you know, maybe a one, maybe it'll be even more capable models, given an even higher level plan that is kind of recursively applied by Sonic and the E-ply model. Maybe we should talk about how to make it fast. Yeah. If you like to fast, there's always an interesting detail. That's good. Yeah. How do you make it fast? Yeah. So one big component of making it fast is speculative edits. So speculative edits are a variant of speculative decoding, and maybe be helpful to briefly describe speculative decoding. With speculative decoding, what you do is you can kind of take advantage of the fact that, you know, most of the time, and I'll add the caveat that it would be when you're memory bound in language model generation. If you process multiple tokens at once, it is faster than generating one token at a time. So this is like the same reason why if you look at tokens per second with prompt tokens versus generated tokens, it's much, much faster for prompt tokens. So what we do is instead of using what speculative decoding normally does, which is using a really small model to predict these draft tokens that your larger model will then go in and verify. With code edits, we have a very strong prior of what the existing code will look like, and that prior is literally the same exact code. So you can do is you can just feed chunks of the original code back into the model, and then the model will just pretty much agree most of the time that, okay, I'm just going to spit this code back out, and so you can process all of those lines in parallel, and you just do this with sufficiently many chunks, and then eventually you'll reach a point of disagreement where the model will now predict text that is different from the ground truth original code. It'll generate those tokens, and then we kind of will decide after enough tokens match the original code to restart speculating a chunks of code. What this actually ends up looking like is just a much faster version of normal editing code. So it looks like a much faster version of the model rewriting all the code. So we can use the same exact interface that we use for DIFs, but it will just stream down a lot faster. And then the advantages that wireless streaming, you can just also be reviewing, start reviewing the code before it's done, so there's no big loading screen. So maybe that is part of the advantage. So the human can start reading before the thing is done. I think the interesting riff here is something like the speculation is a fairly common idea nowadays. It's like not only in language models, I mean, there's obviously speculation and CPUs, and there's speculation for databases, and speculation all over the place. Let me ask the ridiculous question of which element is better at coding? GPT, Claude, who wins in the context of programming, and I'm sure the answer is much more nuanced because it sounds like every single part of this involves a different model. Yeah, I think there there's no model that Prado dominates others, meaning it is better in all categories that we think matter. The category is being speed, ability to edit code, ability to process lots of code, long context, you know, a couple of other things, and kind of coding capabilities. The one that I'd say right now is just kind of net best is on it. I think this is a consensus opinion. Our one's really interesting, and it's really good at reasoning. So if you give it really hard programming interview style problems, or lead code problems, it can do quite, quite well in them. But it doesn't feel like it kind of understands your rough intent as well as on it does. Like if you look at a lot of the other frontier models, one quam I have is it feels like they're not necessarily over, I'm not saying they train on benchmarks, but they perform really well on benchmarks relative to kind of everything that's kind of in the middle. So if you try it on all these benchmarks and things that are in the distribution of the benchmarks they're evaluated on, you know, they'll do really well. But when you push them a little bit outside of that, so on it's I think the one that that kind of does best at kind of maintaining that same capability, like you kind of have the same capability in the benchmark as when you try to instruct it to do anything with coding. What another day goes question is the difference between the normal programming experience versus what benchmarks represent. Like where do benchmarks fall short do you think when we're evaluating these models? By the way, that's like a really, really hard. It's like like critically important detail, like how how difference like benchmarks are versus versus like real coding. We're real coding. It's not interview style coding. You're doing these, you know, humans are saying like half broken English sometimes and sometimes you're saying like, oh, do what I did before. Sometimes you're saying, you know, go add this thing and then do this other thing for me and then make this UI element and then, you know, it's just like a lot of things are sort of context dependent. You really want to like understand the human and do do what the human wants as opposed to sort of this. Maybe the way to put it is sort of abstractly is the interview problems are very well-specified. Dave lean a lot on specification while the human stuff is less specified. Yeah, I think that this this venture question is both complicated by what I'm sorry, just mentioned. And then also to what a man was getting into is that even if you like, you know, there's this problem of like the skew between what can you actually model in a benchmark versus real programming. And that can be sometimes hard to encapsulate because it's like real programming is like very messy and sometimes things aren't super well specified what's correct or what isn't. But then it's also doubly hard because of this public benchmark problem. And that's both because public benchmarks are sometimes kind of filled climbed on. But then it's like really, really hard to also get the data from the public benchmarks out of the models. And so for instance, like one of the most popular like agent benchmarks, sweet bench, is really, really contaminated in the training data of these foundation models. And so if you ask these foundation models to do a sweet bench problem, you actually don't give them the context of a code base. They can like hallucinate the right file pass. They can hallucinate the right function names. And so it's also just the public aspect of these things is tricky. Yeah, like in that case, it could be trained on the literal issues or pull requests themselves. And maybe the labs will start to do a better job, or they've already done a good job at decontaminating those things. But they're not going to emit the actual training data of the repository itself. Like these are all like some of the most popular Python repositories, like Sympi is one example. I don't think they're going to handicap their models on Sympi and all these popular Python repositories in order to get true evaluation scores in these benchmarks. I think that given the DERTHs and benchmarks, there have been like a few interesting crutches that places that build systems with these models or build these models.
Actually use to get a sense of are they going in the right direction or not and in a lot of places People will actually just have humans play with the things and give qualitative feedback on these Like one or two of the foundation model companies. They they have people who that's that's a big part of their role And you know internally we also You know qualitatively assess these models and actually lean on that a lot in addition to like private e-vails that we have It's like the vibe Yeah, the vibe The vibe benchmark human benchmark. Yeah human you pull in the humans to do a vibe check. Yeah, okay I mean, that's that's kind of what I do like just like reading online forms and read it and X just like Well, I don't know how to Properly load in people's opinions because they'll say things like I feel like Claude or GPT's gotten dumber or something. They'll say I feel like and Then I sometimes feel like that too, but I wonder if it's the models problem or mine You know with Claude, there's an interesting take I heard where I think AWS has different chips and I suspect they have slightly different numerics than Nvidia GPUs and Someone speculated that Claude staggered the graded performance would have to do with maybe using the quantized version that existed on AWS bedrock versus Whatever was running on Anthropics GPUs. I interview a bunch of people have conspiracy theories. I'm glad Spoke to this conspiracy It's not like conspiracy theory as much There's you know humans humans are humans and there's there's these details and you know, you're doing like these Quaisy monoflops and you know chips are messy and man you can just have bugs like bugs are It's it's hard to overstate how hard bugs are to avoid What's the role of a good prompt in all this see you will mention that benchmarks have really Structured well formulated prompts What what should a human be doing to maximize success? And what's the importance of what the humans you wrote a blog post on you called it prompt design? Yeah, I think it depends on which model you're using and all of them are slightly different and they respond differently to different prompts, but I Think the original GP4 and the regional sort of breed of a models last last year They were quite sensitive to the prompts and they also had a very small context window and so we have all of these pieces of Information around the code base that would maybe be relevant in the prompt like you have the docs you have the files that you had You have the conversation history and then there's a problem like how do you decide what you actually put in the prompt and when you have an Eliminate space and even for today's models even when you have long context filling out the entire context window means that It's slower and means that sometimes the model actually gets confused and some models get more confused than others And we have this one system internally that we call pre-empt which helps us with that a little bit and I think it was built for the era before where we had 8,000 token context windows and It's a little bit similar to when you're making a website you you sort of You you wanted to work on mobile you wanted to work on a desktop screen and you have this Dynamic information which you don't have for example if you're making like designing a print magazine You have like you know exactly where you can put stuff But when you have a website or when you have a prompt you have these inputs and then you need to format them to always work Even if the input is really big then you might have to cut something down And and and so the idea was okay like let's take some inspiration. What's the best way to design websites? Well, they think that we really like is is react and the declarative approach where you You use JSX in in JavaScript and then you declare this is what I want and I think this has higher priority or like this has higher Z index than something else and then you have this rendering engine in web design It's like Chrome and in our case it's a pre-empt renderer which then fits everything onto the page And as you declaratively decide what you want and then it figures out what you want And as we have found that to be quite helpful and I think the role of it has has sort of shifted over time Where initially was to fit to these small context windows now it's really useful because You know it helps us with Splitting up the data that goes into the prompt and the actual rendering of it and so It's easier to debug because you can change the rendering of the prompt and then try it on old prompts Because you have the raw data that went into the prompt and then you can see did my change actually improve it for for like this entire ebalset See do you literally prompt with JSX? Yes, yes So it kind of looks like react there are components like we have one component that's File a component and it takes in like the cursor Like usually there is like one line where the cursor is in your file And that's like probably the most important line because that's one you're looking at and so then you can give priorities So like that line has the highest priority and then you subtract one for every line that Is farther away and then eventually when it's rendered it figure out how many lines can actually fit in a centers around that thing That's amazing Yeah, and you can do like other fancy things where if you have lots of code blocks from the entire code base You could use retrieval And things like embedding and re-ranking scores to add priorities for each of these components So should humans when they ask questions also use try to use something like that like would it be beneficial To write JSX in the problem or the whole idea is this should be loose and messy I think our goal is kind of that You should just do whatever is the most natural thing for you And then we our job is to figure out How do we actually like retrieve the relative of things so that you're thinking actually makes sense Well, this is a sort of the discussion I had with Arvin of proplexity is like his whole idea is like you should let the person be as lazy. Yeah, yeah, but like Yeah, that's a beautiful thing But I feel like you're allowed to ask more of programmers, right? So like if you say just do what you want I mean humans are lazy There's a kind of tension between just being lazy versus like provide more as Be prompted almost like the system Pressuring you or inspiring you to be articulate Not in terms of the grammar of the sentences, but in terms of the depth of thoughts that you convey inside the the problems I think even as a system gets closer to some level of perfection Often when you ask the model for something you just are not not not enough intent is conveyed to know what to do And there like a few ways to resolve that intent one is the simple thing of having models just ask you I'm not sure how to do these parts based on your query. Could you clarify that? Um, I think the other could be maybe If you there are five or six possible generations given the uncertainty Presenting your query so far. Why don't we just actually show you all those and let you pick them How hard is it to for the model to choose to speak talk back Sort of versus That's it's hard to sort of like how to deal with the uncertainty Do I do I choose to Ask for more information to reduce the ambiguity? So I mean one of the things we we do is It's like a recent addition is try to suggest files that you can add so and while you're typing one can guess what the uncertainty is and Maybe suggest that like you know, maybe maybe you're writing your API and We can guess using the commits That you've made previously in the same file that The client and the server is super useful and There's like a hard technical problem of how do you resolve it across all commits which files are the most important given your current prompt and We're still sort of Initial versions rolled out and I'm sure we can make it much more accurate It's it's very experimental But then the idea is we show you like do you just want to add this file this file this file also to tell you know The model to edit those files for you Because if if you maybe you're making the API like you should also edit the client and the server that is using the API and the other one resolving the API So that will be kind of cool as both there's the phase Where you're writing the prompt and there's before you even click enter Maybe we can help resolve some of the uncertainty to what degrees Agente approaches how use for our agents We think agents are really really cool Like I think agents is like Uh, it's like resembles sort of like a human. It's sort of like the things like you can kind of feel that it like you're getting closer to a GI because you see a demo where Um, it acts as as a human would and and it's really really cool. I think Um agents are not yet Super useful for many things they I think we're getting close to where they will actually be useful and so I think
There are certain types of tasks we're having an agent would be really nice. Like I would love to have an agent. For example, if we have a bug where you sometimes can't command-see and command-v inside our chat input box. And that's a task that's super well-specified. I just want to say, like in two sentences, this does not work. Please fix it. And then I would love to have an agent that just goes off, does it, and then a day later, I come back and I reviewed the thing. You mean it goes finds the right file? Yeah, it finds the right files, it tries to reproduce the bug, it like fixes the bug, and then it verifies that it's correct. And this could be a process that takes a long time. And so I think I would love to have that. And then I think a lot of programming, like there is often this belief that agents will take over all of programming. I don't think we think that that's the case because a lot of programming, a lot of the value is in iterating. Or you don't actually want to specify something upfront. Because you don't really know what you want until you've seen an initial version and then you want to iterate on that. And then you provide more information. And so for a lot of programming, I think you actually want a system that's instant that gives you an initial version instantly back. And then you can iterate super, super quickly. What about something like that reason came out replete agent that does also like setting up the development environment and solving software packages, configuring everything, configuring the databases, and actually deploying the app. Is that also in the set of things you dream about? I think that would be really cool. For certain types of programming, it would be really cool. Is that within scope of cursor? Yeah, we're aren't actively working on it right now. But it's definitely like we want to make the programmers life easier and more fun. And some things are just really tedious and you need to go through a bunch of steps and you want to delegate that to an agent. And then some things you can actually have an agent in the background while you're working, like let's say you have a PR that's both backend and frontend and you're working in the frontend. And then you can have a background agent that doesn't work and figure out kind of what you're doing. And then when you get to the backend part of your PR, then you have some like initial piece of code that you can iterate on. And so that would also be really cool. One of the things we already talked about is speed. But I wonder if we can just linger on that some more in the various places that the technical details involved in making this thing really fast. So every single aspect of cursor, most aspects of cursor feel really fast. Like I mentioned, the apply is probably the slowest thing. And for me from the pain that we're feeling we're working on fixing it. Yeah. I mean, it says something that feels, I don't know what it is, like one second or two seconds. That feels slow. That means that actually shows that everything else is just really, really fast. So is there some technical details about how to make some of these models, how to make the chat fast, how to make the divs fast. Is there something that just jumps to mind? Yeah. I mean, so we can go over a lot of the strategies that we use. One interesting thing is cache warming. And so what you can do is if as the user is typing, you can have, you're probably going to use some piece of context. And you can know that before the user is done typing. So, you know, as we discussed before reusing the KV cache results in lower latency, lower cost, cross request. So as the user starts typing, you're going to immediately warm the cache with, like, let's say the current file contents. And then when they press enter, there's very few tokens it actually has to pre-fill and compute before starting the generation. This will significantly lower TTFD. Can you explain how KV cache works? Yeah. So the way transformers work. I like it. I mean, one of the mechanisms that allow transformers to not just independently, like the mechanism that allows transformers to not just independently look at each token, but see previous tokens are the keys and values to tension. And generally, the way attention works is you have at your current token some query. And then you've all the keys and values of all your previous tokens, which are some kind of representation that the model stores internally of all the previous tokens in the prompt. And like by default when you're doing a chat, the model has to for every single token do this for pass through the entire model. That's a lot of matrix multiplies that happen and that is really, really slow. Instead, if you have already done that and you stored the keys and values and you keep that in the GPU, then when I'm let's say I have sort of for the last end tokens, if I now want to compute the output token for the n plus one token, I don't need to pass those first end tokens through the entire model because I already have all those keys and values. And so you just need to do the forward pass through that last token. And then when you're doing attention, you're reusing those keys and values that have been computed, which is the only kind of sequential part or sequentially dependent part of the transformer. Is there like higher level caching of like caching of the prompts or that kind of stuff to help? I see. Yeah, there's other types of caching you can kind of do. One interesting thing that you can do for cursor tab is you can basically predict ahead as if the user would have accepted the suggestion and then trigger another request. And so then you've done the speculative, it's a mix of speculation and caching, right? Because you're speculating what would happen if they accepted it. And then you have this value that is cash, this suggestion. And then when they press tab, the next one would be waiting for them immediately. It's a kind of clever heuristics-lash trick that uses a higher level caching and can give the-it feels fast despite they're not actually being any changes in the model. And if you can make the kvcache smaller, one of the advantages you get is like maybe you can speculate even more. Maybe you can guess here's the 10 things that could be useful. I like like predict the next 10 and then like it's possible the user hits the one of the 10. It's like much higher chance than the user hits like the exact one that you show them. Maybe they type in other character and we sort of hit something else in the cache. So there's all these tricks where the general phenomena here is, I think it's also super useful for RL is, maybe a single sample from the model isn't very good. But if you predict like 10 different things, turns out that one of the 10, that's right, is the probability is much higher. There's these passive key curves and part of RL, like what RL does is, you can exploit this passive key phenomena to make many different predictions. And one way to think about this, the model sort of knows internally has some uncertainty over which of the k things is correct or which of the k things does the human wants. When we RL are, you know, cursor tab model, one of the things we're doing is we're predicting, which of the hundred different suggestions the model produces is more amenable for humans, like which of them to humans more like than other things. Maybe there's something where the model can predict very far ahead versus a little bit and maybe somewhere in the middle and then you can give a reward to the things that humans would like more and punish the things that it would like and then train the model to output the suggestions that humans would like more. You have these like RL loops that are very useful that exploit these passive key curves, um, a mod maybe can, can you go into even more detail? Yeah, it's a little, it is a little different than speed, but I mean, like technically you tie it back in because you can get away at the smaller model if you RL your smaller model and gets the same performance as the bigger one. That's like, and while I was mentioning stuff about KB about reducing the size of your KB cache, there are other techniques there as well that are really helpful for speed. So kind of back in the day, like all the way two years ago, people mainly use multi-head attention and I think there's been a migration towards more efficient attention schemes like group query or multi-query attention and this is really helpful for then with larger batch sizes being able to generate the tokens much faster. The interesting thing here is this now has no effect on that time to first token pre-fill speed. The thing this matters for is now generating tokens. And why is that? Because when you're generating tokens, instead of being bottlenecked by doing these super paralyzable matrix multiplies across all your tokens, you're bottlenecked by how quickly it's for long context with large batch sizes by how quickly you can read those cache keys and values. And so that's memory bandwidth and how can we make this faster? We can try to compress the size of these keys and values. So multi-query attention is the most aggressive of these where normally with multi-head attention, you have some number of quote-unquote attention heads and some number of kind of query heads. Multi-query just preserves the query heads, gets rid of all the key dogs.
value heads. So there's only one kind of key value head and there's all the remaining query heads. With Group Query, you instead, you know, preserve all the query heads and then your keys and values are kind of, there are fewer heads for the keys and values, but you're not reducing it to just one. But anyways, like the whole point here is you're just reducing the size of your KV cash. And then there is the MLA. Yeah, multi latent. That's a little more complicated. And the way that this works is it kind of turns the entirety of your keys and values across all your heads into this kind of one latent vector that is then kind of expanded in for its time. But MLA is from this company called DeepSeek. It's quite an interesting algorithm. Maybe the key idea is sort of in both MQA and in other places, what you're doing is sort of reducing the number, like the number of KV heads that manage you get from that is is, you know, there's less of them, but maybe the theory is that you actually want a lot of different, like you want each of the keys and values to actually be different. The one way to reduce the size is you keep one big shared vector for all the keys and values. And then you have smaller vectors for every single token. So that when you can store the only smaller thing as some sort of like low rank reduction. And the low rank reduction with that. And at the end of the time, when you when you eventually want to compute the final thing, remember that like your memory band, which means that like you still have some some compute left that you can use for these things. And so if you can expand the latent vector back out. And somehow like this is far more efficient because just like you're reducing like for example, maybe you're reducing like 32 or something like the size of the vector that you're keeping. Yeah, there's perhaps some richness in having a separate set of keys and values and query that kind of pairwise match up versus compressing that all to one. And that interaction at least. Okay. And all of that is dealing with being memory bound. Yeah. And what I mean, ultimately, how does that map to the user experience, trying to give us? Yeah, the two things that a map to is you can now make your cache a lot larger. Because you've less space allocated for the KV cache, you can maybe cache a lot more aggressively and a lot more things. So you get more cache hits, which are helpful for reducing the time to first token for the reasons that we're kind of described earlier. And then the second being when you start doing inference with more and more requests and larger and larger batch sizes, you don't see much of a slowdown. And as it's generating the tokens, the speed of that would also allow you to make your prompt bigger for certain. Yeah. Yeah. So like the basic the size of your KV cache is both the size of all your prompts multiplied by the number of prompts in process and parallel. So you could increase out of those dimensions, right? The back size or the size of your prompts without degrading the latency of generating tokens. All right. You wrote a blog post shadow workspace iterating on code in the background. Yeah. So what's going on? So to be clear, we want there to be a lot of stuff happening in the background. And we're experimenting with a lot of things. Right now, we don't have much of that happening. Other than like the cache warming or like, you know, figuring out the right context to that goes into your Cammackay prompts, for example. But the idea is if you can actually spend computation in the background, then you can help help the user maybe like at a slightly longer time horizon than just predicting the next few lines that you're going to make, but actually like in the next 10 minutes, what are you going to make? And by doing it in the background, you can spend more computation doing that. And so the idea of the shadow workspace that we implemented, and we use it internally for like experiments, is that to actually get advantage of doing stuff in the background, you want some kind of feedback signal to give back to the model. Because otherwise, like you can get higher performance by just letting the model think for longer. And so like, oh, one is a good example of that. But another way you can improve performance is by letting the model iterate and get feedback. And so one very important piece of feedback when you're a programmer is the language server, which is this thing it exists for most different languages. And there's like a separate language server per language. And it can tell you, you know, you're using the wrong type here, and then it gives you an error, or it can allow you to go to definition and sort of understands the structure of your code. So language servers are extensions developed by like, there's a typescript language server developed by the typescript people, a rust language server developed by the rust people, and then they all interface over the language server protocol to VS code. So that VS code doesn't need to have all of the different languages built into VS code. But rather, you can use the existing compiler infrastructure for linting purposes. It's for linting. It's for going to definition. And for like seeing the right types that you're using. So it's doing like type checking also. Yes, type checking and going to references. And that's like when you're working in a big project, you kind of need that. If you don't have that, it's like really hard to code in a big project. Can you say again, how that's being used inside cursor, the language server protocol communication thing? So it's being used in cursor to show to the programmer just like in VS code. But then the idea is you want to show that same information to the models, the IAM models. And you want to do that in a way that doesn't affect the user because you want to do it in background. And so the idea behind the chat workspace was, okay, like one way we can do this is we spawn a separate window of cursor. That's hidden. And so you can set this flag and electron is hidden. There is a window, but you don't actually see it. And inside of this window, the AI agents can modify code however they want. As long as they don't save it because it's still the same folder. And then can get feedback from the linters and go to definition and iterate on their code. So like literally run everything in the background. Like as if right, yeah, maybe even run the code. So that's the eventual version. That's what you want. And a lot of the blog post is actually a bunch. How do you make that happen? Because it's a little bit tricky. You want it to be on the user's machine so that it exactly mirrors the user's environment. And then on Linux, you can do this cool thing where you can actually mirror the file system and have the AI make changes to the files. And it thinks that it's operating on the file level, but actually that's stored in memory. And you can create this kernel extension to make it work. Whereas on Mac and Windows, it's a little bit more difficult. But it's a fun technical problem. That's why one one maybe hacky bit interesting idea that I like is holding a lock on saving. And so basically you can then have the language model kind of hold the lock on on saving to disk. And then instead of you operating in the ground truth version of the files that are safe to disk, you actually are operating what was the shadow works face before and these unsafe things that only exist in memory that you still get linter errors for and you can code in. And then when you try to maybe run code, it's just like there's a small warning that there's a lock. And then you kind of will take back the lock from the language server if you're trying to do things concurrently or from the shadow workspace if you're trying to do things concurrently. That's such an exciting feature. By the way, it's a bit of a tangent, but like to allow a model to change files. It's scary for people, but like it's really cool to be able to just like let the agent do a set of tasks and you come back the next day and kind of observe like it's a colleague or something like that. And I think there may be different versions of like runability where for the simple things where you're doing things in the span of a few minutes on behalf of the user as they're programming, it makes sense to make something work locally in their machine. I think for the more aggressive things where you're making larger changes that take longer periods of time, you'll probably want to do this in some sandbox remote environment. And that's another incredibly tricky problem of how do you exactly reproduce or mostly reproduce to the point of it being effectively equivalent for running code the user's environment with this remote sandbox. I'm curious what kind of agents you want for coding. Did you want them to find bugs? Do you want them to like implement new features like what agents do you want? So by the way, when I think about agents I don't think just about coding. I think so for the practice this particular podcast is video editing and a lot of if you look in Adobe a lot of this code behind it's very poorly documented code but you can interact with Premiere for example using code and basically all the uploading everything I do on YouTube everything as you could probably imagine I do all of that through code and including translation and overdubbing all of this so I envision all of those kinds of tasks so automating many of the tasks that don't have to do directly with the editing so that okay that's what I was thinking about but in terms of coding I would be fundamentally thinking about bug finding like many levels of kind of bug finding and also bug finding like logical bugs not logical like spiritual bugs or something
the ones like sort of big directions of implementation, that kind of stuff. - That's a fine and buckfinding. - Yeah. I mean, it's really interesting that these models are so bad at buckfinding when just knifely prompted to find a bug. - They're incredibly poorly calibrated. - Even the smartest model. - Exactly. - Even know one. - How do you explain that? Is there a good intuition? - I think these models are really strong reflection of the pre-training distribution, and I do think they generalize as the loss gets lower and lower, but I don't think the loss in the scale is quite, the loss is low enough such that they're like really fully generalizing on code. Like the things that we use these things for the frontier models that they're quite good at are really code generation and question answering. And these things exist in massive quantities and pre-training with all of the code and GitHub on the scale of many, many trillions of tokens and questions and answers on things like stack overflow and maybe GitHub issues. And so when you try to push into these things that really don't exist very much online, like for example, the cursor tab objective of predicting the next edit given the edits done so far, the brittleness kind of shows. And then bug detection is another great example where there aren't really that many examples of like actually detecting real bugs and then proposing fixes, and the models just kind of like really struggling it. But I think it's a question of transferring the model. Like in the same way that you get this fantastic transfer from pre-trained models just on code in general to the cursor tab objective, you'll see a very, very similar thing with generalized models that are really good at code to bug detection. It just takes like a little bit of kind of nudging in that direction. - Like to be clear, I think they sort of understand code really well. Like while they're being pre-trained, like their representation that's being built up, like almost certainly like somewhere in the stream, there's the model knows that maybe there's something sketchy going on, right? It's sort of has some sketchiness, but actually eliciting the sketchiness to like actually, like part of it is that humans are really calibrated on which bugs are really important. It's not just actually saying like there's something sketchy, it's like, it's just a sketchy trivial. It's the sketchy, like you're gonna take the server down. It's like, like part of it is maybe the cultural knowledge of like why is a staff engineer, a staff engineer, a staff engineer is good because they know that three years ago, like someone drove a really sketchy piece of code that took the server down. And as opposed to like, as opposed to maybe there's like, you know, you just, this thing is like an experiment. So like a few bugs are fine, like you're just trying to experiment and get the feel of the thing. And so if the model gets really annoying when you're writing an experiment, that's really bad. But if you're writing something for super production, you're like writing a database, right? You're writing code in Postgres or Linux or whatever, like you're Linus Torval, so you're sort of unacceptable to have even in that case. And just having the calibration of like, how paranoid is the user like? But even then, like if you're putting in a maximum paranoia, it still just like doesn't quite get it. Yeah, yeah, yeah. - I mean, but this is hard for humans too to understand what which line of code is important, which is not. Like you, I think one of your principles on a website says if a code can do a lot of damage, one should add a comment that say this line of code is dangerous. - And all caps, 10 times. - No, you say like, for every single line of code inside the function, you have to, and that's quite profound. That says something about human beings because the engineers move on, even the same person, might just forget how it can sync the Titanic, a single function. Like you don't, you might not intuit that quite clearly by looking at the single piece of code. - Yeah, and I think that one is also partially also for today's AI models, where if you actually write dangerous, dangerous, dangerous in every single line, like the models will pay more attention to that, and will be more likely to find bucks in that region. - That's actually just straight up a really good practice of labeling code of how much damage this can do. - Yeah, I mean, it's controversial. Some people think it's ugly. - Well, I actually think it's, like, in fact, I actually think there's one of the things that I learned from Arvid is, you know, like I sort of aesthetically, I don't like it, but I think there's certainly something where it's useful for the models, and humans just forget a lot, and it's really easy to make a small mistake and cause, like, bring down, you know, like just bring down the server, and like you, like, or go, of course, we test a lot and whatever, but there's always these things that you have to be very careful. - Yeah, like with just normal doc strings, I think people will often just skim it when making a change and think, oh, I know how to do this, and you kind of really need to point it out to them, so that that doesn't slip through. - Yeah, you have to be reminded that you can do a lot of damage. That's like, we don't really think about that. - Yeah. - You think about, okay, how do I figure out how this works so I can improve it? You don't think about the other direction. - Yeah. - Until we have formal verification for everything, then you can do whatever you want, and you know for certain that you have not introduced a bug if the proof pass. But concretely, what do you think that future would look like? - I think people will just not write tests anymore, and the model will suggest, like you write a function, the model will suggest a spec, and you review this spec, and in the meantime, a smart reasoning model computes a proof that the implementation follows this spec. And I think that happens for most functions. - Do you think this gets at a little bit, some of the stuff you were talking about earlier with the difficulty of specifying intent for what you want to software. Where sometimes it might be, because the intent is really hard to specify, it's also then going to be really hard to prove that it's actually matching whatever your intent is. - Like you think that spec is hard to generate? - Yeah, or just like, for a given spec, maybe you can, I think there is a question of like, can you actually do the formal verification? Like, is that possible? I think that there's like more to dig into there. But then also, - Even if you have a spec. - Even if you have the spec. - Is the spec ridden in natural language? - Yeah, how's it work? - No, the spec wouldn't be formal. - But how easy would that be? - So then I think that you care about things that are not going to be easily well specified in the spec language. - I see, I see. - Yeah. - Yeah. - Maybe an argument against formal verification is all you need. - Yeah, but there's this massive document. - Replacing, replacing something like unit tests. - Sure. - Yeah. I think you can probably also evolve the spec languages to capture some of the things that they don't really capture right now. Wait, I don't know. I think it's very exciting. - And you're speaking not just about like single functions. You're speaking about entire code bases. - I think entire code bases is harder, but that is what I would love to have. And I think it should be possible. And because you can even, there's like a lot of work recently where you can prove formally verified down to the hardware. So like through the, you formally verify the C code and then you formally verify through the GCC compiler and then through the very log down to the hardware. And that's like an incredibly big system, but it actually works. And I think big code bases are sort of similar in that they're like multi-layered system. And if you can decompose it and formally verify each part, then I think it should be possible. I think the specification problem is a real problem, but how do you handle side effects? - Or how do you handle I guess external dependencies like calling stripe API? - Maybe stripe would write a spec for there. - But like you can't do this for everything. Like can you do this for everything you use? Like how do you, how do you do it for, there's a language, maybe like people will use language models as primitives in the programs they write. And there's like a dependence on it. And like how do you now include that? - I think it might be able to prove that still. - Prove what about language models? - I think it feels possible that you could actually prove that a language model is aligned. For example, or like you can prove that it actually gives the right answer. Nice to dream. - Yeah, that is, I mean, that's, if it's possible. That's your, I have a dream speech, if it's possible. That will certainly help with, you know, making sure you code doesn't have bugs and making sure AI doesn't destroy all human civilization. So the full spectrum of AI safety to just bug finding. So you said the models struggle with bug finding. What's the hope? - You know, my hope initially is, and I can let Michael, Michael chime in too, but it was like this, it should, you know, first help with the stupid bugs. Like it should very quickly catch the stupid bugs. Like off by one error is like, sometimes you write something in a common and do the other way. It's like very common. Like I do this, I write like less than in a common and like I may be right to greater than something like that. And the model is like, yeah, it looks catchy. Like do you sure you won't want to do that? But eventually, it should be able to catch harder bugs to you. - Yeah, and I think that it's also important to note that this is having good bug finding models feels necessary to get to the highest reaches of having AI do more and more programming for you. Where you're going to, you know, if the AI is building more and more of the system for you, you need a not just generate, but also verify.
And without that, some of the problems that we've talked about before with programming with these models will just become untenable. So it's not just for humans. Like you write a bug, I write a bug, find the bug for me, but it's also being able to verify the iScode and track it. It's really important. Yeah, and then how do you actually do this? Like we have had a lot of contentious dinner discussions of how do you actually screen a bug model. But one very popular idea is, you know, it's kind of potentially easy to introduce a bug than actually finding the bug. And so you can train a model to introduce bugs in existing code. And then you can train a reverse bug model than that can find bugs using this synthetic data. So that's like one example. But yeah, there are lots of ideas for how to do it. You can also do a bunch of work not even at the model level of taking the biggest models. And then maybe giving them access to a lot of information that's not just the code. Like it's kind of a hard problem to like stare at a file and be like, where's the bug? And you know, that's hard for humans often, right? And so often you have to run the code and being able to see things like traces and step through to bugger. There's another whole other direction where it like kind of tends toward that. And it could also be that there are kind of two different product form factors here. It could be that you have a really specialty model that's quite fast that's kind of running in the background and trying to spot bugs. And it might be that sometimes sort of sort of orbits earlier example about, you know, some nefarious input box bug. It might be that sometimes you want to like, there's, you know there's a bug. You're not just like checking hypothesis free. You're like, this is a problem. I really want to solve it. And you zap that with tons and tons and tons of compute. And you're willing to put in like $50 to solve that bug or something even more. Have you thought about integrating money into this whole thing? Like I would pay probably a large amount of money for if you found a bug or even generated code that I really appreciated. Like I had a moment a few days ago when I started using cursor or generated perfect, like perfect three functions for interacting with the YouTube API to update captions and for localization like different in different languages. The API documentation is not very good and the code across like if I Google it for a while I couldn't find exactly. There's a lot of confusing information and cursor generated perfectly. And I was like, I just set back. I read the code and I was like, this is correct. I tested it is correct. I was like, I want a tip. On a button that goes. Yeah, there's $5. One, that's really good just to support the company and support what the interface is. And the other is that probably sends a strong signal. Like, good job. Right, so there's much stronger signal than just accepting the code, right? You just actually send like a strong good job. That and for bug finding obviously, like there's a lot of people that would pay a huge amount of money for a bug, like a bug bounty thing, right? Is that you guys think about that? Yeah, it's a controversial idea inside the company. I think it sort of depends on how much you believe in humanity, how much, you know? Like I think it would be really cool if you spend nothing to try to find a bug. And if it doesn't find a bug, you spend zero dollars. And then if it does find a bug and you click accept, then it also shows like in parentheses like $1. As you spend $1 to accept the bug. And then of course there's a worry like, okay, we spent a lot of computation. Like maybe people will just copy paste. I think that's a worry. And then there's also the worry that like introducing money into the product makes it like kind of, you know, like it doesn't feel as fun anymore. Like you have to like think about money and you all you want to think about is like the code. And so maybe it actually makes more sense to separate it out. And like you pay some fee like every month and then you get all of these things for free. But there could be a tipping component, which is not like it. It costs it. It still has that like dollar symbol. I think it's fine. But I also see the point where like maybe you don't want to introduce it. Yeah, I was going to say the moment that feels like people do this is when they share it. When they have fantastic example, they just kind of share it with their friend. There is also a potential world where there's a technical solution to this like honor system problem too, where if we can get to a place where we understand the output of the system more, I mean to the stuff we were talking about with like, you know, error checking with the LSP and then also running the code. But if you could get to a place where you could actually somehow verify, oh, I have fixed the bug. Maybe then the Bouchy system doesn't need to rely on the honor system too. How much interaction is there between the terminal and the code? My how much information is gained from if you run the code and the terminal? Like can you use, can you do like a loop where runs the code and suggest how to change the code if the code in runtime gives an error? Is right now they're separate worlds completely? Like I know you can do control K inside the terminal to help you write the code. You can use terminal contacts as well inside of checkmank kind of everything. We don't have the looping part yet. Though we suspect something like this could make a lot of sense there's a question of whether it happens in the foreground too or if it happens in the background like what we've been discussing. Sure, the background is pretty cool. Like we do running the code in different ways plus there's a database side to this which how do you protect it from not modifying the database but okay. I mean there's certainly cool solutions there. There's this new API that is being developed for. It's not an AWS, but you know, it's certainly, I think it's in planet scale. I don't know if planet scale was the first one to add it. It's the stability sort of add branches to a database which is like if you're working on a feature and you want to test against the broad database but you don't actually want to test against the broad database you could sort of add a branch to the database. And the way they do that is they add a branch to the right analog and there's obviously a lot of technical complexity in doing it correctly. I guess database companies need new things to do. They have the databases now and I think like turbo buffer which is one of the databases we use as it's going to add I hope maybe branching to the right analog. And so maybe the AI agents will use branching to like test against the branch and it's sort of going to be a requirement for the database to like support branching or something. It'll be really interesting to you to branch a file system. Right. Yeah. If you like everything needs branching, it's like-- Yeah. Yeah, it's like the problem with the multiverse, right? Like if you branch an everything, that's like a lot. I mean there's obviously these like super clever algorithms to make sure that you don't actually use a lot of space or CPU or whatever. Okay, this is a good place to ask about infrastructure. So you guys mostly use AWS. What are some interesting details? What are some interesting challenges? Why do you choose AWS? Why is AWS still winning? Hashtag. AWS is just really, really good. It's really good. Like whenever you use an AWS product, you just know that it's going to work. Like it might be absolute hell to go through the steps to set it up. Why is the interface so horrible? Because it's just so good. It doesn't need-- The nature of winning. I think it's exactly. It's just nature they're winning. Yeah, yeah. But AWS, you can always trust like it will always work. And if there is a problem, it's probably your problem. Okay, is there some interesting like challenges? You guys are pretty new startup to get scaling to like, to so many people and-- Yeah, I think that there. It has been an interesting journey adding, you know, each extra zero to the request per second. But you run into all of these with like, you know, the general components you're using for caching and databases. Running to issues as you make things bigger and bigger. And now we're at the scale where we get like, you know, into overflows on our tables and things like that. And then also there have been some custom systems that we've built. Like for instance, our retrieval system for computing a semantic index of your codebase and answering questions about a codebase that have continually, I feel like, been one of the trickier things to scale. I have a few friends who are super, super senior engineers. And one of their sort of lines is like, it's very hard to predict where systems will break when you scale them. You can sort of try to predict in advance, like there's always something weird that's going to happen when you add this extra zero. And you thought you thought through everything, which you didn't actually think through everything. But I think for that particular system, we've-- So for concrete details, the thing we do is obviously we upload, when we chunk up all of your code, and then we send out sort of the code for embedding and we embed the code, and then we store the embeddings in a database, but we don't actually store any of the code. And then there's reasons around making sure that we don't introduce client bugs, because we're very, very paranoid about client bugs. We store much of the details on the server. Like everything is sort of encrypted. So one of the technical challenges is always making sure that the local index, the local codebase state, is the same as the state that is on the server. And the way, sort of technically, we ended up doing that is, so for every single file, you can sort of keep this hash. And then for every folder, you can sort of keep a hash, which is the hash of all of its children, and you can sort of recursively do that until the top.
and why do something complicated. One thing you could do is you could keep a hash for every file, then every minute you could try to download the hashes that are on the server, figure out what are the files that don't exist on the server, maybe just created a new file, maybe just deleted a file, maybe you checked out a new branch, and try to reconcile the state between the client and the server. But that introduces like absolutely ginormous network overhead, both on the client side, I mean, nobody really wants us to hammer their Wi-Fi all the time if you're using cursor. But also, I mean, it would introduce like ginormous overhead on the database. It would sort of be reading this tense of terabyte database, sort of approaching like 20 terabytes or something database, like every second, that's just kind of crazy. You definitely don't want to do that. So what did you sort of just try to reconcile the single hash, which is at the root of the project? And then if something mismatches, then you go, you find where all the things disagree. Maybe you look at the children and see if the hashes match, and if the hashes don't match, go look at their children and so on. But you only do that in the scenario where things don't match. And for most people, most of the time, the hashes match. So it's kind of like hierarchical reconciliation. Yeah, something like that. Yeah, it's called the Merkel's free. Yeah, Merkel. Yeah. I mean, so yeah, it's just cool to see that you kind of have to think through all these problems. And I mean, the point of the reason it's gone hard is just because, like the number of people using it and some of your customers have really, really large code bases to the point where we originally wrote a dark code base, which is big. But I mean, it's just not the size of some company that's been there for 20 years and sort of has a enormous number of files and you sort of want to scale that across programmers. There's all these details where like building a simple thing is easy, but sort of scaling it to a lot of people, like a lot of companies is obviously a difficult problem, which is sort of independent of actually. So there's part of this scaling our current solution is also coming up with new ideas that obviously we're working on. But then scaling all of that in the last few weeks, months. Yeah. And there are a lot of clever things, like additional things that go into this indexing system. For example, the bottleneck in terms of costs is not storing things in the vector database or the database. It's actually embedding the code. And you don't want to reinvent the code base for every single person in a company that is using the same exact code, except for maybe there is a different branch with a few different files or they've made a few local changes. And so because, again, embeddings of the bottleneck you can do is one clever trick and not have to worry about the complexity of dealing with branches and the other databases where you just have some cash on the actual vectors computed from the hash of a given chunk. And so this means that when the end of the person that a company goes into a vendor code base, it's really, really fast. And you do all this without actually storing any code on our servers at all. No code data stored. We just store the vectors in the vector database and the vector cache. What's the biggest gains at this time you get from indexing the code base? I could just, out of curiosity, like what benefit do users have? It seems like longer term, there'll be more and more benefit. But in the short term, just asking questions of the code base, what's the usefulness of that? I think the most obvious one is just you want to find out where something is happening in your large code base. And you sort of have a fuzzy memory of, OK, I want to find the place where we do X. But you don't exactly know what to search for in a normal text search. And so you ask a chat, you hit command enter to ask with the code base chat. And then very often, it finds the right place that you were thinking of. I think, like you mentioned, in the future, I think this is only going to get more and more powerful, where we're working a lot on improving the quality of our retrieval. And I think the ceiling for that is really, really much higher than people get the credit for. One question that's good to ask here, have you considered and why having you much done sort of local stuff to where you can do the-- and it seems like everything we've just discussed is exceptionally difficult to do, to go to the cloud yet to think about all these things with the caching and the large code base with a large number of programmers that are using the same code base. You have to figure out the puzzle of that. A lot of, you know, most software just does stuff this heavy computational stuff locally. Have you considered doing sort of embedding locally? Yeah, we thought about it. And I think it would be cool to do it locally. I think it's just really hard. And one thing to keep in mind is that, you know, some of our users use the latest MacBook Pro. And but most of our users, like more than 80% of our users are in Windows machines, which and many of them are not very powerful. And so local models really only works on the latest computers. And it's also a big overhead to build that in. And so even if we would like to do that, it's currently not something that we are able to focus on. And I think there are some people that do that. And I think that's great. But especially as models get bigger and bigger and you want to do fancier things with like bigger models, it becomes even harder to do it locally. Yeah. And it's not a problem with like weaker computers. It's just that for example, if you're some big company, you have big company code base. It's just really hard to process big company code base, even on the beefiest MacBook Pros. Yeah. So even if it's not even a matter of like, if you're just like a student or something, I think if you're like the best programmer at a big company, you're still going to have a horrible experience. And if you do everything locally, you could do edge and sort of scrape by, but like again, it wouldn't be fun anymore. Yeah. Like approximate nearest neighbors on this massive code base is going to just eat up your memory and your CPU. And that's just that like, let's talk about like also the modeling side where as I've said, there are these massive headwinds against local models where one, things that seems to move towards M.O.E.s, which like one benefit is maybe there are more memory bandwidth bound, which plays in favor of local versus using GPUs or using Nvidia GPUs. But the downside is these models are just bigger and total. And you know, they're going to need to fit often not even on a single node, but multiple nodes. There's no way that's going to fit inside of even really good MacBooks. And I think especially for coding, it's not a question as much of like, does it clear some bar of like the models good enough to do these things and then like, we're satisfied, which may be the case for other other problems and maybe we're local models shine, but people are always going to want the best, the most intelligent, the most capable things. And that's going to be really, really hard to run for almost all people locally. Don't you want the most capable model, like you want, you want Sonnet you also with O.O.E. I like how you're pitching me. Would you be satisfied with an inferior model? I'm, yes, I'm one of those, but there's some people that like to do stuff locally, especially like that really there's a whole obviously open source movement that kind of resists. And it's good that they exist actually because you want to resist the power centers that are growing. There's actually an alternative to local models that I am particularly fond of. I think it's still very much in the research stage, but you could imagine to do homomorphic encryption for language model inference. So you encrypt your input on your local machine, then you send that up and then the server can use loss of computation. They can run models that you cannot run locally on this encrypted data, but they cannot see what the data is and then they send back the answer and you decrypt the answer and only you can see the answer. So I think that's still very much research and all of it is about trying to make the overhead lower because right now the overhead is really big. But if you can make that happen, I think that would be really, really cool and I think it would be really, really impactful. Because I think one thing that's actually kind of worrisome is that as these models get better and better, they're going to become more and more economically useful and so more and more of the world's information and data will flow through one or two centralized actors. And then there are worries about there can be traditional hacker attempts, but it also creates this kind of scary part where if all of the world's information is flowing through one node in plaintext, you can have surveillance in very bad ways. And sometimes that will happen for, you know, initially will be like good reasons like people will want to try to protect against like bad actors using AI models in bad ways. And then you will add in some surveillance code and then someone else will come in and you know, you're in a slippery slope and then you start doing bad things with a lot of the world's data. And so I'm very hopeful that we can solve homeomorphic encryption for language modeling. >> Yeah, and doing privacy preserving machine learning, but I would say that's the challenge you have with all software these days is like, there's so many features that can be provided from the cloud and all this increasingly reliant it and make our life awesome, but there's downsides and that's why you rely on really good security to protect from basic attacks. But there's also only a. small set of companies that are controlling that data, you know, and they obviously have leverage and they can be infiltrated in all kinds of ways. That's the world we live in. Yeah, I mean, the thing I'm just actually quite worried about is sort of the world where, I mean, the entropic has this responsible scaling policy and where we're on like the low ESLs, which is the entropic security level or whatever, of like of the models, but as we get you like, couldn't cut ESL, 3 ESL, 4, whatever models, which are sort of very powerful. But for mostly reasonable security reasons, you would want to monitor all the prompts, but I think that's sort of reasonable and understandable where everyone is coming from, but Matt, it would be really horrible if sort of like all the world's information is sort of monitored that heavily. It's way too centralized. It's like sort of this really fine line you're walking where on the one side, like you don't want the models to go rogue on the other side, like humans, like, I don't know if I trust like all the world's information to pass through like three model providers. Yeah. What do you think it's different than cloud providers? Because I think this is a lot of this data would never have gone to the cloud providers in the first place, where this is often like you want to give more data to the EIA models. You want to give personal data that you would never have put online in the first place to these companies or to these models. And it also centralizes control where right now for cloud, you can often use your own encryption keys and like AWS can't really do much. But here is just centralized actors that see the exact plaintext of everything. On the topic of context, that's actually been a friction for me. When I'm writing code, you know, in Python, there's a bunch of stuff imported. There's a, you could probably intuit the kind of stuff I would like to include in the context. Is there like how hard is it to auto figure out the context? It's tricky. I think we can do a lot better at computing in context automatically in the future. One thing that's important to note is there are trade-offs with including automatic context. So the more context you include for these models, first of all, the slower they are. And the more expensive those requests are, which means you can then do less model calls and do less fancy stuff in the background. So for a lot of these models, they get confused if you have a lot of information in the prompt. So the bar for accuracy and for relevance of the context you include should be quite high. But this is already we do some automatic context in some places within the product. It's definitely something we want to get a lot better at. And I think that there are a lot of cool ideas to try there. Both on the learning better retrieval systems, like better embedding models, better re-rankers, I think that there are also cool academic ideas, you know, stuff we've tried out internally, but also the field is grappling with writ large about can you get language models to a place where you can actually just have the model itself like understand a new corpus of information. And the most popular talks about version of this is can you make the context when it's infinite, then if you make the context when it's infinite, can you make the model actually pay attention to the infinite context. And then after you can make it pay attention to the infinite context to make it somewhat feasible to actually do it, can you then do caching for that infinite context? You don't have to recompute that all the time. But there are other cool ideas that are being tried that are a little bit more analogous to fine tuning of actually learning this information and the weights of the model. And it might be that you actually get sort of a qualitatively different type of understanding if you do it more at the weight level, then if you do it at the in context learning level, I think the journey, the jury's still a little bit out on how this is all going to work in the end. But in the interim us as a company, we are really excited about better retrieval systems and picking the parts of the code base that are most relevant to what you're doing. We could do that a lot better. Like one interesting proof of concept for the learning this knowledge directly in the weights is with VSCode. So we're in a VSCode fork and VSCode. The code is all public. So these models in pre-training have seen all the code. They've probably also seen questions and answers about it. And then they've been fine tuned and hourly shift to be able to answer questions about code in general. So when you ask a question about the S code, sometimes it'll hallucinate, but sometimes it actually does a pretty good job at answering the question. And I think like this is just by, it happens to be okay to, but what if you could actually like specifically train or post train a model such that it really was built to understand this code base? It's an open research question, one that we're quite interested in. And then there's also uncertainty of like do you want the model to be the thing that end to end is doing everything? I.e. it's doing the retrieval and it's internals and then kind of answering a question, creating the code, or do you want to separate the retrieval from the front here model, where maybe you'll get some really capable models that are much better than like the best open source ones in a handful of months. And then you'll want to separately train a really good open source model to be the retriever, to be the thing that feeds in the context to these larger models. Can you speak a little more to the post training a model to understand the code base? What do you mean by that? Is this a synthetic data direction? Yeah, I mean, there are many possible ways you could try doing it. There's certainly no shortage of ideas. It's just a question of going in and trying all of them and being empirical about which one works best. One very naive thing is to try to replicate what's done with VS code and these front here models. Let's continue pre-training. Some continued pre-training that includes general code data, but also throws a lot of the data of some particular repository that you care about. And then in post-training, meaning, let's just start with instruction fine tuning. You have a normal instruction fine tuning data set about code, but you've thrown a lot of questions about code in that repository. You could either get ground truth ones, which might be difficult, or you could do what you kind of hinted at or suggested using synthetic data, i.e. kind of having the model ask questions about various pieces of the code. So you kind of take the pieces of the code, then prompt the model or have a model propose a question for that piece of code, and then add those as instruction fine tuning data points. And then in theory, this might unlock the model's ability to answer questions about that code base. Let me ask you about OpenAI 01. What do you think is the role of that kind of test time compute system in programming? I think test time compute is really, really interesting. So there's been the pre-training regime, which will kind of, as you scale up the amount of data and the size of your model, get you better and better performance, both on loss and then on downstream benchmarks. And just general performance, we'll use it for coding or other tasks. We're starting to hit a bit of a data wall, meaning it's going to be hard to continue scaling up this regime. And so scaling up 10 test time compute is an interesting way of now, you know, increasing the number of inference time flops that we use, but still getting like, like yeah, as you increase the number of flops use inference time, corresponding, impermanence and performance of these models. Traditionally, we just had to literally train a bigger model that always uses, that always used that many more flops. But now we could perhaps use the same size model and run it for longer to be able to get an answer at the quality of a much larger model. And so the really interesting thing I like about this is there are some problems that perhaps require 100 trillion parameter model intelligence trained on 100 trillion tokens. But that's like maybe 1%, maybe like 0.1% of all queries. So are you going to spend all of this effort, all this compute, train a model that costs that much and then run it so infrequently? It feels completely wasteful when it's said you get the model that can, that is, that you train the model those capable doing the 99.9% of queries, then you have a way of inference time running it longer for those few people that really, really want max intelligence. How do you figure out which problem requires what level of intelligence? Is that possible to dynamic to figure out when to use GPT-4, when to use, like when to use a small model and when you need the, the O1? I mean, yeah, that's, that's an open research problem, certainly. I don't think anyone's actually cracked this model routing problem quite well. We'd like to, we have like kind of initial implementations of this for things, for something like cursor tab. But at the level of like, going between 4.0 Sonnet to 01, it's a bit trickier for how like, there's also questions like, what level of intelligence do you need to determine if the thing is too hard for the, for the, the four level model? Maybe you need the O1 level model. It's really unclear, but you mentioned that so there's, there's a, there's a pre-training process and there's post-training and there's like test time compute. That's fair to sort of separate. Where's the biggest gains? Well, it's weird because like test time compute.
there's like a whole training strategy needed to get test time to compute to work. And the really, the other really weird thing about this is, like outside of the big labs and maybe even just open AI, no one really knows how it works. Like there've been some really interesting papers that show hints of what they might be doing. And so perhaps they're doing something with tree search using process reward models. But yeah, I think the issue is, we don't quite know exactly what it looks like. So it would be hard to kind of comment on like where it fits in. I would put it in post training, but maybe like the compute spent for this kind of, for getting test time compute to work for a model is going to dwarf pre-training eventually. - So we don't even know if all one is using just like chain of thought, RRL, we don't know how they're using any of these. I don't know anything. - It's fun to speculate. (laughing) Like if you were to build a competing model, what would you do? - Yeah, so one thing to do would be, I think you probably need to train a process reward model, which is, so maybe we can get into reward models and outcome reward models versus process reward models. Outcome reward models are kind of traditional reward models that people are trained for language modeling. And it's just looking at the final thing. So if you're doing some math problem, let's look at that final thing you've done, everything. And let's assign a great to it, how likely we think, like what's the reward for this outcome. Process reward models instead try to grade the chain of thought. And so open AI had some preliminary paper on this, I think last summer, where they use human laborers to get this pretty large, several hundred thousand data set of grading chains of thought. Ultimately, it feels like I haven't seen anything interesting in the ways that people use process reward models, outside of just using it as a means of affecting how we choose between a bunch of samples. So like what people do in all these papers is they sample a bunch of outputs from the language model, and then use the process reward models to grade all those generations alongside, maybe some other heuristics, and then use that to choose the best answer. The really interesting thing that people think might work when people want to work is tree search with these process reward models, because if you really can grade every single step of the chain of thought, then you can kind of branch out and you know, explore multiple paths of this chain of thought, and then use these process reward models to evaluate how good is this branch that you're taking? - Yeah, when the quality of the branch is somehow strongly correlated with the quality of the outcome at the very end, so like you have a good model of knowing which branch to take. So not just in the short term, like in the long term. - Yeah, and like the interesting work that I think has been done is figuring out how to properly train the process, or the interesting work that has been open sourced in people I think talk about is how to train the process reward models maybe in a more automated way. I could be wrong here, could not be mentioning some people, but I haven't seen anything super, that seems to work really well for using the process reward models creatively to do tree search and code. - This is kind of an AI safety, maybe a bit of a philosophy question, so open AI says that they're hiding the chain of thought from the user, and they've said that that was a difficult decision to make. They instead of showing the chain of thought, they're asking the model to summarize the chain of thought. They're also in the background saying they're going to monitor the chain of thought to make sure the model is not trying to manipulate the user, which is a fascinating possibility. But anyway, what do you think about hiding the chain of thought? - One consideration for open AI, and this is completely speculative, could be that they want to make it hard for people to distill these capabilities out of their model. It might actually be easier if you had access to that hidden chain of thought to replicate the technology, because that's pretty important data. Like seeing the steps that the model took to get to the final result. - So you could probably train on that also. - And there was sort of a mirror situation with this, with some of the large language model providers, and also this is speculation, but some of these APIs used to offer easy access to log probabilities for all the tokens that they're generating, and also log probabilities for the problem tokens. And then some of these APIs took those away. And again, complete speculation, but one of the thoughts is that the reason those were taken away is if you have access to log probabilities, similar to this hidden chain of thought, that can give you even more information to try and distill these capabilities out of the APIs, out of these biggest models, and to models you control. As an asterisk on also the previous discussion about us integrating O1, I think that we're still learning how to use this model. So we made O1 available in cursor, because when we got the model, we were really interested in trying it out. I think a lot of programmers are gonna be interested in trying it out, but O1 is not part of the default cursor experience in any way up. And we still haven't found a way to get integrated into the editor in a way that we reach for sort of every hour, maybe even every day. And so I think that the jury's still out on how to use the model. And we haven't seen examples of people releasing things where it seems really clear, like, oh, that's like now the use case. The obvious one to turn to is maybe this can make it easier for you to have these background things running, right, to have these models and loops, to have these models be a genetic. But we're still discovering. - To be clear, we have ideas. We just need to try and get something incredibly useful before we put it out there. - But it has these significant limitations. Like, even like faring capabilities, and it does not stream. And that means it's really, really painful to use for things where you want to supervise the output. And instead you're just waiting for the wall text to show up. Also, it does feel like the early innings of test time computing search, where it's just like a very, very much a VZero. And there's so many things that like don't feel quite right. And I suspect in parallel to people increasing the amount of pre-training data, and besides the models in pre-training and finding tricks there, you'll now have this other thread of getting searched to work better and better. So let me ask you about strawberry tomorrow eyes. So it looks like Github Copilot might be integrating O1 in some kind of way. And I think some of the comments are saying, "Is this mean cursor is done?" I think I saw one comment saying that. - I saw a time to shut down cursor. - Time to shut down cursor, thank you. So it was a time to shut down cursor. I think this space is a little bit different from past software spaces over the 20 times, where I think that the ceiling here is really, really, really incredibly high. And so I think that the best product in three to four years will just be soon, much more useful than the best product today. And you can like wax poetic about modes this and brand that, and you know, this is our advantage. But I think in the end, just if you don't have, like if you stop innovating on the product, you will lose. And that's also great for startups that's great for people trying to enter this market because it means you have an opportunity to win against people who have, you know, lots of users already by just building something better. And so I think, yeah, over the next few years, it's just about building the best product, building the best system and that both comes down to the modeling engine side of things. And it also comes down to the editing experience. - Yeah, I think most of the additional value from cursor versus everything else out there is not just integrating the new model fast, like a one. It comes from all of the kind of depth that goes into these custom models that you don't realize are working for you in kind of every facet of the product, as well as like the really thoughtful UX with every single feature. - All right, from that profound answer, let's descend back down to the technical, you mentioned you have a taxonomy of synthetic data. - Oh yeah, can you please explain? - Yeah, I think there are three main kinds of synthetic data. The first, so what is synthetic data first? So there's normal data, like non-synthetic data, which is just data that's naturally created, i.e. Usually it'll be from humans having done things. So from some human process, you get this data. Synthetic data, the first one would be distillation. So having a language model, kind of output tokens or probability distributions over tokens, and then you can train some less capable model on this. This approach is not gonna get you a net, like more capable model than the original one that has produced the tokens. But it's really useful for if there's some capability, you wanna elicit from some really expensive high latency model, you can then distill that down into some smaller task-specific model. The second kind is when one direction of the problem is easier than the reverse. And so a great example of this is bug detection, like we mentioned earlier, where it's a lot easier to introduce reasonable looking bugs than it is to actually detect them. And this is probably a case for humans too. And so what you can do is you can get a model that's not training that much data, It's not that smart.
to introduce a bunch of code and then you can use that to then train, use a synthetic data to train a model that can be really good at detecting bugs. The last category, I guess the main one that feels like the big labs are doing for synthetic data, which is producing text with language models that can then be verified easily. The extreme example of this is if you have a verification system that can detect if language is Shakespeare level and any of a bunch of monkeys typing in typewriters, you can eventually get enough training data to train a Shakespeare level language model. And I mean, this is the case, very much the case for math, where verification is actually really, really easy for formal formal languages. And then what you can do is you can have an OK model generated a ton of rollouts and then choose the ones that you know have actually proved the grand truth here. And then train that further. There's similar things you can do for code with lead code like problems where if you have some set of tests that you know correspond to if something passes these tests, it is actually solved a problem. You can do the same thing where we verify that it's passed the test and then train the model the outputs that have passed the test. I think it's going to be a little tricky getting this to work in all domains, or just in general, like having the perfect verifier feels really, really hard to do with just like open ended miscellaneous tasks, you get the model or more like long horizon tasks, even encoding. That's because you're not as optimistic as armoured, but yeah. So, yeah, so that that that third category requires having a verifier. Yeah, verification is it feels like it's best when you know for a fact that it's correct and like, then it like it wouldn't be like using a language model to verify it'd be using tests or formal systems or running the thing to doing like the human form of verification, where you just do manual quality control. Yeah, but like the language model version of that where it's like running the thing, it's actually understands the app, but yeah, no, that's sort of somewhere between yeah, yeah, I think that that's the category that is most likely to result in like massive gains. What about RL with feedback side RLHF versus RL AIF? What's the role of that in getting better performance on the models? Yeah, so RLHF is when the reward model you use is trained from some labels you've collected from humans giving feedback. I think this works if you have the ability to get a ton of human feedback for this kind of task that you care about. RLHF is interesting because you're kind of depending on like this is actually kind of going to this is depending on the constraint that verification is actually a decent bit easier than generation. Because it feels like, okay, like what are you doing? You're using this language model to look at the language model outputs and then prove the language model, but no, it actually may work if the language model has a much easier time verifying some solution. Then it does generating it then you actually could perhaps get this kind of recursive, but I don't think it's going to look exactly like that. The other thing you could do is that we kind of do is like a little bit of a mix of RL AIF and RLHF where usually the model is actually quite correct and this is the case cursor tap at picking between like two possible generations of what is what is what is the better one. And then it just needs like a hand a little bit of human nudging with only like on the order of 50 100 examples to like kind of align that prior the model has with exactly with what you want. It looks different than I think normal RLHF are usually usually training these reward models and tons of examples. What's your intuition when you compare generation and verification generation and ranking is ranking way easier in generation. My intuition would just say yeah, it should be like this is kind of going back to like if you if you believe P does not equal NP. Then there's this massive class of problems that are much much easier to verify given a proof that actually proving it. I wonder if the same thing will prove P not equal to NP or P equal to NP. That would be that would be really cool. A B of whatever feels metal. Why AI who gets the credit? Another open philosophical question. I'm actually I'm actually surprisingly curious what what what like a good bat for one one AI will get the feels metal will be. I actually don't have a lot of specialty. I don't know what a month's bet here is. Oh, sorry Nobel Prize or feels metal first. Well, feels metal level. Feels metal. He should solve. Feels metal comes first. Well, you would say that of course. It's also this like isolated system. No. Sure. Like I don't even know if I don't need to do so. I feel like I have much more to do there. I felt like the path to get to IMO was a little bit more clear because it already could get a few IMO problems. And there are a bunch of like there's a bunch of low hanging fruit given the literature at the time of like what what tactics people could take. I think I'm one much less first in the space of deer improving now. And to yeah less intuition about how close we are just solving these really really hard open problems. So you think it'll be feels metal first. It won't be like in physics or in. 100% I think I think that's probably. Like it's probably much more likely they don't get then. Yeah. Well, I think it goes to like I don't know like BSD, which is a bird's winter and diet conjecture or like we want iPods or any one of these like hard hard math problems. It's actually really hard. It's sort of unclear what to pass you to get even a solution looks like. Like we don't even know what a path looks like let alone. And you don't buy that. Yeah, this is like an isolated system and you can actually you have a good reward system and. It feels like it's easier to train for that. I think we might get feels metal before AGI. I mean, I'll be very happy. Very happy. But I don't know if I think. 20 20 age 20 30. Feels metal. Feels metal. All right. It's feels like forever from now giving off fast things have been going. Speaking of how fast things have been going let's talk about scaling laws. So for people who don't know, maybe it's good to talk about this whole idea of scaling laws. What are they? Where do you think stand and where do you think things are going? I think it was interesting the original scaling laws paper by OpenAI was slightly wrong because I think of some issues they did with learning rate schedules. And then Chinchilla showed a more correct version. And then from then people have again kind of deviated from doing the compute optimal thing. Because people start now optimizing more so for making the thing work really well given a given inference budget. And I think there are a lot more dimensions to these curves than what we originally used of just compute number of parameters and data. Like inference computers is the obvious one. I think content length is another obvious one. So if you care, like let's say you care about the two things of inference compute and then context window. Maybe the thing you want to train is some kind of SM because they're much much cheaper and faster at super super long context. And even if maybe it is 10x worth scaling properties during training many spend 10x more compute to train the thing to get the same level of capabilities. It's worth it because you care most about that inference budget for really long context windows. So it'll be interesting to see how people kind of play with all these dimensions. So yeah, let me speak to the multiple dimensions obviously. The original conception was just looking at the variables of the size of the model as measured by parameters and the size of the data as measured by the number of tokens and looking at the ratio of the two. Yeah. And it's kind of a compelling notion that there is a number or at least a minimum. And it seems like one was emerging. Do you still believe that there is a kind of bigger is better? I mean, I think bigger is certainly better for just raw performance. And raw intelligence. I think the path that people might take is I'm particularly bullish on distillation. And like, yeah, how many knobs can you turn to if we spend like a ton, ton of money on training, like get the most capable cheap model? Right. Like really, really caring as much as you can because like the naive version of caring as much as you can about inference time computer is what people have already done with like the llama models are just overtraining the shit out of 70 models on way, way, way more tokens. Then it isn't a lot of all right. But if you really care about it, maybe think to do is what gamma did, which is let's just not let's not just train on tokens. Let's literally train on minimizing the KL divergence with the distribution of gamma 27 be right so knowledge distillation there. And you're spending the compute of literally training this 27 billion model, a billion parameter model on all these tokens just to get out this smaller model. And the distillation gives you just a faster model smaller means faster. Yeah, distillation theory is I think getting out more signal from the data that you're training on and it's like another it's perhaps another way of getting over.
Not completely over but partially helping with the data wall where you only have so much data to train on, let's train this really big model on all these tokens and we'll distill it into this smaller one. Maybe we can get more signal per token for this much smaller model than we would have originally trained it. So if I gave you $10 trillion, how would you spend it? I mean, you can't buy an island or whatever. How would you allocate it in terms of improving the big model versus maybe paying for HF in the RLHF? Yeah, I think there's a lot of these secrets and details about training these large models that I just don't know and only privy to the large labs and the issue is I would waste a lot of that money if I even attempted this because I wouldn't know those things. Suspending a lot of disbelief and assuming like you had the know how an operator or if you're saying like you have to operate with like full the limited information you have now. No, no, actually I would say you swoop in and you get all the information, all the little qs, all the little parameters, all the parameters that define how the thing is trained. If we look in how to invest money for the next five years in terms of maximizing what you called raw intelligence. I mean, isn't the answer like really simple? You just try to get as much compute as possible. Like at the end of the day, all you need to buy is the GPUs and then the researchers can find find all the all like they can sort of you can tune whether you want to be trained a big model or a small model like. Well, this gets me to the question of like, are you really limited by compute and money or are you limited by these other things? And I'm more privy to Arvid's beliefs that we're sort of idea limited but there's always that like. But if you have a lot of compute, you can run a lot of experiments. So you would run a lot of experiments versus like use that compute to train a gigantic model? I would, but I do believe that we are limited in terms of ideas that we have. I think yeah, because even with all this compute and like, you know, all the data you could collect in the world, thank you really are ultimately limited by not even ideas, but just like really good engineering. Like even with all the capital in the world, would you really be able to assemble? Like there aren't that many people in the world who really like make the difference here. And there's so much work that goes into research that is just like pure really really hard engineering work. That is like a very kind of hand wave example if you look at the original transformer paper. You know, how much work was kind of joining together a lot of these really interesting concepts embedded in the literature versus then going in and writing all the codes like maybe the CUDA kernels, maybe whatever else. I don't know if it ran on GPUs or TPUs originally. So I said it actually saturated a GPU performance, right? Getting known, she's here to go in and do do all this code right and known is like probably one of the best engineers in the world or maybe going a step further like the next generation of models. Having these things like getting model parallelism to work and scaling it on like, you know, thousands of or maybe tens of thousands of like V-100s, which I think GBDE-3 may have been. There's just so much engineering effort that has to go into all these things to make it work. If you really brought that cost down to like, you know, maybe not zero, but just made it 10x easier, made it super easy for someone with really fantastic ideas to immediately get to the version of like the new architecture they dreamed up that is like getting 50-40% utilization on the GPUs. I think that would just speed up research by a ton. I mean, I think if you see a clear past improvement, you should always sort of take the low-hanging fruit first, right? I think probably open the eye and I'll do other labs that did the right thing to pick off the low-hanging fruit. Where the low-hanging fruit is like sort of, you could scale up to a GPT-4.25 scale and you just keep scaling and things keep getting better and as long as like, there's no point of experimenting with new ideas when like everything is working. And you should sort of bang on it and try to get as much juice out of the possible and then maybe when you really need new ideas for. I think if you're spending 10 trillion dollars, probably want to spend, then actually like reevaluate your ideas, like probably your idea limited at that point. I think all of us believe new ideas are probably needed to get you know, all the way there to AGI. And all of us also probably believe there exist ways of testing out those ideas at smaller skills and being fairly confident that they'll play out. It's just quite difficult for the labs in their current position to dedicate their very limited research and engineering talent to exploring all these other ideas when there's like this core thing that will probably like improve performance for some like these amount of time. Yeah, but also these big labs like Winnie, they're just going wild. So how big question looking out into the future, you're now at the center of the programming world. How do you think programming, the nature programming changes in the next few months in the next year in the next two years, next five years, ten years? I think we're really excited about a future where the programmers in the driver seat for a long time. And you've heard us talk about this a little bit, but one that emphasizes speed and agency for the programmer and control the ability to modify anything you want to modify the ability to iterate really fast on what you're building. And this is a little different I think than where some people are jumping to in the space, where I think one idea that's captivated people is can you talk to your computer, can you have it build software for you as if you're talking to like an engineering department or an engineer over Slack and can I just be this sort of isolated text box. And part of the reason we're not excited about that is some of the stuff we talked about with latency, but then a big piece of reason we're not excited about that is because that comes with giving up a lot of control. It's much harder to be really specific when you're talking in the text box. And if you're necessarily just going to communicate with a thing like you would be communicating with an engineering department you're actually advocating tons of tons of really important decisions to this bot. And this kind of gets at fundamentally what engineering is. I think that some people who are a little bit more removed from engineering might think of it as you know the spec is completely written out and then the engineers just come and they just implement and it's just about making the thing happen in code and making the thing exist. But I think a lot of the best engineering we enjoy involves tons of tiny micro decisions about what exactly you're building and about really hard trade offs between you know speed and cost and just all the other things involved in a system. And we want as long as humans are actually the ones making you know designing the software and the ones specifying what they want to be built and it's not just like company run by all AI's. We think you'll really want the human in a driver's seat dictating these decisions. And so there's the jury still out on kind of what that looks like. I think that you know one weird idea for what that could look like is it could look like you kind of you can control the level of abstraction you view a code base at. And you can point at specific parts of a code base that maybe you digest a code base by looking at it in the form of pseudocode and you can actually edit that pseudocode too and then have changes get made down at the the sort of formal programming level. And you keep the like you know you can gesture at any piece of logic in your software component of programming. You keep the inflow text editing component of programming. You keep the control of you can even go down into the code you can go at higher levels of abstraction. Well also giving you these big productivity gains. It'd be nice if you can go up and down the abstraction stack. Yeah. And there are a lot of details to figure out there that's sort of like a fuzzy idea. Time will tell if it actually works. But these these principles of control and speed in the human in the driver's seat we think are really important. We think for some things like Arbit mentioned before for some styles of programming you can kind of hand it off chatbot style. You know if you have a bug that's really well specified. But that's not most of programming and that's also not most of the programming. We think a lot of people value. What about like the fundamental skill of programming. There's a lot of people like young people right now kind of scared like thinking because they like love programming but they're scared about like will I be able to have a future if I pursue this career path. Do you think the very skill of programming will change fundamentally? I actually think this is a really really exciting time to be building software. Like we remember what programming was like in you know 2013 2012 whatever it was. And there was just so much more craft and boilerplate and you know looking up something really gnarly and you know that stuff like this. It's definitely not at zero. But programming today is way more fun than back then. It's like we're really
getting down to the the delight concentration and all the things that really draw people to programming like for instance this element of being able to build things really fast and speed and also individual control like all those are just being turned up a ton. And so I think it's just going to be I think it's going to be really really fun time for people who build software. I think that the skills will probably change to a I think that people's taste and creative ideas will be magnified and it will be less about. Maybe less a little bit about or they'll play text editing maybe even a little bit less about carefulness, which I think is really important today for a programmer, it'll be a lot more fun. What do you guys think? I agree. I'm very excited to be able to change like just one thing that that happened recently was like we wanted to do a relatively big migration to our code base. We were using Async local storage in no JS, which is known to be not very performant and we wanted to migrate to a context object and this is a big migration affects the entire code base and swallowing I spent. I don't know five days working through this even with today's AI tools and I am really excited for a future where I can just show a couple of examples and then the AI applies that to all of the locations and then it highlights oh this is a new example like what should I do and then I show exactly what to do there and then that can be done in like 10 minutes and then you can iterate much much faster than you can then you don't have to think as much up front and stay at stand at the blackboard and like think exactly like how are we going to do this because it costs is so high, but you can just try something first and you realize oh this is not actually exactly what I want and then you can change it instantly again after and so yeah I think being a programmer in the future is going to be a lot of fun. Yeah, I really like that point about it feels like a lot of the time with programming there are two ways you can go about it one is like you think really hard carefully up front about the best possible way to do it and then you spend your limited time of engineering to actually implement it, but I must refer just getting in the code and like you know taking a crack and seeing how it how it kind of lays out and then iterating really quickly on that that feels more fun yeah like just speaking to generating the boilerplate is great so you just focus on the difficult design nuanced difficult design decisions migration I feel like this is this is a cool one like it seems like large language models able to basically translate for one program language or another or like translate like migrate in the general sense of what my grade is but that's in the current moment. So I mean that the fear has to do with like okay as these models get better and better than you're doing less and less creative decisions and is it going to kind of move to a place where it's. You're operating in the design space of natural language or natural language is the main programming language and I guess I get asked that by way of advice like if somebody's interested in programming now what do you think they should learn. Like to say you guys started in Java and. forget the old some PHP objective see objective see there you go yeah I mean in the end we all know JavaScript is going to win. And not like script is going to be like vanilla JavaScript is going to eat the world and maybe a little bit of PHP and I mean it also brings up the question of like I think Don Knuth has a. This idea that some percent of the population is geeks and like there's a particular kind of psychology in mind required for programming and it feels like more and more that expands the kind of person that should be able to can do great programming might expand. I think different people do programming for different reasons but I think the true maybe like the best programmers are the ones that really love. Just like absolutely love programming for example there are folks in our team who. Literally when they're they get back from work they go and then they boot up cursor and then they start coding on their side projects for the entire night and they say also 3 am doing that. And when they're sad they said. I just really need to code. And I think like. You know there's there's that level programmer where like the succession and love of programming I think makes really the best programmers and I think these types of people will. Really get into the details of how things work. I guess the question I'm asking that exact program think about that person. When you're when the super tab the super awesome praise be the tab is succeeds you keep pressing tab that person in the team loves to curse the tab more than anybody else yeah and it's also not just like. Like pressing tab is like the just pressing tab that's like the easy way to say it in the catch catch phrase you know. But what you're actually doing when you're pressing tab is that you're you're injecting intent all the time while you're doing it you're you're. Sometimes you're rejecting it sometimes you're typing a few more characters and and that's the way that you're. You're sort of shaping the things that's being created and I think programming will change a lot to just what is it that you want to make sort of higher bandwidth the communication to the computer just becomes higher and higher bandwidth as the person like. Like just typing as much lower bandwidth and then communicating in time I mean this goes to your manifesto titled engineering genius we are an applied research lab building extraordinary productive human AI systems so speaking to this like hybrid element. To start we're building the engineer of the future a human AI programmer that's an order of magnitude more effective than any one engineer. This hybrid engineer will have effortless control over their code base and no low entropy keystrokes they will iterate at the speed of their judgment even in the most complex systems using a combination of AI and human ingenuity they will outsmart and out engineer the best pure AI systems. We are a group of researchers and engineers we build software models to invent at the edge of what's useful was possible our work has already improved the lives of hundreds of thousands of programmers and on the way to that will at least make programming more fun so thank you for talking today thank you thanks for having us thank you. Thanks for listening to this conversation with Michael swale arvid and I'm on to support this podcast please check out our sponsors in the description. And now let me leave you with random funny and perhaps profound programming code I saw on reddit nothing is as permanent as a temporary solution that works. Thank you for listening and hope to see you next time. (gentle music)
Podcast Summary
Key Points:
Cursor is a fork of VS Code designed to deeply integrate AI capabilities into the coding experience, moving beyond simple autocomplete to predict and execute complex code changes.
The team was inspired by scaling laws in AI and early access to models like GitHub Copilot and GPT-4, which demonstrated tangible gains in programming productivity and shifted their vision for AI-driven development.
Cursor introduces “Tab” functionality that predicts the next code edit or jump in the codebase, eliminating low-entropy actions and enabling rapid, intuitive navigation through the editing process.
Key technical innovations include speculative decoding and custom models trained for code application, allowing fast, accurate edits while reducing latency and computational cost.
Cursor’s diff interface is designed to be intelligent and user-friendly, highlighting only relevant changes and guiding developers through code reviews with minimal cognitive load.
The team emphasizes that AI-powered programming will not replace human intuition but will augment it, with natural language being useful in some contexts but not universally sufficient.
Real-world programming differs significantly from benchmarked tasks—being messy, context-dependent, and often ambiguous—highlighting the need for human-in-the-loop evaluation and qualitative feedback.
Prompt design and pre-emptive rendering systems help manage context, prioritize relevant information, and improve model performance in complex, real-world coding scenarios.
Summary:
Cursor is a next-generation code editor built as a fork of VS Code, designed to revolutionize AI-assisted programming. Inspired by the scaling laws in AI and early breakthroughs with models like Copilot and GPT-4, the team recognized a critical gap: while AI models improved, the tools around them remained stagnant. Cursor addresses this by embedding AI deeply into the editing workflow, introducing intelligent features like "Tab" that predict and execute the next code change—jumping ahead of the user in time and logic.
This is powered by custom-trained models and techniques like speculative decoding, which drastically reduce latency and computational load. The editor also features a smart diff interface that highlights only relevant code changes, guiding developers through complex edits with less cognitive effort. Unlike traditional code review tools, Cursor leverages AI to anticipate developer intent, especially in multi-file or large-scale edits.
A key insight is that real-world programming is messy and ambiguous, unlike the well-structured benchmarks used to evaluate AI models. As a result, human feedback and qualitative assessment remain essential. The team emphasizes that AI won’t replace human creativity or intuition, but will instead augment it—enabling faster iteration and more natural, less verbose communication between humans and machines.
Cursor represents a shift from AI as a side tool to AI as an active, integrated partner in the development process.
FAQs
Cursor is a code editor forked from VS Code, designed specifically to integrate advanced AI features for programming. Unlike standard VS Code extensions, Cursor rethinks the entire editing experience to provide deeper AI-assisted coding, enabling faster, more intuitive development with features like AI-powered autocompletion and next-step predictions.
Cursor's Tab feature predicts not just the next character, but the next entire code change or edit. It uses advanced AI models to anticipate the programmer's intent and jump to the next logical step, reducing the need for manual typing and enabling faster, more fluid coding.
Cursor trains custom AI models to specialize in specific tasks like code editing and diff generation. These models work alongside frontier models (like GPT-4) to improve accuracy, especially in complex edits or multi-file changes, where general-purpose models struggle with precision and context.
Cursor displays code suggestions in a clean, visual diff interface with red and green highlights. It evolves to show only relevant changes, highlights potential bugs, and allows users to review or accept edits seamlessly. The interface is designed to reduce cognitive load and make code reviews faster and more intuitive.
The team forked VS Code to avoid being limited by the existing ecosystem and to build a fully integrated, AI-native environment. This allowed them to design a more cohesive and responsive experience where AI features are deeply embedded and optimized for programming workflows.
Cursor uses techniques like speculative decoding and sparse models to process code edits quickly. By reusing KV caches and predicting edits in parallel, it reduces latency and enables real-time, fluid interactions without slowing down the development experience.
Chat with AI
Loading...
Pro features
Go deeper with this episode
Unlock creator-grade tools that turn any transcript into show notes and subtitle files.