Regex vs LLM Field Extraction for ReceiptsFirst-Party Benchmark Results (2026)

Last reviewed: 2026-11-06 · Run tier: official · First-party benchmark · 8 models × 2 receipt datasets

What this page covers: A first-party, reproducible benchmark comparing two ways of extracting structured fields (company, date, address, total) from OCR text of receipts: traditional regex postprocessing vs LLM postprocessing (deepseek-v4-flash). Field-level F1 and accuracy for 8 open-source OCR engines — Tesseract, PaddleOCR, EasyOCR, docTR, Docling, Surya2, Unlimited-OCR, PaddleOCR-VL — run on SROIE 2019 English receipts (361 samples) and CORD v2 Indonesian receipts (100 samples). Every number traces to a published CSV row in the Receipt benchmark repository — this is reproducible experimental data, not an aggregation of third-party reports.
What this page does NOT cover: Full OCR text-quality metrics (CER/WER) as the headline — applicable SROIE values are text-distance diagnostics only, while whole-page CORD CER/WER are not applicable. Also not covered: cloud/API OCR engines, fine-tuned document-AI models, OCR engine latency or cost (see Receipt OCR Accuracy and OCR accuracy by document category), or vendor performance claims.

All numbers below come from the benchmark's results/receipt_v1_1/field_method_comparison.csv (regex vs LLM field metrics) and results/receipt_v1_1/summary_metrics.csv (CER/WER context), mirrored in the public GitHub repository and cited row-by-row. F1 values are stored as 0–1 decimals in the CSV and shown as percentages here. The same field-F1 scorer is applied to two postprocessors — the regex-based approach and the LLM-based approach — are labeled on every figure and never blended.

On these retained receipt outputs, changing the named postprocessor changes field F1 substantially. The fixed regex baseline spans 0.0766–0.3376 on SROIE and 0.0000–0.3721 on CORD; retained deepseek-v4-flash extraction spans 0.3717–0.6171 and 0.1627–0.5527, respectively. The LLM has the higher point score on every released row. These observations do not establish a universal ordering for other prompts, schemas or models.

The largest SROIE change under this fixed postprocessor comparison is docTR: field F1 rises from 0.0766 under regex to 0.6171 under deepseek-v4-flash, using the same OCR text. This is evidence about two extraction pipelines on this corpus. It does not isolate recognition quality or establish that every field missing under regex was present and readable in the OCR output.

0.08 → 0.62
docTR SROIE field F1 on the same OCR transcripts: 0.0766 with fixed regex → 0.6171 with retained LLM postprocessing (field_method_comparison.csv, doctr/sroie_2019 row)
8.1×
Largest regex→LLM field-F1 lift on SROIE: docTR 0.077 → 0.617 (8.1×). Lifts range 1.76×–8.1× across all 8 engines (min: PaddleOCR-VL, max: docTR) (same CSV, same rows)
0.16
Tesseract's retained CORD LLM field F1 (0.1627). Its OCR transcripts were empty for 25 of 100 receipts; request completion and usable text are separate observations (summary_metrics.csv empty_output_rate; field_method_comparison.csv llm_field_value_f1)

SROIE Results: English Receipts (361 Samples)

On English receipts, the retained LLM postprocessor has the higher field F1 for every engine. Six of eight LLM scores lie in the 0.5685–0.6171 band; EasyOCR (0.3717) and Tesseract (0.4389) remain below it. Across all eight engines, the full range is 0.2454 under LLM extraction versus 0.2610 under regex, so the all-engine gap has not disappeared.

SROIE (Scanned Receipt OCR and Information Extraction, ICDAR 2019) is the standard English receipt benchmark: 361 test receipts with four target fields — company, date, address, and total (Huang et al., 2019). Each engine first produced OCR text on a shared RTX 4090 setup; that text was then fed to two parallel postprocessors: a fixed set of regex patterns (the traditional OCR + rule-based KIE approach) and the LLM deepseek-v4-flash with a structured extraction prompt. Both scored against the same ground-truth fields. The chart shows regex field F1 (blue) vs LLM field F1 (green) per engine.

SROIE field F1 by postprocessor: regex 7.7–33.8% vs LLM 37.2–61.7% across 8 OCR engines. docTR shows the largest lift (7.7% → 61.7%).

Source: field_method_comparison.csv — rows for dataset=sroie_2019, columns regex_field_value_f1 / llm_field_value_f1 (stored as 0–1 decimals, shown as %). LLM postprocessor: deepseek-v4-flash (llm_model column). 361 samples per engine (llm_ok_count).

