RSSAmplifier

Blog

Blog on AI Blindspots

Recent content in Blog on AI Blindspots

ezyang.github.ioRSS feed ↗20 posts

Latest posts

Rule of Three

The Rule of Three in software says that you should be willing to duplicate a piece of code once, but on the third copy you should refactor. This is a refinement on DRY (Don’t Repeat Yourself) accounting for the fact that it might not necessarily be obvious how to eliminate a duplication, and waiting until the third occurrence might clarify. (See also The Wrong Abstraction .) LLMs love to…

Culture Eats Strategy

Culture Eats Strategy (For Breakfast) says no matter how good your strategy is, the culture of your team isn’t capable of executing it. If your problem is execution, look to change the culture instead of trying to come up with increasingly elaborate strategies. By default, your LLM lives in a certain part of the “latent space”: when you ask it to generate code, it will generate…

Know Your Limits

It is important to know when you are out of your depth or you don’t have the tools available to do your job, so you can escalate and ask for help. Sonnet 3.7 is not very good at knowing its limits. If you want it to tell you when it doesn’t know how to do something, at minimum you will have to explicitly prompt it (for example, Sonnet’s system prompt instructs it to explicitly…

The tail wagging the dog

The tail wagging the dog refers to a situation where small or unimportant things are controlling the larger or more important things. A common reason this occurs in software engineering is when you get too absorbed in solving some low level problem that you forgot the whole reason you were writing the code in the first place. LLMs are particularly susceptible to this problem. The problem is that…

Scientific Debugging

When there is a bug, there are broadly two ways you can try to fix it. One way is to randomly try things based on vibes and hope you get lucky. The other is to systematically examine your assumptions about how the system works and figure out where reality mismatches your expectations. I generally think that the second approach of scientific debugging is better in the long run; even if it takes you…

Memento

In the movie Memento, the protagonist is unable to form new memories, and has to resort to an elaborate system of notes to remember what he has done in the past to uncover who killed his wife. Like in Memento, the LLM you are working with has no memory. Whenever you ask it to perform a task, it must reconstruct enough context to do what it needs to do. This will be the prompt (e.g., the Cursor…

Respect the Spec

When designing changes, it is important to keep in mind what parts of the system you can change and what parts you cannot. For example: If you expose a public API, you should prefer not to make a BC breaking change to the API, even if it would make your life easier if the API was different. If you interact with an external system, you have to conform to the API that actually exists, not some…

Mise en Place

In cooking, mise en place refers to the practice of organizing and arranging all of the ingredients that will be needed during a shift, so that one does not have to scramble to find the things you need when you are on task. Mise en Place for your LLM is ensuring that all of the rules, MCPs and general development environment for your model may need are properly setup before you have a task. In my…

Use MCP Servers

Model Context Protocol servers provide a standard interface for LLMs to interact with their environment. Cursor Agent mode and Claude Code use agents extensively. For example, instead of needing a separate RAG system (e.g., as previously provided by Cursor) to find and feed the model relevant context files, the LLM can instead call an MCP which will let it lookup what files it wants to look at…

Use Static Types

The eternal debate between dynamic and static type systems concerns the tradeoff between ease of prototyping and long term maintainability. The rise of LLMs greatly reduces the pressure to choose a language that is good at prototyping, since the LLM can cover up for boilerplate and refactors. Choose accordingly. You will want an agent setup where the LLM is informed about type errors after changes…

Walking Skeleton

The Walking Skeleton is the minimum, crappy implementation of an end-to-end system that has all of the pieces you need. The point is to get the end-to-end system working first, and only then start improving the various pieces. I can still remember Jacob Steinhardt telling me about this trick while I was a PhD student at Stanford, and it has stuck with me ever sense. In the era of LLM coding, it…

Read the Docs

When you’re learning to use a new framework or library, simple uses of the software can be done just by copy pasting code from tutorials and tweaking them as necessary. But at some point, it’s a good idea to just slog through reading the docs from top-to-bottom, to get a full understanding of what is and is not possible in the software. One of the big wins of AI coding is that LLMs…

Keep Files Small

It has been long debated about at what size a code file is too big. Some say that it should be based on single responsibility principle (one class per file), others say that large files can be situationally OK and it depends on if it is causing problems. Do not make files that are too large, if your RAG system for feeding code context can only operate on a per-file level, you will blow out your…

Use Automatic Code Formatting

Automatic code formatting tools like gofmt, rustfmt and black help enforce a consistent coding style across your codebase. LLMs are generally not very good at following mechanical rules like “lines with no content on them should have no trailing spaces even if the indentation level is non-zero” or “make sure a line is wrapped at 78 columns.” Use the right tool for the job.…

Requirements, not Solutions

In human software engineering, a common antipattern when trying to figure out what to do is to jump straight to proposing solutions, without forcing everyone to clearly articulate what all the requirements are. Often, your problem space is constrained enough that once you write down all of the requirements, the solution is uniquely determined; without the requirements, it’s easy to devolve…

Bulldozer Method

The Bulldozer Method as popularized by Dan Luu suggests that sometimes you can achieve results that seem superhuman simply by just sitting down, doing the brute force work, and then capitalizing on what you learn by doing this to get a velocity increase. AI coding is the epitome of brute force work: you can just brute force large refactoring problems if you are willing to spend enough tokens, or…

Stateless Tools

Your tools should be stateless: every invocation is independent from every other invocation, there should be no state that persists between each invocation that has to be accounted for when doing the next invocation. Unfortunately, shell is a very popular tool and it has a particulary pernicious form of local state: current working directory. Sonnet 3.7 is very bad at keeping track of what the…

Preparatory Refactoring

Preparatory Refactoring says that you should first refactor to make a change easy, and then make the change. The refactor change can be quite involved, but because it is semantics preserving, it is easier to evaluate than the change itself. Current LLMs, without a plan that says they should refactor first, don’t decompose changes in this way. They will try to do everything at once. They also…

Black Box Testing

Black box testing says that you should test the functionality of a component without knowing its internal structure. By default, LLMs have difficulty abiding with this, because by default the implementation file will be put into the context, or the agent will have been tuned to pull up the implementation to understand how to interface with it. Sonnet 3.7 in Cursor also has a strong tendency to try…

Stop Digging

Outside of very tactical situations, current models do not know how to stop digging when they get into trouble. Suppose that you want to implement feature X. You start working on it, but midway through you realize that it is annoying and difficult to do because you should do Y first. A human can know to abort and go implement Y first; an LLM will keep digging , dutifully trying to finish the…