[Paper Review] Layout and Task Aware Instruction Prompt for Zero-shot Document Image Question Answering
This paper proposes LATIN-Prompt, a zero-shot document image question answering method that uses spaces and line breaks to encode layout information from OCR outputs, enabling instruction-tuned models like Claude and ChatGPT to understand document layout without fine-tuning. It achieves zero-shot performance comparable to fine-tuned SOTA models, with a 263% improvement on DocVQA for Claude and 87.7% for Alpaca using LATIN-Tuning.
Layout-aware pre-trained models has achieved significant progress on document image question answering. They introduce extra learnable modules into existing language models to capture layout information within document images from text bounding box coordinates obtained by OCR tools. However, extra modules necessitate pre-training on extensive document images. This prevents these methods from directly utilizing off-the-shelf instruction-tuning language foundation models, which have recently shown promising potential in zero-shot learning. Instead, in this paper, we find that instruction-tuning language models like Claude and ChatGPT can understand layout by spaces and line breaks. Based on this observation, we propose the LAyout and Task aware Instruction Prompt (LATIN-Prompt), which consists of layout-aware document content and task-aware instruction. Specifically, the former uses appropriate spaces and line breaks to recover the layout information among text segments obtained by OCR tools, and the latter ensures that generated answers adhere to formatting requirements. Moreover, we propose the LAyout and Task aware Instruction Tuning (LATIN-Tuning) to improve the performance of small instruction-tuning models like Alpaca. Experimental results show that LATIN-Prompt enables zero-shot performance of Claude and ChatGPT to be comparable to the fine-tuning performance of SOTAs on document image question answering, and LATIN-Tuning enhances the zero-shot performance of Alpaca significantly. For example, LATIN-Prompt improves the performance of Claude and ChatGPT on DocVQA by 263% and 20% respectively. LATIN-Tuning improves the performance of Alpaca on DocVQA by 87.7%. Quantitative and qualitative analyses demonstrate the effectiveness of LATIN-Prompt and LATIN-Tuning. We provide the code in supplementary and will release it to facilitate future research.
Motivation & Objective
- To enable zero-shot document image question answering using off-the-shelf instruction-tuned language models without fine-tuning.
- To address the limitation of existing layout-aware models that require extensive pre-training on document images.
- To explore whether instruction-tuned models can understand layout through whitespace (spaces and line breaks) instead of coordinate-based embeddings.
- To improve small instruction-tuned models like Alpaca in layout comprehension through targeted instruction tuning.
- To develop a method that is compatible with closed-source and large-scale open-source LLMs, avoiding costly pre-training.
Proposed method
- LATIN-Prompt constructs layout-aware document content by inserting appropriate spaces and line breaks between OCR-extracted text segments to encode spatial layout.
- It integrates a task-aware instruction prompt to guide the model to generate answers in required formats, such as span or list.
- The method leverages the inherent ability of instruction-tuned models like Claude and ChatGPT to interpret layout from whitespace, eliminating the need for coordinate-based modules.
- LATIN-Tuning is introduced to enhance small instruction-tuned models like Alpaca by creating synthetic instruction-tuning data from CSV tables converted into space- and line-break-encoded strings.
- The approach is orthogonal to visual input use, and the authors validate it on DocVQA, InfographicVQA, and MP-DocVQA.
- The method is evaluated via ablation studies and case analyses to demonstrate the contribution of layout and task components.
Experimental results
Research questions
- RQ1Can instruction-tuned language models like Claude and ChatGPT understand document layout solely through spaces and line breaks?
- RQ2Can a prompt-based method using whitespace encoding achieve zero-shot performance comparable to fine-tuned SOTA models in document image question answering?
- RQ3How effective is LATIN-Tuning in improving layout comprehension for small instruction-tuned models like Alpaca?
- RQ4What is the relative contribution of layout-aware content and task-aware instruction in the overall performance of LATIN-Prompt?
- RQ5Does the size and capability of the underlying LLM correlate with zero-shot performance in this setup?
Key findings
- LATIN-Prompt enables Claude’s zero-shot performance on DocVQA to improve by 263% compared to plain prompt, reaching performance comparable to fine-tuned SOTA models.
- ChatGPT’s zero-shot performance on DocVQA improves by 20% with LATIN-Prompt, also matching fine-tuned SOTA levels.
- LATIN-Tuning enhances Alpaca’s zero-shot performance on DocVQA by 87.7%, significantly improving its layout comprehension ability.
- Ablation studies confirm that both layout-aware content and task-aware instruction are essential, with task instruction contributing more to Claude’s performance.
- The method outperforms fine-tuned baselines like Longformer and Big Bird on MP-DocVQA, and exceeds most fine-tuned models on InfographicVQA except TILT.
- Performance of LATIN-Tuning improves with more instruction-tuning data, though gains plateau beyond 2000 samples.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.