OCR EngineTyperegex F1LLM F1regex AccLLM Acc
TesseractTraditional (CPU)23.3%43.9%21.4%43.4%
PaddleOCRTraditional32.5%58.1%29.5%58.1%
EasyOCRTraditional14.8%37.2%12.7%37.1%
docTRTraditional7.7%61.7%6.2%61.7%
DoclingPipeline parser22.4%56.9%20.4%56.6%
Surya2Document VLM31.8%61.4%30.0%61.4%
Unlimited-OCRDocument VLM33.8%60.5%30.9%60.5%
PaddleOCR-VLDocument VLM33.7%59.2%31.0%58.5%

Source: field_method_comparison.csv — sroie_2019 rows: regex_field_value_f1 / llm_field_value_f1 / regex_field_value_accuracy / llm_field_value_accuracy (0–1 decimals shown as %). docTR F1 0.0766 → 0.6171; Surya2 0.3183 → 0.6139; PaddleOCR 0.3254 → 0.5810.

CORD Results: Indonesian Receipts (100 Samples, Stress Test)

On CORD, the corrected regex scalar field-F1 range is 0.0000–0.3721, while retained LLM field F1 spans 0.1627–0.5527. Six engines remain at or below 0.1249 under this fixed regex set. The named LLM postprocessor has the higher point score on all eight rows; this compares pipelines on these receipts, not universal language robustness.

CORD v2 contains Indonesian receipts with nested menu, subtotal and total annotations. This page scores the published scalar field targets; menu and complete-row line-item F1 are separate metrics. Whole-page CER/WER are not applicable because gt_text contains annotation structure. The v1.1 correction separates subtotal labels from total labels in the fixed regex postprocessor; it changes five regex rows while retaining the original OCR and LLM outputs.

CORD scalar field F1 by postprocessor: corrected regex 0.0–37.2% versus retained LLM 16.3–55.3% across eight engines. Tesseract had 25/100 empty OCR transcripts; CORD CER is not applicable.

Source: field_method_comparison.csv — rows for dataset=cord_v2, columns regex_field_value_f1 / llm_field_value_f1 (0–1 decimals shown as %). 100 samples per engine (llm_ok_count).

OCR EngineTyperegex F1LLM F1regex AccLLM Acc
TesseractTraditional (CPU)8.2%16.3%6.4%14.3%
PaddleOCRTraditional OCR1.5%55.3%1.1%50.7%
EasyOCRTraditional OCR0.7%33.8%0.4%30.5%
docTRTraditional OCR0.0%55.0%0.0%51.8%
DoclingPipeline parser7.3%46.9%6.0%44.3%
Surya2Document VLM25.9%52.0%21.0%49.0%
Unlimited-OCRDocument VLM12.5%46.8%10.4%45.0%
PaddleOCR-VLDocument VLM37.2%52.0%32.9%49.3%

Source: field_method_comparison.csv, cord_v2 scalar field columns: PaddleOCR regex 0.0154 and retained LLM 0.5527; docTR regex 0.0000 and LLM 0.5500; Tesseract corrected regex 0.0818 and retained LLM 0.1627. Values are scalar field scores, not menu-row scores.

Postprocessor Effects and Their Limits

Three patterns describe the released point observations. They compare named pipelines with the OCR text held fixed; they do not isolate recognition quality or causal mechanisms.

(a) Six of eight LLM scores cluster within a 0.0486-point band

With the OCR text held fixed, SROIE field F1 ranges from 0.0766 to 0.3376 under regex. Six of eight retained LLM rows lie between 0.5685 and 0.6171; EasyOCR (0.3717) and Tesseract (0.4389) lie below that band. This is a property of the named extraction pipelines on this corpus, not proof that engine choice becomes irrelevant or that every field missing under regex was readable in the input.

(b) Tesseract's low CORD result needs output-health context

Tesseract has the lowest retained CORD LLM field F1, 0.1627, alongside 25 empty OCR transcripts out of 100. The lost content is already reflected in field scoring and is not deducted a second time. CORD CER cannot quantify how much the model read incorrectly, and this experiment did not isolate all causes of the downstream result. A postprocessor still depends on the text it receives.

(c) docTR is the biggest beneficiary: regex-floor to LLM-top

docTR's SROIE regex F1 is 0.0766 and its retained LLM F1 is 0.6171, an 8.1× ratio under the two specified pipelines. On CORD the corresponding values are 0.0000 and 0.5500. The output text was held fixed. Pattern coverage, formatting and extraction behavior may contribute; the benchmark does not independently attribute the entire difference to one mechanism.

When Regex Is Enough vs When to Use an LLM

The fixed regex set is deterministic and adds no model API call. The retained LLM requests add tokens and 1.8–2.4 seconds median per document across the released rows. In return, observed field F1 is higher on all 16 model/dataset pairs. The SROIE ratios range from 1.76× to 8.1×; a ratio of F1 scores is not a count of additional fields recovered.

