Andrej Karpathy's Thoughts on AI Assisted Coding

English 简体中文 繁体中文 ภาษาไทย Tiếng Việt
Summary

Andrej Karpathy outlines three approaches to AI-assisted coding: old-school manual, hybrid with autocomplete, and "vibe coding," where he primarily uses the hybrid method. He highlights AI models' strengths in generating boilerplate code, common patterns like HTTP servers, and lowering the barrier to entry for new programming languages. However, Karpathy also points out significant drawbacks, including the models' tendency to misunderstand custom implementations, introduce overly defensive or messy code, and suggest deprecated APIs. Ultimately, while AI coding tools offer clear advantages, they still require substantial improvement and are not yet suitable for complete reliance.

In a recent episode of the Dwarkesh Podcast, AI researcher Andrej Karpathy (formerly Director of AI and Autopilot Vision at Tesla) shared his experiences and perspectives on AI-assisted coding. What he discussed struck a chord with me — many programmers will recognize the same tensions and trade-offs he described.

Below I’ll walk through Andrej's key points (you can also check out the full interview if you’re curious).

Programming Style

Andrej describes three broad approaches to coding today:

  • Old-school scratch mode: write everything manually, ignoring AI tools entirely.

  • Hybrid with autocomplete: you write the main logic, but lean on autocomplete or AI suggestions for boilerplate pieces. You still know exactly how things should work — the AI just helps implement bits.

  • Vibe coding: you prompt something like “please implement this” and let the model do the heavy lifting, then hit Enter.

Andrej places himself in the second camp: he codes most of the logic himself, tapping autocomplete when it makes sense.

Pros and Cons of AI Assisted Code

The AI coding models at the moment are good at creating boilerplate code that's just copy paste stuff.

The AI coding models are also good at those stuff already on the internet. For example, if you are building a HTTP server in Go, it can help create the basic HTTP server code easily as it's pretty standard given the models have been trained on many such code.

The AI coding models lower the accessibility to new language. For example if you have some Python project which you are quite familiar with and you want to reimplement it in Rust(for performance sake) which you are not good at, this is a very good fit for the coding model to help with.

While coding models do have all these good features, they come with some deficits as well. Here are some shared by Andrej

They keep misunderstanding code as they have too much code in their memory which do things typically in some way which might not adapt. One example

So the way to synchronize, so we have eight GPUs that are all doing forward backwards. The way to synchronize gradients between them is to use a distributed data parallel container of PyTorch, which automatically does all the, as you're doing the backward, it will start communicating and synchronizing gradients. I didn't use DDP because I didn't want to use it because it's not necessary. So I threw it out. And I basically wrote my own synchronization routine that's inside the step of the optimizer. And so the models were trying to get me to use the DDP container, and they were very concerned about, this gets way too technical, but I wasn't using that container because I don't need it, and I have a custom implementation of something like it.

The coding models also like to mess up with styles, sometimes it's just too defensive. They would create lots of try-catch statements which the programmer writes the code has the safe assumptions already. This usually leads to a very complex and messy implementation.

They would occasionally use deprecated APIs as well. It's also annoying one needs to type too much English on what is needed and wait for the implementation.

Overall Andrej thought that completely using AI assisted coding models write code is not a good idea. they have good parts but still they have lots of things to improve. 

INTERVIEW ANDREJ KARPATHY THOUGHTS OF AI

  RELATED

  COMMENTS

0

No comment for this article.