AI·News
뒤로

법률 에이전트를 위한 효율적인 검증기 설계

Designing Efficient Verifiers for Legal Agents

저자: Vivek Trivedy (LangChain), Jake Broekhuizen (LangChain), Harrison Chase (LangChain), Niko Grupen (Harvey), Gabe Pereyra (Harvey), Spencer Poff (Harvey), Julio Pereyra (Harvey)

이달 초 Harvey는 복잡한 법률 업무에서 에이전트를 평가하기 위한 오픈소스 벤치마크인 LAB을 출시했습니다. 초기 결과는 현재의 에이전트로는 법률 업무가 전혀 포화되지 않았음을 보여줍니다.

Harvey와 함께 우리는 다음 질문에 대해 연구했습니다:

법률 에이전트의 작업 정확성을 보다 효율적으로 확인할 수 있는 방법은 무엇일까요?

왜 이것이 중요할까요? 법률 업무는 에이전트에게 특히 어려운 분야입니다. 많은 문서를 다루며 컨텍스트를 채우고, 전문 지식이 필요하며, 출력이 수용되기 위해 반드시 따라야 할 엄격한 기준이 있기 때문입니다.

LAB 벤치마크는 인간 검토자가 하는 것처럼 검증에 접근합니다. 데이터셋의 모든 작업에는 해당 작업을 통과하기 위해 반드시 통과해야 하는 기준 집합이 있습니다. 각 기준은 검증자 모델을 사용하는 개별 LLM 판사에 의해 평가됩니다. 각 기준에 대해 검증자는 에이전트 출력과 측정해야 할 match_criteria를 받습니다. 기준당 하나의 verdict를 출력합니다. 많은 작업에는 확인해야 할 50개 이상의 개별 기준이 있습니다. 각 기준에 대해 LLM API 호출을 하면 최첨단 모델로 대규모로 실행할 때 비용이 많이 듭니다.

더 효율적인 검증을 실행할 수 있을까요?

최첨단 검증자를 실행하는 비용은 법률 에이전트 평가를 실행하거나 RL로 법률 에이전트를 훈련하는 팀에 실질적인 질문을 제기합니다:

최첨단 성능에 가깝게 유지하면서 검증자의 비용을 가장 잘 줄일 수 있는 방법은 무엇일까요?

우리는 더 효율적인 검증을 수행하는 두 가지 다른 방법을 연구했습니다:

  1. 더 적은 토큰 사용
  2. 더 저렴한 토큰 사용

우리가 탐색한 첫 번째 방법: 더 적은 토큰 사용. 더 적은 토큰을 사용하기 위해 우리는 배치에서 검증자를 실행할 것을 제안합니다. 즉, 각 기준에 대해 독립적으로 LLM 호출을 사용하는 대신 단일 배치 호출에서 전체 루브릭을 판단하도록 요청할 수 있습니다.

  • 기준별 점수 매기기: 각 루브릭 요구 사항에 대해 하나의 판사 호출을 실행합니다.
  • 배치 점수 매기기: 작업에 대해 하나의 판사 호출을 실행하고 판사에게 모든 루브릭 요구 사항에 한 번에 라벨을 지정하도록 요청합니다.

우리가 탐색한 두 번째 방법: 더 저렴한 토큰 사용. 더 저렴한 토큰을 사용하기 위해 검증 중에 더 저렴한 모델을 테스트할 수 있습니다. 우리는 기준별 참조로 Opus 4.7을 사용했고 기준별 및 배치 점수 매기기 전반에 걸쳐 GPT-5.5, Sonnet 4.6, DeepSeek v4 Flash, Claude Haiku 4.5를 비교했습니다.

검증자 설계 전반에 걸친 효율성을 측정하는 실험

검증자 실험을 실행하기 위해 먼저 검증자가 평가할 출력 집합을 생성해야 했습니다. 이러한 출력을 만들기 위해 우리는 다음 실무 분야에 걸쳐 40개의 공개 LAB 작업에 대해 (Kimi K2.6으로 구동된) 에이전트를 실행했습니다: Corporate M&A, Tax, Emerging Companies/VC, Trusts and Estates.

이 40개 작업에는 2,348개의 개별 루브릭 기준이 있었습니다 - 각각 검증자에 의해 pass/fail로 점수가 매겨집니다. 우리는 먼저 모든 기준에 걸쳐 Opus-4.7을 기준으로 실행했습니다. 이는 GPT-5.5, Sonnet 4.6, Haiku 4.5, DeepSeek-V4-Flash를 다른 검증자 옵션으로 테스트할 때 비교할 기준을 제공합니다. 모든 검증자 실행은 동일한 2,348개의 기준 점수(pass/fail)를 생성하며 이를 사용하여 어떻게 비교되는지 연구할 수 있습니다.

