---
title: "Form2Seq — paper by Aggarwal et al. (2020)"
description: "Form2Seq extracts form fields and nested groups from text and layout, showing how sequence prediction compares with image segmentation."
canonical: "https://research.elamur.ai/free/en/papers/aggarwal-2020-form2seq-framework-higher-order-form/"
---
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/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/aggarwal-2020-form2seq-framework-higher-order-form/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2020](https://md.research.elamur.ai/free/en/papers/2020/) / Form2Seq : A Framework for Higher-Order Form Structure Extraction

# Form2Seq : A Framework for Higher-Order Form Structure Extraction

Paper · 2020 · Milan Aggarwal, Hiresh Gupta, Mausoom Sarkar et al.

**Authors:** Milan Aggarwal, Hiresh Gupta, Mausoom Sarkar and Balaji Krishnamurthy · **Year:** 2020 · **Venue:** Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP) · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP) · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2020.emnlp-main.314/)
- [PDF](https://aclanthology.org/2020.emnlp-main.314.pdf)
- [DOI 10.18653/v1/2020.emnlp-main.314](https://doi.org/10.18653/v1/2020.emnlp-main.314)

## What it is about

Form2Seq extracts form fields and nested groups from text and layout, showing how sequence prediction compares with image segmentation. · about 35 minutes to read

**In this deep dive**

1. [Summary](#dd-summary)
2. [Ideas worth borrowing](#dd-ideas-worth-borrowing)
3. [How Mova uses it](#dd-how-mova-uses-it)
4. [The problem and its context](#dd-the-problem-and-its-context)
5. [The method, step by step](#dd-the-method-step-by-step)
6. [Experiments and results](#dd-experiments-and-results)
7. [What the ablations show](#dd-what-the-ablations-show)
8. [Limitations](#dd-limitations)
9. [What came after](#dd-what-came-after)

### Summary

A digital form needs more than recognizable words and visible boxes. To rearrange it for a different screen, software must know which caption belongs to which input space, which alternatives belong together, and which heading governs a collection of choices. Form2Seq addresses this structural problem. It starts with text blocks and empty input areas that have already been identified, then predicts their roles and relationships. Its central move is to represent a form as an ordered sequence of elements, carrying both text and position, rather than to recover every relationship through image segmentation.

The paper studies two connected tasks. The first assigns an element type: a text block might be a field caption, a section heading, a list item, or another category, while an empty input area might belong to a text field or a choice field. The second assembles these elements into larger structures. A text field connects a caption with its input areas. A choice field connects a description with its selectable widgets. A choice group brings related choice fields together, sometimes beneath an instructional title. These relationships matter because a page can look approximately correct while still connecting the wrong pieces.

Form2Seq orders the elements from left to right and from top to bottom. It encodes the words inside each text block, combines that representation with the element’s bounding box, and processes the resulting sequence with recurrent networks. A decoder then makes predictions element by element while attending to the encoded page. For grouping, the output is a group identifier rather than a semantic category. Elements assigned the same identifier are treated as members of the same structure. The strongest grouping design also receives intermediate representations from the element-type predictor, allowing role recognition to guide structural assembly.

On the authors’ Forms Dataset, the strongest type classifier reaches an overall accuracy of 90.06%. When the system extracts the different higher-order structures together, its F-scores are 75.82 for text fields, 86.01 for choice fields, and 61.63 for choice groups. It exceeds the image-segmentation baselines used in those experiments. The paper also applies the grouping approach to table rows and columns on ICDAR 2013, reporting an average F1 of 94.7 against the comparison system’s 93.4. These results support the usefulness of text, layout, and sequential context for document structure; they do not establish that images are unnecessary for every document-understanding task.

The most informative finding concerns the connection between local roles and larger relationships. Grouping improves when it can use information from type prediction, but the way that information travels matters. Passing the type decoder’s internal outputs works better than passing its final category probabilities in the compared settings. Text also contributes beyond geometry and a simple distinction between text and widgets. The experiments therefore make a more specific argument than merely preferring sequences over pixels: structural extraction benefits from preserving meaningful elements, supplying linguistic evidence, and letting related decisions inform one another.

### Ideas worth borrowing

Preserve objects before predicting relationships. Once useful elementary units are available, a system can reason over those units instead of returning to a dense image representation for every decision. Form2Seq retains text blocks and widgets as identifiable objects, making group membership an explicit output. The same principle applies to [information extraction](https://md.research.elamur.ai/free/en/concepts/information-extraction/), where connecting the correct records can matter more than drawing a plausible region around them.

Use order without discarding position. A sequence creates a convenient computational path through a document, but sequence order alone cannot express its layout. Form2Seq keeps bounding-box information alongside reading order. This combination offers a reusable compromise: exploit a familiar ordering while retaining evidence about spatial relationships that the ordering compresses or obscures.

Let role recognition support assembly. Knowing that an element is a caption, an instruction, or a widget can help determine which larger structure contains it. The paper makes this dependency part of the architecture instead of treating classification and grouping as unrelated products. Similar designs can connect token roles to phrase construction, event participants to event records, or document headings to the material they organize.

Pass useful intermediate information. A final category decision is a compressed account of what a predictor has learned about an element. In the paper’s grouping experiments, internal decoder outputs are more effective than the corresponding final probabilities. The broader lesson is to test what an interface preserves: a downstream task may need distinctions that are useful internally but disappear when the upstream task produces its official answer.

Evaluate complete membership. A region can overlap the correct structure while omitting an essential caption or including a neighboring option. Form2Seq’s exact-membership criterion asks whether a predicted group contains precisely the required elements. This idea transfers to record assembly, graph extraction, and other tasks where a nearly correct boundary can conceal an operationally important relationship error.

Separate evidence through controlled comparisons. The authors compare coordinates alone, coordinates with an element-kind flag, and coordinates with text. They also vary the connection between type prediction and grouping. Such comparisons help identify which information and architectural choices support a result. The same discipline is useful whenever a system combines several sources of evidence and an overall score cannot explain their individual contributions.

### How Mova uses it

Mova is a small language system implemented in Rust, with explicit parsing, frame construction, world state, and bounded operational interfaces. Its documented direction favors rules, logic, and statistics over adopting neural architectures by default. Form2Seq is relevant chiefly as a source of representation and evaluation ideas. The implementation marks below are proposals based on documented mechanisms; they do not establish that Mova has applied Form2Seq or reproduced its results. Effects on Mova remain unknown until the corresponding transfers are evaluated.

Idea: Preserve elementary objects before assembling larger structures. Where: Introduction and Methodology, including Figure 1. Area: representation. Mova: частково є (the `en` → `prag` → `world` pipeline in `docs/architecture.md`). Mova already keeps structured linguistic objects instead of reasoning only over undifferentiated text. A document adapter could similarly preserve captions, widgets, and their source identities before attempting grouping. This would make incorrect associations inspectable at the element level. The analogy concerns representation; a form-element reader is not established by the digest.

Idea: Keep sequence order alongside independent positional evidence. Where: Methodology and Element Type Classification. Area: data. Mova: нове. A proposed document reader could store reading order and bounding boxes as separate properties, allowing rules to use either without mistaking sequence adjacency for spatial proximity. The digest does not establish such a layout-aware input contract, so novelty remains provisional. Why Mova: this would extend transparent structural reasoning to documents whose organization carries information that plain text loses.

Idea: Distinguish an element’s physical kind from its semantic role. Where: Experiments, Table 1. Area: representation. Mova: нове. Form2Seq’s text-or-widget flag separates a basic input distinction from the role eventually predicted. Mova could use a corresponding typed interface in document ingestion, keeping “empty input area” distinct from “choice widget” until evidence supports the latter. Why Mova: explicit physical types could prevent a rule from assuming a semantic function merely because two objects share a shape.

Idea: Let local role recognition guide structural grouping. Where: Higher Order Group Identification and Figure 3. Area: syntax and structure. Mova: частково є (`prag` frames feed `world` interpretation, as described in `docs/architecture.md`). The existing pipeline already uses interpreted local structure in subsequent reasoning. A form extension could apply the same principle to caption and widget roles, then test whether those roles improve field membership. The paper supports this dependency in its own experiments; its value for Mova’s document processing is unknown.

Idea: Preserve alternatives at an interface rather than forwarding only a final label. Where: Higher Order Group Identification and the comparison of D_G with E_G. Area: uncertainty and interfaces. Mova: частково є (reason-bearing rules and retained disagreements in the architecture and `treeagree`). Mova need not imitate a neural hidden state. It could pass candidate roles, supporting observations, and unresolved constraints to a grouping module. That would preserve distinctions a hard label removes while keeping the interface inspectable. The appropriate representation and its benefit would require measurement.

Idea: Represent membership directly rather than only through an enclosing region. Where: Higher Order Group Identification. Area: knowledge representation. Mova: нове. A proposed form structure could contain explicit source-element identifiers for every caption and widget. Bounding boxes could remain useful evidence without becoming the definition of the group. Why Mova: direct membership fits a logical module that must explain exactly which objects an answer or action concerns. The digest does not establish an implemented form-membership representation.

Idea: Use an explicit state for elements outside the target grouping. Where: Higher Order Group Identification, where group 0 is reserved for nonmembers. Area: classification. Mova: частково є (gap reporting in `world` and explicit unsupported-request outcomes in `docs/hybrid-system.md`). The transferable principle is to avoid forcing every object into a recognized structure. A document module could retain “not part of this grouping” separately from a positive membership claim. That state should also remain distinct from unresolved evidence; the paper’s reserved label does not itself define Mova’s uncertainty policy.

Idea: Support more than one membership relation for the same object. Where: Higher Order Group Identification and simultaneous construct extraction. Area: graphs. Mova: частково є (frames, world relations, and source-bound groupants in the architecture). A choice caption can belong to a field that also belongs to a larger choice group. Mova could represent these relationships as separately typed edges rather than compressing them into one flat partition. The digest supports relational representations generally, but does not establish this form-specific hierarchy.

Idea: Check complete membership when a structure will drive an action. Where: Results and Discussion, Group Identification. Area: evaluation. Mova: нове. A proposed benchmark could require the exact set of captions and widgets needed for a field, instead of accepting a nearby region or a largely correct set. Why Mova: a logical module needs to know whether an operation concerns the intended objects, and an omitted instruction can matter in spite of otherwise plausible structure. Existing evaluation mechanisms do not establish this particular check.

Idea: Report approximate localization and exact reconstruction separately. Where: Results and Discussion, the exact-match and IoU evaluations. Area: evaluation. Mova: частково є (declared conformance boundaries in groupants and the CPU/GPU distinction in the documentation). Mova already distinguishes kinds of agreement. A form benchmark could similarly report region overlap and exact membership as different observations. This would prevent an easier geometric measure from silently standing in for structural correctness. The particular metrics and thresholds would need a task-specific justification.

Idea: Isolate information sources through ablations. Where: Table 1 and the E_G/F_G comparison in Table 2. Area: evaluation. Mova: вже є (regression gates, negative controls, and held-out comparisons described in `README.md` and `docs/architecture.md`). Form2Seq supplies a useful pattern for extending that practice: compare geometry, elementary type information, and text separately. For a dictionary or document reader, analogous tests could remove syntax, lexical evidence, or source metadata in turn. Existing controls still deserve this proposal because each new interface creates new possible confounds.

Idea: Measure architectural dependencies rather than assuming that joint processing helps. Where: Table 2. Area: experimental design. Mova: частково є (independent checking and gated changes in the documented training workflow). Mova could compare separate role analysis, shared processing, and explicitly cascaded rules on identical document cases. The paper shows that different connections between related tasks produce different outcomes. It does not imply that Mova should share every component, or that a jointly trained mechanism is preferable to a transparent staged one.

Idea: Inspect category-level behavior alongside aggregate accuracy. Where: Table 1 and Results and Discussion. Area: statistics and evaluation. Mova: вже є (`prag` evaluation by field and confidence, together with diagnostic parsing audits in the application ledger). Form2Seq’s uneven class results show why a single score can hide important weaknesses. A proposed document reader should report captions, headings, widgets, and other roles separately. The existing diagnostic principle is applicable even when a new task uses a different classifier or no neural network.

Idea: Make upstream extraction assumptions explicit. Where: Introduction and Element Type Classification. Area: data contracts. Mova: частково є (`dictindex` indexes existing parses and records missing or unsuitable source material). Form2Seq assumes that text blocks and widgets are already available. Mova could require a document adapter to declare which objects came from extraction, which are missing, and which text is unreliable. This would keep failures in source preparation distinguishable from failures in semantic grouping.

Idea: Preserve text noise as a diagnosable condition. Where: Element Type Classification, Text Encoder. Area: lexical processing. Mova: нове. The authors choose character-derived word representations because PDF text can be noisy. Mova could instead test explicit normalization candidates and retain the original form with each interpretation, using dictionary and morphological evidence where appropriate. Why Mova: this offers a rule-oriented route to handling damaged document text while preserving evidence for review. Neither effectiveness nor a document-specific implementation is established.

Idea: Treat reading order as a testable assumption. Where: Methodology. Area: data and evaluation. Mova: нове. A proposed layout reader could record the order supplied by extraction and compare outcomes under plausible alternative traversals. Form2Seq uses a fixed reading-order convention; it does not provide this robustness experiment. Why Mova: documenting ordering sensitivity would reveal whether a failure comes from linguistic interpretation or from the path chosen through the page. The proposed test is a Mova hypothesis inspired by the representation choice.

Idea: Separate consistency repair from unconstrained prediction. Where: Table Structure Recognition. Area: constraints. Mova: частково є (`treeagree` applies explicit edits through UD validity gates). The table experiment combines predicted group identifiers with alignment-based majority reassignment. Mova could borrow the separation between a candidate grouping and a declared consistency operation, logging which members changed and why. Its existing tree gates demonstrate a related practice, but they do not establish a table-repair component or validate this majority rule for other structures.

Idea: Check structural validity after assembling a group. Where: Figure 1 and Higher Order Group Identification. Area: logic. Mova: частково є (groupant invariants and `treeagree` validity checks). The paper defines what its field and group categories contain. Mova could turn comparable definitions into explicit obligations, such as requiring a supported relationship between a caption and the widgets assigned to it. Such checks would be proposed additions, not properties demonstrated by Form2Seq’s output mechanism. Their precision and failure behavior would need separate evaluation.

Idea: Keep optional components optional. Where: Higher Order Group Identification, the description of ChoiceGroups. Area: schema design. Mova: частково є (typed frame roles and explicit gaps in `prag` and `world`). A group title is optional in the authors’ definition, so absence alone should not invalidate every choice group. Mova could make required and optional parts explicit in a document schema. This extends an existing typed-representation principle to a new domain without claiming that every missing component has the same meaning.

Idea: Choose a representation with computational costs in view. Where: Introduction and the baseline comparison. Area: efficiency. Mova: частково є (bounded capabilities, job estimates, and measured execution tools described in the architecture). The paper motivates its element sequence partly through the memory demands of image segmentation. Mova could compare the costs of retaining source elements against raster-based processing for a concrete task. The result cannot be inferred from parameter counts alone, and the paper provides no Mova runtime measurement.

Idea: Review annotation at both the element and relationship levels. Where: Dataset. Area: annotation. Mova: частково є (`treeagree`, teacher-reviewed proposals, and staged enrichment in `tools/enrich`). The authors annotate constituent elements as well as larger structures and use another annotator for review. Mova’s document data could similarly preserve separate checks for an object’s identity, its role, and its membership. Existing review boundaries provide a procedural foundation; a form-annotation protocol and its agreement measurements remain unknown.

Idea: Preserve rights and source boundaries when building structural datasets. Where: Dataset, including the restriction on releasing the complete Forms Dataset. Area: provenance. Mova: вже є (`tools/sources`, `dictindex`, and the documented data-licensing gates). A proposed form corpus would need source-specific rights records instead of treating extractable documents as automatically reusable training material. The paper’s release restriction makes this practical concern visible, while Mova’s existing mechanisms already distinguish source provenance, permitted use, and admitted data.

Idea: Test a representation on a related task without inflating the generalization claim. Where: Table Structure Recognition and Table 4. Area: evaluation. Mova: частково є (separate readers, students, and domain routing in `docs/architecture.md`). Mova could test a common element-and-relation representation on both forms and tables while reporting each task independently. Form2Seq’s table result motivates such an experiment, but it does not show that one trained system understands all structured documents or that task-specific adjustments are unnecessary.

Idea: Keep structural interpretation separate from knowledge admission. Where: Introduction, Methodology, and the distinction between element roles and grouped constructs. Area: knowledge management. Mova: вже є (`dictindex` labels do not admit dictionary entries, and `mova-enrich` staging remains separate from admission). Recognizing an instruction block or assembling a field would establish a document relationship, not the truth or trustworthiness of its contents. This is a Mova-specific use of the paper’s representational separation. Form2Seq itself evaluates structure rather than the epistemic status of extracted statements.

### The problem and its context

Forms are documents designed to collect information, but their organization often lives in visual relationships rather than in a simple stream of prose. A caption might sit beside several input boxes. A heading might govern a set of alternatives arranged beneath it. A line of instructions might apply to a whole group rather than to the closest widget. Recovering the words is therefore insufficient for recovering the document’s function.

The authors connect this problem to digitization and reflow. A paper or PDF form may need to become an interactive representation that rearranges itself for a different device. Once a page is reorganized, its original spacing can no longer serve as the only indication of what belongs together. Software must preserve the underlying relationships so that captions remain associated with their input areas and related choices remain grouped.

This concern places structure extraction between low-level document processing and the behavior of a usable form. At the lower level, tools can already identify some text and input areas. At the higher level, an application needs meaningful fields and collections. The paper focuses on bridging that gap. It does not attempt to solve every aspect of form conversion, and its experiments should be understood as tests of this intermediate structural layer.

The paper describes earlier layout-analysis approaches as relying heavily on manually designed features and rules. Some methods worked upward from components and text lines towards larger regions. Others worked downward by splitting a page into columns and blocks. These approaches addressed important page organization problems, but they required explicit decisions about the visual patterns that should guide subdivision or aggregation.

More recent work, in the authors’ account, moved toward learned segmentation. [Fully convolutional networks](https://md.research.elamur.ai/free/en/papers/long-2015-fully-convolutional-networks-semantic-segmentation/) make predictions over image locations, allowing document regions to be identified through pixel-level output. The paper discusses applications to page segmentation, handwritten material, and regions such as tables. These methods reduce reliance on hand-designed layout heuristics and can learn representations suitable for distinguishing larger visual areas.

Forms expose a particular weakness in this approach. Their meaningful structures can be closely packed, and boundaries between neighboring groups may depend on small separations. Increasing image resolution creates more intermediate activations and gradients during training. Under limited GPU memory, resizing the input becomes attractive or necessary. The authors argue that this resizing can remove distinctions needed to separate nearby structures.

That argument is about the relationship between representation and task. A broad region may be sufficient for finding a paragraph, yet insufficient for deciding which checkbox belongs to which caption. Likewise, a visually plausible mask can cover much of a group while still connecting its members incorrectly. The authors therefore seek a representation that preserves elementary identities rather than making every structural decision through a rasterized page.

The related-work discussion also acknowledges text-based and multimodal approaches. Some earlier systems use text and bounding boxes to extract pre-defined entities from invoice-like documents. Other work combines textual and layout representations for document [information extraction](https://md.research.elamur.ai/free/en/topics/information-extraction/). The paper situates [BERT](https://md.research.elamur.ai/free/en/papers/devlin-2019-bert-pre-training-deep-bidirectional/) and [LayoutLM](https://md.research.elamur.ai/free/en/papers/xu-2019-layoutlm-pre-training-text-layout/) in this broader movement towards contextual and layout-aware document representations.

Form2Seq’s claimed distinction is the target structure. It aims to recover varied, nested form constructs rather than only a predetermined set of entity values. Its outputs concern what an element is and how it participates in a larger unit. This makes a field’s caption, widgets, and enclosing group central objects of prediction.

The paper also distinguishes its task from document classification. It discusses approaches that use visual features, textual features, or both to assign a class to a document. [Hierarchical attention networks](https://md.research.elamur.ai/free/en/papers/yang-2016-hierarchical-attention-networks-document-classification/) organize textual representations at different levels, while other cited work combines features from [MobileNets](https://md.research.elamur.ai/free/en/papers/howard-2017-mobilenets-efficient-convolutional-neural-networks/) and [subword-based word representations](https://md.research.elamur.ai/free/en/papers/bojanowski-2017-enriching-word-vectors-subword-information/). Such approaches provide context for combining evidence, but assigning a document label is different from reconstructing its internal relationships.

Within this context, Form2Seq asks a focused question: if meaningful small elements are already available, can their text, positions, and sequential context recover the larger structures more effectively than the compared segmentation systems? The experiments address that question through both role classification and grouping, then examine whether the grouping formulation also works for table structure.

### The method, step by step

The method begins after elementary extraction. Its inputs are TextBlocks and widgets, not an unprocessed scan. A TextBlock is a coherent unit of text. A widget is an empty space provided for a response. Each element has a bounding box, and text-bearing elements also have words. This starting point matters because Form2Seq’s later predictions depend on the quality and completeness of these supplied objects.

From form elements to higher-order structures The steps in order.

#### Build a sequence from the page

The authors first combine the text and widget collections. In their notation, the elementary set is formed as follows:

```
fᵉ = fᵗ ∪ fʷ
```

Here fᵗ denotes the form’s TextBlocks, fʷ denotes its widgets, and fᵉ denotes the combined collection of elements. The union symbol indicates that both kinds enter the input. The elements are then arranged into a sequence called aᵉ, using a reading-order convention that proceeds horizontally and downward through the page.

This ordering turns a spatial document into something a sequence-processing architecture can consume. The motivation is that neighboring roles are not independent. A bullet commonly precedes its list item, and a field caption tends to occur near its widgets. Reading order brings some of these dependencies close together in the input sequence.

The method does not rely on order alone. Each element retains its bounding box:

```
sᵃᵢ = (x, y, w, h)
```

The symbol sᵃᵢ denotes the spatial information for element i in the arranged sequence. The coordinates x and y locate the box relative to the image’s upper-left corner. The symbols w and h denote its width and height. These values preserve aspects of the page that a simple element index cannot express.

For a newcomer, the distinction is useful: order tells the network which element it processes next, while coordinates tell it where that element actually lies. Two consecutive sequence elements need not have the same relationship as two elements positioned directly beside each other. Supplying both gives the predictor evidence for learning that difference.

#### Encode the words inside each element

The text encoder operates within an individual TextBlock before the form-level context encoder processes the whole sequence. A block may contain several words, each requiring a representation. The authors note that PDF-derived text can be noisy, making reliance on conventional whole-word vectors problematic.

They use chars2vec to obtain a representation for each word. These word representations are processed by an LSTM, a recurrent component that updates an internal state as it reads the sequence. After the block’s final word, the resulting cell state serves as the text representation for that entire element.

This is a nested sequence design. The inner sequence consists of words inside a block. The outer sequence consists of blocks and widgets across the form. The inner encoder reduces the block’s text to a representation that can travel alongside the element’s geometry through the remainder of the architecture.

Widgets have no text to encode, so the method gives them an all-zero textual vector. Their geometry still enters the next stage. This choice allows text-bearing and empty elements to share the same form-level processing path without pretending that an empty input area contains words.

The implementation limits a TextBlock to 200 words. Each word representation has 100 dimensions, and the text encoder’s LSTM size is 100. These are concrete choices in the reported implementation, not evidence that the same limits would suit every document collection.

#### Add context across the form

For every element, the system concatenates its text representation with its spatial coordinates. Concatenation places the two kinds of information into a single input vector without making either disappear. The resulting sequence enters a bidirectional LSTM.

A bidirectional encoder reads context in both directions. For an element being represented, information can therefore come from material before it and material after it in the arranged form. This is relevant when an element’s role depends on a nearby title, a following widget, or the surrounding collection of choices.

The output is a context-sensitive representation for each element. The same short text can consequently receive a different representation depending on the page around it. A word or phrase that functions as an instruction in one arrangement need not be treated identically when it appears as a caption elsewhere.

For element-type prediction, each direction of this context encoder uses a hidden size of 500. The decoder has a hidden size of 1000. These settings describe the capacity of the reported system; the paper does not use them to establish an optimal architecture beyond its validation-based selection procedure.

#### Predict element types sequentially

The type decoder is another LSTM. At each position, it receives the context representation associated with the current element and produces an output used for classification. The architecture predicts in sequence, allowing current decisions to depend on preceding outputs.

This design is inspired by [sequence-to-sequence learning](https://md.research.elamur.ai/free/en/papers/sutskever-2014-sequence-sequence-learning-neural-networks/), but the output here remains aligned with the supplied document elements. The task is not unrestricted text generation. Each step predicts a structural category for a particular input object.

The decoder also uses [Bahdanau attention](https://md.research.elamur.ai/free/en/papers/bahdanau-2014-neural-machine-translation-jointly-learning/) over the encoded sequence. Attention allows the decoder to consult different elements while deciding the role of the current one. The authors motivate this by the length of form sequences, where relying only on recurrent state could make relevant context harder to access.

The attention memory is assembled from the encoder outputs:

```
M = [b₁; b₂; …]
```

Here M is the memory available to attention, and each bᵢ is the contextual representation for an element at position i. The bracketed expression indicates that these representations are stacked into a common memory. It does not denote a separate source of document information: attention revisits the encoded input.

A linear projection followed by softmax converts each decoder output into category probabilities. In the type-classification experiment, there are 10 target categories. The attention layer has size 500. The authors train the text encoder, context encoder, and type decoder together with cross-entropy loss and teacher forcing.

Teacher forcing means that training supplies the expected preceding outputs while the decoder learns to predict the next target. Its role is to guide sequential learning. The paper names this procedure but does not provide an additional mathematical derivation of the loss or the recurrent updates, so the architecture should not be mistaken for a fully specified implementation merely from its diagram.

#### Turn grouping into identifier prediction

The grouping task changes what the decoder emits. Rather than assigning a role such as caption or heading, it predicts a group identifier. Elements belonging to the same target structure receive the same identifier. An element outside the relevant groups receives the reserved identifier 0.

This turns structural assembly into a sequential labeling problem with a relational interpretation. The important consequence is not the numerical value of an identifier on its own. What matters is whether the correct elements share it and whether elements that should remain separate are kept apart.

The group decoder can use earlier outputs when assigning the current identifier. That dependency is particularly relevant to grouping: once a group has begun to receive an identifier, later members must be linked consistently. The paper therefore uses the same broad contextual encoding and autoregressive decoding pattern as in type prediction.

A standalone grouping system can operate without the type-prediction branch. The authors nevertheless hypothesize that semantic roles will help. A caption and a title may occupy similar geometric regions while playing different roles in the structure. Explicit supervision for these distinctions could give grouping access to information that its own objective does not learn as effectively.

#### Cascade role information into grouping

The strongest design uses a shared text encoder but separate context encoders for type prediction and grouping. The type branch runs first on the textual and spatial representations. Its decoder outputs are then concatenated with those original element representations before entering the grouping context encoder.

This is a richer connection than passing only the most likely type label. The grouping branch receives the type decoder’s internal output representation. That representation can contain information useful for grouping even when it is not needed to distinguish the final type categories.

The grouping context encoder processes this enriched sequence and produces its own contextual representations. The group decoder then predicts memberships while attending to that grouping memory. All of the components are trained together in the cascaded configuration.

For this setting, the type categories are adjusted to the grouping problem. They distinguish the roles relevant to field and choice-group reconstruction, including captions, titles, widgets, and other text. The role branch therefore supplies task-relevant distinctions rather than necessarily preserving every category from the standalone classification experiment.

Nested structure requires more than a single flat membership assignment. An element can belong to a choice field while that field participates in a broader choice group. The architecture uses separate prediction layers to produce the relevant group identifiers. This permits simultaneous relationships at different structural levels.

The authors compare this connection with several alternatives, including a shared context encoder, separately trained type predictions, and final softmax outputs passed downstream. These are not interchangeable implementations of one abstract idea. Their different outcomes are central evidence for the claim that the interface between the tasks matters.

#### Train and adapt the framework

Training uses [Adam](https://md.research.elamur.ai/free/en/papers/kingma-2014-adam-method-stochastic-optimization/) with a learning rate of 1 × 10⁻³. The experiments run on a single Nvidia 1080Ti GPU. The authors select a batch size of 8 as the largest that fits the available memory and manually tune hyper-parameters using validation performance.

The table experiment retains the grouping formulation but changes the target relationships. Text elements within a table are ordered in the same general manner. One prediction head assigns row memberships, while another assigns column memberships.

The table outputs also undergo alignment-based processing. For columns, the method examines sets of texts with a shared horizontal span and reassigns their column labels using the majority prediction within the set. A corresponding process is applied to rows. The final table results therefore reflect both sequential prediction and this consistency operation.

### Experiments and results

The experiments evaluate two related claims on forms: that the representation can classify elementary roles, and that it can recover complete larger structures. A further experiment asks whether the grouping mechanism works for table rows and columns. These tasks use different outputs and metrics, so their scores should not be treated as interchangeable measures of one general document-understanding ability.

#### The Forms Dataset

The authors’ collection contains 23K forms from several practical domains. They describe documents involving finance and insurance, medical use, and government activities, among other sources. The purpose of this variety is to study forms with different layouts and information-collection patterns rather than a single fixed template.

Annotators mark both the larger structures and their constituent elements. Another annotator then reviews each form. The authors report that ∼85% of the forms required no correction during review, while the remaining 15% received minor corrections. This describes the review outcome; it is not a formal inter-annotator agreement statistic.

The data contains substantial numbers of text and widget instances. For instance, the reported training/test counts for ChoiceGroup Title are 8.92k/2.28k, while Header Title has 10.2k/2.57k. The corresponding Bullet counts are 56.4k/14.2k, and List Item counts are 58.9k/14.7k. These counts make clear that role classification is evaluated over many elements, not merely over the number of document pages.

For higher-order choice groups, the reported training/test distribution is 15.5k/1.76k. Field counts follow the corresponding caption distributions. This connection between captions and fields is consistent with the task’s structural definitions, but it does not mean a correct caption label automatically supplies the full field membership.

The paper states that legal restrictions prevent release of the entire Forms Dataset. It announces an intended release of a substantial, representative subset with detailed annotations. That announcement is relevant to reproducibility, but it should not be converted into an assertion about the contents or availability of a later release.

#### Element-type classification

The type experiment compares the image baselines with several Form2Seq input settings. A_T uses spatial coordinates without textual content. B_T adds a bit indicating whether an element is text or a widget. C_T uses text and geometry without receiving that additional bit.

The primary metric is classification accuracy over elements. The aggregate result is strongest for C_T, but the category-level results are also important because the form contains roles with different frequencies and difficulty. An approach can achieve a respectable overall score while doing poorly on a role essential to grouping.

Forms Dataset element-type classification, overall accuracy Text and geometry produce the strongest aggregate classification result among the compared settings.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| MFCN | 48.59 |
| DeepLabV3+ | 84.18 |
| Form2Seq A_T, coordinates | 76.92 |
| Form2Seq B_T, coordinates and kind flag | 88.87 |
| Form2Seq C_T, text and coordinates (this paper) | 90.06 |

The coordinates-only setting is weaker than the version that knows the elementary kind of each object. This is useful evidence that layout does not by itself reveal whether an element is an input area or text. Providing that distinction changes the classification problem substantially.

Text then supplies information beyond the kind flag. Section Title accuracy is 57.02 for B_T and 67.48 for C_T. Choice GroupTitle accuracy is 76.81 and 78.93, respectively. These comparisons support the idea that words can help distinguish organizational roles that geometry alone leaves ambiguous.

The gains are not uniform. Text Widget accuracy is 98.26 for B_T and 96.89 for C_T. TextField Caption accuracy is 91.36 for B_T and 91.27 for C_T. A faithful reading therefore treats C_T as the strongest aggregate setting instead of claiming that textual input improves every individual category.

#### Choice-group identification

Grouping is evaluated through precision, recall, and F-score. For Form2Seq’s exact criterion, a predicted group is correct only when its members match the reference membership precisely. This puts emphasis on complete reconstruction rather than approximate localization.

The authors first study choice groups independently. These structures are demanding because they combine several fields and can include an instructional title. Recovering most choices while losing the title is a structural error under exact matching.

Forms Dataset choice-group identification, exact-group F-score The cascade using internal type-decoder outputs leads the compared grouping configurations.

**The numbers**

| System or setting | F-score |
| --- | --- |
| MFCN | 13.96 |
| DeepLabV3+ | 44.14 |
| Form2Seq A_G, grouping alone | 53.24 |
| Form2Seq B_G, shared context | 54.65 |
| Form2Seq C_G, separate type predictions | 56.51 |
| Form2Seq D_G, type probabilities | 52.77 |
| Form2Seq E_G, type decoder outputs (this paper) | 59.72 |
| Form2Seq F_G, without text | 55.65 |

For the strongest standalone choice-group setting, E_G, recall is 58.67 and precision is 60.81. Its F-score of 59.72 indicates substantial remaining difficulty even though it exceeds the baselines. The result supports the architecture comparison without making exact group recovery a solved problem.

The paper also evaluates E_G using overlap rather than exact membership. At an IoU threshold of 0.40, it reports recall of 74.3, precision of 78.6, and F-score of 76.3. These values measure a different success condition from the exact-group result. They show why the evaluation rule must accompany the number.

#### The segmentation baselines

The image comparisons use DeepLabV3+ and MFCN. For each, the authors test an image-only input and a variant supplied with masks identifying text blocks and widgets. They report the stronger variant for each baseline.

The images are resized with their proportions preserved into a 792x792 input setting. For element classification, segmentation output is converted into an element label through majority voting over the pixels inside the element. This processing connects a pixel-oriented output to the object-level task used by Form2Seq.

For grouping, the baselines use an overlap criterion with a threshold of 0.40. The paper emphasizes that Form2Seq’s exact-membership evaluation is stricter. Its separate IoU evaluation is therefore valuable: it helps reveal how much of the apparent comparison depends on the success criterion.

The authors report 31.2 million parameters for their grouping system and 59.4 million for DeepLabV3+. This provides a capacity-related comparison, but the experiments do not turn parameter count into a general claim about speed, energy use, or deployment cost.

The qualitative examples show errors consistent with the paper’s motivation. Segmentation can combine neighboring groups, return incomplete regions, or confuse a title with another caption. These examples help explain the numerical pattern, although they do not measure the frequency of every error category across the test set.

#### Extracting several structures together

The authors also train for text fields, choice fields, and choice groups simultaneously. The baselines receive separate prediction heads so that overlapping hierarchical structures can be represented through different masks.

For text fields, Form2Seq reports recall of 71.59, precision of 80.6, and F-score of 75.82. The corresponding F-scores are 38.62 for DeepLabV3+ and 38.0 for MFCN. These are results for joint extraction, instead of the earlier choice-group-only comparison.

For choice fields, Form2Seq’s recall is 83.48, precision is 88.71, and F-score is 86.01. DeepLabV3+ has an F-score of 51.73, while MFCN has 19.6. This is the strongest of Form2Seq’s reported F-scores across the simultaneously extracted form constructs.

For choice groups, the joint setting produces recall of 59.27, precision of 64.2, and F-score of 61.63. The baseline F-scores are 47.83 for DeepLabV3+ and 28.77 for MFCN. The results support the method across these structures, while again showing that larger choice-group assembly remains harder than choice-field extraction.

#### Table structure recognition

The ICDAR 2013 experiment uses 156 tables. Following the comparison strategy cited by the authors, 125 tables are used for training and 31 for testing. The task groups text into rows and columns rather than identifying form-element roles.

For rows, Form2Seq reports precision of 94.2, recall of 96.1, and F1 of 95.1. The cited comparison system reports precision of 95.3, recall of 94.2, and F1 of 94.8. The stronger row F1 therefore coexists with lower row precision.

For columns, Form2Seq reports precision of 95.7, recall of 92.9, and F1 of 94.3. The comparison figures are 91.6, 92.6, and 92.1. The paper also provides averaged precision, recall, and F1 for the row-and-column task.

ICDAR 2013 table structure recognition, average F1 Form2Seq has the stronger reported average F1 in the cited table comparison.

**The numbers**

| System or setting | F1 |
| --- | --- |
| Siddiqui et al. | 93.4 |
| Form2Seq (this paper) | 94.7 |

Form2Seq’s average precision is 95.0 and average recall is 94.5. The comparison system reports 93.4 for each. The authors describe the table result as state of the art in their experimental context. The demonstrated evidence is the reported comparison on this split, using the task-specific grouping heads and alignment-based processing.

### What the ablations show

The paper offers a substantial set of controlled comparisons. They address both the information supplied to the system and the architecture through which type prediction supports grouping. Their strongest contribution is explanatory: they help distinguish a useful overall design from assumptions about why it works.

#### Geometry supplies structure, but not enough identity

A_T shows what the type predictor can recover from coordinates. Its overall accuracy of 76.92 indicates that layout contains useful regularities. Roles are not placed arbitrarily, and the contextual sequence can learn some of those patterns.

B_T reaches 88.87 after receiving the text-or-widget flag. This comparison establishes the importance of knowing the elementary object kind in the tested setup. The decoder is no longer required to infer every such distinction from position and size.

This result also clarifies the meaning of a geometry-only baseline. Without the flag, two objects can have similar boxes but different basic functions. A gain from identifying the input kind does not necessarily imply that the system has learned a deeper linguistic distinction. The flag removes a simpler ambiguity before semantic roles are predicted.

#### Text helps distinguish organizational roles

C_T reaches 90.06 overall accuracy using textual content and coordinates. The comparison with B_T shows that content can help beyond layout and object kind, even though C_T is not given B_T’s explicit bit.

Section titles provide a conspicuous example. Their reported accuracies of 57.02 and 67.48 show that wording can support distinctions between kinds of text that occupy similar positions. The paper also reports stronger results for several other roles when text is available.

The comparison does not support a universal monotonic benefit. Some categories are slightly weaker with C_T, including text widgets and text-field captions. The aggregate improvement is therefore a balance across categories rather than evidence that every element becomes easier to classify.

The inputs also differ in more than a simple appended feature: C_T omits the extra flag supplied to B_T. It is still a useful practical comparison between configurations, but it should not be described as a perfectly isolated test in which all existing inputs remain fixed and only text is added.

#### Type supervision helps, but the connection matters

A_G performs grouping without the type task and obtains an F-score of 53.24. B_G, which shares a context encoder while supporting both tasks, obtains 54.65. This supports the hypothesis that type prediction can assist grouping in the compared design.

C_G uses a separately trained type predictor and passes its classification outputs without a differentiable connection. Its F-score is 56.51. The result shows that useful type information does not require every component to be trained as one continuous cascade.

The strongest result comes from E_G at 59.72. This configuration uses separate context encoders and passes the type decoder’s internal outputs into the grouping pathway. It combines task-specific contextual processing with a richer connection between the branches.

D_G is especially informative because it passes final softmax outputs instead. Its F-score is 52.77. Merely connecting type prediction to grouping is therefore insufficient to reproduce the strongest outcome. The form and location of the connection have practical consequences.

The comparison suggests that internal decoder representations retain information useful to grouping that final probabilities do not expose as effectively. That is a reasonable architectural interpretation, not a direct measurement of which dimensions encode which relationships. The paper does not analyze the representation in enough detail to establish that stronger causal account.

#### Text contributes to complete group recovery

F_G removes text from the strongest cascade and uses coordinates with the element-kind signal. It obtains an F-score of 55.65, whereas E_G obtains 59.72. The authors report this as a 4.07-point advantage for the text-bearing configuration.

Their illustrated example makes the mechanism plausible. Without text, the system misses a choice-group title; with text, it reconstructs the complete group. Because the evaluation requires exact membership, identifying the title matters even when the remaining choice fields are already grouped sensibly.

This example connects the type and grouping tasks particularly well. A title is not just another text rectangle near a group. Recognizing its role changes which elements count as a complete structure. The quantitative ablation supports a benefit from text overall, while the visualization supplies a concrete account of one way that benefit can arise.

#### The comparison does not isolate every design decision

The paper does not report an ablation for every component. There is no corresponding comparison here that removes attention, replaces the reading-order convention, or removes the table alignment processing while leaving everything else fixed.

Similarly, the reported experiments do not isolate teacher forcing from other training choices. Its use is part of the implementation description rather than a separately demonstrated source of improvement.

These omissions do not invalidate the controlled comparisons that are present. They define their scope. The results support text, elementary kind information, and particular ways of connecting type and grouping decisions. Other components remain parts of a successful configuration whose individual contributions are not separately established.

### Limitations

The paper’s evidence is strongest for reconstructing structure from supplied elements. It is less informative about a complete system that must discover those elements from arbitrary documents. Keeping this distinction visible prevents an effective grouping method from being mistaken for an end-to-end solution to every stage of form understanding.

#### Limits stated by the authors

The authors explicitly identify a dataset-release restriction. Legal issues prevent distribution of the entire Forms Dataset, and the paper instead announces a planned subset. This limits how directly an independent researcher could reproduce the complete form experiments from the announced release alone.

They also state that extracted PDF words can contain noise. Their character-derived representations address that concern within the text encoder, but the paper does not claim that all extraction errors are removed. Missing text and incorrect block boundaries would create different problems from an unfamiliar spelling inside an otherwise valid block.

Hardware constraints are part of the experimental account. The batch size is selected according to the available GPU memory, and the image baselines use resized inputs. These details matter because the paper’s motivation links segmentation difficulty to the resolution that can be processed during training.

The authors present their framework as targeting forms and then evaluate an adaptation for tables. They do not claim a universal document interpreter. The structures studied have defined roles and memberships, and the table adaptation uses its own output heads and consistency processing.

#### Limits visible in the experimental setup

A careful reader should distinguish element extraction from element interpretation. Form2Seq begins with text blocks, widgets, and boxes. The experiments do not quantify how grouping performance changes when an upstream extractor misses a widget, splits a caption incorrectly, or combines unrelated text into one block.

The reading-order convention is another assumption. It creates a tractable sequence and can place related elements near each other, but the paper does not compare alternative orderings. The evidence therefore does not establish how robust the method is when layout makes a simple horizontal-and-downward traversal misleading.

The supplied coordinates are described in pixel terms. The paper does not provide a detailed robustness study of coordinate transformations, page-scale changes, or alternative spatial encodings. It would be unwarranted to infer invariance to such changes merely because text and layout are combined.

Group identifiers make membership prediction convenient, yet the description leaves some implementation questions open. The paper does not fully explain how identifier capacity, numbering conventions, and unusual group arrangements affect generalization. Its successful experiments demonstrate that the formulation can work in the reported setting, without resolving every possible issue in identifier-based grouping.

The sequential decoder introduces dependence between predictions. That can encourage consistent assignments, but it also makes earlier decisions relevant to later ones. The paper does not provide a separate analysis of how mistakes propagate during decoding or how that behavior differs from training with teacher forcing.

The exact-membership metric is a strength for evaluating structural completeness, but it also compresses different mistakes into a failed group. Missing a title, losing a widget, and combining neighboring fields can all prevent an exact match. The paper’s examples help interpret some errors, but it does not provide a comprehensive breakdown of all failed groups.

The baseline comparison requires particular care. Form2Seq and segmentation systems produce different kinds of output, and the main grouping comparison applies different success conditions. The paper is explicit about this and supplies an IoU evaluation for its own strongest grouping configuration. Readers should preserve those distinctions rather than treating all reported F-scores as if they arose from identical matching rules.

The experiments also compare particular implementations and input sizes. They support the claim that Form2Seq exceeds those baselines under the reported conditions. They do not establish that every image-based approach must fail on dense forms, or that combining image evidence with the element sequence could never help.

Statistical uncertainty is not reported in the form of repeated-run variation or confidence intervals for the principal scores. The numerical ordering of configurations is clear in the reported tables, but the paper does not provide the evidence needed for a detailed assessment of training variability.

The annotation review procedure offers useful quality control, yet the percentage of forms requiring correction is not a substitute for measured agreement on every role and relation. Nor does the description provide a full account of how variation in annotation decisions might affect exact-membership evaluation.

The table experiment demonstrates transfer of the formulation, not transfer without adaptation. It uses table-specific row and column targets, separate heads, and alignment-based reassignment. Its success is evidence that grouping text elements is useful beyond forms, while the additional processing remains part of the achieved result.

Finally, the study evaluates structure rather than all downstream consequences. It motivates reflow, interactive forms, and better handling of collected data, but does not report a user study of form filling or a full assessment of a reflowed application. A correct structural prediction is an enabling result, not direct evidence that every later interaction works correctly.

### What came after

[MessToClean](https://md.research.elamur.ai/free/en/papers/tuo-2026-messtoclean-evidence-grounded-structure-preserving/) is identified as a later work that cites Form2Seq. Its title describes evidence-grounded reconstruction that preserves structure in degraded exam-paper images. That places it near the broader concern that makes Form2Seq interesting: recovering useful document organization rather than merely obtaining visually plausible output.

The available citation information does not establish how MessToClean uses Form2Seq. It does not specify whether the later work adopts sequential grouping, borrows a representation, compares against the architecture, or cites it as background. No result or methodological inheritance should therefore be attributed to that relationship without further evidence.

What Form2Seq itself leaves for subsequent work is a clear design question. Once a document has been decomposed into meaningful elements, how should a system represent and recover the relationships that make those elements function together? The paper’s answer combines ordered processing, spatial evidence, textual content, and intermediate role representations. Its experiments show that this combination can outperform the compared segmentation approaches, while its remaining errors and assumptions leave room for stronger extraction, more explicit constraints, and more complete tests of structural reliability.

## Cite

Cite as Milan Aggarwal, Hiresh Gupta, Mausoom Sarkar and Balaji Krishnamurthy. 2020. Form2Seq : A Framework for Higher-Order Form Structure Extraction. Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP).

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

```bibtex
@inproceedings{aggarwal2020form2seq,
  title = {{Form2Seq : A Framework for Higher-Order Form Structure Extraction}},
  author = {Milan Aggarwal, Hiresh Gupta, Mausoom Sarkar and Balaji Krishnamurthy},
  booktitle = {Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)},
  year = {2020},
  doi = {10.18653/v1/2020.emnlp-main.314},
  url = {https://doi.org/10.18653/v1/2020.emnlp-main.314}
}
```

> 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)
