Hamel Husain ★ 107 4 min

AI Evals: Everything You Need to Know

🔗 https://hamel.dev/blog/posts/evals-faq/

📌 Hamel Husain的AI Evals實戰心法:70%通過率可能比100%更有意義

TL;DR:教過700多位工程師與PM做AI評估後,Hamel Husain把最常被問到的問題整理成一份實戰FAQ。

如果你的AI評估分數長期接近100%,先別急著慶祝。這往往代表你的測試根本沒有真正挑戰系統。

🤔 兩種「evals」,別搞混

Hamel Husain與Shreya合著的這份FAQ指出,提到「evals」通常指兩種不同的東西。一種是模型基準測試,比較通用模型在共同任務上的表現,例如GPQA Diamond(研究生等級科學推理)、Terminal-Bench(指令列環境中的Agent任務)、MMLU(跨領域知識與推理)。這些分數可以幫你挑選一個有潛力的起始模型,但無法告訴你「你自己的產品」做得好不好。

真正該關注的是產品評估:衡量你的特定AI產品是否做到你想要它做的事,把你對「好的產品體驗」的判斷轉化成可追蹤的指標。產品評估涵蓋模型、提示詞、檢索、工具與應用程式碼等所有元件,聚焦在對使用者與業務真正重要的失敗案例。文中舉例:一個訂單取消Agent,評估要檢查的是它是否選對了訂單、是否等到取消工具真正成功執行後才告訴使用者「已取消」。實作方式包括程式碼斷言、人工審查、LLM作為評審(LLM-as-judge)與線上實驗,選哪種取決於你要測量的具體失敗類型。

🧩 從錯誤分析開始,不是從基礎設施開始

FAQ給出的核心流程是:先分析traces(從使用者初始查詢到最終回應之間,涵蓋所有Agent、工具與系統元件的完整動作記錄)找出真實的失敗模式,再把重要的失敗轉化成針對性的評估,用結果指導修改,最後重跑評估確認系統確實改善了。

具體做法建議:每次做出重大變更後,花30分鐘手動檢視20到50筆LLM輸出;由一位深刻理解使用者的領域專家擔任品質的「仁慈獨裁者」,做最終判斷;用notebook或藉助Claude、Codex這類AI編碼助手自建標註介面,寫任意程式碼、視覺化資料、快速迭代。文中特別強調,評估是開發流程的一部分,而不是獨立的檢查項目,就像除錯本來就是軟體開發的一環,應該持續進行,而不是等到某個階段才「做評估」。

至於什麼時候該投入自動化評估器,FAQ給出的判準是成本效益分析:能用簡單的斷言或正規表達式抓到的錯誤,成本低,值得做;但如果需要對齊一個LLM-as-judge評審器,就要衡量這個失敗模式是否真的值得投入。作者提到,在他們經手的專案中,60%到80%的開發時間花在錯誤分析與評估上,多數精力其實是花在「理解失敗」而不是「打造自動化檢查」。

💡 別急著推銷「evals」,直接拿數據說話

FAQ建議不要試圖向團隊「推銷」evals這個概念,而是先自己動手做錯誤分析,檢視50到100則真實使用者對話,找出最常見的失敗模式,用這些發現說一個有數據支撐的故事。把評估框定成開發流程的一部分,而不是可有可無的測試項目;保留一份錯誤日誌,記錄抓到的問題、學到的教訓、修法與避免掉的潛在影響,每週或每月分享一次。文中認為,「我們在使用者看到問題前抓到了47個issue」這種具體報告,比抽象地談論evals的價值更容易讓人信服,也更能建立信任。

錯誤分析被形容為evals中最重要的活動,因為它決定了你該寫哪些評估,並幫你找出屬於自己應用與資料的獨特失敗模式。流程是:先蒐集有代表性的traces(沒有資料的話可以先生成合成資料),由人工標註者(理想上是同一位仁慈獨裁者)審閱並寫下開放式筆記,這個過程類似質化研究方法中的「田野筆記」。作者建議先自己標註至少30筆traces,再去參考AI Agent給出的建議。

🎯 實務啟示

如果你的團隊正在為「要不要做AI evals」爭論,不用先建置一套評估平臺,直接找30到50筆真實輸出坐下來手動看一遍,把看到的失敗模式整理成一頁報告,往往比任何工具介紹都更有說服力。

🔗 來源

#AIEvals #LLM #MachineLearning #ErrorAnalysis #ProductEvals #LLMasJudge #AgentEvaluation #MLOps #AIEngineering #EvalDrivenDevelopment

原始資料 Hamel Husain · 收集於 2026-09-22
來源原標題
AI Evals: Everything You Need to Know
作者
Hamel Husain
原始標籤
blog
原始連結
https://hamel.dev/blog/posts/evals-faq/

摘要原文

