Unifying Structured Data as Graph for Data-to-Text Pre-Training

Shujie Li, Liang Li, Ruiying Geng, Min Yang, Binhua Li, Guanghu Yuan, Wanwei He, Shao Yuan, Can Ma, Fei Huang, Yongbin Li · DOI

Introduction

Data-to-text (D2T) generation is the task of converting structured, machine-readable data—such as spreadsheets, databases, or knowledge graphs—into natural, human-readable language. Despite the advancements in Large Language Models (LLMs), two significant challenges persist in the D2T field. First, structural silos force models to be specialized; a model optimized for summarizing tables often fails when applied to knowledge graphs. Second, the flattening problem occurs when models linearize structured data into a simple string, destroying the spatial and relational context essential for accurate interpretation.

To address these issues, we introduce UniD2T, a unified framework that treats diverse structured data formats as a single graph representation. By utilizing a structure-aware Transformer architecture, UniD2T preserves the underlying connections of the data, leading to state-of-the-art performance and a significant reduction in factual hallucinations.

Methodology

Unified Graph Representation

UniD2T bridges the gap between different data formats by converting tables, knowledge graphs (KGs), and key-value pairs into a unified graph format.

  • Tables: Cells within the same row or column are connected to maintain tabular relationships.
  • Knowledge Graphs: The model employs a Levi graph transformation. This approach treats relationships (edges) as nodes themselves, enabling the model to represent complex multi-node interactions effectively.

Structure-Enhanced Transformer

Built upon the T5 (Text-to-Text Transfer Transformer) architecture, UniD2T introduces two critical modifications to the encoder to make it "structure-aware":

  1. Relative Position Matrix: Instead of standard sequential indexing, UniD2T uses a matrix that calculates the relative distance between nodes within the graph. If two nodes are not connected, their distance is treated as effectively infinite, preventing the model from assuming false relationships.
  2. Connectivity-Aware Attention: Standard Transformers use a global attention mechanism where every token attends to every other token. UniD2T replaces this with a masked attention mechanism where nodes primarily attend to their direct neighbors. To maintain a global perspective, the model includes special "global prefix" tokens that act as a summary of the entire input, allowing nodes to access broader context without the noise of unrelated data points.

Pre-training Objectives

The model underwent pre-training on PREDATA, a massive collection of 4.9 million pairs derived from Wikipedia tables (TAPAS) and Wikidata subgraphs (KGTEXT). Two primary objectives were used:

  • Struct Denoising: Predicting missing nodes in a corrupted graph to learn structural integrity.
  • Graph-to-Text Generation: Standard generative training to align graph structures with natural language.

Experimental Results

UniD2T was evaluated across six major benchmarks covering table-to-text, graph-to-text, and key-value-to-text tasks. It consistently outperformed strong baselines, including T5-Large, BART, and specialized models like TABT5.

Performance Highlights

  • CoSQL: UniD2T achieved a significant performance leap, increasing BLEU scores by 7.03 points and ROUGE-L by 3.58 points over the previous state-of-the-art model, FALCON.
  • DART: The model surpassed the "CONTROL PREFIXES" model by 3.0% BLEU.
  • Few-Shot Learning: On the E2ENLG dataset, UniD2T demonstrated remarkable efficiency, significantly outperforming competitors when trained on as little as 0.1% of the available data.

Factual Consistency and Scalability

Human evaluations revealed that UniD2T is substantially more accurate and less prone to hallucinations than zero-shot ChatGPT or standard T5 models. It excels at capturing specific facts, such as identifying the correct attributes in a large list. Furthermore, the model's advantage increases as the input data grows more complex; while linear models degrade with larger tables or more triples, UniD2T’s attention mechanism filters out noise, maintaining high performance even with large-scale graphs.

Discussion and Insights

Several key insights emerged from the development of UniD2T:

  • Structure as a Stabilizer: The graph-based approach provides a stabilizing effect for complex data, preventing the "nearsightedness" or confusion common in linearized models.
  • Bidirectional Flexibility: The researchers found that undirected (bidirectional) edges in the graph representation outperformed strictly directed ones, suggesting that learning mutual relationships is more beneficial for general pre-training.
  • Global Memory via Prefixes: The use of prefix tokens allows the model to maintain a global context while keeping the core attention localized to the graph structure, balancing detail with overview.

Conclusion and Future Work

UniD2T demonstrates that unifying structured data as a graph is a highly effective strategy for data-to-text generation. While the model sets new benchmarks, future work will focus on increasing the diversity of pre-training data beyond TAPAS and KGTEXT. Additionally, the team plans to explore more advanced graph construction strategies that move beyond simple row/column heuristics to capture even deeper semantic relationships within the data.

Summary updated

BibTeX
@article{li2024unifying,
  author = {Shujie Li and Liang Li and Ruiying Geng and Min Yang and Binhua Li and Guanghu Yuan and Wanwei He and Shao Yuan and Can Ma and Fei Huang and Yongbin Li},
  title = {{Unifying Structured Data as Graph for Data-to-Text Pre-Training}},
  journal = {Trans. Assoc. Comput. Linguistics},
  year = {2024},
  doi = {10.1162/tacl\_a\_00641},
}
Figure