Hamel Husain and Shreya Shankar

Hamel Husain and Shreya Shankar joined Lenny's Podcast to talk about product, AI and metrics. We pulled 10 frameworks, mental models and tactics from the conversation. Each one below covers what it is, when to use it and how to apply it, with the moment in the episode where Hamel Husain and Shreya Shankar explains it.

10 frameworks 1 skills 2 insights

Includes our free 8-email course on making your product team AI-native. Unsubscribe anytime.

Hamel Husain and Shreya Shankar's frameworks

Framework

Open Coding Error Analysis

A systematic approach to analyzing AI application failures by manually reviewing traces and writing quick notes about what went wrong, without trying to categorize or fix everything at once.

When to use it

When you need to understand what's going wrong with your AI application before building automated tests

How to apply it

  1. Sample 100+ traces from your AI application
  2. Write quick notes about the first thing you see that's wrong in each trace
  3. Don't try to find all errors - just capture the most upstream issue
  4. Stop when you reach theoretical saturation (no new types of problems)
"So what you do is, the first step in conquering data like this is just to write notes. Okay? So you got to put your product hat on... you don't want to try to figure out if something is wrong. In this case, it's kind of not doing the right thing, but you just write a quick…" 17:07
Framework

Axial Coding with AI

Using LLMs to automatically categorize your error notes into failure modes and count their prevalence to prioritize what to fix.

When to use it

After completing open coding to synthesize your notes into actionable categories

How to apply it

  1. Export your open codes to a CSV
  2. Use an LLM to create axial codes (categories) from your notes
  3. Iterate on the categories to make them specific and actionable
  4. Use AI to automatically categorize all your notes
  5. Count occurrences with pivot tables
"So you have all these notes. Now, to turn this into something useful, you can do basic counting. So basic counting is the most powerful analytical technique in data science because it's so simple and it's kind of undervalued in many cases... And so the first thing you want to do…" 32:02
Framework

Binary LLM Judge Pattern

Creating AI evaluators that give pass/fail judgments on specific failure modes rather than scoring on scales, then validating them against human judgment.

When to use it

For subjective failure modes that can't be caught with simple code-based tests

How to apply it

  1. Focus on one specific failure mode per judge
  2. Write a prompt that outputs only true/false
  3. Test the judge against human-labeled examples
  4. Measure agreement with confusion matrix, not just overall accuracy
  5. Iterate the prompt until alignment is acceptable
"You want to make it binary because we want to simplify things. We don't want, 'Hey, score this on a rating of one to five. How good is it?' That's just in most cases, that's a weasel way of not making a decision. Like, 'No, you need to make a decision. Is this good enough or…" 52:16
Mental model

Theoretical Saturation Stopping Rule

Stopping error analysis when you're no longer discovering new types of problems or concepts that would materially change your next steps.

When to use it

To know when you've done enough manual error analysis

How to apply it

  1. Start with a goal of 100 traces (just to get started)
  2. Keep looking at traces until patterns become repetitive
  3. Stop when new traces don't reveal materially different failure modes
  4. Trust your intuition - this skill develops with practice
"Keep looking at traces until you feel like you're not learning anything new... There's actually a term in data analysis and qualitative analysis called theoretical saturation." 30:30
Mental model

Vibes Check Integration

Vibe checks (intuitive product sense) are valuable and necessary, but they need to be systematized and grounded in data analysis to scale.

When to use it

As part of your overall evaluation strategy, not as the only method

How to apply it

  1. Start with vibe checks to get initial sense of problems
  2. Systematize your intuitions through structured error analysis
  3. Use data to validate and scale your product intuitions
  4. Don't abandon intuition, but make it more rigorous
"And vibe checks are good and you should do vibe checks initially, but it can become very unmanageable very fast because as your application grows, it's really hard to rely on vibe checks." 07:11
Tactic

Benevolent Dictator Approach

Appointing one domain expert to make evaluation decisions rather than using a committee, to keep the eval process tractable and efficient.

When to use it

