Golden Rule: Manage Context0:08
The first and the most important rule of vibe coding is to prevent context rot. This is a concept I will remind you of again and again, I'm gonna call it the golden Rule. In every video, I'm gonna say, remember the golden rule In every prompt? I'm gonna say, remember the golden rule? It is to manage your context. Your old job was to plan and write all of the code yourself. Your new job is to manage a junior engineer.
Your old job was to plan and write all of the code yourself. Your new job is to manage a junior engineer. This junior engineer is constantly screwing up. They're constantly overwhelmed and they've forgotten everything you've ever told them about your code base and your application. And so your job then is to guide them in the direct path that will get you to success. LLMs are at a very basic level, auto complete machines. It's a lot more complicated than that,
How LLMs Use Context0:44
LLMs are at a very basic level, auto complete machines. It's a lot more complicated than that, but if you think about it, it's you have a chunk of context, and that is the first part of what it is going to say. That is the part that it needs to auto complete. Here is the context, and then given that context, what tokens, what chunks of a word, what chunks of code in our case come next, given that context. And so your job is to manage the top part, the context, the input that will make the output that you want.
Token Length Hurts Performance1:06
And so your job is to manage the top part, the context, the input that will make the output that you want. Now, here's the problem. Model performance degrades as input length increases. This is something that is maybe a little bit counterintuitive and it goes against the advice that you see online Often. Often what I see is that when you start out building, you should have a giant PRD with as many tokens as you can, as much context as you can.
you should have a giant PRD with as many tokens as you can, as much context as you can. What I see is people saying, add more cursor rules. More, more, more, more context, more rules, more input. And the problem is, is that I think that that's while good intention, you do want more context up to a certain point, I think it leads to a lot of frustration in the vibe coding community because they just expect to be able to give these things as much context as they can,
because they just expect to be able to give these things as much context as they can, and then that will magically improve performance. Now, the problem is if you have a code base that is 100, 200, 300,000 lines of code, that's too much context. These things cannot handle this. And if you read this, again, this is very important, we need you to understand this model performance degrades as the input length increases. That means the more that you tell it, the worse
as the input length increases. That means the more that you tell it, the worse that it does, and that is up to a certain point. So I found this@trychroma.com. They have this fantastic report that shows how increasing the input tokens impacts the performance. Notice how the performance dramatically drops off at a certain point. Now, a lot of these models tell you that they have something like a 1 million token context,
Now, a lot of these models tell you that they have something like a 1 million token context, and to you that's like, whoa, that's a lot. Surely I can just throw everything. But the distribution of performance across those tokens is not actually even, you would think that it is so that you would be able to get all the way up to that million token limit before the performance really dropped off a cliff. That's not how it is at all.
before the performance really dropped off a cliff. That's not how it is at all. We find when we study these LLMs and their performance and their output is that over the course of the input length increasing, you find really steady drop offs with the performance. And by performance, I mean the success towards the task that you've asked it to do. This is a really great report. I highly recommend that you read through here
This is a really great report. I highly recommend that you read through here and really try to understand this concept of how token count increases and model performance degrades, and what that means for you as a vibe coder and how you're writing your prompt. If you gave it no context on your code, no context on your product, it would not do a good job. It would utterly fail. And there is a point where adding every extra token is
It would utterly fail. And there is a point where adding every extra token is improving that performance. And then you just kind of have to get a feel for this per model, per model harness or agent harness or, uh, agent sort of construction like you have in an application like cursor, which we're going to be using a lot. It's different for all of them. So you have to get a feel for where
It's different for all of them. So you have to get a feel for where that performance curve sorts to fall off even in your own specific code. So that is your job as a vico to really is to kind of get a sense for the models that you're working with. These are your agents, and then your own code base where that performance really starts to dip off. Another thing that I want you to know, it's related. So the LLMs we test this is from this, this report called
Multi-Turn Conversations Degrade4:00
Another thing that I want you to know, it's related. So the LLMs we test this is from this, this report called LLMs Get lost in multi turn conversation that is here. The idea here is LLMs, we test exhibit significantly lower performance in multi turn conversations than single turn. So what this means is this should give you an an aha moment. If you've ever used an LLM to code or if you've ever tried to use a vibe coding application, the more you get into that conversation,
or if you've ever tried to use a vibe coding application, the more you get into that conversation, the worse things get. I think you hear this a lot when you're thinking about vibe coating or you're hearing people talk about vibe coating is that it worked at first, but then everything fell apart. This is why everything falls apart, because as that conversation grows and as the context grows, the performance is just going down and down and down and over the course
Wrong Turns Don’t Recover4:43
and as the context grows, the performance is just going down and down and down and over the course of really long multi turn conversation, the hallucination rate just goes through the roof and the reliability sort of just falls off. Another thing, super important, when LLMs make a wrong turn in the conversation, they get lost and they do not recover. This is the most significant thing for fixing bugs, especially.
This is the most significant thing for fixing bugs, especially. We're gonna have a whole video on fixing bugs, but the thing that I want you to remember is that if an LLM takes a turn, a wrong turn in a conversation, you're going through it and it's, it's you're chatting with it and you're saying, Hey, fix this bug, and it try something and it doesn't work, it has taken a wrong turn somewhere in there, and it has probably made your context rotten
it has taken a wrong turn somewhere in there, and it has probably made your context rotten so rotten at a fundamental level that that LLM cannot recover because they get stuck in these lanes. You just find that the more you work with them, the more you see this pattern where they just can't fix it if they're spiraling out of control. The more you dig into that conversation,
they're spiraling out of control. The more you dig into that conversation, the more you add more chats to that one long with thread, the worse it gets. You think that the more you're adding, the more it's learning along the way. That's sort of like a human would be, is that, oh, I've learned from all these mistakes. Now I'm really not gonna make a mistake. I'm going to try the next thing.
Course Goals and Techniques5:51
Now I'm really not gonna make a mistake. I'm going to try the next thing. But LLMs aren't the same way currently. They really get lost along the way. So this course is a lesson in how to get around this. How do we, despite these limitations, build real applications? How do we, despite having hundreds of thousands of lines of code get around the idea that model performance will degrade?
of code get around the idea that model performance will degrade? That's what this course is about. I hope to show you some tips and techniques that you can use and we're gonna have a lot of fun. So let's get started.
