← All episodes

Sequoia AI series · Episode 05

How Harvey Built a Research Lab on a Budget

Gabe Pereyra, co-founder and president of Harvey (legal AI) · ~29 min · Video · Transcript (Whisper) · Previous: Ep 04, Post-Training

2-minute recap. Application companies can't match the frontier labs' money, talent or compute. Instead, they can combine what the ecosystem offers: open-weight models, data vendors, "neolabs", inference platforms and eval tools. Harvey's playbook has three steps, in this order. ① Build a benchmark ("no benchmark → you can't train → nothing to serve"). Because they can't train on customer data, lawyers use coding agents to generate synthetic data rooms with issues deliberately planted in them, then Mercor and Snorkel make the data look realistic. They open-sourced parts of it. ② Post-train with neolabs: open models (Kimi, GLM, Nemotron) plus RL can now beat the frontier on a specific task. Harvey works with several neolabs at once and increasingly does it in-house with Tinker, Fireworks and Baseten. ③ Serve: build the serving and evaluation infrastructure before post-training. Start with simple open-model swaps and routing, then run the flywheel. "If we win on this budget, we'll have changed the game."

1 · An unfair game, so use the ecosystem

Slide: it's an unfair game. Total funding: OpenAI $180B, Anthropic $130B, Harvey $1B
Speaker slide — Total funding: OpenAI ~$180B, Anthropic ~$130B, Harvey ~$1B. "There are rich teams, there are poor teams, and then there's us."
Slide: use the frontier ecosystem. Model providers, open-weight models, data, neolabs, inference and training, evaluation, leaderboards
Speaker slide — Harvey Labs sits on top of the whole ecosystem: model providers, open weights (Kimi, GLM, Nemotron, DeepSeek, Qwen), data (Mercor, Snorkel), neolabs (Trajectory, Applied Compute, Engram), inference (Fireworks, Baseten), evals (LangChain) and leaderboards.

Four years ago most of these companies didn't exist, so Harvey had to build everything itself or focus on sales and product. Now the pieces can be combined. This episode brings together the speakers from Ep 01 (Trajectory), Ep 02 (LangChain), Ep 03 (Mercor) and Ep 04 (Fireworks).

① Benchmark synthetic data + experts → RL environments ② Post-train open base + neolabs → in-house over time ③ Serve eval gates · swaps routing · A/B "If you don't have a good benchmark you can't train models, and if you can't train models you don't need to serve them."
My diagram of the talk's structure. But note section 4: the serving infrastructure should exist before you post-train.

2 · Step 1: build the benchmark

Slide: our benchmarks. Legal Agent Bench 1,200 tasks, 24 practice areas, 75,000 rubrics; LAB Contracts 500 negotiation tasks, 10 contract families, 4 stages; LAB Diligence M&A synthetic data rooms, about 3,500 documents and 50 to 80 million tokens per task
Speaker slide — Legal Agent Bench (LAB): 1,200 client-matter tasks, 24 practice areas, 75,000 expert-written rubric items. LAB Contracts: 500 negotiation tasks in 4 stages (draft → redline → issues list → escalation). LAB Diligence: synthetic M&A data rooms of ~3,500 documents and 50–80M tokens per task, one of the largest RL environments released publicly.

The key trick: synthetic data with planted issues

The problem: Harvey can't train on customer data, since it's privileged and highly sensitive. You can sometimes find the final output publicly (a signed purchase agreement), but never the inputs (the data room, the emails, the negotiation). And asking lawyers to write 10,000 consistent fake contracts by hand isn't realistic. The solution, which a lawyer at Harvey (Gabe's brother) worked out, is to start from the rubric:

