Building and Evaluating Legal AI with Multi-Modal Evaluation Systems
unify · Legal · year n/a · source Agentic: yes · promotional bias: low · 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 product evaluation
Harvey needed a way to evaluate high-stakes legal AI products whose outputs are long, subjective, domain-specific, and dangerous to launch on shallow benchmark scores alone.
Constraints:
- Legal documents can be hundreds or thousands of pages with cross-references, scanned material, tables, and complex layouts.
- Legal AI mistakes can be career-impacting, including subtle factual misinterpretations.
- Output quality depends on legal nuance and taste, not only factual correctness.
- Domain experts are expensive, so evaluation throughput had to combine human and automated signals.
- New foundation models and workflows needed product-specific launch evidence before rollout.
Architecture
Harvey built a layered evaluation operating system around legal AI products. Lawyers define tasks, datasets, rubrics, and review criteria with engineers; BigLawBench and product datasets test open-ended legal work; human side-by-side ratings remain the highest-quality launch signal; LLM-as-judge evaluations and step-wise workflow checks scale routine assessment; LangSmith and custom tools support dogfooding and repeated release decisions.
Diagram confidence: reconstructed (reconstructed from prose).
flowchart LR legal-ai-products["Legal AI products"] --> evaluation-workflow["Evaluation workflow"] legal-ai-products --> citation-and-verification-layer["Citation and verification layer"] evaluation-workflow --> domain-expert-lawyers["Domain expert lawyers"] evaluation-workflow --> human-preference-evaluation["Human preference evaluation"] evaluation-workflow --> biglawbench["BigLawBench"] evaluation-workflow --> step-wise-workflow-evaluation["Step-wise workflow evaluation"] evaluation-workflow --> llm-as-judge-evaluation["LLM-as-judge evaluation"] evaluation-workflow --> dogfooding-feedback["Dogfooding feedback"] evaluation-workflow --> langsmith-and-custom-tools["LangSmith and custom tools"] domain-expert-lawyers --> biglawbench domain-expert-lawyers --> human-preference-evaluation biglawbench --> llm-as-judge-evaluation langsmith-and-custom-tools --> human-preference-evaluation langsmith-and-custom-tools --> step-wise-workflow-evaluation
Components
| Component | Role | Interacts with |
|---|---|---|
Legal AI products |
Draft, summarize, extract, search, and run legal workflows for customers. | Evaluation workflow, Citation and verification layer |
Evaluation workflow |
Coordinates model, prompt, algorithm, and UI assessment before launch. | Legal AI products, Domain expert lawyers, Human preference evaluation, BigLawBench, Step-wise workflow evaluation, LLM-as-judge evaluation, Dogfooding feedback |
Domain expert lawyers |
Define use cases, datasets, rubrics, feedback, and legal quality standards. | Evaluation workflow, Human preference evaluation, BigLawBench |
Human preference evaluation |
Collects side-by-side ratings, numerical scores, and qualitative attorney feedback. | Evaluation workflow, Domain expert lawyers |
BigLawBench |
Benchmarks complex open-ended legal tasks that mirror real legal work. | Evaluation workflow, Domain expert lawyers, LLM-as-judge evaluation |
LLM-as-judge evaluation |
Applies detailed domain-specific rubrics to evaluate complex outputs at scale. | Evaluation workflow, BigLawBench |
Step-wise workflow evaluation |
Breaks agentic or RAG workflows into evaluable intermediate steps. | Evaluation workflow |
LangSmith and custom tools |
Provide routine evaluation infrastructure and custom human-rater workflows. | Evaluation workflow, Human preference evaluation, Step-wise workflow evaluation |
Dogfooding feedback |
Captures qualitative internal product feedback before customer rollout. | Evaluation workflow |
Citation and verification layer |
Grounds generated legal statements in sources so users can verify outputs. | Legal AI products |
Data flow
For a new product or model, legal domain experts help define use cases and evaluation datasets. Engineers prototype the workflow, run BigLawBench and step-wise automated checks, collect side-by-side attorney preferences and qualitative feedback, dogfood internally, inspect regressions, and only then launch or adjust the model, prompt, algorithm, or UI.
3 supporting quotes
Why this architecture
Harvey treated evaluation as a multi-modal product-development system because legal correctness is not reducible to a single automated score. Human lawyers supply domain taste and rubrics, automated judges increase coverage, and step-wise checks make long workflows tractable.
3 supporting quotes
Models used: GPT-4.1 · LLM-as-judge models
Scale
- Harvey served nearly 400 customers globally.“The company serves nearly 400 customers globally, including one-third of the largest 100 US law firms and eight of the top ten largest firms.”summary, stated
- Harvey had one-third of the largest 100 US law firms as customers.“including one-third of the largest 100 US law firms and eight of the top ten largest firms.”summary, stated
- The document tasks can involve hundreds or thousands of pages.“Lawyers work with extraordinarily complex documents—often hundreds or thousands of pages long—that contain extensive cross-references to other documents, case law, and legislation.”summary, stated
- Human ratings used a 1-7 scale.“numerical ratings on a scale (typically 1-7, from "very bad" to "very good"), and qualitative feedback.”summary, stated
Alternatives considered (roads not taken)
Use academic legal benchmarks as the main launch signal
Rejected because: Benchmarks such as LegalBench did not represent complex, open-ended legal work over external documents.
Rely only on automated evaluations
Rejected because: Harvey kept human legal judgment as the highest-quality signal because quality is nuanced and subjective.
Evaluate only final end-to-end answers for complex workflows
Rejected because: Harvey decomposed agentic workflows into intermediate steps so each part could be assessed more tractably.
Commit to one evaluation platform
Rejected because: Harvey used LangSmith for some evaluations and custom tools for human-rater workflows because no single platform fit everything.
Patterns
eval-driven-development (evaluation)
Harvey uses evaluation data, dogfooding, domain rubrics, and human preference results to guide launches of models, prompts, products, and algorithms.
human-in-the-loop-gate (evaluation)
Lawyers participate throughout feature discovery, rubric design, side-by-side evaluation, UI iteration, and launch readiness.
llm-as-judge (evaluation)
Harvey uses model-based evaluation with detailed legal rubrics for complex open-ended outputs where human-only review would not scale.
prompt-chaining (workflow)
Complex legal workflows are broken into step-wise sub-evaluations such as query rewriting, retrieval, answer generation, and citation creation.
rag-retrieval (retrieval)
Harvey's evaluation examples include retrieval, citation, and document-grounded legal workflows over extensive external legal materials.
Tradeoffs
Human preference signal as launch authority
Chose Keep attorney side-by-side evaluation as the highest-quality signal over Rely on automated benchmark or judge scores alone.
Rationale: Legal quality includes subtle correctness, nuance, and taste that automated scores do not reliably capture.
Custom legal benchmark investment
Chose Build BigLawBench with open-ended legal tasks over Use LegalBench-style simple yes/no benchmark tasks.
Rationale: Real legal work requires analyzing external documents and producing subjective long-form outputs.
Prototype-first product development
Chose Rapid prototyping across prompts, algorithms, and UI over Detailed product requirement documents before building.
Rationale: Making work tangible let lawyers and engineers iterate on quality faster.
Hybrid evaluation tooling
Chose Use LangSmith for some routine evaluations and custom tools for human-rater workflows over Standardize on one evaluation platform.
Rationale: Different evaluation modes needed different tooling surfaces.
Gotchas (what bit them)
Standard legal benchmarks did not match real product quality needs.
Root cause: Academic benchmark tasks were too simple and lacked the external-document, open-ended, subjective nature of legal work.
Resolution: Harvey built BigLawBench with complex open-ended legal tasks and domain-specific rubrics.
Automated metrics missed product regressions.
Root cause: Some failures were qualitative, stylistic, or brand-specific rather than captured by benchmark scores.
Resolution: Harvey supplemented automated tests with product-specific datasets and internal dogfooding before rollout.
Human legal evaluation is high quality but expensive and slow.
Root cause: Legal quality requires trained attorneys and detailed domain-specific judgment.
Resolution: Harvey invested in tooling, automated judges, step-wise evaluation, and custom human-rater workflows to improve throughput.
Legal answer quality is subjective even when both answers are factually correct.
Root cause: Lawyers care about nuance, detail, style, and domain fit beyond hallucination avoidance.
Resolution: Harvey collects preference judgments, numerical ratings, and qualitative comments from legal raters.
Evaluation
Harvey combines side-by-side human preferences, 1-7 ratings, qualitative attorney feedback, BigLawBench, LLM-as-judge rubrics, step-wise workflow checks, product-specific datasets, and internal dogfooding.
Metrics: Side-by-side preference · 1-7 human rating scale · Rubric categories for structure, style, substance, and accuracy · Product-specific dataset performance · Internal dogfooding regressions
3 supporting quotes
Outcomes
- The evaluation stack supported GPT-4.1 launch decisions.
- Additional tests caught brand and product regressions that automated metrics missed.
- Evaluation tooling increased how often teams ran evaluations and improved confidence in launches.
- Citation features help users verify AI-generated legal statements.
Harvey applied this evaluation system in a legal AI business serving nearly 400 customers globally, including one-third of the largest 100 US law firms and eight of the top ten largest firms.