Document Processing Automation with LLMs: Evolution of Evaluation Strategies

tola_capital_/_klarity · Finance · 2023 · source Agentic: no · 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: Evaluation strategy for production LLM document workflows

Klarity needed evaluation methods for fast-moving, multi-LLM document automation workflows where generic leaderboards, delayed eval builds, and abstract accuracy metrics did not track customer experience.

Constraints:

Architecture

Klarity's evaluation strategy starts with UX risk before full eval construction, then works backward from user value to task-specific accuracy metrics. For large enough use cases, the company builds customer-agnostic synthetic-data evals, monitors data drift and synthetic-data distribution, and reduces degrees of freedom in its multi-LLM architecture, for example by fixing one LLM for automated-prompt-engineering tasks rather than grid-searching every customer/task combination.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  customer-document-workflows["Customer document workflows"] --> multi-llm-application-stack["Multi-LLM application stack"]
  multi-llm-application-stack --> ux-testing["UX testing"]
  ux-testing --> task-specific-eval-metrics["Task-specific eval metrics"]
  multi-llm-application-stack --> task-specific-eval-metrics["Task-specific eval metrics"]
  task-specific-eval-metrics --> synthetic-data-generation-stack["Synthetic data generation stack"]
  synthetic-data-generation-stack --> data-drift-monitoring["Data drift monitoring"]
  data-drift-monitoring --> task-specific-eval-metrics["Task-specific eval metrics"]
  degrees-of-freedom-controls["Degrees-of-freedom controls"] --> multi-llm-application-stack
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Customer document workflows Finance/accounting documents such as invoices, revenue recognition, and tax withholding workflows. Multi-LLM application stack
Multi-LLM application stack Production LLM workflows spanning extraction, matching, and composition tasks. UX testing, Task-specific eval metrics, Synthetic data generation stack
UX testing Early product-market-fit check for new generative AI feature experiences. Task-specific eval metrics
Task-specific eval metrics Accuracy and user-value metrics built backward from the desired user experience. Synthetic data generation stack, Data drift monitoring
Synthetic data generation stack In-house synthetic data used for customer-agnostic evals once a use case is large enough. Data drift monitoring
Data drift monitoring Checks whether incoming documents and synthetic data match expected/customer distributions. Task-specific eval metrics
Degrees-of-freedom controls Architecture choices that reduce model/prompt/customer grid-search complexity. Multi-LLM application stack

Data flow

Customer documents flow through LLM-based extraction, matching, tabular extraction, table composition, and other document workflows. User testing identifies whether the experience is worth scaling. Production-bound use cases then receive task-specific evals, synthetic datasets, drift monitoring, and simplified model/prompt dimensions so teams can iterate without a combinatorial evaluation burden.

“we have more than 15 unique llm use cases running in in production today uh and more than 10 llms under the hood often times a single use case has multiple llms working together”transcript, stated
“frontload the ux risk backload building out evals uh of course I'm not advocating that you go into production and scale without building EV vals”transcript, stated

Why this architecture

Klarity organizes evaluation around user experience and production task value because generic model benchmarks and raw F1-style metrics do not reliably represent document-workflow success. The synthetic-data and degrees-of-freedom strategy keeps evals tractable despite many customers, tasks, prompts, and LLMs.

“you need to think backward wordss from the user experience not forwards from what is easy to measure”transcript, stated
“you can imagine over a 100 customers uh you could end up with like literally thousands or tens of thousands of prompts”transcript, stated

Models used: More than 10 LLMs under the hood · Multiple LLMs per use case · Automated prompt engineers · Custom synthetic data generation stack

Scale

Alternatives considered (roads not taken)

Build polished evals at the start of every feature

Rejected because: Good evals are expensive and many features fail at the UX stage before full eval investment is worthwhile.

“don't put the threshold of highquality evals at the beginning of the fature development life cycle”transcript, stated

Measure whatever is easy, such as generic F1

Rejected because: The framework starts from end-user value and works backward to evals.

