On Task-personalized Multimodal Few-shot Learning for Visually-rich Document Entity Retrieval

Jiayi Chen, Hanjun Dai, Bo Dai, Aidong Zhang, Wei Wei

Introduction

Visually-rich Document Entity Retrieval (VDER) is a critical component in industrial automation, enabling systems to extract structured data—such as dates, totals, and addresses—from scanned receipts, invoices, and forms. While standard VDER models perform well on static datasets, they often struggle with the dynamic nature of real-world applications where new document types and unique entity categories appear frequently. This "few-shot" challenge is compounded by the presence of complex background information that does not belong to the target task, a phenomenon the authors define as the Out-of-Task Distribution (OTD).

This paper introduces a task-personalized meta-learning framework designed to distinguish relevant entities from noisy backgrounds in few-shot scenarios. By shifting the focus from global document classification to task-specific entity retrieval, the proposed approach significantly improves the robustness and accuracy of information extraction in visually-rich environments.

The Challenge: Out-of-Task Distribution (OTD)

In traditional VDER, models are trained on a predefined set of labels. However, a specific user task might only require the extraction of a few rare entity types. The remaining text in the document—which might include entities relevant to other tasks—becomes "background" noise.

Standard models typically treat all non-target text as a single "Other" (O) class. This paper argues that this is insufficient because the background is not a uniform distribution; it is a complex, multimodal collection of text and layout features. When a model is asked to learn a new entity type from only a few examples, it often confuses these new entities with the OTD background, leading to a collapse in precision and recall.

Proposed Methodology

The authors propose a multimodal meta-learning framework that integrates textual and spatial information to better navigate the OTD problem. The architecture consists of three core components:

1. Multimodal Encoder

To capture the "visual richness" of documents, the framework utilizes a BERT-base transformer. This encoder processes both the text tokens and their corresponding 2D spatial coordinates (bounding boxes), allowing the model to understand the relationship between content and layout.

2. Task-Aware Meta-Learners

The paper explores two distinct meta-learning strategies to handle task personalization:

  • ContrastProtoNet (Metric-based): This approach extends the Prototypical Network by incorporating a Meta Contrastive Loss (MCON). MCON ensures that "in-task" entity embeddings are pulled toward their respective class prototypes while being simultaneously pushed away from both other entity classes and the noisy OTD background.
  • ANIL + Hierarchical Classifier (Gradient-based): This method employs a "Almost No Inner Loop" (ANIL) strategy with a two-step decoding process. A binary classifier first determines if a token is "In-Task" or "Background." If identified as In-Task, a second classifier assigns it to a specific entity category. This separation of concerns helps the model filter out noise before attempting classification.

3. Unsupervised OTD Detector

During inference, the model employs a Mahalanobis distance-based uncertainty score. This allows the system to identify and reject tokens that appear too similar to the background distribution, further enhancing task specificity.

The FewVEX Benchmark

To evaluate their approach, the authors introduced FewVEX (Few-shot Visually-rich Entity eXtraction). Derived from the FUNSD (forms) and CORD (receipts) datasets, FewVEX uses a novel Cross-document Rejection (XDR) sampling algorithm. XDR mimics real-world behavior by generating few-shot tasks with imbalanced entity occurrences, forcing models to prove they can handle realistic data distributions.

Key Results and Insights

The experimental results demonstrate a substantial performance gap between the proposed methods and standard meta-learning baselines:

  • Performance Leap: On the 4-way 4-shot FewVEX(S) task, ContrastProtoNet achieved an F1 score of 0.60, whereas the vanilla ProtoNet baseline struggled at a mere 0.03. This highlights the necessity of task-specific contrastive learning.
  • Robustness to Noise: The models achieved AUROC scores of up to 0.98 for Task Specificity (TS), indicating a near-perfect ability to distinguish between relevant entities and background noise.
  • Embedding Disentanglement: Visual analysis via t-SNE reveals that while standard models cluster background noise and entities together, ContrastProtoNet successfully pushes relevant entities into clean, distinct clusters far removed from the multimodal background.

Conclusion and Future Directions

This research underscores that in the context of VDER, the "background" is a sophisticated adversary. By treating entity retrieval as a personalized, task-aware problem rather than a global classification task, the authors provide a path forward for more flexible and industrial-ready NLP systems.

Future work will look toward scaling these methods to larger datasets and addressing the challenge of overlapping or nested entities (e.g., a city name within a full address). Additionally, the authors suggest exploring the causal relationships within pre-trained models to further refine how spatial and textual features are integrated during the few-shot adaptation process.

Summary updated

BibTeX
@inproceedings{chen2023task,
  author = {Jiayi Chen and Hanjun Dai and Bo Dai and Aidong Zhang and Wei Wei},
  title = {{On Task-personalized Multimodal Few-shot Learning for Visually-rich Document Entity Retrieval}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.findings-emnlp.604},
}
Figure