惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Spread Privacy
Spread Privacy
P
Palo Alto Networks Blog
P
Proofpoint News Feed
AI
AI
Help Net Security
Help Net Security
S
Securelist
T
Troy Hunt's Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
Cisco Blogs
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
Vercel News
Vercel News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
B
Blog
GbyAI
GbyAI
Recent Commits to openclaw:main
Recent Commits to openclaw:main
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Proofpoint News Feed
S
Security Affairs
Cisco Talos Blog
Cisco Talos Blog
AWS News Blog
AWS News Blog
T
Tenable Blog
H
Help Net Security
NISL@THU
NISL@THU
F
Fortinet All Blogs
博客园_首页
G
GRAHAM CLULEY
L
LINUX DO - 最新话题
P
Privacy International News Feed
G
Google Developers Blog
博客园 - Franky
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Security Archives - TechRepublic
Security Archives - TechRepublic
The Register - Security
The Register - Security
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
T
Tor Project blog
P
Privacy & Cybersecurity Law Blog
量子位
C
Cyber Attacks, Cyber Crime and Cyber Security
Forbes - Security
Forbes - Security
S
Secure Thoughts
Simon Willison's Weblog
Simon Willison's Weblog
D
Docker
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
L
Lohrmann on Cybersecurity
T
Tailwind CSS Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Why Accuracy Is Not Enough: Evaluation Metrics Every AI Engineer Should Understand
Neetika Mittal · 2026-05-31 · via DEV Community

Why Accuracy Is Not Enough: Evaluation Metrics Every AI Engineer Should Understand

Your evaluation dashboard says your model is 95% accurate. Leadership is happy. The deployment goes live.

Two weeks later, users complain that critical failures are still slipping through.

The problem is not always the model. Sometimes the problem is the metric.

As AI systems move from research prototypes into production infrastructure, evaluation becomes one of the most important engineering problems. This is especially true for modern GenAI systems, where outputs are probabilistic, subjective, and highly context dependent.

In this article, we will break down the most important evaluation metrics used in machine learning and GenAI systems, understand where they fail, and discuss how to think about evaluation from a production engineering perspective.


The Core Problem With Accuracy

Accuracy is usually the first metric people encounter in machine learning. It is simple:

Accuracy=Correct PredictionsTotal Predictions Accuracy = \frac{Correct\ Predictions}{Total\ Predictions}

At first glance, it seems reasonable. If a model predicts correctly 95% of the time, surely that sounds good.

But accuracy becomes dangerous when datasets are imbalanced.

Imagine a fraud detection system:

  • 99% of transactions are legitimate
  • 1% are fraudulent

Now suppose your model predicts:

"Every transaction is legitimate."

The result?

  • 99% accuracy
  • Completely useless fraud detection

To make the failure more obvious, imagine 10,000 transactions:

Metric Count
Fraudulent transactions 100
Legitimate transactions 9,900
Fraud cases detected 0
Fraud cases missed 100

The model gets 9,900 predictions right, so accuracy looks excellent. But recall for fraud is 0%.

This is one of the most common evaluation mistakes in production systems: the metric looks healthy while the system fails at its actual job.

Understanding the Confusion Matrix

Most evaluation metrics are derived from something called the confusion matrix.

Predicted Positive Predicted Negative
Actual Positive True Positive (TP) False Negative (FN)
Actual Negative False Positive (FP) True Negative (TN)

This matrix gives us a much richer understanding of model behavior. From it, we derive several important metrics.


Precision

Precision answers:

"When the model predicts positive, how often is it correct?"

Precision=TPTP+FP Precision = \frac{TP}{TP + FP}

High precision means the model produces few false positives, so its positive predictions are more trustworthy.

Precision matters when false alarms are expensive. Common examples include spam filters, content moderation, automated bans, and financial transaction blocking.

If your spam detector incorrectly flags legitimate emails, users lose trust quickly.


Recall

Recall answers:

"How many actual positives did the model successfully detect?"

Recall=TPTP+FN Recall = \frac{TP}{TP + FN}

High recall means the model misses fewer positive cases and catches most of the important events.

Recall matters when missing something is costly. Common examples include fraud detection, medical diagnosis, security systems, and safety monitoring.

A cancer detection model with low recall can miss life-threatening cases.


The Precision vs Recall Tradeoff

In most real-world systems, improving precision hurts recall, and improving recall hurts precision. This creates one of the central optimization problems in machine learning.

For example, lowering a classification threshold usually increases recall, but it also increases false positives, which reduces precision.

