#ai #llm #heuristics #software
Vibe coding is an AI-based coding approach that utilizes LLM-based generation and learning from codebases to develop new code for a wide range of applications, including web apps, service-based applications, and product-based applications.
Coined by Andrej Karpathy in early 2025.
Vibe coding needs the following to generate a code: its recursion,
1 — Use voice (optionally text) and tell what you want to build or what you want to edit in functionality.
2 — Generate code, don’t see it. As part of the deployment, add it to GitHub with a new version number. Run the code, view the output, and review the errors and presentation. Are you satisfied with it?
3 — Tell to improve the code with what you want. Go to Step 1.
— — — — — -
However, no one stops you from examining the code and understanding what is happening. But this breaks the very definition of vibe coding. It’s ok. You have a piece of code, and you should be allowed to improve on it on your own if you like. If you are a programmer, you would love to see the code in front of you.
This is not fully like prompt engineering-based coding.
People are generating full programs, apps/games with Vibe coding.
However, these are simple ones. Andrej Karpathy loves it, as the internet says so.
For coders, the vibe is better; they can cut, copy, and paste a lot of product development tasks, which are often done by software engineers during code refactoring. However, this is more of a prompt engineering approach, involving coding in parts. We can have a hybrid of vibe and prompt engineering.
For naive people, the vibe is not the solution, as they are often lost in the code versioning systems. (see below, how to deal with it)
However, there are side effects such as,
— Exposed API Keys
— Env code issues
— API overuse
— Security flaws
Want to generate vibe code. How it works you need to provide is voice or text of the following:
— Technical Core features — What you want to generate, how it would work. Key features and the app’s flow suggest it’s an online game. E.g., The flow of points earned. The winning strategy, end-of-game condition, and loops.
— User specifications — Eg: Assertions, colors, user-specific things, such as a yellow cloud in a game made by Vibe Code, once points are gained.
Disadvantages
— Some say modular structure is not in vibe coding.
— Others say a lack of logical steps, as in human coding, is missing in advanced codes (as per the internet). Logic is not all time easy for LLM.
— Design patterns need to be included.
How can these be improved?
I. With the help of experienced programmers, based learning (reinforcement learning in vibe-based LLM applications)
Real-time feedback from experienced programmers as we edit and save the code. While debugging or editing, what Vibe can’t do is provide feedback in natural language as a comment, enumerating all points that an experienced programmer can understand. This can be used as reinforcement learning.
Give a prompt, “Take me to bug files,” and this input is fed into the LLM to guide it in understanding what a bug is.
But why would experienced programmers help LLM learn to replace them one day?
II. With the help of Heuristics
Just like Hill Climbing and A-star algorithms, we need a goal; the goal can be how well the vibe code performs. This would direct the LLM in the right direction, as the End Goal, apart from the Start Goal, is set, and the LLM won’t wander here and there. The LLM would focus on moving in that direction, where the goal is set. The End Goal can be, for example
— No API Keys
— Security
— No env code
What would be the Heuristic — Distance from the End Goal? But this is not the Start Goal of this LLM run.
Other Goals can be set to direct the LLM. This is not just for vibe coding, but this heuristic search can be used in many LLM applications to guide the search in an endless horizon of parameters.
III. Adding debug points automatically
Vibe coding should allow for intentional insertion of debug points based on voice text inputs, enabling experienced programmers to navigate directly to specific code locations without wasting time. For example, add a debug point to setting API keys, or add a debug point to assigning a new login. This can help experienced programmers. Learning from experienced programmers can be beneficial in this regard.
Subscribe to my blog to read upcoming articles.