When regex is enough: stable layouts and strict value formats are reasonable candidates for rule-based extraction and validation. This fixed pattern set is a baseline, not an optimized per-vendor parser. Its best SROIE field F1 is 0.3376; the experiment did not measure an achievable ceiling for tuned regex systems.

When to evaluate an LLM: variable labels and formatting may benefit from semantic extraction. The same deepseek-v4-flash postprocessor beat this fixed regex baseline on these two datasets, but a second language, document mix or LLM could change the values. Evaluate exact field matches and complete-document matches on the target corpus, and keep model-call latency and tokens separate from OCR cost.

Frequently Asked Questions

Is LLM field extraction more accurate than regex extraction?

Yes, in this benchmark, on every row: LLM postprocessing (deepseek-v4-flash) beat regex postprocessing for all 8 OCR engines on both datasets (field_method_comparison.csv, all 16 rows). On SROIE English receipts, LLM field F1 was 0.37–0.62 vs regex 0.08–0.34; on CORD Indonesian receipts, 0.16–0.55 vs 0.00–0.37.

Which OCR model extracts receipt fields best with LLM postprocessing?

docTR has the highest retained SROIE LLM field F1, 0.6171. Six of eight engines lie between 0.5685 and 0.6171, while EasyOCR (0.3717) and Tesseract (0.4389) remain lower. The full eight-engine range is 0.2454, versus 0.2610 under regex. On CORD, PaddleOCR leads at 0.5527 and docTR follows at 0.5500. These are point scores for the named extraction pipeline.

Why does Tesseract fall behind even with an LLM?

Its retained CORD LLM field F1 is 0.1627, and 25/100 OCR transcripts were empty. Those are observed outcomes of this pipeline. CORD whole-page CER is not applicable, so it cannot establish a numeric reading-quality ceiling or prove the complete cause of the low field result.

How much does an LLM improve field extraction over regex?

On SROIE, ratios of retained LLM F1 to fixed-regex F1 range from 1.76× to 8.1×. On CORD, the smallest finite ratio is PaddleOCR-VL at about 1.397×; docTR rises from 0.0000 to 0.5500, an absolute F1 increase of approximately 0.5500, for which a multiplier is undefined. CORD gains are not uniformly larger than SROIE gains, and an F1 ratio does not count additional correct fields.

Does LLM postprocessing get every field right?

No. The best retained SROIE LLM field F1 is 0.6171, but F1 is a precision/recall summary, not the percentage of correct fields and not one minus an error rate. The best document-fields-exact observation is 15.5% for Surya2: only that metric directly reports the fraction of receipts with every target field exactly matched.

How slow or expensive is LLM postprocessing?

In this benchmark the LLM call added 1.8–2.4 s median latency per document (field_method_comparison.csv, llm_median_latency_ms, all 16 rows), and the full 16-group run consumed roughly 1.33M prompt + 0.28M completion tokens (sum of llm_prompt_tokens / llm_completion_tokens). This is not a real-time field-extraction latency — it suits async batch processing, not interactive lookups.

Does LLM postprocessing work on non-English receipts?

The retained deepseek-v4-flash postprocessor has higher scalar field F1 than the corrected fixed-regex baseline on each CORD row: LLM 0.1627–0.5527 versus regex 0.0000–0.3721. This is a result for these Indonesian receipts and named pipelines, not a controlled estimate of a language-only penalty.

Methodology & Sources

Protocol

Receipt v1.1 is an offline correction of retained August 2026 predictions for eight engines on fixed SROIE test receipts (361) and CORD test receipts (100). Recognition, weights, images and retained deepseek-v4-flash field outputs were not rerun. Corrected scoring, metric applicability, timing availability and output-health fields are defined in the version-pinned correction protocol. The historical per-run warm/cold modes are retained. Zero request errors mean execution completed, not that every transcript was nonempty or every field correct.

Runtime Environment

  • Hardware: all GPU runs on NVIDIA RTX 4090 (24 GB). The PyTorch-based engines (docTR, EasyOCR, Docling) ran with PyTorch 2.8.0+cu128 (CUDA 12.8); Tesseract ran CPU-only (no GPU cost); the vLLM-served engines (Surya2, Unlimited-OCR, PaddleOCR-VL) ran on a vLLM pod. Driver and Python versions vary slightly per run and are recorded exactly in the redacted run manifests (see Artifact Access below).
  • LLM postprocessor: deepseek-v4-flash via API, temperature 0.
  • Measurement boundary: historical warm_then_scored and cold_end_to_end modes are retained per run. Latencies describe successful runner requests; no uniform steady-state or full server cold-start boundary is claimed.
  • Datasets: SROIE 2019 test — 361 English receipts, flat fields (company, date, address, total), CC-BY-4.0; CORD v2 test — 100 Indonesian receipts, nested fields (menu, sub_total, total), CC-BY-4.0.
  • Sample counts: SROIE 361 / CORD 100, all from the fixed test splits (no training data leakage).