When doing error analysis and building evals to avoid getting bogged down in committee decisions

How to apply it

  1. Identify the person with the most domain expertise
  2. Give them authority to make evaluation judgments
  3. Trust their taste and let them move quickly
  4. Often this is the product manager
"When you're doing this open coding, a lot of teams get bogged down in having a committee do this. For a lot of situations, that's wholly unnecessary. You don't want to make this process so expensive that you can't do it. You can appoint one person whose taste that you trust." 00:49
Tactic

Fix First, Eval Second

When you discover obvious problems during error analysis, just fix them immediately rather than building elaborate evaluation systems around them.

When to use it

When error analysis reveals straightforward issues with clear solutions

How to apply it

  1. If the fix is obvious (like prompt improvements), implement it immediately
  2. Only build evals for persistent or complex failure modes
  3. Focus eval-building energy on the most valuable or risky areas
  4. Remember the goal is product improvement, not eval perfection
"If any, we teach our students, 'Hey, when you're doing these evals, if you see something that's wrong, just go fix it.' The whole point is not to have evals, a beautiful eval suite, where you can point at it, edit it and say, Oh, look at my evals.' No, just fix your application,…" 01:30:16
Contrarian take

Error Analysis Before A/B Testing

You should ground your hypotheses in actual error analysis rather than jumping straight to A/B tests based on assumptions.

When to use it

Before running experiments or A/B tests on AI products

How to apply it

  1. Do error analysis first to discover real failure modes
  2. Use those findings to inform what to test
  3. Then run A/B tests on solutions to real problems
  4. Avoid testing hypothetical improvements
"I think a lot of people prematurely do A-B tests, because they've never done any error analysis in the first place... if you're going to do A-B tests and they're powered by actual error analysis as we've shown today, then that's great, go do it." 01:18:23
Contrarian take

Anti-Generic Tools Philosophy

Generic eval tools and scores don't work - you need application-specific evaluation grounded in your actual data and domain expertise.

When to use it

When choosing evaluation approaches and tools

How to apply it

  1. Don't rely on generic hallucination scores or cosine similarity
  2. Build evaluations specific to your application and domain
  3. Start with manual analysis, don't jump to automated tools
  4. Create your own simple tools when needed
"The top one is, 'Hey, I can just buy a tool, plug it in, and it'll do the eval for you. Why do I have to worry about this? We live in the age of AI. Can't the AI just eval it?' But it doesn't work... If you look at the eval products, let's say the ones up until recently that…" 01:24:31
Story

Real Estate Assistant Handoff Example

A story about how an AI real estate assistant handled a customer inquiry about apartment availability, responding correctly but missing the opportunity to nurture the lead by handing off to a human.

When to use it

To illustrate why product managers need to be involved in AI evaluation

How to apply it

  1. Look beyond technical correctness to business impact
  2. Consider the full customer journey and business goals
  3. Question whether AI responses serve the business purpose
  4. Identify missed opportunities for human handoff
"A user asked about availability. The AI said, 'Oh, we don't really have that. Have a nice day.' Now, for a product that is helping you with lead management, is that good?" 18:30

Overlay: Building AI Products Skills

Building systematic metrics allows teams to move beyond subjective 'vibe checks' and iterate on AI features with the same confidence as traditional software.

"Evals help you create metrics that you can use to measure how your application is doing and kind of give you a way to improve your application with confidence. That you have a feedback signal in which..."
48:46

Streamline the categorization of AI errors by appointing a single 'benevolent dictator' with domain expertise to define quality standards instead of relying on a committee.

"When you're doing this open coding, a lot of teams get bogged down in having a committee do this. For a lot of situations, that's wholly unnecessary. You don't want to make this process so expensive t..."
31:42

About Hamel Husain and Shreya Shankar

Hamel Husain and Shreya Shankar teach the world’s most popular course on AI evals and have trained over 2,000 PMs and engineers (including many teams at OpenAI and Anthropic).

From the notes for Hamel Husain and Shreya Shankar's episode of Lenny's Podcast.