Human in the loop data validation is the step where a person checks or corrects data that a machine produced, such as extracted invoice fields, labels, classifications or transcripts, before anything downstream treats it as true. In a working system people do not check everything. Automated rules catch the obvious errors, confidence thresholds send only the uncertain items to a reviewer, and a small random sample of the auto-accepted items is checked to prove the thresholds still hold. This article is about validating data. Approval gates for actions an AI takes, such as payments or sending messages, are a related but separate design question.
What is human in the loop data validation?
It is quality control for machine produced data, with a person as the final check on the items that need one. The data can come from OCR, a document extraction model, a speech to text engine, a labeling tool or a language model asked to sort tickets into categories. In every case the question is the same: can this value be written into a system of record, or does someone need to look at it first?
Amazon's description of its own review service captures the pattern in one line: people review "low-confidence predictions or random prediction samples". The first half catches likely errors. The second half catches the errors the model is confident about, which are the dangerous ones.
Where approval gates belong, and why reviewers come to over-trust a system that is usually right, is covered in our guide to human in the loop AI.
What does human in the loop validation look like for each data type?
The layers are the same for every kind of data; the checks and the measure change.
| Data type | Automated checks first | What a person reviews | How to measure quality |
|---|---|---|---|
| Document fields | Schema and types, required fields, line items sum to totals, supplier and PO exist in master data | Fields below threshold, failed rules, missing keys | Field-level error rate on a sampled audit |
| Labels (text, images) | Label is in the allowed set, required attributes present | Items where annotators disagree, a ground truth subset | Agreement between annotators (Cohen's kappa), accuracy against ground truth |
| Transcripts | Word confidence, terms checked against a vocabulary list, timestamps in order, plausible speaker count | Names, numbers, product terms, low-confidence spans, speaker turns | Word error rate on a reference set, diarization error rate for speakers |
| LLM classifications | Output is one of the allowed classes, schema valid, consistent with other fields | Rare classes, high-impact classes, cases where two runs disagree | Precision and recall per class on a human-labeled sample |
The extraction pipeline that produces document fields is explained in our article on intelligent document processing.
Which automated checks should run before a person sees anything?
Every check that can be written as a rule, because rules are cheap, consistent and catch errors confidence scores miss: a model can be very confident about a total that does not match its own line items.
Three groups cover most of it:
- Shape. The output matches the schema, required fields are present, dates parse as dates, amounts parse as numbers. A schema check proves the data has the right form, not that it is correct.
- Business rules. Line items sum to the subtotal, subtotal plus tax equals the total, a due date is after the invoice date, a ticket classified as a refund request has an order number.
- Cross-checks against your own records. The supplier exists, the purchase order is open, the customer ID matches the email domain, the bank details match the supplier file. Our guide to invoice processing automation shows how matching and master data checks work for invoices.
Missing data is a rule too; Amazon's Textract integration could create a human loop when Amazon Textract did not identify the key or its associated aliases within the document. An item that fails a rule goes to review with the reason attached.
How do you set the confidence threshold for human review?
Pick the threshold from your own labeled data, per field, by looking at two numbers side by side: the share of items that would go to review, and the error rate among the items that would be auto-accepted. Raising the threshold lowers the error rate and raises the review volume. The right value depends on what an error in that field costs.
Take a few hundred items, have people record the correct value for each, keep the model's confidence alongside, and try candidate thresholds:
import random
AUTO_ACCEPT = 0.95 # per-field confidence needed to skip review
AUDIT_RATE = 0.03 # share of auto-accepted items a person still checks
def automated_checks(doc):
errors = []
if not doc.get("invoice_number"):
errors.append("missing invoice_number")
if round(sum(doc["line_amounts"]), 2) != round(doc["subtotal"], 2):
errors.append("line amounts do not sum to subtotal")
if round(doc["subtotal"] + doc["tax"], 2) != round(doc["total"], 2):
errors.append("subtotal plus tax does not equal total")
return errors
def route(doc, confidences):
errors = automated_checks(doc)
if errors:
return "review", errors
low = [field for field, c in confidences.items() if c < AUTO_ACCEPT]
if low:
return "review", [f"low confidence: {field}" for field in low]
if random.random() < AUDIT_RATE:
return "audit", ["random sample of auto-accepted items"]
return "accept", []
def threshold_table(labeled, thresholds):
# labeled: (confidence, was_correct) pairs from a human-checked sample
for t in thresholds:
auto = [ok for c, ok in labeled if c >= t]
review_share = sum(1 for c, _ in labeled if c < t) / len(labeled)
error_rate = auto.count(False) / len(auto) if auto else 0.0
print(f"threshold {t:.2f}: review {review_share:.0%}, "
f"errors among auto-accepted {error_rate:.1%}")
Run threshold_table on the labeled sample, choose the lowest threshold whose error rate you can live with, and set AUTO_ACCEPT per field. A bank account number and a delivery note reference should not share a threshold. Amazon's own examples did exactly this, with different confidence limits for fields such as Employee Name, Pay Date and Gross Pay.
Language models used as classifiers usually do not give you a calibrated confidence score. Practical substitutes are disagreement signals: run the classification twice with different prompts or models and send disagreements to review, or treat any rare or high-impact class as review-only until the sample data says otherwise.
Why should you sample items that were auto-accepted?
Because a threshold is a guess about the future, and sampling shows whether it still holds. Layouts change, audio gets noisier, and a model can be confidently wrong in a new way. Without a sample of auto-accepted items, you only ever measure the items you already doubted.
Amazon built this into A2I as its own condition type. The Sampling condition let you specify a percentage of forms to send to humans for review, regardless of inference confidence scores. One documented pattern combines both layers: always send low confidence inferences of a specified key-value pair for human review and sample high confidence inference of a key-value pair at a specified rate.
Sample randomly across the whole stream, and record sampled items separately: their error rate is your best estimate of the error rate in everything nobody looked at.
How does human in the loop transcript validation work?
Transcript validation means checking speech to text output against the audio, concentrating effort where errors cost the most. Microsoft's documentation calls word error rate (WER) the industry standard and defines it plainly: "WER counts the number of incorrect words identified during recognition, and divides the sum by the total number of words provided in the human-labeled transcript (N)." The errors are insertions, deletions and substitutions, so WER = (I + D + S) / N. As rough bands, Microsoft says "A WER of 5-10% is considered good quality and is ready to use", 20% is acceptable but may need more training, and 30% or more signals poor quality.
WER has two known weaknesses that shape how people should review:
- It counts formatting as error. The Whisper paper from OpenAI notes that WER, which is based on string edit distance, penalizes all differences between the model's output and the reference transcript including innocuous differences in transcript style. Its authors normalized text before scoring and saw WER drops of up to 50 percent on some datasets from fixing quirks alone. Normalize both transcripts the same way before you compare.
- It weighs every word equally. "Pay invoice 4471 to Jansen by Friday" transcribed as "pay invoice 4417 to Johnson by Friday" is two substitutions in seven words, a WER of 29%. Those two words carry the whole meaning. Track a separate error count for names, numbers, amounts, dates and product terms, and point reviewers at those first.
Transcription models can also invent text. A study of Whisper found that roughly 1% of audio transcriptions contained entire hallucinated phrases or sentences, which is another reason to sample confident output.
Amazon Transcribe states that, at a minimum, your transcript contains the start time, end time, and confidence score for every word. Use word confidence to highlight spans, and timestamps so a reviewer can click a word and hear that moment of audio. For speaker labels the measure is diarization error rate, which pyannote calls the de facto standard metric for evaluating and comparing speaker diarization systems: false alarm, missed detection and speaker confusion time over total reference speech.
Corrections should feed the engine. Amazon described using reviewed transcripts to create a custom vocabulary and improve future transcriptions of similar video or audio content.
How do you measure agreement between human reviewers?
Give the same items to two reviewers and compute Cohen's kappa, not just the percentage of items where they agree. Kappa was introduced by Jacob Cohen in 1960 and, in McHugh's summary, was developed to account for the possibility that raters actually guess on at least some variables. scikit-learn implements it as cohen_kappa_score, a statistic that measures inter-annotator agreement, defined as kappa = (p_o-p_e)/(1-p_e), where p_o is the observed agreement and p_e the agreement expected by chance. The jiwer package does the same job for WER.
from sklearn.metrics import cohen_kappa_score
from jiwer import wer
reviewer_a = ["ok", "ok", "fix", "ok", "reject", "ok", "fix", "ok", "ok", "ok"]
reviewer_b = ["ok", "fix", "fix", "ok", "reject", "ok", "ok", "ok", "ok", "ok"]
print(round(cohen_kappa_score(reviewer_a, reviewer_b), 2)) # 0.57
reference = "pay invoice 4471 to Jansen by Friday"
hypothesis = "pay invoice 4417 to Johnson by Friday"
print(round(wer(reference, hypothesis), 3)) # 0.286
The two reviewers agree on 8 of 10 items, which sounds fine, yet kappa is 0.57, because most items are "ok" and agreement on those is easy. That is McHugh's point about raw agreement: It thus may overestimate the true agreement among raters. Her guide treats any kappa below 0.60 as inadequate. Low agreement usually means ambiguous review instructions, and no model can be measured against a reference people cannot agree on. Fix the guidelines before you tune thresholds.
What should a review screen show, and where do corrections go?
The screen should show the value next to its source, the highlighted page region or the audio at that timestamp, and ask for accept, correct or reject with a reason. Do not show reviewers which items are random samples, so they read every item with the same care.
Every correction is a labeled example. Store the original value, the correction, the reason and the source, and add the cases to a regression set that runs before any model, prompt or threshold change goes live.
Do not plan around a vendor queue without checking its status. As of November 2026, Amazon states that "Amazon SageMaker A2I is no longer open to new customers", and Google lists Document AI's Human in the Loop (HITL) as deprecated since January 16, 2024. Label Studio covers annotation review, but its docs say "The annotation review workflow is only available in Label Studio Enterprise Edition." Most teams build the routing and queue themselves. Qubba builds validation and review queues into document, transcript and classification pipelines, starting with a sample of your real data, with a fixed written quote after a 30 minute call.
Frequently asked questions
What is the difference between data validation and human in the loop validation?
Data validation is any check that data is complete, well formed and consistent, and most of it is automated rules.
Human in the loop validation adds a person for the items rules and confidence scores cannot settle.
A good design uses both: rules on every item, people only on flagged items and a random sample of the rest.
What percentage of items should humans review?
There is no fixed share.
It follows from your threshold and from the error rate you accept, measured on a labeled sample of your own data.
Review volume usually starts high and falls as corrections improve the model.
Keep a small random audit of auto-accepted items permanently, because that sample is your only measure of errors nobody flagged.
Is a confidence score enough to decide what humans review?
No.
Confidence scores miss errors the model is sure about, such as a total that contradicts its own line items, and language models often give no usable score at all.
Combine confidence with business rules, cross-checks against your records and random sampling.
Microsoft also notes that not all document fields return a confidence score.
How accurate does a transcript need to be?
It depends on use.
Microsoft describes a WER of 5 to 10 percent as good quality and ready to use, but an overall figure hides the words that matter.
A transcript with low WER can still get an amount or a name wrong.
Measure names, numbers and key terms separately, and require human review for transcripts used as records.
