[Paper Review] ICL-D3IE: In-Context Learning with Diverse Demonstrations Updating for Document Information Extraction
ICL-D3IE is a novel in-context learning framework that enables large language models (LLMs) to perform document information extraction (DIE) by leveraging diverse, iteratively updated demonstrations. It improves performance over fine-tuned models by using hard, layout-aware, and formatting demonstrations, achieving state-of-the-art results on SROIE, FUNSD, and CORD, even surpassing LayoutLMv3 in in-distribution and out-of-distribution settings.
Large language models (LLMs), such as GPT-3 and ChatGPT, have demonstrated remarkable results in various natural language processing (NLP) tasks with in-context learning, which involves inference based on a few demonstration examples. Despite their successes in NLP tasks, no investigation has been conducted to assess the ability of LLMs to perform document information extraction (DIE) using in-context learning. Applying LLMs to DIE poses two challenges: the modality and task gap. To this end, we propose a simple but effective in-context learning framework called ICL-D3IE, which enables LLMs to perform DIE with different types of demonstration examples. Specifically, we extract the most difficult and distinct segments from hard training documents as hard demonstrations for benefiting all test instances. We design demonstrations describing relationships that enable LLMs to understand positional relationships. We introduce formatting demonstrations for easy answer extraction. Additionally, the framework improves diverse demonstrations by updating them iteratively. Our experiments on three widely used benchmark datasets demonstrate that the ICL-D3IE framework enables Davinci-003/ChatGPT to achieve superior performance when compared to previous pre-trained methods fine-tuned with full training in both the in-distribution (ID) setting and in the out-of-distribution (OOD) setting. Code is available at https://github.com/MAEHCM/ICL-D3IE.
Motivation & Objective
- To address the modality and task gap in applying large language models (LLMs) to document information extraction (DIE), where LLMs lack direct access to visual and layout information.
- To improve in-context learning performance for DIE by designing diverse demonstration types that address key challenges: generalization, layout understanding, and answer extractability.
- To iteratively update hard demonstrations using feedback from predictions on training data, enhancing model generalization across test instances.
- To evaluate the framework’s effectiveness in both in-distribution and out-of-distribution settings, demonstrating robustness beyond standard fine-tuning baselines.
Proposed method
- Extract hard demonstrations by identifying the most difficult and distinct segments from training documents that are challenging for LLMs to predict correctly.
- Construct layout-aware demonstrations by prompting LLMs to describe positional relationships between textual content boxes, enhancing spatial reasoning.
- Design formatting demonstrations using randomly selected training segments to guide LLMs to predict labels in a structured, machine-readable format for easy extraction.
- Implement iterative demonstration updating by using the LLM’s own predictions on training data to refine and improve the hard demonstrations over multiple rounds.
- Apply label mapping to convert ambiguous or unnatural entity labels into terms more compatible with LLMs’ training distribution.
- Organize the final prompt with a specific ordering of demonstration types—label mapping, hard, layout-aware, and formatting—to maximize in-context learning effectiveness.
![Figure 1 : Two approaches for solving the DIE task: (a) previous pre-trained document understanding models [ 15 , 42 ] fine-tuned with full training examples, and (b) in-context learning over LLMs with a few examples.](https://ar5iv.labs.arxiv.org/html/2303.05063/assets/x1.png)
Experimental results
Research questions
- RQ1Can in-context learning with diverse, task-specific demonstrations outperform fine-tuned vision-language models in document information extraction?
- RQ2How does the inclusion of layout-aware demonstrations affect LLMs’ ability to understand document structure and improve entity prediction accuracy?
- RQ3What is the impact of iteratively updating hard demonstrations using in-context feedback on model generalization across test instances?
- RQ4How does the ordering of different demonstration types influence in-context learning performance in DIE tasks?
- RQ5Does the ICL-D3IE framework maintain superior performance in out-of-distribution settings compared to fine-tuned models?
Key findings
- ICL-D3IE with Davinci-003 achieved 97.88% F1 on SROIE, outperforming LayoutLMv3 base (96.89%) in the in-distribution setting.
- On CORD, ICL-D3IE (Davinci-003) achieved 95.12% F1, significantly outperforming LayoutLMv3 base (92.45%) and showing strong generalization in out-of-distribution settings.
- The framework consistently outperformed fine-tuned LayoutLMv3 across all demonstration numbers (1 to 12), with a larger margin at lower shot settings.
- Iterative updating of hard demonstrations improved performance, with optimal results observed after 20 iterations, indicating feedback-based refinement enhances generalization.
- M-H-L-F ordering (label mapping, hard, layout-aware, formatting) outperformed M-L-H-F across all datasets, confirming that demonstration ordering is critical for in-context learning success.
- Case studies confirmed that ICL-D3IE accurately described positional relationships and correctly predicted entities (e.g., 'question' vs. 'header'), while standard ICL failed, demonstrating the value of layout-aware and hard demonstrations.

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.