NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

LMDX: Language Model-based Document Information Extraction and Localization

Vincent Perot, Kai Kang, Florian Luisier, Guolong Su, Xiaoyu Sun, Ramya Sree Boppana, Zilong Wang, Zifeng Wang, Jiaqi Mu, Hao Zhang, Chen-Yu Lee, Nan Hua

Introduction

Visually Rich Documents (VRDs), such as invoices, forms, and receipts, present a unique challenge for automated information extraction. Unlike plain text, the semantic meaning in VRDs is often inextricably linked to spatial layout. Traditional Large Language Models (LLMs) excel at general text processing but often struggle to maintain the spatial relationships necessary for complex tasks like tabular data extraction or hierarchical line-item parsing. LMDX (Language Model-based Document Information EXtraction and Localization) addresses this by enabling LLMs to both extract and precisely locate information within these documents using a text-based coordinate system.

The LMDX Framework

LMDX introduces a robust four-stage pipeline designed to leverage the generative power of LLMs while grounding their outputs in the physical layout of the document without requiring complex vision-language architectures.

The LMDX methodology pipeline: from raw document to final localized extraction.
  1. Chunking: Large documents are partitioned into page-level segments to fit within the model's context window.
  2. Prompt Generation: The core innovation involves suffixing text segments with normalized coordinate tokens (e.g., Apple Store 38|05). This allows the layout modality to be communicated directly through the standard text interface.
  3. LLM Inference: Utilizing models like PaLM 2-S or Gemini Pro, the system generates multiple completions to facilitate error correction via majority voting.
  4. Decoding & Grounding: The model is prompted to output structured JSON containing these coordinate tokens. A specialized decoding algorithm uses these tokens as anchors to map extracted text back to the original document coordinates, effectively mitigating generative hallucinations common in standard LLMs.

Empirical Evaluation

The framework was evaluated on several rigorous benchmarks, including the Visually Rich Document Understanding (VRDU) suite—comprising Registration and Ad-buy forms—and the Consolidated Receipt Dataset (CORD). These datasets test the model's ability to handle complex hierarchies, fine-grained entity types, and varied document layouts.

Key Results and Insights

LMDX demonstrates state-of-the-art (SOTA) performance, particularly in data-constrained environments where traditional models often fail.

Quantitative results on the VRDU benchmark across different data regimes.
  • Zero-Shot and Low-Data Efficiency: LMDX significantly outperforms larger vision-language models like GPT-4V and Gemini Pro Vision in zero-shot settings. Its sample efficiency is notable; with as few as 10 training examples, it often surpasses specialized models trained on significantly larger datasets.
  • Hierarchical Extraction: On the VRDU Ad-buy task, LMDX achieved a Line Item F1 score of 72.09 with 200 documents, nearly tripling the performance of the LayoutLMv2 baseline (25.46). This highlights the strength of using JSON as an output format for nested data.
  • Localization Precision: The system achieves 98-99% localization accuracy in fine-tuned settings. By using coordinates as anchors, the model ensures that extracted entities are physically present at the specified locations on the page.

Conclusion and Future Directions

LMDX proves that simple coordinate tokens can effectively bridge the gap between text-based LLMs and visually rich document understanding. While the system currently faces limitations regarding OCR dependence and line-level granularity, it offers a highly efficient and performant alternative to specialized vision-language models. Future research will focus on achieving character-level precision and developing more efficient coordinate encoding strategies to reduce token overhead.

Summary updated

BibTeX
@inproceedings{perot2024lmdx,
  author = {Vincent Perot and Kai Kang and Florian Luisier and Guolong Su and Xiaoyu Sun and Ramya Sree Boppana and Zilong Wang and Zifeng Wang and Jiaqi Mu and Hao Zhang and Chen-Yu Lee and Nan Hua},
  title = {{LMDX: Language Model-based Document Information Extraction and Localization}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-acl.899},
}
Figure