TL;DR
This paper introduces a multi-domain transfer learning approach to extract information from form-like documents (like invoices and paystubs) using very little labeled data. By leveraging a shared "visual design language" across different document types and languages, the authors achieve up to a 35 F1 point improvement over training from scratch when only 50 labeled documents are available.
What Problem Does This Paper Address?
Automating data extraction from forms is a massive bottleneck in industries like finance and healthcare. The core challenge is the "infinite layout" problem: every vendor has their own way of arranging information on a page. Traditional NLP struggles because it ignores spatial cues, and while multi-modal models (combining text and vision) exist, they are typically "data-hungry" and computationally expensive to train.
The authors identify a critical gap: how do we scale these systems to hundreds of document types and languages without needing thousands of manually labeled examples for every single one? They aim for data efficiency—getting high-quality extraction results with orders of magnitude less human labeling.
Methods
The researchers build upon Glean, an information extraction system that factors the problem into three distinct stages:
- Candidate Generation: Using standard entity extraction libraries (like Google’s Knowledge Graph API), the system identifies all possible text spans that could be a target field (e.g., finding all dates on an invoice).
- ML-based Scoring: This is the heart of the paper. The model learns dense representations (embeddings) for both the extraction candidates and the target fields in a shared latent space. A candidate is scored based on its similarity to the field embedding. Crucially, the candidate's features are its spatial neighborhood—the words around it and their relative positions—rather than the value itself.
- Assignment: The highest-scoring candidate for each field is selected, potentially guided by document-specific business logic.
The novel contribution is a multi-domain transfer learning strategy. Instead of just training on one document type and fine-tuning on another, they:
- Combine candidates from both source (e.g., English Invoices) and target (e.g., French Invoices) domains during initial training.
- Use a common vocabulary across both domains.
- Fine-tune the entire stack on the small target dataset.
Datasets
The study uses four proprietary datasets from Google, ensuring that no two documents in a corpus share the same template to test true generalization:
- English Invoices: 20k documents (Source domain).
- French Invoices: 5k for training, 400 for testing (Target domain for language transfer).
- Paystubs: 10k for training, 1.5k for testing (Target domain for structural transfer).
Key Insights and Ideas
- Shared Visual Language: The authors postulate that all form-like documents share a common "visual design language." A date on a paystub relates to its neighbors (like the word "Date:" or a nearby table header) in a way very similar to a date on an invoice.
- Spatial Context is King: By focusing on the neighborhood of a candidate rather than its specific value, the model learns domain-agnostic spatial relationships that transfer across languages and document types.
- Vocabulary Matters: Using a common vocabulary during the multi-domain training phase prevents the model from becoming too specialized to the source domain's specific terminology, making the learned representations more generalizable.
- Compute Efficiency: Unlike heavy pre-trained models like BERTGrid, which can take 18 hours to converge, this approach trains in about 45 minutes and fine-tunes in just a few minutes on a single GPU.
Key Results
The multi-domain transfer learning approach significantly outperformed both training from scratch and simple transfer learning, especially in "low-data regimes":
- New Document Type (English Invoices $\rightarrow$ Paystubs): With only 50 labeled documents, the proposed method improved the F1 score by 35 points over training from scratch and 8 points over simple transfer learning.
- New Language (English Invoices $\rightarrow$ French Invoices): With only 10 labeled documents, it yielded a 23 F1 point improvement over the scratch baseline.
- Scaling: The performance gap is most dramatic when data is scarce (10–100 documents). As the number of labeled documents approaches 1,000, the baselines begin to catch up, but the proposed method remains superior or competitive.
Limitations and Future Work
- Proprietary Data: The results are based on internal Google datasets, which makes direct replication by outside researchers difficult.
- Candidate Bottleneck: The system's recall is capped by the initial candidate generators. If the entity detector fails to find a date, the ML scorer never sees it.
- The "100 Document" Goal: While the results at 50 documents are impressive, the authors note that the next big challenge is to consistently reach production-grade performance with only ~100 labeled examples for any new document type.
Summary updated