This tradeoff appears everywhere in production AI systems. Modern LLM moderation systems constantly balance aggressive filtering, user experience, safety requirements, and operational costs.

There is rarely a perfect threshold. Only tradeoffs.


F1 Score

F1 score combines precision and recall into a single metric.

F1=2×Precision×RecallPrecision+Recall F1 = 2 \times \frac{Precision \times Recall}{Precision + Recall}

F1 becomes useful when class imbalance exists, both precision and recall matter, and you want a single aggregate metric.

This is why F1 is heavily used in information retrieval, NLP classification, GenAI evaluations, entity extraction, and multi-label classification.

However, F1 also hides information. Two models can have identical F1 scores while behaving very differently operationally.

One model may produce many false positives. Another may miss many true positives. The same metric can hide very different failure modes.


When F1 Is Not Enough

F1 assumes precision and recall are equally important. That is not always true.

In fraud detection, recall may matter more because missing fraud is expensive. In automated account bans, precision may matter more because false accusations damage user trust.

In these cases, optimizing F1 can still produce the wrong system behavior.

A related metric, F-beta, lets you control this tradeoff:

  • F2 emphasizes recall
  • F0.5 emphasizes precision

The important question is not "Which metric is popular?" The important question is "Which mistake is more expensive?"


A Production Lesson From GenAI Evaluations

One of the most interesting problems in GenAI systems is that evaluation itself becomes probabilistic.

Traditional systems often evaluate deterministic outputs:

  • Correct
  • Incorrect

But LLM systems are rarely binary. Suppose you build a ticket classification system using an LLM. The model may partially understand the issue: it might identify the correct root cause, assign the wrong severity, produce an incomplete explanation, or hallucinate remediation steps.

Now evaluation becomes much harder.

In one evaluation pipeline I worked on, aggregate metrics initially looked strong despite obvious quality problems observed by engineers. The root cause was class imbalance.

Some labels appeared thousands of times while others appeared only a handful of times. Weighted metrics looked excellent because common labels dominated the scores.

Macro F1 revealed the actual issue immediately: the system was effectively ignoring rare but operationally important classes.

This is one reason why evaluation engineering is becoming a major discipline in modern AI infrastructure.


Macro vs Micro vs Weighted F1

This distinction becomes extremely important in multi-class systems.

Micro F1

Micro F1 aggregates all predictions globally. It favors common classes, which makes it useful when overall system performance matters most and the dataset distribution reflects production reality.


Macro F1

Macro F1 computes F1 independently per class and averages them equally. This treats rare classes as equally important, which makes it useful when rare classes, fairness, or tail performance matter.


Weighted F1

Weighted F1 balances both worlds. Classes contribute proportionally based on frequency.

This is often used in production dashboards, but it can sometimes hide minority-class failures.


ROC-AUC

ROC-AUC stands for Receiver Operating Characteristic - Area Under the Curve.

It measures how well a model separates positive cases from negative cases across different classification thresholds.

Many classifiers do not directly output positive or negative. They output a score or probability.

For example:

Transaction Actual Class Model Score
A Fraud 0.92
B Fraud 0.81
C Legitimate 0.40
D Legitimate 0.12

To turn these scores into predictions, we choose a threshold.

If the threshold is 0.8:

  • A and B are predicted as fraud
  • C and D are predicted as legitimate

If the threshold is 0.3:

  • A, B, and C are predicted as fraud
  • D is predicted as legitimate

Changing the threshold changes false positives and false negatives.

The ROC curve shows this tradeoff by plotting the true positive rate, which tells you how many actual positives the model catches, against the false positive rate, which tells you how many actual negatives the model incorrectly flags.

AUC stands for Area Under the Curve.

A score of 1.0 means perfect separation, 0.5 means random guessing, and anything below 0.5 means worse than random guessing.

A high ROC-AUC means the model usually gives higher scores to positive examples than to negative examples.

ROC-AUC is useful when comparing models because it does not depend on one fixed threshold. But in highly imbalanced datasets, it can look better than the system actually feels in production.


PR-AUC

Precision-Recall AUC often becomes more informative for imbalanced problems.

Unlike ROC-AUC, PR-AUC focuses directly on precision and recall. This makes it especially valuable for fraud detection, security systems, rare event detection, and GenAI issue detection.

In practice, PR-AUC often tells a more honest story for production AI systems.


Calibration: The Metric Most Teams Ignore

Suppose two models both predict:

"90% confidence"

But:

  • Model A is actually correct 90% of the time
  • Model B is correct only 60% of the time

Model A is calibrated. Model B is overconfident.

