Scaling AI Evaluation for Legal AI Systems Through Multi-Modal Assessment
harvey · Legal · 2025 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)
Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.
Problem
Domain: legal AI evaluation for high-stakes professional work
Harvey needed to evaluate legal AI systems that retrieve sources, generate answers, analyze documents, and cite law in contexts where errors can undermine professional trust.
Constraints:
- Legal outputs require domain expertise to judge, especially for nuanced jurisdictions and practice areas.
- Retrieval mistakes can cascade into final answer failures in agentic search workflows.
- Manual expert review is rigorous but limited by data scarcity, feedback latency, fragmented expertise, and regression risk.
- Evaluation data may contain confidential or restricted legal information and needs strict access controls.
- Model, prompt, pipeline, and citation changes need statistically meaningful evidence before rollout.
Architecture
Harvey built a three-pillar evaluation system: direct legal-expert review, automated evaluation pipelines, and a dedicated evaluation-data service. Experts create golden retrieval datasets and judge answer quality through anonymized A/B and Likert comparisons; automated evaluators use domain documentation, rubrics, confidence scores, canary runs, production monitoring, and citation-matching pipelines; the data service isolates evaluation data, standardizes annotations, enforces row-level access controls, and locks published datasets for reproducible experiments.
Diagram confidence: explicit (topology described by the source).
flowchart LR A["Legal experts"] --> B["Golden retrieval datasets"] B --> C["Retrieval systems"] C --> D["Answer generation system"] D --> E["Side-by-side evaluation tool"] E --> A D --> F["Automated evaluation pipelines"] F --> G["Knowledge source identification"] A --> H["Evaluation data service"] F --> H
Components
| Component | Role | Interacts with |
|---|---|---|
Legal experts |
Partners, tax experts, and subject-matter specialists who create datasets and judge outputs. | Golden retrieval datasets, Side-by-side evaluation tool, Evaluation data service |
Golden retrieval datasets |
Expert-curated query sets and relevant supporting documents for search and retrieval testing. | Retrieval systems, Automated evaluation pipelines |
Retrieval systems |
Traditional and agent-based search systems evaluated with precision, recall, NDCG, retrieval power, and model context. | Answer generation system, Golden retrieval datasets |
Answer generation system |
Harvey AI answer pipeline that retrieves documents, constructs context, and generates legal responses. | Retrieval systems, Side-by-side evaluation tool, Automated evaluation pipelines |
Side-by-side evaluation tool |
Human evaluation interface for anonymized A/B preference tests and Likert ratings. | Legal experts, Answer generation system |
Automated evaluation pipelines |
Nightly canaries, production monitoring, model vetting, rubric-based grading, and confidence scoring. | Answer generation system, Knowledge source identification |
Knowledge source identification |
Citation-verification subsystem using structured parsing, retrieval, embeddings, and LLM binary matching. | Automated evaluation pipelines |
Evaluation data service |
Isolated platform for data storage, access control, annotation, versioning, and collaboration. | Legal experts, Automated evaluation pipelines |
Data flow
Legal experts define queries and relevant documents for retrieval evaluation, then review generated answers through structured comparison tools. Automated systems grade model outputs using the user request, model answer, domain knowledge, expert prior knowledge, and rubrics. Citation strings are parsed into structured metadata, retrieved through databases or embeddings, and checked by an LLM binary matcher. Evaluation samples and annotations flow through a dedicated data service with versioning and role-based access control.
3 supporting quotes
Why this architecture
Harvey combines expert review with automation because legal evaluation needs both professional judgment and broad continuous coverage. Expert evaluation supplies legal correctness and statistical release signals, while automated pipelines catch regressions, run nightly canaries, vet new models, and verify citations at scale. The separate data service protects confidentiality and keeps experiments reproducible.
3 supporting quotes
Models used: GPT-4.1 · GPT-4o · LLM-based grading systems · LLM binary document-matching evaluation · embedding retrieval
Scale
- GPT-4.1 improved Harvey's mean expert rating by more than 10% in a legal QA system.“The mean rating improved by over 10% (from 5.10 to 5.63), and the median score rose from 5 to 6—a full point higher on a 7-point scale.”article, stated
- Harvey's citation-verification system reports over 95% accuracy on an attorney-validated benchmark.“This combination of structured parsing, intelligent retrieval, and LLM-based judgment has yielded over 95% accuracy on our internal benchmark dataset validated by attorneys.”article, stated
- Automated canary evaluations run nightly before production.“Routine Evaluations: We run a suite of lightweight canary evaluations nightly to validate the day's code changes before they go to production”article, stated
- Citation matching operates against a corpus of millions of documents.“High-Volume Fuzzy Matching: Quickly and accurately matching citation strings against a corpus of millions of documents”article, stated
Alternatives considered (roads not taken)
Expert review alone
Rejected because: Manual expert review cannot cover the volume of potential test cases or provide continuous monitoring.
Generic automated benchmarks
Rejected because: Legal workflows require nuanced rubrics and domain knowledge beyond generic evaluation.
Unstructured side-by-side review
Rejected because: Harvey uses anonymization, randomization, standardized prompts, and scales to reduce bias and measure statistical significance.
Evaluation data inside the primary application
Rejected because: An isolated evaluation service reduces data leakage risk and unauthorized dependencies.
Patterns
eval-driven-development (evaluation)
Harvey uses expert datasets, A/B comparisons, Likert ratings, model vetting, canaries, and automated graders to decide model and pipeline changes.
human-in-the-loop-gate (governance)
Legal experts create datasets, judge answers, and directly shape product decisions.
llm-as-judge (evaluation)
Automated evaluators grade answers and an LLM performs binary document matching for citations.
rag-retrieval (retrieval)
Harvey evaluates traditional and agent-based retrieval against expert references and uses retrieved documents to construct model context.
privacy-preserving-processing (governance)
The evaluation data service isolates sensitive data and enforces row-level role-based access controls.
Tradeoffs
Evaluation mix
Chose expert-led review plus automated evaluation over either expert review or automation alone.
Rationale: The combined design gives legal depth and broader continuous coverage.
Human comparison protocol
Chose randomized, anonymized A/B and Likert evaluations over uncontrolled expert feedback.
Rationale: Structured controls reduce labeling bias and support statistically significant release decisions.
Evaluation data architecture
Chose isolated dedicated evaluation data service over evaluation data embedded in the primary app.
Rationale: Isolation, access control, and versioning protect confidentiality and reproducibility.
Gotchas (what bit them)
Retrieval errors compound in legal answer pipelines.
Root cause: Agentic search may repeatedly search, reflect, and refine context before answer generation.
Resolution: Harvey evaluates retrieval separately with expert references, precision, recall, NDCG, retrieval power, and context-window tests.
Generative legal outputs are hard to evaluate automatically.
Root cause: Answer quality depends on domain expertise, accuracy, helpfulness, clarity, and legal nuance.
Resolution: Harvey built side-by-side LLM comparisons and Likert scoring for expert reviewers.
Citation verification has messy public-source matching problems.
Root cause: Citation strings may be incomplete, misspelled, partial, or ambiguous across millions of documents.
Resolution: Harvey combines metadata parsing, title-focused embeddings, source context, date filters, and LLM binary matching.
Evaluation datasets can drift if mutable during experiments.
Root cause: Changing samples or annotations can make quality improvements look like model improvements.
Resolution: Harvey locks published datasets and versions samples for reproducible comparisons.
Evaluation
The case is itself an evaluation system: expert-created retrieval datasets, precision/recall/NDCG, side-by-side A/B preference tests, 1-7 Likert ratings, statistical significance, nightly canaries, production monitoring, model vetting, rubrics, confidence scores, and citation-matching benchmarks.
Metrics: Precision, recall, and NDCG for retrieval · Retrieval power and model context · A/B preference tests · 1-7 Likert ratings · Mean rating 5.10 to 5.63 · Median rating 5 to 6 · Over 95% citation matching accuracy · Nightly canary evaluations
3 supporting quotes
Outcomes
- Harvey validated moving more workloads to GPT-4.1 after statistically significant expert-review gains.
- A chunking change improved perceived helpfulness and factual grounding.
- The citation verification system reached over 95% accuracy on an attorney-validated benchmark.
- Nightly automated canaries catch regressions before production.
- The dedicated evaluation data service creates a single source of truth and reproducible baselines.
Harvey reports daily professional usage, expert review across multiple product lines, nightly canary evaluations, a citation corpus of millions of documents, a 5.10 to 5.63 mean rating improvement, a median rating rise from 5 to 6, and over 95% citation-verification accuracy.