① Lawyer writes scenario + rubric + list of PLANTED issues ② Coding agents generate the whole data room, with the issues hidden inside ③ Mercor / Snorkel experts make every contract look realistic ④ Model does the work e.g. writes a diligence memo ⑤ Automatic grading "Did you catch every issue we planted?" We know the answer because we put it there.
My diagram of his Q&A answer. This gets around the chicken-and-egg problem: law firms wouldn't share data until Harvey proved training worked, and Harvey couldn't prove it without data. Now firms are asking to do the same with their own data.
Slide: scale with expert data providers. Mercor and Snorkel run expert review of every generated task; plan to scale dataset creation 100x
Speaker slide — Synthetic data alone "isn't good enough, but it's a way to get started". Mercor and Snorkel review and verify every generated task. The plan is to scale dataset creation 100× next year.
Slide: verifier cost during RL training. Opus $18k, GPT-5.5 $11k, Sonnet $7.4k, DeepSeek $305, DeepSeek batch $18
Speaker slide — Verifier cost matters. Grading 3,200 rollouts with LLM judges costs $18k with Opus vs $18 with batched DeepSeek, about 1,000× cheaper for the same labeling pass. (Work done with LangChain; this is Ep 02's "cheap online evaluators".)
Slide: open source it. A tweet about Harvey's legal agent benchmark and a leaderboard table
Speaker slide — They open-sourced it, which was controversial. "It's very hard to know your dataset is good unless a lot of people train on it." It's the same reason ImageNet and MNIST became so useful. Outside users send pull requests and fixes, and labs now report results on it. It also lets Harvey tell the many startups pitching new techniques: "go try it on this, and if it works we'll talk."

3 · Step 2: post-train with the neolabs

Why now: before, any post-training you did was quickly overtaken by the next pre-trained model. Now open bases (Kimi, GLM, Nemotron, Inkling) are strong enough that post-training them reaches frontier level on a specific task.

Slide: frontier post-training now possible. Rubric pass rate: AC GLM 5.1 0.913 highest, GLM-5.1 untrained 0.853, Opus 4.8 max 0.911, GPT-5.5 xhigh 0.885
Speaker slide — On LAB, GLM-5.1 post-trained with Applied Compute scores 0.913, up from 0.853 untrained. That puts it level with or above Opus 4.8 (0.911) and GPT-5.5 (0.885).
Slide: working with the neolabs. Fireworks, Trajectory, Applied Compute, Baseten, Engram, with charts on cost-quality frontier
Speaker slide — A separate project with each neolab. Fireworks: routing plus advisor models (GLM does the work and consults a Claude model as an advisor, which beats Opus on cost and quality). Trajectory: post-training and continual-learning recipes. Applied Compute: GLM-5.1 past the frontier on LAB, and high-volume data extraction. Baseten: KV-cache compaction to scale RL to 100M+ token problems. Engram: a whole synthetic law firm, plus memory-efficient models inside the harness.
Why several neolabs instead of one?
Harvey has more research projects than any single partner can handle. Each neolab is betting on a different research direction, so working with several teaches Harvey more. "If you work with them and can't get better results, there's probably something wrong with your dataset." In effect, a neolab is a check on your data.
Slide: building post-training expertise. Each neolab has unique research focus; they provide guidance on recipes, datasets and evaluations; training APIs like Tinker, Baseten, Fireworks make it easy; start hiring post-training researchers
Speaker slide — Then bring it in-house: training APIs (Tinker, Baseten, Fireworks) remove the need to build infrastructure, so you can hire post-training researchers, not infrastructure specialists paid "$100M+". The goal is "our version of Cursor's Composer 1".

4 · Step 3: serve it, with the infrastructure in place first

Slide: model serving infrastructure. Providers, models, regions US EU Australia, product surfaces; fallback across providers for every model family in every region
Speaker slide — Real serving is a matrix: 7 providers × ~10 model families × 3 regions (60 countries overall) × 9 product surfaces. Every model family in every region needs fallbacks across providers to meet SLAs, and each model–provider pair has its own discounts, rate limits and uptime. A post-trained model is just one more entry in this matrix.
Slide: how we evaluate models. Pre-production: model-general LAB, model-product CUJ, human-general expert side by side, human-product testing. In production: A/B testing, engagement, uptime, token efficiency, product feedback
Speaker slide — The same gates apply to every model, closed, open or post-trained. Before production, a 2×2: automated general (LAB), automated per product (critical user journeys), human general (expert side-by-sides), human per product (product testing). Plus cost, latency and region availability. In production: A/B tests, engagement, uptime, token efficiency and product feedback ("angry customer emails").
"You need that infrastructure in place before you think about post-training."~11:50
Slide: start with naive model swaps and routing. Query goes to open-weight model for simple tasks or closed frontier model for complex tasks
Speaker slide — The first moves are cheap. ① Simple swaps: find places that don't need the biggest model (e.g. generating citations) and drop in GLM for cost or speed. This builds the habit of running open and closed models side by side. ② Routing: where you can't swap everywhere, send only the simple queries to the open model.
Slide: build the post-training flywheel. Build environments, post-train, serve in production, collect feedback
Speaker slide — The flywheel: build environments → post-train → serve → collect feedback → back to environments. Caveat: "collecting feedback" does not mean training on customer data. It means signals from user testing that shape the next synthetic datasets.
Slide: that's our playbook. Every company will become an AI company; it is now possible because of the frontier ecosystem; many are still betting against this playbook; but if we win on this budget
Speaker slide — "Every company will become an AI company." He closes with Moneyball: "If we win on this budget, with this team, we'll have changed the game." Go change the game.

5 · Q&A takeaways

QuestionAnswer, in short
Hiring researchers from the labs?"One of the big mistakes I made" early on was trying to hire frontier-lab researchers against $100M+ offers. Much of that talent was needed to build infrastructure. Now Fireworks and Tinker-style APIs handle that, so PhDs and people who don't want to work at big labs are enough.
When something breaks, is it data, research or infrastructure?There's no single answer. Treat a post-trained model as "just another new model" going through the existing gates: benchmark → product tests → A/B. The stage where it fails tells you where the problem is. Warning: a model can ace the benchmark (overfitting) and then fall apart in a general assistant on out-of-distribution requests.
Open-source vs closed benchmark?It's a real trade-off, since labs can hill-climb on an open benchmark. But it helps customers see which models are good at what, and it lets the ecosystem test ideas on your problem. The data that really matters is helping each law firm train on its own private data.
How do you compete with Codex and Claude Cowork?Those tools make individuals more productive. Harvey targets organizational productivity: 10,000 client matters, teams of 20–30 over six months, coordinating humans, agents and outside parties. Go hyper-vertical, where horizontal products won't follow.

His open problems

1 · Distribution gap
Synthetic data is "future-facing". A great diligence data room doesn't match how the product is actually used today (e.g. drafting an email), and they can't look at customer data to close the gap.
2 · Huge context
80M-token data rooms. Models are poor at managing that much context, and training them to do it is an open research problem.
3 · Per-customer continual learning
The end goal isn't the best legal model. It's that every firm's AI improves with each matter it works on, while client data stays protected. This is Ep 01's problem again.

6 · Glossary

TermMeaning
NeolabA new research company (Trajectory, Applied Compute, Engram, Thinking Machines, …) that post-trains models for, or with, other companies.
Data roomAll the documents for a deal (contracts, emails) that lawyers review during due diligence.
Planted issuesProblems deliberately placed in synthetic data, so grading can check whether the model found them.
Advisor modelA cheaper model does the work and consults a stronger model only when it needs to.
CUJCritical user journey: the key workflows in a product that each need their own tests.
FallbackAutomatically switching to another provider or model when one fails, to keep uptime (SLA).
KV-cache compactionShrinking a model's working memory so it can handle very long contexts.
TinkerA training API that lets you post-train models without building your own infrastructure.

7 · When you start building

Notes are based on a Whisper transcript, with misheard names corrected: "Deepline" → DeepMind, "Ngram" → Engram, "Lang chain" → LangChain, "Code S / Cloud" → Codex / Claude Cowork. Slides marked Speaker slide are captured from the video. The other diagrams are my own drawings of the talk's structure and the Q&A.