Calibration measures whether model confidence matches reality. This becomes critically important in autonomous systems, medical AI, LLM judges, recommendation systems, and human-AI collaboration.

Common ways to inspect calibration include reliability diagrams, expected calibration error, and Brier score.

Modern LLMs are notoriously poor at calibrated confidence estimation. This creates major challenges for autonomous agent systems, where the model must decide when to act, ask for help, or stop.


Evaluation in LLM Systems Is Different

Traditional ML evaluation usually assumes clear labels, deterministic outputs, and stable datasets.

LLM systems violate all three assumptions. Their outputs may be subjective, creative, multi-step, context dependent, and non-deterministic.

For LLM products, evaluation often needs to measure multiple dimensions at once: factual correctness, instruction following, relevance, completeness, groundedness, safety, formatting compliance, tool-use correctness, latency, and cost.

This creates new evaluation approaches.


LLM-as-a-Judge

One increasingly popular technique is using LLMs themselves as evaluators.

The idea is simple:

  • Generate model output
  • Ask another LLM to evaluate quality
  • Compare against expected behavior

This enables scalable evaluation pipelines for summarization, reasoning, agent workflows, coding systems, and customer support systems.

But LLM judges introduce new problems, including judge bias, prompt sensitivity, position bias, preference leakage, and self-preference bias.

Teams reduce these risks by using clear rubrics, randomizing answer order, hiding model identity, comparing judge scores against human labels, and tracking agreement between judges.

Evaluation systems now require evaluation themselves. This recursive problem is becoming a major research area.


Human Evaluations Still Matter

Despite advances in automated metrics, humans remain essential, especially for alignment, safety, UX quality, tone, reasoning correctness, and policy compliance.

The most reliable production evaluation systems usually combine automated metrics, human review, statistical monitoring, regression detection, and real user feedback.

No single metric captures reality completely.


Offline vs Online Evaluation

Offline evaluation happens before deployment. It includes test sets, golden datasets, regression suites, and benchmark runs.

Online evaluation happens after deployment. It includes A/B tests, shadow deployments, user feedback, production monitoring, and human review queues.

Both matter.

Offline evaluation catches regressions before users see them. Online evaluation tells you whether the system is actually working in the messy reality of production traffic.


Which Metric Should You Use?

Use Case Recommended Metric
Fraud Detection Recall + PR-AUC
Spam Detection Precision
Search Ranking NDCG
Recommendation Systems MAP / CTR
Multi-label NLP Macro F1
GenAI Classification F1 + Human Review
Safety Systems Recall
LLM Judges Agreement Metrics
Ranking Models ROC-AUC + NDCG

Some ranking metrics deserve a quick note:

  • NDCG is useful when the order of results matters and top-ranked items are more important
  • MAP is useful for retrieval systems where multiple relevant results may exist
  • CTR is a behavioral business metric, but it can be noisy and biased by position, UI, and user intent

The key lesson is:

Metrics must align with operational goals.

Optimizing the wrong metric can destroy system quality while dashboards continue looking healthy.


A Practical Evaluation Checklist

Before trusting a model metric, ask:

  • Is the dataset imbalanced?
  • Which error is more expensive: false positives or false negatives?
  • Are rare classes hidden by averages?
  • Is the model calibrated?
  • Does offline performance match production behavior?
  • Are humans reviewing ambiguous cases?
  • Are evaluation datasets versioned?
  • Are regressions caught before deployment?
  • Are latency and cost part of the evaluation?

This checklist is often more useful than adding another metric to a dashboard.


Evaluation Is an Engineering Discipline

Many teams treat evaluation as an afterthought. In reality, evaluation systems are production infrastructure.

Good evaluation systems require more than a few metrics on a dashboard. They need dataset versioning, label quality pipelines, drift detection, continuous benchmarking, human review loops, statistical monitoring, cost-aware execution, and experiment reproducibility.

As AI systems become core infrastructure, evaluation engineering is becoming as important as model engineering itself.


Final Thoughts

Metrics are compression functions for reality. Every metric hides information.

Accuracy hides class imbalance. F1 hides confidence. ROC-AUC hides calibration. Calibration hides ranking quality.

No single number can fully describe model behavior.

The best evaluation systems combine multiple perspectives: correctness, reliability, uncertainty, safety, and operational impact.

If you are building production AI systems, choosing the right evaluation metric is often more important than choosing the right model.

Because in the end:

What you measure is what your system learns to optimize.

And poorly chosen metrics can quietly push systems in the wrong direction for months before anyone notices.