Struc-Bench: Are Large Language Models Good at Generating Complex Structured Tabular Data?

Xiangru Tang, Yiming Zong, Jason Phang, Yilun Zhao, Wangchunshu Zhou, Arman Cohan, Mark Gerstein

Introduction

While Large Language Models (LLMs) have demonstrated remarkable proficiency in natural language understanding and conversational prose, their ability to generate complex structured data remains a significant hurdle. Tasks requiring strict adherence to hierarchical syntaxes—such as LaTeX or HTML tables—often result in structural failures where a single missing tag or delimiter renders the entire output useless. This paper introduces STRUC-BENCH, a comprehensive benchmark and evaluation suite designed to probe the structural limits of LLMs, alongside a novel fine-tuning methodology called FORMATCOT.

The Structural Gap in LLMs

The authors identify three primary deficiencies in the current landscape of structured data generation:

  1. The Benchmark Gap: Existing evaluations often focus on simple Information Extraction (IE) rather than the generation of complex, multi-row, and multi-column tables.
  2. The Metric Gap: Traditional linguistic metrics like ROUGE or BLEU are "structure-blind." They prioritize word overlap over structural integrity, failing to penalize models for tables that do not render correctly.
  3. The Performance Gap: Even state-of-the-art models like GPT-4 exhibit high error rates when converting raw text into complex formats, frequently suffering from "Structure Errors" (missing rows/columns) or "Element Format Errors" (incorrect units or symbols).

Methodology: FORMATCOT and Instruction Tuning

To bridge these gaps, the researchers developed a three-pronged approach centered on making structural requirements explicit rather than implicit.

FORMATCOT (Format Chain-of-Thought)

The core innovation is FORMATCOT, a "self-instruct" method that enriches training data. Instead of training a model on simple {text, table} pairs, the researchers utilized GPT-3.5 to generate detailed natural language "blueprints." These blueprints describe the target table's format—for instance, specifying the number of columns, the use of bold headers, and the inclusion of specific borderlines. By training on these intermediate reasoning steps, the model learns to "think" about the structure before populating it with data.

Specialized Instruction Tuning

Using these enriched instructions, the authors fine-tuned a LLaMA-7B model (referred to as "Ours-7B"). This specialized model is explicitly taught to recognize and execute structural requirements, transforming it into a format-aware generator.

New Evaluation Metrics

Recognizing the inadequacy of standard metrics, the paper introduces:

  • P-Score (Prompting Score): An LLM-based evaluation where GPT-3.5 acts as a judge, separately scoring content accuracy and structural integrity on a 1-10 scale.
  • H-Score (Heuristical Score): An algorithmic approach that calculates similarity based on Levenshtein distance and hard-coded structural checks, such as matching row and column counts.

The STRUC-BENCH Dataset

The STRUC-BENCH benchmark consists of 3.4k training instances and 1.7k test instances, drawing from two primary sources:

  • RotoWire: A table-to-text dataset of NBA statistics, reversed for text-to-table tasks.
  • The Stack: A collection of source code from which complex HTML and LaTeX table examples were extracted.

Key Findings: Specialization vs. Scale

The results from STRUC-BENCH reveal a surprising disparity between general-purpose "giant" models and specialized smaller models.

  • GPT-4's Struggles: Despite its general capabilities, GPT-4 produced fully accurate complex tables only 9% of the time. GPT-3.5 performed even worse, with a 3% accuracy rate.
  • The Power of Blueprints: The success of FORMATCOT indicates that LLMs struggle with structure because it is typically implicit in training data. By providing explicit natural language instructions, the 7B-parameter model was able to manage complexities that baffled much larger models.
  • Performance Metrics: "Ours-7B" achieved a 90.6 SacreBLEU score on raw text tables, significantly outperforming GPT-4’s 68.13. On the P-Score for formatting adherence, the fine-tuned model scored 8.60, surpassing GPT-4’s 8.30.
  • Ablation Results: Without FORMATCOT, the LLaMA model’s performance plummeted (e.g., SacreBLEU dropped from 90.6 to 9.9), confirming that format-aware instructions are the critical component of its success.

Limitations and Future Directions

While STRUC-BENCH and FORMATCOT represent a significant step forward, several challenges remain:

  • Numerical Reasoning: Models still struggle with tasks requiring mathematical comprehension, such as calculating totals from individual rows.
  • Format Optimization: The study did not determine which specific format (HTML, LaTeX, or Markdown) is inherently most "learnable" for LLMs.
  • Multimodality: Future work could expand the scope from text-to-table to generating tables from images or audio.
  • Domain Specificity: There is a need for specialized benchmarks in fields like medicine or law, where table conventions are highly specialized.

Conclusion

STRUC-BENCH demonstrates that for complex structural tasks, targeted fine-tuning and explicit formatting instructions are more effective than simply increasing model scale. By teaching LLMs the "art of the table" through FORMATCOT, researchers can achieve state-of-the-art performance in structured data generation using relatively small, efficient models.

Summary updated

BibTeX
@inproceedings{tang2024struc,
  author = {Xiangru Tang and Yiming Zong and Jason Phang and Yilun Zhao and Wangchunshu Zhou and Arman Cohan and Mark Gerstein},
  title = {{Struc-Bench: Are Large Language Models Good at Generating Complex Structured Tabular Data?}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.naacl-short.2},
}
Figure