Table of contents
- 1. Measure against a reviewed ground truth, not production corrections
- 2. Set a minimum sample per document type and per field
- 3. Use a percentage and an absolute cap per field
- 4. Specify processing time as P95 and P99, never the mean
- 5. The other terms that decide whether the SLA means anything
- An illustrative clause template
- How Invofox approaches it
A disclosure before anything else: Invofox sells a document data extraction API with a per-field accuracy SLA on Enterprise plans, so we have an interest in buyers asking for one. This post is about how to structure that kind of agreement with any vendor. Every number below is either cited to its source or computed in the text so you can check it, and the example clause at the end is an illustrative template with placeholders, not Invofox’s contract terms.
A service level agreement for document extraction is only as good as its measurement. “99-something percent accurate” means nothing until you know what was counted, against what, on how many documents, over which period, and what happens when the number is missed.
The vocabulary comes from site reliability engineering. In Google’s SRE book, a service level indicator (SLI) is “a carefully defined quantitative measure of some aspect of the level of service that is provided”, a service level objective (SLO) is “a target value or range of values for a service level that is measured by an SLI”, and a service level agreement (SLA) is a contract with your users “that includes consequences of meeting (or missing) the SLOs they contain”. The same chapter puts the test for telling them apart as a question: “what happens if the SLOs aren’t met?”
That chapter is about latency and availability, not extraction accuracy. But the structure carries over: an extraction SLA needs a well-defined indicator (per-field accuracy, processing time), a target for each, and a consequence. The five sections below cover the parts buyers most often leave loose.
1. Measure against a reviewed ground truth, not production corrections
The tempting shortcut is to compute accuracy from the corrections your team already makes in production: count the values someone fixed, divide by the values extracted, done. That number is biased, and the reasoning is simple.
Only what someone notices gets corrected. A reviewer catches a total that does not match the line items, or a date in the future. A wrong value that looks plausible, such as a transposed digit in a tax ID or an invoice number from the wrong field, passes through untouched and is counted as correct. Fields that nobody reviews at all contribute zero corrections, whatever their real error rate. So a corrections log undercounts errors, and it undercounts most where review is weakest, which is often exactly where the expensive silent errors live. We are not going to put a number on the size of that bias: it depends entirely on how your review works, which is the point.
Corrections are still valuable. They are the signal that improves the model, and continuous learning from them is how an extraction system gets better on your documents. But corrections improve the model; they do not certify the SLA. For that you need a ground-truth set:
- Labeled field by field, with the expected value for every field in the schema, including “not present on the document”.
- Reviewed by people, ideally more than one annotator per document with a rule for resolving disagreements.
- Sampled from real traffic for each document type, including the ugly tail: low-resolution scans, rotated photos, stamps over amounts.
- Held out: documents in the evaluation set are not used to tune the system being measured.
There is published support for both halves of this. A recent preprint by Bhaskar Gurram of Zasti AI, Valid Per-Field Selective Risk Control for Document Extraction (arXiv, submitted 28 July 2026, not yet peer-reviewed), treats the field, not the document, as the unit of evaluation, and checks its results with a blind three-annotator human-gold audit (Fleiss’ kappa 0.83). Its setting is narrower than an SLA: it studies when to accept a field automatically versus send it to review, on LLM-extracted receipts from the CORD dataset, not invoices and not Invofox. We use it only for the evaluation principles, not for any of its rates.
2. Set a minimum sample per document type and per field
An accuracy figure measured on a sample is an estimate with an error bar. Small samples cannot support a rate, because the interval around it is wider than any difference you would act on.
Two vendor guides on sizing AI evaluations give worked numbers. Neither is about document extraction (both are written for LLM and agent evals), but the statistics of estimating a proportion are the same.
Failproof AI’s guide (Nikita Agarwal, 14 September 2026) computes 95% Wilson intervals around an observed 90%:
| Items | Observed | 95% Wilson interval |
|---|---|---|
| 20 | 90% | 69.9% to 97.2% |
| 50 | 90% | 78.6% to 95.7% |
| 100 | 90% | 82.6% to 94.5% |
| 200 | 90% | 85.1% to 93.4% |
Twenty documents showing 90% are consistent with a true rate anywhere from about 70% to 97%. The same guide puts a worst-case margin of ±5 points at 385 items and ±3 points at 1,068.
DASS’s guide (Dr. Nedim Yel, updated 25 September 2026) gives the planning formula, n = 1.96² × p(1 − p) ÷ margin², and the margins for a rate near 80%: ±7.8 points at 100 items, ±5.5 at 200, ±3.5 at 500 and ±2.5 at 1,000. Working backwards, ±5 points near 80% takes 246 items and ±3 points takes 683. (Check one yourself: 3.8416 × 0.8 × 0.2 ÷ 0.05² = 245.9, which rounds up to 246.)
Three consequences for an SLA:
The minimum applies per field and per document type, not to the total. Both guides make the same point about slices: Failproof notes that 500 examples across ten intents is 50 each, with an interval of about 17 points; DASS that five categories at ±5 points need about 250 items each, not 250 in total. If the SLA sets a target for the IBAN on a supplier invoice, that field on that document type needs its own sample. A field that appears on a fraction of documents needs more documents to reach the same count.
Count documents, not fields. Fields on the same document tend to be right or wrong together: a bad scan hurts all of them. DASS gives the correction, a design effect of 1 + (m − 1) × ICC: 500 items from 100 documents at 5 items each, with an ICC of 0.2, gives a design effect of 1.8, worth about 280 independent items, and the margin grows from ±3.5 to ±4.7 points. More documents beats more fields per document. The Gurram preprint measured this in extraction directly: on 13,859 fields from 800 receipts, document clustering produced a design effect of 1.84 to 2.45, roughly halving the effective calibration size.
Estimating one accuracy and comparing two versions need different sample sizes. If the SLA also governs model updates (“a new version may not be worse than the current one”), the comparison needs its own sizing. Failproof’s numbers for independent samples at 5% significance and 80% power: 197 items per version to tell 80% from 90%, and 903 per version for 80% versus 85%. Running both versions on the same documents and testing the pairs needs far fewer; DASS puts a paired 5-point gap at about 470 items when the versions disagree on 15% of them, against about 2,600 per model unpaired for 80% versus 83%.
And zero errors does not prove a zero error rate. By the rule of three, as Failproof puts it, zero failures in n items gives a 95% upper bound of about 3/n: zero errors in 50 documents still allows a rate near 6%. Seeing a 1% failure at least once with 95% confidence takes 299 items.
3. Use a percentage and an absolute cap per field
A per-field percentage is the right headline. On its own, it hides volume in both directions.
At low volume, the percentage is noise. If a field appears on 40 documents in a month, each error moves its rate by 2.5 points (1 ÷ 40). Whether the period passes or fails can come down to a single document, and from section 2, the interval around a rate measured on 40 items is wide whatever the observed value.
At high volume, the percentage hides the damage. At 100 occurrences, missing a target by one point is one wrong value. At 100,000 occurrences, the same one-point miss is 1,000 wrong values reaching your ERP, and the percentage looks identical.
So set both, per field:
- A percentage threshold, measured against the ground truth, for periods with enough volume to support it.
- An absolute cap on the number of errors in that field during the period, so that the damage is bounded when volume is high.
- A minimum volume below which the percentage is not evaluated for that period, and either the absolute cap governs alone or the period is pooled with the next one.
Which numbers go into those three blanks depends on the field. A wrong amount or bank account usually costs more than a wrong free-text description, and the thresholds should reflect what an error costs you, not a single number applied to every field.
4. Specify processing time as P95 and P99, never the mean
The SRE book is direct about averages: averaging latencies “obscures an important detail: it’s entirely possible for most of the requests to be fast, but for a long tail of requests to be much, much slower.” Its Figure 4-1 shows a service whose typical request takes about 50 ms while 5% of requests are 20 times slower, a change that monitoring based only on the average would not show. The chapter’s conclusion is that “most metrics are better thought of as distributions rather than averages”, and that “a high-order percentile, such as the 99th or 99.9th, shows you a plausible worst-case value, while using the 50th percentile (also known as the median) emphasizes the typical case.”
A worked example. Take 100 requests: 99 complete in 20 ms and one takes 5,000 ms.
- Sum: 99 × 20 = 1,980 ms, plus 5,000 ms, is 6,980 ms.
- Mean: 6,980 ÷ 100 = 69.8 ms.
- The slowest user waited 5 seconds, 250 times the typical request.
A mean of 69.8 ms describes no request that actually happened. P95 here is 20 ms under any method, which is honest about the typical case.
P99 is where you have to be careful, and this example shows why. With 100 samples, the 99th percentile sits exactly on the boundary between the 99th and 100th values, and the answer depends on the percentile method:
- Nearest rank (the 99th of 100 sorted values): 20 ms.
- Linear interpolation between closest ranks: 20 + 0.01 × 4,980 = 69.8 ms, which happens to equal the mean here by coincidence.
- Exclusive interpolation, using rank p × (n + 1): 20 + 0.99 × 4,980 = 4,950.2 ms.
Same data, three P99 values from 20 ms to almost 5 seconds. That is not a reason to drop P99; it is a reason to write the method into the contract and to measure over a window with enough requests that the 99th percentile is not decided by one or two of them. The SRE book makes the general point that SLOs “should specify how they’re measured and the conditions under which they’re valid.”
What to write down for processing time:
- Several percentiles, each with its own target. The SRE book’s example sets three: 90% of calls under 1 ms, 99% under 10 ms, 99.9% under 100 ms. For extraction, P95 and P99 are a sensible pair.
- The percentile method, by name.
- The window: the measurement period and a minimum number of requests in it.
- Start and end points: from upload accepted to result available, or to webhook sent, for example.
- The unit and the conditions: per document or per page, how multi-page files are handled, and whether time spent in human review is inside or outside the clock.
The same chapter warns that it is “both unrealistic and undesirable to insist that SLOs will be met 100% of the time”, and suggests an error budget, “a rate at which the SLOs can be missed”, tracked daily or weekly. That framing works for an extraction SLA too: a target is a budget for misses, not a promise of none.
5. The other terms that decide whether the SLA means anything
Field definitions and the match rule. For each field: what counts as the value, and whether a match is exact or normalized. Is 1,234.50 equal to 1234.5? Is 01/02/2026 the first of February or the second of January, and against which normalized form is it scored? Are case, whitespace and leading zeros significant in an invoice number? Is a correct “not present on this document” counted as a correct field, or left out? Write the normalization rules down before measuring, because changing them afterwards changes the score.
Unreadable documents. Some documents cannot be read by anyone: a blank page, a photo of a thumb, a fax of a fax. Define what counts as unreadable, who decides, and whether those documents leave the denominator. Without a definition and a cap on the share that can be excluded, excluding the hardest documents is the easiest way to raise a measured rate.
The measurement period. Monthly, quarterly, rolling: whichever you pick, it sets how much volume each measurement has (section 3) and how many requests the latency percentiles rest on (section 4). It should be the same period that the remedy refers to.
The remedy if the SLA is missed. This is what makes it an SLA and not an SLO. Write down what happens, how it is calculated and how it is claimed. A target with no consequence is a marketing claim.
Who holds the ground truth. Who labels it, who reviews it, how disagreements are resolved, how it is refreshed as your documents change, and who can see it. If the vendor holds the only copy and labels it alone, the vendor is marking its own exam. Agree on a process where you can audit the labels, and keep the evaluation set separate from anything used for training.
An illustrative clause template
Illustrative template only. These are not Invofox’s contract terms, and the placeholders are not recommended values.
For each field listed in Schedule A, on each document type listed in Schedule A, Provider’s per-field accuracy, measured against the Ground Truth Set using the match rules in Schedule B, will be at least
X%in each Measurement Period ofperiod, provided at leastNoccurrences of that field were processed in the period. Independently, the number of incorrect values for that field in the period will not exceedE. Processing time, measured fromstart eventtoend eventperdocument or page, will be at or belowT95at the 95th percentile andT99at the 99th percentile, computed using thenamedpercentile method over a window of at leastRrequests. Documents classified as unreadable under Schedule C are excluded, up toU%of documents in the period. The Ground Truth Set is labeled and reviewed under the process in Schedule D. If any target is missed,remedy.
Every placeholder in that template is a decision with a cost attached. A vendor that agrees to fill them in is accepting part of the risk of wrong data. If a vendor will not put accuracy in an SLA, you are absorbing all of that risk yourself.
How Invofox approaches it
Invofox is a document data extraction API that turns PDFs and images into validated, structured JSON. We take the position this post argues for: accuracy is measured per field against ground truth, and it belongs in the contract. That is why we offer a per-field accuracy SLA on Enterprise plans, and why our pricing is built around paying for correct results rather than for pages pushed through. Zero data retention is available as an opt-in on Scale and Enterprise plans, and the platform is SOC 2, ISO 27001 and GDPR compliant.
We have deliberately not quoted any of our own thresholds or terms in this post. If you are drafting an extraction SLA and want to see how we measure, evaluation and accuracy describes the method, and a performance report runs it on your own documents.