two things.
- Deepseek R1 gives you some interesting rules suggestions if you go back and forth with it.
- Regarding why cursorrules and how they are thought of, this is kind of tangential but i remember listening to a Lex podcast with the cursor team which was a fascinating listen btw. They mentioned they use JSX to do prompting and I think that kind of influences how they though of this cursorrules feature. Transcript:
(00:44:43) And we have this one system internally that we call Preempt, which helps us with that a little bit. And I think it was built for the era before where we had 8,000 token contact windows. And it’s a little bit similar to when you’re making a website. You want it to work on mobile, you want it to work on a desktop screen, and you have this dynamic information which you don’t have. For example, if you’re designing a print magazine, 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 so the idea was, okay, let’s take some inspiration. What’s the best way to design websites? Well, the thing that we really like is React and the declarative approach where you use JSX in JavaScript, and then you declare, “This is what I want and I think this has higher priority or this has higher Z index than something else.”
(00:45:56) And then you have this rendering engine in web design. It’s like Chrome, and in our case it’s a preempt renderer, which then fits everything onto the page. And as you declare, decide what you want and then it figures out what you want. And so we have found that to be quite helpful and I think the role of it has shifted over time where initially it was to fit to these small context windows. Now it’s really useful because 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 this entire eval set?”
Lex(00:46:45) So do you literally prompt with JSX?
Aman(00:46:48) Yes. Yes.
Arvid(00:46:48) Yeah. So it looks like react. There are components. We have one component that’s a file component and it takes in the cursor. Usually there’s one line where the cursor is in your file and that’s probably the most important line because that’s the one you’re looking at. And so then you can give priorities. So 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 figures out how many lines can actually fit and it centers around that thing.
Lex(00:47:17) That’s amazing.
Aman(00:47:18) And you can do 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 you through these components.
Lex(00:47:30) So should humans when they ask questions, also try to use something like that? Would it be beneficial to write JSX in the problem or the whole idea is this should be loose and messy?
Arvid(00:47:43) I think our goal is that you should just do whatever is the most natural thing for you, and then our job is to figure out how do we actually retrieve the relative event things so that your thinking actually makes sense?
Lex(00:47:56) Well, this is the discussion I had with Aravind of Perplexity is his whole idea is you should let the person be as lazy as he wants. That’s a beautiful thing, but I feel like you’re allowed to ask more of programmers, right?
Arvid(00:48:14) Yes.
Lex(00:48:14) So if you say, “Just do what you want,” humans are lazy. There’s a tension between just being lazy versus 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 prompts.
Aman(00:48:39) I think even as a system gets closer to some level of perfection, often when you ask the model for something, not enough intent is conveyed to know what to do. And there are a few ways to resolve that intent. One is the simple thing of having the model just ask you, “I’m not sure how to do these parts based on your query. Could you clarify that?” I think the other could be maybe if there are five or six possible generations, “Given the uncertainty present in your query so far, why don’t we just actually show you all of those and let you pick them?”
Lex(00:49:19) How hard is it for the model to choose to talk back versus generally… It’s hard, how deal with the uncertainty. Do I choose to ask for more information to reduce the ambiguity?
Sualeh(00:49:36) So one of the things we do, it’s like a recent addition, is try to suggest files that you can add. And while you’re typing, one can guess what the uncertainty is and maybe suggest that 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 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 initial version is ruled out and I’m sure we can make it much more accurate. It’s very experimental, but then the idea is we show you, do you just want to add this file, this file, this file also to tell the model to edit those files for you?
(00:50:37) Because if maybe you’re making the API, you should also edit the client and the server that is using the API and the other one resolving the API. So that would be cool as both there’s the phase where you’re writing a prompt and there’s… Before you even click, “Enter,” maybe we can help resolve some of the uncertainty.