각 검증자 실행에 대해 우리는 다음을 측정했습니다:

  • 일치: Opus 기준별 라벨과 얼마나 자주 일치했는지
  • 거짓 통과: Opus가 실패한 기준을 얼마나 자주 통과했는지
  • 거짓 실패: Opus가 통과한 기준을 얼마나 자주 실패했는지
  • 비용: 40개 작업 검증자 실행에 대한 관찰된 토큰 비용

우리는 거짓 통과에 특별한 주의를 기울였습니다. 실제 환경에서 실패한 기준은 추가 검토를 위해 상향 조정될 수 있습니다. 이는 일반적으로 법률과 같은 도메인에서 기준이 실패해야 할 때 통과하도록 하는 것보다 선호됩니다.

대부분의 에이전트 시스템 설계와 마찬가지로 검증은 성능, 비용, 시간 간의 트레이드오프입니다. 기준별 검증은 판사에게 더 좁은 결정 창을 제공하지만 많은 추가 호출이 필요합니다. 배치 검증은 더 저렴하고 빠르지만 판사는 전체 루브릭을 한 번에 추적해야 합니다.

아래 차트는 비용 대 라벨 드리프트를 보여줍니다. x축은 1,000개 루브릭 기준당 검증자 비용입니다. y축은 Opus 기준별 라벨과의 불일치, 즉 100% - 일치입니다. 낮을수록 그리고 더 왼쪽일수록 좋습니다.

몇 가지 주요 내용:

  1. 전반적으로 배치 모드로 실행하면 기준별 모드로 실행하는 것보다 낮은 일치율을 보입니다. 하지만 배치를 실행하면 반복되는 입력 토큰 비용을 절약하므로 동일한 모델의 경우 실행 비용이 한 자리 수 낮습니다.
  2. GPT-5.5 및 Opus와 같은 최첨단 모델도 라벨에 대해 동의하지 않습니다 - 95.7%의 일치율만 있습니다. 이는 일부 데이터 포인트가 전문가처럼 일관되게 적용하기에 충분하지 않게 지정되었을 수 있음을 의미합니다. 이는 또한 100% 일치율을 목표로 하는 것이 현실적이지 않을 수 있으며 95.7%의 일치율이 합리적인 상한선일 수 있음을 의미합니다.
  3. DeepSeek은 검증자로서 Opus의 강력한 근사치이며, 한 번에 하나의 기준을 실행하거나 배치 모드로 실행할 수 있습니다. 또한 3자리 수 더 저렴하게 실행할 수 있으므로 대규모 검증을 실행해야 하는 대규모 데이터 및 훈련 도메인에 좋은 후보입니다.
  4. Haiku는 Opus와 Sonnet보다 저렴하지만 훨씬 더 관대했습니다. 거짓 통과율은 기준별 48.4%, 배치 34.7%였으며, 이는 법률 검증을 위한 잘못된 실패 모드입니다.

사후 훈련에서의 비용 절감

검증자는 평가에만 사용되지 않습니다. 또한 사후 훈련에 사용되며, 작업당 여러 롤아웃으로 인해 검증 비용이 증폭됩니다. LLM-as-judge 시스템은 작업 루브릭을 보상 신호로 변환하며, 더 저렴한 보상 신호는 더 많은 실험을 실행하고, 더 많은 롤아웃을 감사하고, 더 빠르게 반복할 수 있게 해줍니다.

비용을 외삽하는 간단한 패스는 DeepSeek이 대규모로 최첨단 검증자보다 60-1000배 더 저렴하게 실행될 수 있음을 보여줍니다. 이는 프로그래밍적으로 쉽게 검증할 수 없고 보상 신호를 생성하기 위해 어느 정도의 LLM-as-Judge가 필요한 도메인에서 특히 중요해집니다.

추적에서 검증자 동작 조정

결과는 모델별 및 검증자 아키텍처별(기준별 대 배치)으로 프롬프트를 고정으로 유지합니다. 우리가 테스트한 하나의 추가 레버는 목표 지향적 프롬프트 튜닝이었습니다.

프롬프트 튜닝의 효과를 테스트하기 위해 우리는 Opus와 비교한 DeepSeek의 이전 결과에 대해 자동 연구 루프를 실행했습니다. DeepSeek이 왜 그리고 어떻게 달라졌는지 살펴보고 여러 실행에 걸쳐 프롬프트를 조정했습니다. 거짓 통과율을 최적화하도록 지시했습니다.

