Hamel Husain breaks down AI failures into three problems: the Gulf of Comprehension (you don't understand your data), the Gulf of Specification (your prompt lacks context), and the Gulf of Generalization (the model won't follow instructions). Fix them in that order or waste months on the wrong problem.
Chapters
If your AI is failing, it's important to understand which one of these three categories the failure falls into. To give people a mental model of this, we have this three gulfs framework, and there's the Gulf of Comprehension, Specification, and Generalization. The Gulf of Comprehension is a failure of not understanding your data. Number one thing that people skip when it comes to evals is doing data analysis. You can't just jump right into writing tests or writing evals, and you shouldn't do that. You should analyze your system's data and understand what the patterns are, and there's systematic ways to do this so you don't get lost. The reason that it's called the Gulf of Comprehension is the only way to understand what is actually failing. The second thing is Gulf of Specification. Gulf of Specification just means, have you been thorough enough with your prompt? Have you told the language model everything it needs to know in the right specificity so that it can carry out your instructions? And again, it's really important that you comprehend, or that you have looked at your data first to understand what the failure modes are, what users are trying to do with your product, etc., so that you can have a really good specification. Specification that also includes having the right context, so being able to retrieve the right information, but also includes having a clear prompt that gives large language model everything it needs to have to succeed. The last thing is Gulf of Generalization. That's the one failure that is the most outside your control. That is a failure of the model simply not doing what you're telling it to do despite giving it all the information. And there are some things you can do like fine-tuning. However, a lot of the failures that we see, failures in the other two categories, if you do really well with understanding your data, doing data analysis, and refining your prompt, you can go a long way.