Home/AI/ML Notes/Basics of Agents/Agent Evaluation
⌂ Main Page
Basics of Agents

Agent Evaluation

Offline and online evaluation, validating LLM judges against humans, and evaluation frameworks.

On this page

Agent Evaluation

Offline evaluation

Multi-faceted methods measuring agent’s success at completing its core functions/behaviors: goal success rate, response quality, safety, finding info, using tools, clear communication, etc.

A screenshot of a computer AI-generated content may be incorrect.

One evaluator: dataset => agent => evaluation => result: e.g. 95% task-level accuracy

Aggregating all evaluators across all instances of the data = final score (think Deep Thought!). Each agent can have multiple evaluation metrics.

High-quality custom dataset for a specific task.

Typical Structure of the Evaluation Process

  1. Create “golden” Eval Dataset to benchmark LLMs & AI agents: Q&A pairs - curated queries and expected answers - org's consensus on quality.

  2. Run the full Eval Dataset (every Q&A pair) across different agents capturing responses for each Q&A pair.

  3. LLM-as-a-judge takes the answers and uses a consistent evaluation prompt or rubric to produce structured metrics (e.g. score each response on a binary or 1-5 scale). If search, run it across different search agents w/same synthesis LLM and prompts - only search quality varied. Judge pitfalls: position bias (swap answer order & average), verbosity bias (length-penalize), self-preference (use a judge from a different model family), score clustering (anchored rubrics w/an example per score level). Pairwise comparison is more reliable than absolute scoring; make the judge reason (CoT) before emitting the score

  4. Aggregate into clear, comparable metrics - powerful for comparing two versions of an agent or different agents. Example - industry benchmarking against competitors.

  5. If custom golden sets aren't feasible, use established benchmarks - SimpleQA, FRAMES, FreshQA, BrowseComp, FinSearchComp, etc. Agent-specific: SWE-bench (real GitHub issues), GAIA (general assistant tasks), WebArena (browser tasks), τ-bench (tool use w/simulated users; reports pass^k — probability that ALL k of k runs succeed (pass to the k, pass power k) — measures reliability/consistency, stricter than pass@k (proba that at least ONE our k passes will be true).

Different task performance: e.g. good at scheduling meeting, but not at sending emails - slicing dimension applied to GSR - breakdown by task type.

1. Retrieval & Grounding (RAG) Quality

Classic RAG triad:

Example: Answer can be grounded in retrieved docs, but still be wrong (wrong docs retrieved). If you ask, "What were our company's Q3 revenues?", retrieval quality checks if the agent pulled the Q3 fin. report; faithfulness checks if the answer matches the numbers in that report.

2. Response Quality

Vertex AI uses model-based evaluation: LLM "grades" the agent's output based on a set of criteria that measure subjective qualities:

3. Tool-level metrics

4. Trajectory evaluation (above tools)

Judges the whole reference tool sequence (distinct from single tool-call correctness) - exact match / in-order match / precision-recall (Vertex AI's agent eval).

5. Task outcomes (task-level metrics)

6. System Performance & Cost (System-level metrics)

Task metrics tell you that it failed; component metrics tell you why. These aren’t parallel buckets - it’s a methodology / causal ladder from components to outcomes explaining the diagnostic flow. Groups 1–3 evaluate individual steps in the agent loop (retrieve, generate, act); group 4 evaluates whether the whole trajectory achieved the goal; group 5 evaluates whether it did so efficiently and reliably. When GSR (group 4) drops, you descend the ladder — was it bad retrieval (1), a hallucinated response (2), or a wrong tool call (3)?.

Online evaluation

Definition. Online evaluation = continuous measurement on live production traffic, versus offline eval on curated test sets. Core challenge: no ground truth labels, so you need reference-free scoring.

Signal sources, roughly in order of scale vs. fidelity:

Online operational metrics: latency percentiles (p50/p95/p99), error and timeout rates, cost per session, tool-call failure rates, human-escalation rate - Group 6 above.

Drift detection. Distribution shift in incoming queries (new topics, new intents) vs. your offline eval set; degradation in judge scores over time; per-segment slicing (online is where you discover capability gaps by task type).

Methods. A/B testing and interleaving for comparing agent versions on live traffic; canary deployments with automatic rollback on metric regression; shadow mode (new version runs silently alongside prod, scored but not shown).

Offline vs. Online

Labelled online data may be persisted for regression testing. Trace-curation flywheel - online data = unlabeled, but you persist production traces (queries, retrieved context, tool calls, responses) + labels you can attach after the fact - explicit user feedback, LLM-judge, or human annotation of sampled traffic. This feeds back into your offline eval set —production failures become tomorrow's regression tests.

The one-line summary: offline eval => "is this version good enough to ship?", online eval => "is it still good, for real users, right now?", and trace-curation flywheel connects them.

Example of LLM Judge Rubrics (offline & online) - DeepResearch:

Validating LLM against humans in the form of an inter-annotator agreement (IAA). Same can be used to calculate agreement among humans:

Evaluation Frameworks

Use categories rather than a flat list —"I've heard of these tools" becomes "I understand the space."

Observability / LLMOps platforms (online eval = trace-first, eval added on top)

Evaluation libraries (offline eval - metrics-first, you bring the harness)

Cloud-native eval services

Benchmark harnesses (a fourth mini-category worth one sentence): EleutherAI lm-evaluation-harness and HELM for standardized academic benchmarks, and agent-specific benchmarks like SWE-bench, WebArena, τ-bench, GAIA — these evaluate models/agents in general, versus everything above, which evaluates your application.

Eval libraries (RAGAS, DeepEval) - offline eval in CI; observability platforms (LangSmith, Langfuse, Phoenix) - online tracing and judge-scored production monitoring, and their dataset features close the loop by turning traces into offline test sets. Mature stack = one platform + one library — e.g., Langfuse + RAGAS is a common all-open-source combination, LangSmith alone covers both roles inside the LangChain ecosystem.