기본 프롬프트를 사용한 일부 DeepSeek 오류의 한 가지 주요 이유는 DeepSeek이 답변이 요구사항과 관련이 있지만 모든 실질적인 부분을 만족하지 않을 때 기준을 통과시키기에 너무 의향이 있었다는 것입니다. 최종 프롬프트는 검증자가 각 기준의 각 부분을 체크리스트로 더 명시적으로 분해하고 제시된 정보가 완전히 명확하지 않으면 주의하도록 지시하게 했습니다. 이는 두 점수 모드 모두에서 DeepSeek 거짓 통과율을 감소시켰습니다: 기준별 10.7%에서 9.5%로, 배치에서 15.6%에서 14.2%로.

데이터에 대한 추적을 마이닝하고 프롬핑을 통해 행동을 목표 지향적으로 추출하는 것은 일반적으로 검증자와 에이전트를 개선하기 위한 효과적인 전략으로 계속됩니다.

법률 도메인을 위한 더 나은 에이전트 및 더 효율적인 검증 시스템 구축

검증자는 세계 수준의 법률 에이전트를 구축하기 위한 퍼즐의 한 부분입니다. 오픈 모델 검증자는 팀이 평가를 실행하고 RL 사후 훈련을 한 자리 수 더 저렴하게 수행할 수 있는 비용-성능 트레이드오프를 제공하며, 종종 처음부터 시도할 수 있게 합니다. 오픈 모델은 또한 기업에 가장 중요한 도메인에 대해 맞춤형 검증자를 미세 조정할 기회를 제공합니다. 많은 작업은 최첨단 폐쇄 모델이 추출할 금본위제라고 가정하지만, 이 연구에서도 Opus, GPT-5.5, Sonnet이 약 4-5%의 라벨에 동의하지 않습니다. 우리는 이 믿음에 더 도전하기 위해 더 많은 작업이 필요하다고 생각합니다.

우리는 Harvey와 파트너십을 맺고 대규모 검증 시스템을 개선하기 위한 연구를 추진하게 되어 흥분됩니다. 향후 작업에서 우리는 검증자 미세 조정의 영향과 대규모 사후 훈련 및 평가 실행에 미치는 영향을 연구하게 되어 흥분됩니다.

Authors: Vivek Trivedy (LangChain), Jake Broekhuizen (LangChain), Harrison Chase (LangChain), Niko Grupen (Harvey), Gabe Pereyra (Harvey), Spencer Poff (Harvey), Julio Pereyra (Harvey)

Earlier this month, Harvey released LAB, an open-source benchmark for evaluating agents on complex legal work. The initial results show that legal work is far from saturated with today’s agents.

Together with Harvey, we tackled the following question:

How can we more efficiently verify the correctness of a legal agent’s work?

Why does this matter? Legal work is a particularly difficult domain for agents because it spans many documents that fill context, requires specialized knowledge, and has strict criteria that need to be followed for an output to be acceptable.

The LAB benchmark approaches verification much like a human reviewer would. Every task in the dataset has a set of criteria that must pass for the task to pass. Every criterion is evaluated by an individual LLM judge using a verifier model. For each criterion, the verifier gets the agent output and the match_criteria it needs to measure. It outputs a verdict per criterion. Many tasks have over 50 individual criteria to verify. Making an LLM API call for each of those criteria gets expensive at scale with frontier models.

Can We Run More Efficient Verification?

The cost of running frontier verifiers creates a practical question for teams running legal-agent evaluation or training legal agents with RL:

How can you best reduce the cost of verifiers while remaining close to frontier performance?

We study two different methods of doing more efficient verification:

  1. Use fewer tokens
  2. Use cheaper tokens

First method we explore: using fewer tokens. In order to use fewer tokens, we propose running verifiers in batch. That is - rather than using an LLM call for each criterion independently, we can ask it to judge the full rubric in a single batch call.

  • Per-criterion scoring: run one judge call for each rubric requirement.
  • Batch scoring: run one judge call for the task and ask the judge to label every rubric requirement at once.

Second method we explore: using cheaper tokens. To use cheaper tokens we can test cheaper models during verification. We used Opus 4.7 per-criterion as the reference and compared GPT-5.5, Sonnet 4.6, DeepSeek v4 Flash, and Claude Haiku 4.5 across per-criterion and batch scoring.

Experiments to Measure Efficiency across Verifier Designs

To run our verifier experiments, we first needed to produce a set of outputs for the verifier to evaluate.  To create these outputs, we ran an agent (powered by Kimi K2.6) over 40 public LAB tasks across the following practice areas: Corporate M&A, Tax, Emerging Companies/VC, and Trusts and Estates.