The upstream OCR text consumed by both postprocessors came from these engine versions:

OCR EngineVersionBackend
TesseractPrediction metadata records 4.1.1; historical binary unverifiedCPU (no GPU)
PaddleOCR3.7.0PaddlePaddle-GPU 3.3.1
EasyOCR1.7.2PyTorch
docTR1.0.1PyTorch
Docling2.119.0PyTorch
Surya20.22.1vLLM
Unlimited-OCRbaidu/Unlimited-OCRvLLM
PaddleOCR-VL1.6vLLM

Correction manifests record scoring revisions, source prediction/performance hashes and timing-availability decisions, linking back to the original inference manifests. Historical engine/runtime environment metadata and artifact fingerprints belong to those original manifests; correction manifests do not repeat a complete GPU/driver/PyTorch environment fingerprint. Tesseract prediction metadata records 4.1.1; its historical binary version is not independently verified.

Metric Definitions

  • Field-value F1 (regex): mean per-document harmonic mean of field-value precision and recall under the published exact-match scorer. It describes the named OCR-plus-postprocessor pipeline, not a fraction of wrong fields or native KIE capability. SROIE field values collapse whitespace but remain case-sensitive.
  • Field-value F1 (LLM): mean per-document harmonic mean of field-value precision and recall under the published exact-match scorer. It describes the named OCR-plus-postprocessor pipeline, not a fraction of wrong fields or native KIE capability. SROIE field values collapse whitespace but remain case-sensitive.
  • Field-value accuracy: target-field exact-match rate under the published scorer. SROIE values retain case sensitivity after whitespace normalization; semantic equivalence is not substituted for an exact match.
  • Document-fields-exact: fraction of documents where every target field matched exactly (regex_document_fields_exact / llm_document_fields_exact).
  • CER/WER: normalized SROIE text-distance diagnostics; the scorer lowercases and collapses whitespace. They cannot establish the causal ceiling of a postprocessor. Whole-page CORD CER/WER are not applicable.

Artifact Access

  1. Receipt v1.1 field_method_comparison.csv. Corrected regex scalar field scores alongside retained deepseek-v4-flash extraction results, exact-match diagnostics, counts and token/request-latency metadata. The LLM extraction itself is unchanged.
  2. Receipt v1.1 summary_metrics.csv. Sixteen unique model/dataset rows: normalized SROIE text distance, applicable regex fields, request latency, latency-derived and accepted wall-clock throughput, explicit timing/cost availability, request errors and empty-output rates. Source run IDs and correction manifests preserve the original inference lineage.
  3. ImageToTableai/benchmark-ocr repository. Public repo hosting the result CSVs, run manifests, and dataset sample lists for reproduction.
  4. Correction manifests record scoring revisions, source prediction/performance hashes and timing-availability decisions, linking back to the original inference manifests. Historical engine/runtime environment metadata and artifact fingerprints belong to those original manifests; correction manifests do not repeat a complete GPU/driver/PyTorch environment fingerprint. Tesseract prediction metadata records 4.1.1; its historical binary version is not independently verified.
  5. Huang et al., "ICDAR2019 Competition on Scanned Receipt OCR and Information Extraction" (2019). SROIE dataset definition and license.
  6. Park et al., "CORD: A Consolidated Receipt Dataset for Post-OCR Parsing" (2019). CORD v2 dataset definition and license.

Limitations

  • Document scope: Receipts only (SROIE + CORD). Findings do not generalize to invoices, forms, or long documents without further testing.
  • Sample size and uncertainty: 361 English and 100 Indonesian receipts. These are retained single-run point observations, not a repeated-run mean or a statistical equivalence test.
  • Single LLM model: All LLM rows use deepseek-v4-flash. A different LLM (size, prompting, or vendor) would produce different absolute numbers; the regex-vs-LLM ordering may shift at the margins.
  • CORD metric scope: gt_text contains annotation structure, so whole-page CER/WER are not applicable. Compare the published scalar field scores separately from SROIE, and report empty outputs separately from request errors.
  • Latency is not real-time extraction latency: llm_median_latency_ms (1.8–2.4 s) covers the whole OCR-text → LLM field extraction call, not per-field lookup, and does not include OCR time itself.
  • Regex tuning: The regex patterns are a fixed set written once per dataset (SROIE-flat schema); a heavily tuned per-vendor regex library could score higher on its own formats — at the cost of the maintenance burden the LLM removes.

Related references: the gap between field and character accuracy · Receipt OCR Accuracy · document-type accuracy benchmarks

Related reading: How to Read OCR Accuracy Claims

📮 contact email: [email protected]