“let's not just say we want to measure F1 and hope that user experience correlates to that want to look at the end user value”transcript, stated

Grid-search every LLM/customer/task/prompt combination

Rejected because: The complexity was too expensive; they fixed one model dimension where commonality appeared.

“building that grid search infrastructure is just too expensive and we don't think it's a good investment of time”transcript, stated

Patterns

eval-driven-development (evaluation)

Klarity builds evals backward from user experience and customer-specific task accuracy rather than from generic benchmarks.

“think backward wordss from the user experience not forwards from what is easy to measure”transcript, stated

synthetic-data-generation (evaluation)

Klarity built an in-house synthetic data generation stack for customer-agnostic evals once a use case became large enough.

“ended up building our own synthetic data generation stack”transcript, stated

model-routing (model-ops)

The production platform uses more than 10 LLMs and sometimes multiple LLMs within a single use case.

“more than 10 llms under the hood often times a single use case has multiple llms working together”transcript, stated

data-quality-loop (data)

Synthetic data is monitored for distributional similarity to customer documents and paired with drift monitoring.

“part of their job is just monitoring that the synthetic data is distributionally similar to what we're seeing from customers”transcript, stated

Tradeoffs

Frontload UX testing

Chose Early user-experience validation over Full eval build before every experiment.

Rationale: Many generative AI features fail because the experience is wrong, so expensive evals should not precede basic UX validation.

“a lot of features die at the ux stage itself let them die before you build out evals”transcript, stated

Build synthetic data internally

Chose In-house synthetic data generation stack over Buying a provider solution.

Rationale: Klarity tried six-plus providers and was not satisfied with fit for its eval needs.

“we actually surveyed like six plus providers in the market tried a bunch of them out um we're not too happy”transcript, stated

Fix one LLM dimension for automated prompt engineering tasks

Chose One LLM for AP tasks, with reevaluation over time over Max-accuracy grid search across all customers/tasks.

Rationale: The team accepted possibly losing a small accuracy point to avoid infrastructure complexity and speed iteration.

“could we eek out another percentage point of accuracy if we didn't do this yes but building that grid search infrastructure is just too expensive”transcript, stated

Gotchas (what bit them)

Eval construction can become the feature-development bottleneck.

Root cause: Feature cycles accelerated to days while thoughtful evals could take one to three weeks.

Resolution: Frontload UX testing and delay full eval investment until a feature is production-bound.

“it takes a week two weeks to build evals it now becomes the bottleneck to feature development”transcript, stated

Benchmark leaderboards can mislead production decisions.

Root cause: Small benchmark differences do not necessarily match Klarity's internal document-workflow tasks.

Resolution: Build task/customer-specific internal benchmarks and customer-agnostic evals.

“a model is supposed to be better in terms of mlu and it's totally not on our internal benchmarks”transcript, stated

Customer-specific prompt/model grids explode combinatorially.

Root cause: Many customers, tasks, prompts, and LLM choices multiply into thousands of combinations.

Resolution: Reduce degrees of freedom by fixing some model dimensions while continuously reevaluating as models change.

“different llms perform uh have different levels of performance on different AP tasks and on different customers so you get like this exponential explosion in complexity”transcript, stated

Evaluation

Klarity evaluates document automation through user-experience-first task metrics, customer-specific accuracy metrics, synthetic-data evals, data drift monitoring, and future-facing eval wish lists.

Metrics: Customer-specific extraction/matching accuracy · User-experience success · Data drift against customer document populations · Synthetic-data distributional similarity · Internal benchmarks versus model leaderboard benchmarks

“we try to put the majority of the onus on ourselves to be rigorous about metrics”transcript, stated
“we have various tools to monitor data drift are we getting documents that are very different from the population we've seen”transcript, stated

Outcomes

The source reports more than half a million documents, 15+ LLM production use cases, 10+ LLMs, and over 100 customers as a driver of prompt/model complexity.

“we have more than 15 unique llm use cases running in in production today”transcript, stated
“over a 100 customers uh you could end up with like literally thousands or tens of thousands of prompts”transcript, stated