Across these 40 tasks were 2,348 individual rubric criteria - each is scored as pass/fail by a verifier.  We first run Opus-4.7 across all criteria as a baseline.  This gives us a baseline to compare against when testing GPT-5.5, Sonnet 4.6, Haiku 4.5, and DeepSeek-V4-Flash as other verifier options.  Every verifier run will produce the same 2,348 criteria scores (pass/fail) and we can use these to study how they compare.

For each verifier run, we measured:

  • Agreement: how often it matched Opus per-criterion labels.
  • False pass: how often it passed a criterion that Opus failed.
  • False fail: how often it failed a criterion that Opus passed.
  • Cost: observed token cost for the 40-task verifier run.

We paid particular attention to false passes. In real world settings, a failed criterion can be escalated for further review. That is usually preferable to letting a criterion pass when it should fail in a domain like legal.

Verification, like most agent-system design, is a tradeoff between performance, cost, and time. Per-criterion verification gives the judge a narrower decision window, but it requires many more calls. Batch verification is cheaper and faster, but the judge has to track the full rubric at once.

The chart below shows cost versus label drift. The x-axis is verifier cost per 1,000 rubric criteria. The y-axis is disagreement with Opus per-criterion labels, or 100% - agreement. Lower and further left is better.

Some takeaways:

  1. Across the board, running in batch mode has lower match rates than running in per-criterion mode.  But running batch is an order of magnitude cheaper to run for the same model as it saves on repeated input token costs.
  2. Even frontier models like GPT-5.5 and Opus disagree on labels - they only have a 95.7% match rate.  This means that some of the datapoints may not be sufficiently specified for models to apply them as consistently as experts. This also means that targeting 100% match rate may not be realistic, and a match rate of 95.7% may be a reasonable upper bound.
  3. DeepSeek is a strong approximation of Opus as a verifier, both running one criterion at a time and running in batch mode.  It can also be run 3 orders of magnitude more cheaply which makes it a good candidate for large data and training domains where you need to run verification at scale.
  4. Haiku was cheaper than Opus and Sonnet, but much more permissive. Its false-pass rates were 48.4% per-criterion and 34.7% batch, which is the wrong failure mode for legal verification.

Cost savings on post-training

Verifiers are not just used for evals. They are also used for post-training, and verification costs are amplified here, due to the multiple rollouts per task. LLM-as-judge systems turn task rubrics into reward signals, and cheaper reward signals make it practical to run more experiments, audit more rollouts, and iterate faster.

A quick pass at extrapolating costs show that DeepSeek can be run 60-1000x cheaper than frontier verifiers at scale.  This becomes especially important in domains that are not easily programmatically verifiable and require some amount of LLM as a Judge to produce a reward signal.

Tuning Verifier Behavior from Traces

The results keep the prompt fixed per model and per verifier architecture (per-criterion vs batch). One additional lever we tested was targeted prompt tuning.

In order to test the effects of prompt tuning, we ran an auto-research loop on the previous results of DeepSeek compared to Opus. We looked at why & how DeepSeek diverged and tweaked the prompt over several runs. We told it optimize for false-pass rate.

One key reason for some of the DeepSeek errors with the default prompt was that DeepSeek was too willing to pass criteria when the answer was related to the requirement but did not satisfy every material part. The final prompt made the verifier decompose each piece of each criterion more explicitly as a checklist and instructed it to be cautious if the information present wasn’t totally clear. This reduced DeepSeek false-pass rates in both scoring modes: from 10.7% to 9.5% per-criterion and from 15.6% to 14.2% in batch.

Mining traces for data and doing targeted distillation of behavior via prompting continues to be an effective strategy for improving verifiers and agents in general.

Building Better Agents & More Efficient Verification Systems for the Legal Domain

Verifiers are one piece of the puzzle for building world class legal agents. Open model verifiers give us a cost-performance tradeoff that allows teams to run evals and do RL post-training orders of magnitude more cheaply, and often makes it feasible to attempt in the first place.  We also find that simple methods like batching verification work reasonably well and provide another order of magnitude reduction in cost.

Open models also give firms the opportunity to fine-tune bespoke verifiers for their most crucial domains. A lot of work assumes that frontier closed models are the gold standard to distill towards, but even Opus, GPT-5.5, and Sonnet disagree on roughly 4-5% of labels in this study. We feel there’s more work to be done to challenge this belief further.

We’re excited to partner with Harvey to push forward research on better verification systems at scale. In future work, we’re excited to study the impact of fine-tuning verifiers and their impact on post-training and running evals at scale.