Claude Certified Architect

Foundations · CCAR-F

Domain 5 — 15%

Task 5.4

Human Review & Stratified Sampling

Reviewing outputs with category-aware sampling

📘What You Need to Know

Why Aggregate Accuracy Misleads

A system reporting 95% overall extraction accuracy sounds production-ready. But stratified metrics reveal the truth: invoices at 70%, receipts at 99%, contracts at 88%. The aggregate number masks systematic failures in specific document types that will cause production incidents.

The exam consistently tests whether you look beyond aggregate metrics. Any answer that deploys based on overall accuracy without per-category breakdown is wrong when categories have different accuracy profiles.

🔑Key Concept

Aggregate 95% can mask invoices at 70%. Always track accuracy per document type with stratified metrics.

Stratified Sampling for Human Review

Human review is expensive — you cannot review every extraction. Random sampling is better than no sampling, but it misses systematic failures in underrepresented categories. If 90% of your volume is receipts and 10% is invoices, random sampling mostly reviews receipts.

Stratified sampling ensures review coverage across all categories. Set minimum review quotas per document type. Weight sampling toward low-confidence extractions and historically problematic categories. This catches systematic failures that random sampling misses.

  • •Set minimum review count per document type category
  • •Weight toward low-confidence extractions
  • •Oversample historically problematic categories (e.g., invoices)
  • •Track review findings per category to update accuracy metrics

Field-Level Confidence Indicators

Document-level confidence is too coarse for efficient review. A 95%-confident extraction might have one critical field (total amount) at 40% confidence. Field-level confidence indicators let reviewers focus on uncertain fields rather than reviewing every field equally.

Route fields below confidence threshold to human review. Present the field value, source location in the document, and confidence score. Reviewers verify only the uncertain fields — not the entire extraction.

{
  "invoice_number": { "value": "INV-2024-001", "confidence": 0.98 },
  "vendor_name":    { "value": "Acme Corp",      "confidence": 0.95 },
  "total":          { "value": 1500.00,           "confidence": 0.42 },
  "tax_amount":     { "value": 150.00,            "confidence": 0.38 },
  "review_required": ["total", "tax_amount"]
}

Building Per-Category Accuracy Dashboards

Production systems track accuracy per document type, per field, and per time period. Dashboards show trends: is invoice accuracy improving after schema changes? Did the new few-shot examples fix contract extraction? Without per-category tracking, you cannot measure whether fixes work.

Set different accuracy targets per category based on business impact. Invoice totals might require 99% accuracy. Receipt dates might accept 95%. Stratified targets align review investment with business risk.

Connecting Review Findings to Pipeline Improvements

Human review is not just a quality gate — it is a feedback loop. Review findings categorized by error type (misclassification, wrong format, missing field, calculation error) feed back into schema design, few-shot examples, and validation rules.

When reviewers consistently flag tax_amount on invoices, that is a detected_pattern signal (from lesson 4.4) indicating a systematic issue requiring pipeline changes — not more human review.

💡Tip

Review findings that repeat across documents are systematic failures. Fix the pipeline, do not just review more.

⚠️Exam Traps

Trap: Reporting only aggregate accuracy (e.g., 95% overall) and deploying to production

Why it's wrong: Masks poor performance on specific document types — invoices at 70% cause production incidents.

Correct approach: Track accuracy per document type with stratified metrics before deployment decisions.

Trap: Random sampling for human review without category stratification

Why it's wrong: Random sampling under-represents low-volume categories where systematic failures hide.

Correct approach: Stratified sampling with minimum quotas per document type and confidence-weighted selection.

Trap: Document-level confidence only, reviewing entire extractions equally

Why it's wrong: Wastes reviewer time on high-confidence fields while missing low-confidence critical fields.

Correct approach: Field-level confidence indicators route reviewers to uncertain fields only.

Trap: Increasing random sample size to improve aggregate metric confidence

Why it's wrong: Larger random samples still miss systematic failures in underrepresented categories.

Correct approach: Switch to stratified sampling across categories, not larger random samples.

✓Concept Check

Your extraction system reports 95% overall accuracy. Invoices are at 70%, receipts at 99%. What should you do before deploying?

🔨Build Exercise

Intermediate35 minutes

Design a Stratified Review Process

What you'll learn

  • •Create category-aware review sampling plans
  • •Implement field-level confidence routing
  • •Build per-document-type accuracy tracking