ZR-004 Research note Duplicate detection

Detecting duplicate documents in client submissions: identical files are easy, identical extractions are not

Abstract

Clients often send the same document more than once: by email and through a shared folder, as a reminder, or inside a later bundle. Since release 1.14.0 (2 November 2026), Ziffa checks each new document against earlier documents for the same client, service and document type, and holds a match for a person to decide. A match is either an identical file or identical extracted data. This note reports the first observations, from 19 duplicate pairs flagged on our staging environment on 21 and 30 November 2026. All 19 were identical files. When we compared the data extracted from each copy, 14 of the 19 pairs differed in at least one field, including invoice numbers, VAT numbers and amounts. Because the data check requires every field to match, it would have flagged at most 5 of these pairs on its own. Duplicates that are not byte-identical, such as a photo and a scan of the same receipt, are therefore unlikely to be caught by the current data check. We set out how we intend to improve it and how we will measure the result.

19 / 19
Flagged pairs that were identical files
14 / 19
Pairs where the same file was extracted differently
≤ 5 / 19
Pairs the extracted-data check alone would catch

1. Background

Duplicate documents are common in client submissions. A client emails an invoice and also drops it into the shared folder. A reminder prompts them to send a document they have already sent. A bundle of receipts sent at the end of the quarter includes some that arrived earlier on their own. A receipt is photographed on a phone and later scanned.

If duplicates are not caught, the same expense can be recorded twice and the same input VAT claimed twice. If documents are wrongly treated as duplicates, a genuine document can be discarded. Both errors matter, and they pull in opposite directions.

2. How Ziffa detects duplicates

Duplicate detection was introduced in release 1.14.0, published on 2 November 2026. Each new document is compared with earlier documents that belong to the same client, service and document type, and that have been filed or are awaiting review. Two checks are applied, in order.

  1. Identical file. A checksum (SHA-256) of the new file’s contents is compared with the checksums of earlier files. A match means the two files are byte-for-byte the same.
  2. Identical extracted data. If the files differ, the data extracted from the new document is compared with that of earlier documents. Every extracted field must match exactly.

A match does not discard anything. The new document is held in Pending Review with a stated reason, for example “This file is identical to an earlier document, filed 30 Nov 2026”. A person compares the two side by side and chooses to keep both, discard the new file, or replace the original (Figure 1).

Ziffa's document comparison screen showing an original and a new document side by side, labelled Duplicate, with the note that the files have identical contents and buttons to keep both files, discard the new file or replace the original
Figure 1. A duplicate held for review on staging. Names are replaced with placeholders and the document previews are blurred.

3. Observations

We examined the duplicate reviews pending on one firm in our staging environment. The duplicates were seen on 21 November 2026 and 30 November 2026, when the latest releases were 1.16.0 and 1.17.1 respectively. They arose when documents were uploaded more than once during testing. There were 19 pairs, covering invoices, receipts, payslips and VAT documents, among others.

All 19 pairs were identical files, so every one was caught by the first check.

For each pair, we then compared the data that had been extracted from the original and from the new copy. Since the files are identical, a fully repeatable extraction would give the same data twice.

Pairs
Identical files flagged as duplicates19
Extracted data identical in every field, ignoring letter case5
Extracted data different in at least one field14

The differing fields were not limited to free-text descriptions. They included identifiers (an invoice number, a supplier’s VAT number, a social security number), amounts (overtime pay, an hourly rate, a total payment), dates, and in one case the document’s subtype. Figure 2 shows one pair: the same photographed invoice, extracted twice, gave two different invoice numbers and two different supplier VAT numbers.

The extracted fields of the original and new document side by side. The invoice numbers differ in their last digit and the issuer VAT numbers differ, although the files are identical
Figure 2. The extracted fields of an identical file read twice. The document number and issuer VAT number differ between the two readings. Names, numbers and addresses are replaced with placeholders that preserve the differences.

4. Discussion

The identical-file check worked as intended: every pair it flagged was a true duplicate, by definition, and none required the extracted-data check.

The extracted-data check is weaker than its design suggests. It requires every field to match, but extraction from the same file is not fully repeatable, particularly for photographs and scans where a digit can be read differently. In our sample it would have flagged at most 5 of the 19 pairs on its own. Duplicates that are not byte-identical, which is the case the data check exists for, will usually be read slightly differently as well, so they are even less likely to be caught.

This is consistent with the argument in our position paper on controlled workflows [1]: a model’s output varies from run to run, so exact comparisons should be made on values that are stable, and checked, rather than on everything the model produces.

We did not observe any document wrongly flagged as a duplicate. With only identical-file matches in the sample, this is expected and says little about the data check’s false flags.

5. Next steps

  1. Match on key fields, not all fields. Compare a small set of identifying fields for each document type, such as the issuer’s VAT number, the document number, the document date and the total, after normalising case, spacing and number formats. Exclude free-text fields such as descriptions.
  2. Flag near matches for review. Where key fields agree except for a small difference, such as one character in a document number, hold the document for a person rather than ignoring it. Deciding remains with a person, as argued in [2].
  3. Measure both kinds of error. Build a labelled set of known duplicate pairs that are not identical files (photo and scan, re-saved PDF, email attachment and folder copy) to measure how many duplicates are caught. Use reviewers’ decisions on flagged pairs, where “keep both” indicates a false flag, to measure how many are flagged wrongly.

6. Limitations

  • Small, single-firm sample. 19 pairs from one firm on staging.
  • Test uploads. The duplicates came from repeated uploads during testing, not from clients’ own behaviour, so every pair was an identical file.
  • No recall measurement. We cannot say how many duplicates were missed, because missed duplicates do not appear in the review queue.

References

  1. Exact where possible, reasoned where necessary: the case for controlled workflows in accounting practice. Ziffa Research, 2026. /research/controlled-flows-for-accounting
  2. Micallef, D. Deciding when to defer: why judgement calls in accounting practice should stay with people. Ziffa Research, 2026. /research/human-judgement-in-document-review
← All research