InstructDoc: A Dataset for Zero-Shot Generalization of Visual Document Understanding with Instructions

Ryota Tanaka, Taichi Iki, Kyosuke Nishida, Kuniko Saito, Jun Suzuki

Introduction

Visual Document Understanding (VDU) represents a critical frontier in artificial intelligence, requiring models to interpret complex intersections of text, layout, and visual cues. While Multimodal Large Language Models (MLLMs) like LLaVA and GPT-4V have demonstrated remarkable capabilities in natural scene understanding, they frequently struggle with the structural nuances of documents, such as invoices, scientific papers, and slide decks. These documents demand "spatial literacy"—the ability to correlate fine-grained text with its specific location and role within a layout.

To address these challenges, researchers have introduced InstructDoc, a large-scale instruction-tuning dataset specifically designed for VDU, and InstructDr, a specialized model architecture designed to bridge the gap between vision and language in text-rich environments. By training on diverse, human-written instructions, InstructDr achieves state-of-the-art zero-shot performance, surpassing general-purpose models in complex document reasoning tasks.

The InstructDoc Dataset

The core contribution of this work is the InstructDoc dataset, which unifies 30 publicly available VDU datasets into a single, instruction-based framework. This collection spans 12 distinct task clusters, including Key Information Extraction (KIE), Document Question Answering (DocVQA), and multi-page reasoning.

Crucially, InstructDoc utilizes a unified instruction schema that provides the model with two vital pieces of information:

  1. Intent: A clear description of the user's goal (e.g., "Extract the total amount from this invoice").
  2. Answer Style: A specification of the expected output format (e.g., "Provide a short span from the text" or "Generate a natural language sentence").

By categorizing datasets into 23 "held-in" sets for training and 7 "held-out" sets for testing, the researchers established a rigorous benchmark for zero-shot generalization—evaluating how well a model can perform tasks it has never explicitly seen during training.

The InstructDr Architecture

To effectively process the InstructDoc dataset, the authors developed InstructDr. Built upon the BLIP-2 architecture, the model introduces a novel component called the Document-former. This module serves as a trainable bridge that fuses three distinct modalities into a unified representation:

  • Visual Features: Extracted via a CLIP vision encoder to capture the overall look and feel of the document.
  • Textual Tokens: Extracted via Optical Character Recognition (OCR) to provide the literal content.
  • Spatial Coordinates: Bounding box data for every text segment, allowing the model to understand the physical relationship between elements (e.g., a header and its corresponding table row).

The Document-former converts these inputs into "document embeddings" that are then processed by a Large Language Model (FlanT5). Additionally, the architecture is designed for multi-page document processing, using mean-pooling across page embeddings to maintain context over long documents.

Key Insights and Results

The research yielded several significant findings regarding the nature of document understanding:

1. The Importance of Answer Styles

One of the most striking results was that specifying the "answer style" is as critical as the task instruction itself. This guidance allows the model to dynamically switch between extractive modes (finding specific data points) and generative modes (summarizing or reasoning), significantly reducing errors in output formatting.

2. Spatial Awareness as a Necessity

The integration of spatial features within the Document-former proved essential. Without explicit knowledge of text locations, models often fail to interpret structured data like tables or charts where the meaning is derived from the layout rather than just the sequence of words.

3. Zero-Shot Performance

InstructDr demonstrated exceptional zero-shot capabilities. On held-out datasets, it achieved an average score of 43.0, significantly outperforming its backbone BLIP-2 (35.7) and even ChatGPT (29.2), which lacks native visual grounding. Furthermore, on complex reasoning tasks like DUDE (multi-page QA) and SlideVQA, InstructDr delivered results competitive with or superior to GPT-4.

4. Robustness

InstructDr showed lower performance variance when presented with different phrasings of the same instruction compared to other MLLMs. This suggests that the model is learning the underlying logic of document tasks rather than simply overfitting to specific linguistic patterns.

Limitations and Future Directions

Despite its successes, InstructDr faces certain limitations. The model is heavily dependent on the quality of external OCR engines; errors in text extraction directly impact downstream performance. Additionally, while the model excels at following instructions, it currently lacks the capacity for complex, multi-turn "in-context learning" where a user provides examples within the prompt.

Future work will focus on increasing the diversity of instructions—potentially using LLMs to generate a wider array of prompts—and reducing the dependency on external OCR to create a more end-to-end document understanding system.

Summary updated

BibTeX
@inproceedings{tanaka2024instructdoc,
  author = {Ryota Tanaka and Taichi Iki and Kyosuke Nishida and Kuniko Saito and Jun Suzuki},
  title = {{InstructDoc: A Dataset for Zero-Shot Generalization of Visual Document Understanding with Instructions}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i17.29874},
}
Figure