Schema-Driven Information Extraction from Heterogeneous Tables

Fan Bai, Junmo Kang, Gabriel Stanovsky, Dayne Freitag, Mark Dredze, Alan Ritter

Introduction

Vast amounts of scientific and experimental data remain "locked" within tables in PDFs and webpages. These tables are designed for human readability rather than machine processing, and their layouts vary significantly—ranging from LaTeX-formatted result tables in AI research papers to XML-based chemical property lists. Traditionally, extracting this data required building custom pipelines for every new domain or table format, a process that demands extensive manually labeled data.

To address this, researchers have developed INSTRUCTE, a method that leverages Large Language Models (LLMs) to extract structured data from complex, heterogeneous tables using only a human-authored JSON schema. This approach moves away from task-specific training, instead utilizing the general reasoning and code-understanding capabilities of LLMs to create a "universal" extractor.

The INSTRUCTE Framework

The core of the proposed approach is Schema-Driven Information Extraction (IE). Instead of training a model to identify specific entities like "Model Name" or "F1 Score," the system provides the LLM with the table's source code and a JSON schema—a template defining the target attributes and their types.

Overview of the schema-driven extraction process, showing the transformation from a raw table to a structured JSON record based on a defined schema.

The INSTRUCTE system consists of two primary components:

  1. Prompt Formulation: A structured prompt is constructed containing the input table (in its raw code format), supplementary context retrieved via BM25, the extraction schema, and specific task instructions.
  2. Iterative Error Recovery: LLMs often struggle with long sequences, potentially losing their place in a complex table or skipping cells. INSTRUCTE monitors the model's output against a rule-based cell detector. If the model deviates from the intended traversal order (e.g., left-to-right, top-to-bottom), the system truncates the output at the point of error and re-prompts the model to continue from the correct cell.
Detailed view of the prompt formulation and the iterative error recovery mechanism used to ensure consistent and accurate extraction.

Benchmarking and Datasets

To evaluate the system, the authors created the SCHEMA-TO-JSON benchmark, which covers four distinct domains and formats:

  • arXiv Machine Learning: LaTeX tables from recent AI papers.
  • PubMed Chemistry: XML tables describing chemical physical properties.
  • DisCoMAT: CSV tables regarding glass composition in materials science.
  • SWDE: HTML webpages from various verticals like "Auto," "Book," and "Movie."

Key Insights

The research yielded several critical insights into the behavior of LLMs for table extraction:

  • Code Models Excel: Models pre-trained on code (such as code-davinci-002) significantly outperform general chat models. This is likely because the task of converting table markup to JSON closely resembles standard programming tasks.
  • The Distraction of Captions: Surprisingly, including table captions sometimes decreased performance. Vague or low-quality captions confused the models, whereas manually improving caption specificity restored performance.
  • Scaffolding via Error Recovery: The iterative error recovery mechanism does more than just fix mistakes; it acts as a scaffold that helps the model adhere to the structured output format over long, complex tables.
  • Viability of Distillation: High performance does not require permanent reliance on massive API-based models. A smaller, open-source model (like T5-11B) can be trained using synthetic data generated by a larger "teacher" model (GPT-4), matching its performance at a significantly lower operational cost.

Results and Performance

In zero-shot settings, GPT-4 and code-davinci-002 achieved F1 scores between 74.2 and 96.1 across the benchmark. Notably, on the task of extracting ML leaderboards, a hybrid version of the system (INSTRUCTE+) outperformed AxCell, the previous state-of-the-art supervised pipeline, despite AxCell being specifically engineered for that single task. Furthermore, the error recovery strategy achieved performance levels similar to cell-by-cell prompting but at approximately 1/7th of the API cost.

Limitations and Future Directions

While powerful, INSTRUCTE remains sensitive to prompt phrasing; minor changes in attribute names can lead to varying results. The model also occasionally struggles with "edge cases" where data spans multiple cells or is implied by context rather than explicitly stated. Future work will explore automatic prompt optimization to reduce human effort in schema design and the use of multi-modal models to handle table images directly, bypassing the need for intermediate LaTeX or HTML representations.

Summary updated

BibTeX
@inproceedings{bai2024schema,
  author = {Fan Bai and Junmo Kang and Gabriel Stanovsky and Dayne Freitag and Mark Dredze and Alan Ritter},
  title = {{Schema-Driven Information Extraction from Heterogeneous Tables}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.findings-emnlp.600},
}
Figure