Library

Volume 2 · AI Evaluation Frameworks

Notebook
Sign in

Section 57

The Pillars of AI Evaluation (Quality, Accuracy, Latency, Cost, Safety, User Satisfaction)

789 words · about 4 min

57.1 Why Evaluation Is Structurally Different for AI Systems

Traditional software testing is binary — a test passes or fails. LLM and agentic system outputs are probabilistic and often subjective: “good enough” varies by use case, and the same input can legitimately produce different acceptable outputs. An enterprise evaluation framework has to formalize what “good” means across multiple dimensions simultaneously, or teams end up arguing about anecdotes instead of measuring systematically.

57.2 The Six Pillars

┌─────────────────────────────────────────────────┐
│              AI Evaluation Framework              │
│                                                    │
│  ┌───────────┐  ┌───────────┐  ┌───────────┐    │
│  │  QUALITY   │  │ ACCURACY  │  │  LATENCY  │    │
│  │            │  │           │  │           │    │
│  │ Relevance  │  │ Factual   │  │ TTFT      │    │
│  │ Coherence  │  │ Faithful  │  │ Total     │    │
│  │ Completeness│ │ Grounded  │  │ Streaming │    │
│  │ Format     │  │ Citation  │  │ Throughput│    │
│  └───────────┘  └───────────┘  └───────────┘    │
│                                                    │
│  ┌───────────┐  ┌───────────┐  ┌───────────┐    │
│  │   COST    │  │  SAFETY   │  │   USER    │    │
│  │           │  │           │  │ SATISFACTION│  │
│  │ Per-query │  │ Toxicity  │  │           │    │
│  │ Monthly   │  │ Bias      │  │ Thumbs    │    │
│  │ Per-user  │  │ PII leak  │  │ CSAT      │    │
│  │ Efficiency│  │ Injection │  │ Retention │    │
│  └───────────┘  └───────────┘  └───────────┘    │
└─────────────────────────────────────────────────┘

57.3 Metric Detail by Pillar

Quality:

Metric Description How to Measure Typical Target
Relevance Does the answer address the question? LLM-as-judge, human eval >95%
Coherence Is the response well-structured/logical? LLM-as-judge >90%
Completeness Are all aspects of the query addressed? LLM-as-judge, human eval >85%
Conciseness Is the response appropriately brief? Token count, LLM-as-judge Context-dependent
Format compliance Does output match the requested schema? Schema validation >99%

Accuracy (especially for RAG/knowledge systems):

Metric Description Tooling Target
Faithfulness Is the answer grounded in retrieved context? RAGAS, TruLens, custom NLI >95%
Answer correctness Is the answer factually correct? Human eval, golden dataset >90%
Hallucination rate % of claims not supported by sources Custom, RAGAS <2%
Citation accuracy Do citations point to the correct source? Custom validation >95%

Latency:

Metric Description Target
TTFT (time to first token) Time before streaming starts <500ms
Total response time Full response generation <3s simple, <10s complex
P95 latency 95th percentile response time <2x average
Throughput Requests per second Based on expected load

Cost:

Metric Description Monitoring
Cost per query Total cost (LLM + retrieval + compute) Real-time dashboard
Cost per user per month Budgeting/pricing input Monthly report
Token efficiency Quality per token consumed Optimize prompts
Cache hit rate % queries served from cache >30%

Safety (toxicity, bias, PII leakage, prompt injection resistance) is detailed in Section 69 alongside Responsible AI. User satisfaction (thumbs up/down, CSAT, retention, reformulation rate) is detailed in Section 63’s feedback loop design.

57.4 Why All Six Pillars Must Be Evaluated Together

Optimizing one pillar in isolation routinely damages another: chasing lower latency by truncating retrieved context hurts accuracy; chasing lower cost by routing everything to a cheap model hurts quality; chasing higher quality with maximal context and the strongest model blows up cost and latency. Every evaluation framework and every regression gate (Section 62) must report all six pillars together so trade-offs are visible and intentional rather than accidental.

Interview Q&A — Section 57

Q1: A product manager says “just make the answers more accurate.” How do you push back constructively while still evaluating rigorously? A: I’d first pin down what “accuracy” means for this system precisely — factual correctness, faithfulness to sources, completeness, or something else — because each has a different fix. Then I’d present accuracy alongside the other five pillars on a single dashboard so the trade-off is explicit: e.g., “we can raise faithfulness from 90% to 96% by retrieving more context and using a stronger model, but that adds ~1.2s latency and roughly doubles cost per query — is that an acceptable trade for this use case?” This reframes a vague request into a scoped, quantified decision the business can actually make.

Q2: How would you set target thresholds for each of the six pillars for a new AI feature before it has any production data? A: Start from the business requirement, not an arbitrary number: what latency is tolerable for this UX (real-time chat vs. async batch), what cost per query keeps unit economics healthy at expected volume, what accuracy/hallucination tolerance the domain allows (near-zero for legal/medical, more lenient for internal exploratory tools), what safety posture is mandated by compliance. Set initial thresholds from these constraints plus benchmarks from comparable systems, then treat them as a hypothesis — validate and recalibrate against the first few weeks of golden-dataset and production data (Sections 77, 82) rather than treating day-one targets as permanent.