---
title: "GenKIE — paper by Cao et al. (2023) — summary and ideas"
description: "GenKIE extracts fields from scanned documents by combining text, layout and images, and tests whether generation can repair OCR mistakes."
canonical: "https://research.elamur.ai/free/en/papers/cao-2023-genkie-robust-generative-multimodal-document/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/cao-2023-genkie-robust-generative-multimodal-document/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2023](https://md.research.elamur.ai/free/en/papers/2023/) / GenKIE: Robust Generative Multimodal Document Key Information Extraction

# GenKIE: Robust Generative Multimodal Document Key Information Extraction

Paper · 2023 · Panfeng Cao, Ye Wang, Qiang Zhang et al.

**Authors:** Panfeng Cao, [Ye Wang](https://md.research.elamur.ai/free/en/authors/ye-wang/), [Qiang Zhang](https://md.research.elamur.ai/free/en/authors/qiang-zhang/) and [Zaiqiao Meng](https://md.research.elamur.ai/free/en/authors/zaiqiao-meng/) · **Year:** 2023 · **Venue:** Findings of the Association for Computational Linguistics: EMNLP 2023 · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

Findings of the Association for Computational Linguistics: EMNLP 2023 · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2023.findings-emnlp.979/)
- [PDF](https://aclanthology.org/2023.findings-emnlp.979.pdf)
- [DOI 10.18653/v1/2023.findings-emnlp.979](https://doi.org/10.18653/v1/2023.findings-emnlp.979)

## Summary

A system can locate the right company name on a receipt and still enter the wrong name in a database. Optical character recognition, or OCR, turns the scan into text, and a conventional extraction pipeline can assign the right field to a misspelled passage. If the pipeline returns the passage as recognized, the spelling error survives. GenKIE tackles this problem by generating the value to return. It reads the OCR transcript, the positions of text on the page and features from the original scan, then uses a short prompt to determine what information to produce. The work concerns a particular kind of [information extraction](https://md.research.elamur.ai/free/en/concepts/information-extraction/).

GenKIE uses the same architecture for two requests. Given a field name such as company, it generates the corresponding value. Given a text segment such as a menu item, it generates the field name. These requests call for different supervision. An extraction example can pair the document with the requested field and its expected value, avoiding the work of marking the beginning and continuation of every entity in the transcript. A labeling example still needs the expected category for the supplied segment. The authors test both questions and fill-in templates as ways to express the request. They also test a receipt template that asks for all the required fields in one response.

On the authors’ token-level evaluation, GenKIE reports F1 of 97.40 for entity extraction on SROIE receipts, 95.75 for entity labeling on CORD receipts and 83.45 for entity labeling on FUNSD forms. These scores are competitive with the published comparisons, and each benchmark table includes a higher result from another system. In a separate SROIE experiment, the authors introduced simulated recognition errors into the transcripts while retaining the page images. At a 50% chance of attempting a replacement per word, GenKIE still achieved nearly 94% F1. LayoutLMv2’s extraction score was much more sensitive to the same perturbation.

The experiments also show where that flexibility helps and where it costs accuracy. In the SROIE feature ablation, text with both layout and visual cues gives the highest F1. The question format works best for SROIE extraction, while a template with a fixed decoding prefix works best for FUNSD and CORD labeling. Individual receipts show GenKIE restoring misspellings and even recovering a deliberately omitted word. Other receipts show it producing incorrect values from correctly recognized text. Its ability to revise the transcript is therefore part of both its robustness and its error profile.

## Deep dive: GenKIE: Robust Generative Multimodal Document Key Information Extraction

GenKIE extracts fields from scanned documents by combining text, layout and images, and tests whether generation can repair OCR mistakes. · about 33 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### Getting a field out of a page

A receipt contains much more text than the fields a business may need to record. A reader looking for the company name has to decide which part of the receipt identifies the business, then transcribe that part accurately. A form presents a related problem in the other direction. Given a particular piece of text, a reader may have to decide whether it is a header or belongs to some other category. Both tasks turn a page meant for people into a record a downstream application can use. The paper motivates that conversion through applications including text mining and [information retrieval](https://md.research.elamur.ai/free/en/topics/information-retrieval/).

A scanned page presents the text and its arrangement together. Once OCR reads the page, its transcript represents the words it recognized, and bounding boxes record where the recognized segments appeared. A box is a rectangle around a segment, giving the system a way to connect text to a location. The scan itself still contains the visual evidence. Each representation answers a different question about the same document. The transcript offers a candidate reading, the box places that reading on the page, and the image preserves its visual appearance and surroundings. This combination puts the paper within [vision and language](https://md.research.elamur.ai/free/en/topics/multimodal/).

The introduction illustrates why the location matters with a receipt that contains `TAMAN DAYAN` in different places and assigns the occurrences different entity types. Recognizing the words perfectly would still leave a system with a decision to make. The same text can play different roles depending on which surrounding information it accompanies and where the occurrence sits on the page. A system that retains positions and image features has additional evidence for that decision. The example concerns the role of an occurrence in a particular document, even though its text is shared with another occurrence.

The company-name error and the repeated-phrase example expose different points of failure. In the former, the system may find the target but inherit a bad transcription. In the latter, it may have a good transcription but assign the wrong role to it. Improving the representation of the page addresses the ambiguity of the second kind. Giving the system a way to produce a value that differs from OCR addresses the rigidity exposed by the first. GenKIE combines those design choices in a single extraction procedure.

#### From hand-written rules to sequence tagging

In the history presented by the authors, earlier document extraction systems used rules or templates written for the fields of interest. A rule could describe where a value appeared or how it was arranged. Designing those rules required knowledge of the documents and effort for each entity type. Their dependence on particular layouts made them difficult to extend to pages with more varied arrangements. The word *template* also appears in GenKIE, but there it refers to the wording and expected shape of a response. It has a different function from a rule that tells the system where to find an answer on the page.

A subsequent line of work cast extraction as [named entity recognition](https://md.research.elamur.ai/free/en/concepts/named-entity-recognition/). In the pipeline the authors describe, OCR first supplies the recognized text and its locations. A sequence tagger then chooses a label for each token, a unit of text used by the system. The beginning, inside and outside convention, abbreviated BIO, allows the tag sequence to distinguish the first token of an entity, tokens that continue it and tokens outside target entities. The resulting labels tell the extraction stage which pieces of the transcript belong together. This gives supervision at the level of individual input tokens, so preparing training data calls for detailed [linguistic annotation](https://md.research.elamur.ai/free/en/concepts/annotation/).

The paper discusses recurrent sequence taggers that use context in both directions and predict a chain of tags. Some use text and others incorporate visual information. It also describes image-based approaches to document encoding and graph approaches for learning relations across sentences. In PICK, for instance, segments of a document are represented as nodes, and edges encode spatial relationships. That representation makes position part of the structure the system reads. The authors see these approaches as ways to place extraction in a wider context, and identify limited large-scale pretraining as a constraint on the robustness and generalization of the earlier methods.

A sequence tagger’s output explains why recognition errors can persist even when its decisions make sense. The tagger can identify the exact span intended by the annotator. If a digit has been read as a similar-looking letter, for instance, the extracted value still inherits whichever character OCR supplied. The category decision and the final string answer are separate. A tagging pipeline that selects spans from the transcript has no opportunity at that output step to emit a different spelling. Accurate span decisions consequently offer only part of what a field-value application needs.

#### Document pretraining and the move to generation

The next line of work in the paper’s account learns representations of documents before adapting them to extraction. LayoutLM brings text together with layout during pretraining and adds visual features during downstream adaptation. LayoutLMv2 uses visual information during pretraining as well. LayoutLMv3 adds a pretraining objective concerned with the alignment between words and image patches. The progression reflects a shared premise with GenKIE. A system should be able to use spatial and visual context when the words alone leave an entity’s role unclear. [LayoutLM](https://md.research.elamur.ai/free/en/papers/xu-2019-layoutlm-pre-training-text-layout/), [LayoutLMv2](https://md.research.elamur.ai/free/en/papers/xu-2021-layoutlmv2-multi-modal-pre-training/) and [LayoutLMv3](https://md.research.elamur.ai/free/en/papers/huang-2022-layoutlmv3-pre-training-document-ai/).

The related-work discussion describes several ways to put that premise into practice. DocFormer uses attention designed to let information from different modalities interact. BROS uses layout features to help with the difficulty of representing a page in a single reading order, and uses a graph-based classifier for entity tags and their relations. LAMBERT augments text with layout. The StrucText approaches use document structure to help identify the entities. These systems differ in what they represent and how they process it. As the authors characterize them, their classification-based outputs still require granular labels and retain the OCR dependency associated with returning selected transcript text.

The paper also situates GenKIE alongside earlier generative approaches. TILT already applies generation to document extraction. The GenKIE authors distinguish their study by its emphasis on prompt formats and on testing correction of OCR errors. Donut takes another route by working from the document image without an OCR transcript. The authors describe its visual component as a Swin Transformer and its decoder as BART-like. They raise the possibility that its visual architecture may have difficulty capturing local character patterns for this task. GenKIE instead keeps the recognized text and makes it possible to revise that text in the answer. [Donut](https://md.research.elamur.ai/free/en/papers/kim-2021-ocr-free-document-understanding-transformer/), [Swin Transformer](https://md.research.elamur.ai/free/en/papers/liu-2021-swin-transformer-hierarchical-vision-transformer/) and [BART](https://md.research.elamur.ai/free/en/papers/lewis-2020-bart-denoising-sequence-sequence-pre/).

The result is a different question about what the extraction stage should produce. A tag sequence specifies the roles of the supplied tokens. A generated answer can use those tokens as evidence and write the requested field in its own output sequence. The question that follows is how to give that freedom a clear target. GenKIE answers with short prompts that name the field or supply the segment to be labeled, building on the practice of adapting pretrained systems through task-specific wording. [Pre-train, Prompt, and Predict](https://md.research.elamur.ai/free/en/papers/liu-2021-pre-train-prompt-predict-systematic/).

### The method, step by step

#### What goes in and what has to come out

For each document, GenKIE works toward a structured set of fields. A field joins an entity type, such as company or address, to the corresponding entity value. The paper’s formulation allows a document to contain a number of field entries particular to that image. It also accommodates tasks in which the caller already knows part of each entry. Asking for an address supplies the type and leaves its value to recover. Asking which label applies to a segment supplies the value and leaves its type to predict.

```
K = {⟨Tᵢ, Vᵢ⟩ | 1 ≤ i ≤ Nᵢ}
```

Here `K` is the set of fields for the current document. The pair brackets enclose an entity type `Tᵢ` and its value `Vᵢ`, where `i` indexes the field. The vertical bar means that the set includes the pairs whose indices are in the stated range. The lower bound `1` starts the indexing. The upper bound is the number of fields in the current image. The paper writes that upper bound as `N` with the image `I` as a subscript, so `Nᵢ` in this display denotes `N` for image `I`, independent of the running field index. The image `I` belongs to the collection of document images, which the paper denotes by `I` with subscript `D`.

The authors build GenKIE on an encoder and decoder. The encoder reads the document evidence and the prompt, turning them into a common numeric representation. The decoder uses that representation to generate text, with each successive output token conditioned on what has already been produced. In extraction, the output can contain the desired value directly or contain a completed template from which the value is parsed. In labeling, the output carries the type. The backbone is [OFA](https://md.research.elamur.ai/free/en/papers/wang-2022-ofa-unifying-architectures-tasks-modalities/), which supplies the pretrained sequence-to-sequence architecture.

With a receipt, the chain begins with the scan and the text and coordinates returned by OCR. An extraction prompt for the company field tells the encoder which part of the page matters to this request. The decoder can then produce the company name using the transcript and its surrounding evidence. Changing the requested field changes the prompt and the expected answer even when the page is unchanged. For a labeling request, the prompt contains a segment already picked out for labeling, so the part to generate is its category. Appending the prompt to the document input makes the request available as the document is encoded.

How GenKIE turns a scanned page into fields The steps in order.

#### Turning the transcript and prompt into tokens

The OCR system supplies a transcript in segments. GenKIE uses byte-pair encoding, abbreviated BPE, to split the text into sub-word tokens, which can represent parts of a word. The same tokenizer handles the prompt. Special tokens delimit the parts of this combined input. A start marker opens the sequence, a separator marks the transition from transcript to prompt, and an end marker follows the prompt. Padding can extend shorter inputs to a common length within a batch. This is the role of [subword tokenization](https://md.research.elamur.ai/free/en/concepts/subword-tokenization/).

```
S = ([BEG], BPE(T), [SEP], BPE(P), [END], …, [PAD])
```

`S` denotes the encoder’s text token sequence. The parentheses hold the sequence elements in order. `BPE` is the tokenizer applied to the transcripts `T` and the prompt `P`. `[BEG]` and `[END]` mark the beginning and end of meaningful input, and `[SEP]` separates the transcript from the prompt. The ellipsis and `[PAD]` represent padding added as needed after the end marker. The transcript supplies what the system can read from OCR, and the prompt supplies the current task.

Each token is represented by a vector, an ordered list of learned values. GenKIE adds a second vector giving the token’s position in the sequence. A token appearing in different positions can therefore have the same token embedding and a different positional contribution. This position is the token’s place in the serialized text input. A separate layout representation describes its original position on the two-dimensional page.

```
TEᵢ = Emb(Sᵢ) + PosEmb₁ᴰ(i) ∈ ℝᵈ,  i ∈ [0, L)
```

`TEᵢ` is the textual embedding at position `i`. `Sᵢ` is the token occupying that position in `S`, and `Emb` is the token embedding layer shared by the encoder and decoder. `PosEmb₁ᴰ` is a learned one-dimensional positional embedding layer. Encoder and decoder use separate positional parameters. The plus sign is element-wise addition of vectors of the same size, and `∈ ℝᵈ` says that the resulting vector has `d` real-valued components. `L` is the length of the token sequence. The interval `[0, L)` includes the initial index `0` and excludes `L`.

The distinction between the two kinds of position is important for reading forms and receipts. Text positions give the transformer the order in which tokens occur in the input it receives. Page coordinates provide a way to distinguish different occurrences of identical text, even when their roles are primarily indicated by where they appear. Keeping text position also helps the architecture represent the prompt as a sequence of words. A location on the page can then be added to a prompt token when the prompt points to an actual occurrence in the transcript.

#### Attaching the layout evidence

GenKIE represents a box through its corners and dimensions. Before embedding the coordinates, the authors normalize and discretize them to fall in `[0, 1024)`. Normalization gives the coordinate representation a common range, and discretization assigns positions to discrete values within that range. The box is attached to all sub-word tokens belonging to the recognized segment. Those sub-words retain their individual places in the serialized text, while sharing the same page location.

```
bᵢ = (xᵢ₀, xᵢ₁, wᵢ, yᵢ₀, yᵢ₁, hᵢ)
```

`bᵢ` is the tuple for box `i`. The coordinates `xᵢ₀` and `yᵢ₀` locate its upper-left corner, and `xᵢ₁` and `yᵢ₁` locate its lower-right corner. The subscripts `0` and `1` distinguish the corresponding ends of each axis. `wᵢ` and `hᵢ` give the width and height. The order groups the horizontal coordinates and width, followed by the vertical coordinates and height.

```
bₑₘₚ = (0, 0, 0, 0, 0, 0)
```

`bₑₘₚ` is the designated empty box. Each `0` is the placeholder for the corresponding coordinate or dimension. Special input markers use the empty box. Prompt tokens use it as well unless they refer to transcript tokens with page coordinates. This convention gives the layout layer an input even when a token, such as a prompt instruction, has no originating location on the scan.

```
b(pⱼ) = bᵢ  when pⱼ refers to tᵢ
```

Here `pⱼ` is the prompt token at index `j`, and `tᵢ` is the referenced transcript token at index `i`. The function written `b` supplies a token’s box, and `bᵢ` denotes the box associated with the transcript token in this rule. If the reference condition is met, the prompt token inherits that box. Otherwise the prompt token receives `bₑₘₚ`. This is especially relevant to a labeling prompt that repeats text from the page. The repeated prompt text can retain the location of the occurrence the system is being asked to label.

```
LEᵢ = Concat(PosEmb₂ᴰₓ(xᵢ₀, xᵢ₁), PosEmb₂ᴰw(wᵢ), PosEmb₂ᴰᵧ(yᵢ₀, yᵢ₁), PosEmb₂ᴰh(hᵢ)) ∈ ℝᵈ
```

`LEᵢ` is the layout vector assigned to the token at position `i`, using its box information. The `x` and `y` arguments are the horizontal and vertical endpoints already defined. `wᵢ` and `hᵢ` are the corresponding width and height. `PosEmb₂ᴰₓ`, `PosEmb₂ᴰw`, `PosEmb₂ᴰᵧ` and `PosEmb₂ᴰh` are the spatial transformations for those four groups of inputs. `Concat` joins the resulting vectors end to end to make the layout embedding. Its dimension is `d`, as expressed by membership in `ℝᵈ`, so it can be added to the textual embedding.

The layout path thus contributes two things to a labeling example. It preserves where OCR found each segment in the document, and it can attach the same location to a reference to that segment in the prompt. In an extraction example, a field name itself may simply be an instruction, while the transcript entries being searched still have their boxes. The shared representation lets the encoder read both sorts of example using the same processing stages.

#### Encoding the scan alongside the text

The visual path begins with the scanned image `I`. GenKIE resizes it to 480 × 480 and applies the first three blocks of a [ResNet](https://md.research.elamur.ai/free/en/papers/he-2015-deep-residual-learning-image-recognition/). This produces a feature map, a grid whose entries summarize image content through learned channels. GenKIE flattens the map into a sequence of patches. A patch token is thus derived from visual features, while a transcript token is derived from OCR text and the tokenizer. Each can provide evidence about the contents of the same page.

```
M ∈ ℝ^(H × W × C)
```

`M` is the contextualized feature map from the visual encoder. `H` and `W` are its height and width, and `C` is its channel count. The expression describes an array of real-valued features with those dimensions. The dimensions describe the map produced from the resized image.

```
Q ∈ ℝ^(K × dᵢₘg)
```

`Q` is the sequence of image patches derived from `M`. In this part of the method, `K` counts the patches and is a different use of the symbol from the field set in the task definition. `dᵢₘg` is the dimension of each image token before projection. The shape expression indicates `K` rows of real-valued patch features.

```
K = (H × W) / P²
```

Here `H` and `W` again describe the feature map, and `P` denotes the fixed patch size. It is independent of the `P` used above for the text prompt. The numerator represents the area of the map in its grid units. The squared patch size in the denominator represents the area allocated to a patch. The paper expresses the patch sequence length `K` in terms of these quantities.

```
VEᵢ = Qᵢ · W + PosEmb₁ᴰ(i) ∈ ℝᵈ
```

`VEᵢ` is the visual embedding at patch index `i`, and `Qᵢ` is the corresponding patch vector. In this expression `W` means the trainable projection parameters, a separate use of the letter from the width in the feature-map expression. The multiplication indicated by `·` maps the patch vector into the common embedding dimension `d`. The addition incorporates a learned one-dimensional position from `PosEmb₁ᴰ`, giving the projected patch information about its place in the visual sequence. The final vector has `d` real-valued components.

This path gives GenKIE access to features from the original page even when OCR supplies a poor reading. The ResNet output is a learned representation of the visual input. The paper’s design lets the encoder combine that representation with the other evidence, so a change to the transcript alone leaves the image path intact. The authors test that situation by making some receipt transcripts less reliable and keeping their corresponding images.

#### Joining the evidence in the encoder

GenKIE adds the layout embedding to the corresponding text embedding. It then places the resulting sequence alongside the visual sequence, with the patches first in the formula. The textual and visual vectors share their embedding dimension so that both can occupy positions in the encoder’s input. This is sequence concatenation. It gives the encoder more positions to read, with a vector of the same size at each position.

```
E = Concat(VE, TE + LE) ∈ ℝ^((K + L) × d)
```

`E` is the combined document embedding. `VE` is the sequence of visual vectors. `TE` and `LE` are the text and layout sequences, whose corresponding vectors are added through `+`. `Concat` combines the visual sequence with the enriched text sequence along their position axis. In the shape written here, `K` is the patch count and `L` the text sequence length. The sum in the shape therefore counts positions from both sequences, and `d` gives the common number of features per position.

The encoder uses the [Transformer and attention](https://md.research.elamur.ai/free/en/concepts/transformer/) architecture. Its input includes the prompt alongside the transcript positions and the image positions, so it can encode the evidence in the context of the requested field. The decoder receives this encoded representation and writes the answer as text. Visual and layout information can influence decoding through the encoder. On the decoder side, the tokens being generated are represented textually, which lets the system use the pretrained decoder in the form chosen by the authors.

#### Questions, templates and training targets

A question prompt is the more direct request. For SROIE extraction, the input supplies the entity type and asks for its value. A question about the company has only the company name as its expected answer. This resembles [question answering](https://md.research.elamur.ai/free/en/concepts/question-answering/) because the input provides a question and the document, while the output consists of the requested information. The decoder does not have to repeat the wording of the question to produce a valid answer.

With a template, the target instead has a predictable textual frame. A company template starts with the company field name and a linking word, then leaves room for the name. The target repeats that frame and includes the actual value, with `[SEP]` delimiting the completed field. A combined template on SROIE presents every required type and expects their values in one response. The separators distinguish one completed field from the next and help the postprocessing step recover the structured pairs.

The direction reverses for FUNSD and CORD labeling. A prompt built from a form segment asks which type that segment belongs to. The paper illustrates this with a registration-form phrase whose type is `header`. A receipt example uses `Es Kopi Rupa` as the supplied text and `menu.nm` as its category. In a template target, the supplied value is included in the completed frame. In a question target, the desired output is the category alone. The examples share a generation procedure, even though the missing component of the pair has changed.

The authors construct the prompts from the dataset schema and examples. For extraction, they identify the entity types, then express a request for each type as a short question or as a template with a slot. The prompt is appended to the transcript to create the encoder input, and the expected value determines the textual target. For labeling, the segment supplies the prompt wording and its annotation supplies the target type. The paper describes these choices as a way to put the meaning of field names and values into the training examples through ordinary words. It contrasts this design with prompts represented solely as learned vectors.

This procedure changes where annotation effort goes. A training target for extraction needs the correct field value. GenKIE can learn from that value as a sequence without assigning a BIO tag to every token in the document. For labeling, the procedure uses the annotated relationship between a segment and its type. In both cases someone must prepare or obtain the expected answer and construct the task prompt. The authors describe simple wording as a way to keep that preparation manageable.

#### Fine-tuning and decoding

GenKIE starts from pretrained OFA base weights. The authors report a 6-layer encoder, a 6-layer decoder and a representation dimension of 768. They adapt those weights to the document tasks by training the system on prompted inputs and their target sequences. This is [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/). The answer tokens draw on the same BPE vocabulary and token embeddings as the encoder text. The authors make the implementation and pretrained weights publicly available under the GenKIE name.

The reported maximum encoder sequence length is 1024 on all datasets. The training setup specifies a maximum sequence length of 512 for SROIE extraction. In both CORD and FUNSD labeling, the question and template prompts have lengths of 32 and 128, respectively. A template target can include the supplied segment as well as the predicted category, so prompt format changes what the target sequence contains. Training runs for 50 epochs with 64 examples per batch and starts at a learning rate of 5 × 10⁻⁵.

At inference, beam search tracks plausible partial output sequences as the decoder extends them. The report specifies five beams and caps the generated length at 512 on SROIE and 128 on both CORD and FUNSD. When there is a known template prefix, the decoder can start its search after that prefix. In the form-labeling example, the known portion includes the segment and the words that lead into the category. The decoder can spend its search on the missing category, while the parser gets the expected opening of the template by construction.

Fixing the prefix leaves the answer to be predicted. In an extraction template, an incorrect company name can still follow the correct opening. In a labeling template, a valid opening can still lead to an incorrect type. The constraint supplies a reliable piece of formatting and removes the need to reproduce known words from scratch. Once decoding is complete, the response is interpreted according to its prompt format to recover the requested field or pairs.

### Experiments and results

#### The benchmarks ask different questions

SROIE is the benchmark for entity extraction. It contains receipts with 4 target field types, including company, address, date and total. A receipt can contain considerable text unrelated to those fields. The system has to return the value associated with the requested field, and the flexibility to improve on an OCR transcription matters directly to that answer. The authors report 626 training receipts, 0 validation receipts and 347 test receipts.

FUNSD is the form benchmark and is used for entity labeling. The paper reports 199 forms and 4 entity types. A form can have multiple values of the same type, so the task is to determine the category of a given segment. Table 2 gives the split as 149 training images, 0 validation images and 50 test images. The unit passed to a labeling prompt is an entity value, while the page supplies context about its role. A few category names can therefore cover many distinct text segments.

CORD is also used for labeling, on receipt images. It has 4 main categories subdivided into 30 categories used for more specific labels. The paper gives the examples of a menu name within the menu category and a total price within the total category. The dataset has 800 training receipts, 100 validation receipts and 100 test receipts. Because CORD and SROIE both contain receipts but are used for different predictions, their reported scores answer different questions about the system.

The reported evaluation is at the token level across the benchmarks. Precision reflects how much predicted material agrees with the reference, recall reflects how much reference material is recovered, and F1 combines those measures so that both matter. The study also trains an extraction system without requiring token-level BIO targets. These facts concern different stages. The annotation used to teach the system can be a field and its value, while evaluation can still compare predictions at token granularity. A token-level F1 score gives a benchmark comparison and leaves document-level exactness as a separate question.

#### How GenKIE compares with earlier systems

The paper compares GenKIE with eleven baselines. Its comparison includes text-only systems such as BERT and UniLMv2, systems that add layout such as BROS and LAMBERT, and systems that also use visual features. Among the latter are LayoutLMv2, DocFormer and TILT. TILT is the generative baseline, so the table includes an earlier system capable of writing a response as well as systems that classify the input. The authors report 180M parameters for GenKIE, 200M for LayoutLMv2 and 230M for TILT. The collection gives context for the scores across differing architectures and parameter counts.

Most baseline scores come from their original papers. For the LayoutLMv3 result on SROIE, the authors ran the source code released for that system. Some systems lack reported results on particular datasets, and some entries supply F1 without both component metrics. The strongest reported result in a column should be read within that coverage. The main table offers a benchmark comparison, with the controlled evidence for the contribution of layout and images coming from a separate test inside GenKIE.

SROIE test token-level F1 for receipt entity extraction GenKIE trails TILT and exceeds the other systems shown.

**The numbers**

| System or setting | F1 |
| --- | --- |
| BERT | 90.99 |
| LayoutLMv3 | 95.30 |
| LayoutLMv2 | 96.25 |
| StrucText | 96.88 |
| TILT | 97.65 |
| GenKIE (this paper) | 97.40 |

On SROIE, GenKIE’s 97.40 F1 comes from reported precision and recall of 97.40 each. That result shows that the freedom to generate values is compatible with high extraction scores on the ordinary test receipts. It is also close to the generative TILT result of 97.65 F1. LAMBERT reaches 96.93 F1 with text and layout. LayoutLMv2 reaches 96.25 with text, layout and vision. These scores illustrate why a cross-system comparison alone cannot isolate the contribution of adding a modality. Training and architectural choices differ alongside the evidence each system can read.

On CORD, GenKIE’s test precision, recall and F1 are all 95.75. LayoutLMv3 has a reported F1 of 96.56 and DocFormer reaches 96.33. GenKIE is ahead of LayoutLMv2 at 94.95 and TILT at 95.11. The result is a test of whether generation can return the appropriate type for a supplied value in a relatively detailed receipt schema. Its score places it among the strongest reported systems in the table for this task.

On FUNSD, GenKIE reaches 83.45 for test precision, recall and F1. DocFormer reports 83.34 F1, StrucText reports 83.09 and BROS reports 83.05. LayoutLMv2 reaches 82.76. The table gives LayoutLMv3 an F1 of 90.29, which is higher than GenKIE’s. The paper’s narrative says GenKIE outperforms LayoutLMv3 on FUNSD, so its written claim and its table disagree. The numerical comparison here follows the table. On that evidence the generative labeling procedure is competitive with several encoder-based baselines, with LayoutLMv3 leading the reported results.

The table reports one overall GenKIE configuration per dataset. The prompt analysis explains what those choices amount to. The SROIE result comes from a question prompt that produces the field value. The FUNSD and CORD results come from template prompts whose known prefixes are supplied at decoding time. The ordinary benchmark scores therefore reflect configurations selected for different target formats. The study also measures what happens when those formats or the search procedure are changed.

#### What changes when the transcript is corrupted

The robustness experiment is on SROIE and asks how extraction responds when the OCR transcript becomes less dependable. The authors use LayoutLMv2 as the baseline because it has a similar design for representing document features. They perturb the original receipt transcripts by attempting to substitute visually similar characters in words. The substitutions come from confusions the authors observed in OCR output. If a word offers no applicable substitution, it is retained. The receipt image remains available even when the transcript has changed.

The test ranges from a 5% to a 50% replacement chance, in steps of 5%. The chance applies to individual words. A 50% setting means each word has that chance of being selected for replacement, with the availability of a visually similar character still governing whether it is changed. As a consequence, the reported level describes the perturbation procedure. It gives no direct count of corrupted words or characters in a particular receipt. The experiment keeps the intended fields as the targets so that the effects of changing the input text can be measured against the same answers.

At the 50% setting, the authors report nearly 94% F1 for GenKIE extraction, describing the drop as only 3% from 97%. Their figure describes LayoutLMv2 extraction F1 as dropping around 40% at that setting. The figure also includes a LayoutLMv2 entity-labeling curve that drops only around 3%, in spite of the much larger drop for its extraction result. This comparison separates the ability to identify a role from the ability to supply the right value. Labels can remain mostly usable even when the recognized strings associated with those labels have deteriorated.

For GenKIE, the generated value is checked against the extraction target, so the robustness curve concerns the output field itself. The decoder can use other recognized words, layout and image evidence to produce a plausible correction. The experiment demonstrates the behavior of that whole system under the stated substitutions. The score holds up even as the OCR representation supplied to it becomes substantially less useful. The absolute F1 under the perturbation also matters because it gives a sense of the remaining extraction quality, beyond the size of the drop from the ordinary test condition.

#### What the receipt examples reveal

The qualitative analysis shows the kinds of edits that can sit behind the score. In the main case study, recognition mistakes appear inside company and address fields. The paper contrasts `TED` and `TEO`, `8HD` and `BHD`, and `Pemias` and `Permas` as strings involved in these errors. The figure shows LayoutLMv2 returning values affected by OCR, while GenKIE produces the intended values. The difference is visible at the character level even when both systems direct their attention to a relevant portion of the page.

An appendix example deliberately removes `IPOH` from the end of an address in the recognized text. GenKIE restores the word. This goes beyond substituting a similar-looking character in a transcript token, since the text version of the input supplies no token for the missing word at that position. The example shows that the decoder can complete an address beyond the available OCR string. The study leaves open how much that instance depends on the scan and how much on clues elsewhere in the input or learned during training.

The appendix also shows incorrect generations with correct OCR. In these examples, the intended value is already present in the transcription and the decoder still produces a different answer. Taken together, the successful edits, the recovery of an omitted word and the failures give the aggregate result a more concrete interpretation. The system has freedom to alter what it read, and the appropriateness of that alteration has to be judged against the output target.

### What the ablations show

#### The contribution of layout and image features

The modality ablation uses entity extraction on SROIE with the question prompt. The authors retain text in every condition and compare adding layout, adding the image and adding both. This is a more direct test of the feature design than ranking systems with different architectures. Each condition asks for the same kind of output, so the main contrast is the evidence available to the system within the GenKIE procedure.

SROIE test token-level F1 by GenKIE input modality Both added modalities help relative to text alone, and using them together gives the highest score.

**The numbers**

| System or setting | F1 |
| --- | --- |
| Text | 96.24 |
| Text and vision | 97.01 |
| Text and layout | 97.14 |
| Text, layout and vision (this paper) | 97.40 |

Text alone reaches 96.24 for precision and recall as well as F1. Adding vision raises precision to 97.20 and recall to 96.82. Adding layout reaches 96.89 precision and 97.39 recall. The full input yields 97.40 for each measure. In this comparison, the text-plus-vision condition has higher precision than text plus layout, while text plus layout has higher recall. The strongest combined score comes from giving the system both. Those metric patterns describe the aggregate results. The table does not assign individual successes to position or appearance.

This ablation bears directly on the design argument about ambiguous text. The text-only condition already performs well, so the measured contribution is an improvement to a strong transcript-based system. The additional features supply complementary ways to distinguish and read occurrences on the page. The experiment establishes that their contribution is measurable for SROIE extraction with a question prompt. Its scope is that benchmark and prompt, with text present in all conditions.

#### A question and a template distribute the work differently

The prompt comparisons change both what the input asks and what the decoder has to write. SROIE asks for a potentially open-ended field value. On FUNSD and CORD, the missing piece is a type from the task’s categories. The category set gives the authors a reason to expect the known segment and a fixed template opening to guide labeling, whereas an answer-only question gives the extraction decoder room to produce the requested string directly. The table allows these interpretations to be tested against the configurations the authors actually ran.

On SROIE, the question prompt reaches 97.40 F1. A template requesting an individual field reaches 96.87 F1 with prefix search and 96.75 without it. The template asking for all the field types in one response reaches 96.92. The combined template is especially relevant because the document and its transcript would otherwise be prepared for multiple single-field requests. Putting the fields together allows the system to generate their values in a shared response. The reported comparison measures the impact on F1, while the reduction in repeated document processing is a property of the example construction.

For FUNSD labeling, the question prompt yields 75.17 F1. The template yields 76.42 without prefix search and 83.45 with it. For CORD labeling, the corresponding F1 scores are 92.44 for the question, 94.24 for the template without prefix search and 95.75 for the template with prefix search. The template has the higher reported F1 on both labeling datasets even when its beginning is generated freely. Fixing the beginning then improves that template’s result, with the larger separation occurring on FUNSD.

The authors interpret the SROIE question result as a benefit of using generation directly for the value, without asking the decoder to reconstruct a frame around it. For labeling, they argue that the value supplied in the template can guide the decoder toward the type. The comparisons support the choice of those formats in these settings. They also compare different datasets and task directions when explaining the overall pattern. Establishing a rule for choosing prompts on unfamiliar documents would require evidence that separates task mechanics from dataset properties.

#### Prefix search changes what the decoder must reproduce

Comparing the same single-field template with and without prefix search is the most direct test of the decoding change. With ordinary beam search, the decoder generates the response from its beginning. That includes text already present in the prompt. With prefix search, the given opening is imposed and the decoder starts at the missing part. The known segment and the words connecting it to its category can thus be supplied as part of the output frame.

The pronounced FUNSD result is consistent with the authors’ explanation that form values give the decoder more material to reproduce from scratch. A labeling prompt may contain a full phrase, and the free template target requires that phrase before it reaches the category. Preserving the phrase in the prefix concentrates the search on the category. The paper presents this as an explanation for the observed scores. The comparison measures overall labeling performance and does not report a separate count of mistakes in regenerated prefixes.

The smaller improvements for CORD and SROIE also show the effect depends on the dataset and on the role of the supplied text. On SROIE the field name in the template is already short, and the decoder’s substantive job is to write a value. FUNSD’s setting is closer to a tag decision after a longer known stretch of text. Across the template comparisons, the fixed opening helps the search preserve the intended format. The question results separately show that answers with no template to reproduce can be effective when the target is an extraction value.

#### Holding out a field type during training

The appendix tests a different sort of generalization on SROIE. For each experiment, the authors designate a field type as unseen and keep the remaining types as common training categories. In the zero-shot condition, they remove training examples of the designated type. In the few-shot conditions, they retain a limited number of examples of that type. They compute F1 on test examples of the designated type alone. This setup examines whether a field prompt is enough to extend a trained extraction procedure, and how its use changes with [few-shot learning](https://md.research.elamur.ai/free/en/concepts/few-shot-learning/).

The zero-shot results are 4.0 F1 for company, 3.9 for address, 3.2 for date and 5.0 for total. The field words have recognizable meanings, but the scores show how little the system recovers from completely held-out categories in this setup. With 1 training example, date reaches 14.53 F1. The other fields score 3.7 for company, 3.6 for address and 4.9 for total. A single labeled instance has different effects across the fields, and the company, address and total figures at that setting are below their zero-shot scores.

At 5 training examples for the designated type, date reaches 77.21 F1, company 34.18, address 12.38 and total 45.92. At 10 examples, date reaches 78.21, company 42.43, address 55.60 and total 66.33. The date results are consistent with the authors’ suggestion that a field whose semantics are familiar can benefit substantially from limited supervision. The address results illustrate a different response to the amount of target-field data. The experiments measure these responses for the same receipt benchmark and evaluate the designated field separately from the others.

The full-shot scores reported in that experiment are 96.97 F1 for company, 97.22 for address, 97.45 for date and 97.83 for total. Those are per-field figures and answer a different question from the overall SROIE score. Together with the held-out results, they show that a prompt’s ability to express a field request can exceed the system’s ability to fulfill that request with little or no field-specific training. The appendix therefore establishes a demanding boundary for the generalization suggested by the ordinary supervised benchmark.

### Limitations

#### Limits identified by the authors

The authors identify dataset preparation and prompt selection as sources of work. Classification datasets may already be organized around entity tags, with each training item designed for a different output procedure. Turning those items into prompted encoder inputs and target answers takes processing. It also takes experiments to decide how to phrase the request and whether to use a question or a template. The difference in the best format between extraction and labeling makes that cost concrete. GenKIE reduces the need to create granular tags for extraction, while relying on correct field values and a formulation suited to the target task.

They also identify a limit in how their document features are used during training. GenKIE starts with pretrained OFA, and the paper’s multimodal document embedding is used in the encoder during fine-tuning. The authors suggest that pretraining with multimodal features on large document datasets could improve performance. They present this as a possible extension. The reported experiments evaluate the OFA initialization and the subsequent task-specific adaptation, so they give no comparative result for that additional document pretraining.

The authors explicitly acknowledge that generation can be wrong even when OCR recognizes the value correctly. Their appendix illustrates the issue and suggests that errors in recognition during training may encourage the system to learn misleading features. The examples establish that the failure occurs. The proposed explanation remains tentative because the errors are illustrated qualitatively, and the experiments do not isolate training-time OCR noise as the cause of those particular predictions.

#### Limits of the experimental evidence

The controlled robustness claim is specific to field extraction on SROIE under the authors’ replacement process. Visually plausible substitutions approximate one source of OCR error while leaving the underlying image and the rest of the input setup in place. Scans can also present broader problems with the available text or coordinates. The appendix’s single deliberately omitted word shows a successful recovery from missing text in one receipt. The aggregate experiment, in contrast, measures a particular family of substitutions, and its 50% setting is the per-word replacement chance defined by that procedure.

The robustness comparison is also specifically with LayoutLMv2. TILT provides evidence that GenKIE competes with another generative approach on ordinary SROIE extraction. Donut is discussed as an OCR-free approach. Under the simulated noise experiment, the paper reports GenKIE and LayoutLMv2. The strength of the resulting claim is that GenKIE withstands the tested transcript corruption better than the chosen extraction baseline. Comparative robustness against the other approaches is outside that experiment.

The modality ablation and the corruption test answer different questions. The first shows that adding layout and images improves ordinary SROIE question-prompt extraction. The second shows that the full GenKIE procedure retains much of its performance when the transcript is perturbed. Neither analysis gives a modality-by-noise comparison that would identify which source of evidence is responsible for a particular correction. The missing-word example likewise leaves the influence of page appearance, address context and learned regularities unresolved.

Competitive scores across the benchmarks come from supervised adaptation to their specified tasks. The study shows that the architecture can be used on forms and receipts with different schemas, and the held-out-field study probes a narrower form of transfer within SROIE. The field-specific results bound the evidence for using a prompt to extend the schema. They show strong performance with full supervision alongside low zero-shot scores, and the usefulness of limited supervision varies considerably with the requested field.

Finally, the metrics quantify success at token granularity. A downstream record can be sensitive to a single wrong character, especially where a value must be copied exactly for later use. The favorable aggregate results and the qualitative failures can coexist because they address different aspects of reliability. The study gives benchmark F1 and examples of both repairs and incorrect generations. It leaves the frequency of fully correct document records and the incidence of unnecessary changes to clean OCR unquantified.

### What came after

The documented follow-up is still open. No later citing study is identified for tracing an adoption or extension of GenKIE. The authors themselves point to large-scale multimodal document pretraining as a possible continuation and suggest that their feature design could be integrated with other vision-and-language architectures. Those are directions proposed at the close of the study, whose demonstrated results concern the prompted OFA-based system and the benchmarks described above.

## Cite

Cite as Panfeng Cao, Ye Wang, Qiang Zhang and Zaiqiao Meng. 2023. GenKIE: Robust Generative Multimodal Document Key Information Extraction. Findings of the Association for Computational Linguistics: EMNLP 2023.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.18653/v1/2023.findings-emnlp.979](https://doi.org/10.18653/v1/2023.findings-emnlp.979)

```bibtex
@inproceedings{cao2023genkie,
  title = {{GenKIE: Robust Generative Multimodal Document Key Information Extraction}},
  author = {Panfeng Cao, Ye Wang, Qiang Zhang and Zaiqiao Meng},
  booktitle = {Findings of the Association for Computational Linguistics: EMNLP 2023},
  year = {2023},
  doi = {10.18653/v1/2023.findings-emnlp.979},
  url = {https://doi.org/10.18653/v1/2023.findings-emnlp.979}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