This document curates the most common questions Shreya and I received while teaching 700+ engineers & PMs AI Evals. Warning: These are sharp opinions about what works in most cases. They are not universal truths. Use your judgment. Browse the questions that interest you, or choose a guide below for a curated reading path through the FAQs and related articles. Browse all questions by section. AI evals are tests that tell you whether an AI system is doing what you want. They give your team feedback when the product drifts from user needs or business goals. The failures they catch also become data you can use to improve the system. More formally, evaluation is the systematic measurement of quality. Each eval checks one behavior on relevant examples and returns a score or structured review. Most AI products need several evals because they can fail in different ways. When you hear the word “evals,” it usually refers to one of two things: model benchmarks or product evals. Model benchmarks compare general-purpose models on shared tasks. Model providers publish these benchmark results when they release new models. Common examples include GPQA Diamond for graduate-level science reasoning, Terminal-Bench for agents doing complex work in command-line environments, and MMLU for knowledge and reasoning across a wide range of subjects. These scores can help you choose a promising model as a starting point. To assess quality on your own tasks you need product evals, which we discuss next. Product evals measure whether your specific AI product does what you want it to do. They turn your judgment about what a good product experience looks like into metrics you can track. Product evals encompass all components of your product, including the model, prompts, retrieval, tools, and application code. This flavor of evals are focused on capturing failures that matter to users and the business. Consider an order-cancellation agent. Its product evals might check whether it selected the correct order and waited for the cancellation tool to succeed before telling the user the order was canceled. A high score on GPQA Diamond or Terminal-Bench gives you little information on this, because those benchmarks don’t have access to your systems. There are several mechanisms you can use to implement product evals, including code assertions, human review, LLM judges, and online experiments. The right method depends on the failure being measured, and is discussed in greater detail in this series . In the rest of the AI Evals FAQ , we focus on product evals. It starts with analyzing traces to discover real failure modes. We then turn important failures into targeted evals and use the results to guide changes. Finally, rerunning the evals tells us whether the system improved. If you are completely new to product-specific evals, see these posts: A trace is the complete record of all actions, messages, tool calls, and data retrievals from a single initial user query through to the final response. It includes every step across all agents, tools, and system components in a session: multiple user messages, assistant responses, retrieved documents, and intermediate tool interactions. Note on terminology: Different observability vendors use varying definitions of traces and spans. Alex Strick van Linschoten’s analysis highlights these differences (screenshot below): Start with error analysis, not infrastructure. Spend 30 minutes manually reviewing 20-50 LLM outputs whenever you make significant changes. Use one domain expert who understands your users as your quality decision maker (a “benevolent dictator”). Use a notebook to review traces and analyze data, or build your own custom annotation interface with an AI coding assistant like Claude or Codex. Either way, you can write arbitrary code, visualize data, and iterate quickly. The video below shows a simple annotation interface built inside a notebook. Watch “Build Your Own Eval Tools With Notebooks!” on YouTube It’s important to recognize that evaluation is part of the development process rather than a distinct line item, similar to how debugging is part of software development. You should always be doing error analysis . When you discover issues through error analysis, many will be straightforward bugs you’ll fix immediately. These fixes don’t require separate evaluation infrastructure as they’re just part of development. The decision to build automated evaluators comes down to cost-benefit analysis. If you can catch an error with a simple assertion or regex check, the cost is minimal and probably worth it. But if you need to align an LLM-as-judge evaluator, consider whether the failure mode warrants that investment. In the projects we’ve worked on, we’ve spent 60-80% of our development time on error analysis and evaluation . Expect most of your effort to go toward understanding failures (i.e. looking at data) rather than building automated checks. Be wary of optimizing for high eval pass rates . If you’re passing 100% of your evals, you’re likely not challenging your system enough. A 70% pass rate might indicate a more meaningful evaluation that’s actually stress-testing your application. Focus on evals that help you catch real issues, not ones that make your metrics look good. Yes. Even with perfect models, you still need to verify they’re solving the right problem. The need for systematic error analysis, domain-specific testing, and monitoring will still be important. Today’s prompt engineering tricks might become obsolete, but you’ll still need to understand failure modes. Additionally, a LLM cannot read your mind, and research shows that people need to observe the LLM’s behavior in order to properly externalize their requirements. For deeper perspective on this debate, see these two viewpoints: “The model is the product” versus “The model is NOT the product” . Don’t try to sell your team on “evals”. Instead, show them what you find when you look at the data. Start by doing the error analysis yourself. Look at 50 to 100 real user conversations and find the most common ways the product is failing. Use these findings to tell a story with data. Frame evaluation as part of development, not optional testing. Keep a running log of the errors you catch, what you learned, the fix, and the likely impact you avoided. Share it weekly or monthly. A concrete report such as “we caught 47 issues before users saw them” makes the value easier to see than an abstract pitch about evals. This approach builds trust. Don’t just show dashboards and metrics; tell the story of what you’re finding in the data. By narrating your findings, you teach the team what you’re learning, providing immediate value. When you fix an issue, show how the error rate for that specific problem went down. Soon, your team will see the progress and ask how you’re doing it. Let results instead of methods lead the conversation. This is similar to classic machine learning projects, where outcomes are speculative and progress is bounded by iterating on experiments . In this situation, it’s important that you share the learnings from each experiment to show progress and encourage investment. Error analysis is the most important activity in evals . Error analysis helps you decide what evals to write in the first place. It allows you to identify failure modes unique to your application and data. The process involves: Gathering representative traces of user interactions with the LLM. If you do not have any data, you can generate synthetic data to get started. Human annotator(s) (ideally a benevolent dictator) review and write open-ended notes about traces, noting any issues. This process is akin to “journaling” and is adapted from qualitative research methodologies. Start by annotating at least 30 traces yourself before reviewing suggestions from an agent.

由 claude-code/sonnet 自動生成