JointGT: Graph-Text Joint Representation Learning for Text Generation from Knowledge Graphs

Pei Ke, Haozhe Ji, Yu Ran, Xin Cui, Liwei Wang, Linfeng Song, Xiaoyan Zhu, Minlie Huang

JointGT is a novel pre-training framework designed to bridge the gap between structured knowledge graphs (KGs) and natural language. By introducing a structure-aware Transformer module and three specialized pre-training tasks—including a sophisticated alignment technique based on Optimal Transport—it achieves state-of-the-art performance in generating high-quality, faithful text from complex graph data.

The Challenge of Graph-to-Text Generation

Knowledge Graph-to-text (KG-to-text) generation involves transforming structured data (e.g., triples like "London -> capital of -> UK") into coherent natural language sentences. While large-scale pre-trained models like BART and T5 excel at general text generation, they face two significant hurdles when applied to KGs:

  1. Structural Information Loss: Standard models typically "linearize" graphs into flat strings, discarding the inherent topology and treating complex webs of connections as simple lists.
  2. Lack of Explicit Alignment: Conventional pre-training focuses on word-to-word prediction. Models often fail to learn the precise correspondence between specific graph entities or relations and their natural language counterparts, leading to "hallucinations" or factual omissions in the generated text.

The JointGT Framework

JointGT addresses these issues by building upon encoder-decoder architectures with two primary innovations: structure-aware aggregation and multi-task pre-training.

Structure-Aware Semantic Aggregation

To preserve graph topology, JointGT integrates a new structure-aware module into every Transformer layer. This module employs a pooling layer to extract representations for entities and relations, followed by a structure-aware attention mechanism that updates these representations based on their actual neighbors in the graph. This ensures that the model maintains a structural "memory" of the graph's shape throughout the encoding process.

Architecture of the Structure-Aware Semantic Aggregation module, showing the pooling and structure-aware self-attention layers.

Specialized Pre-training Tasks

The model is pre-trained on KGTEXT, a massive dataset of 7 million graph-text pairs, using three distinct tasks designed to unify the representation space of graphs and text:

  • Graph-Enhanced Text Reconstruction: The model reconstructs a corrupted sentence using information from a complete graph.
  • Text-Enhanced Graph Reconstruction: The model recovers missing entities or relations in a corrupted graph using a complete sentence.
  • Graph-Text Embedding Alignment: Utilizing Optimal Transport (OT), the model calculates the "cost" of mapping graph representations to text representations in a continuous embedding space. By minimizing this cost, the model learns a shared latent "language" for both data types.
Overview of the three pre-training tasks: (a) Graph-Enhanced Text Reconstruction, (b) Text-Enhanced Graph Reconstruction, and (c) Graph-Text Embedding Alignment.

Key Results and Insights

JointGT achieved new state-of-the-art results across several major benchmarks, including WebNLG (v2.0), WebQuestions, and PathQuestions. Key findings include:

  • Superior Performance: On the WebNLG "Constrained" split, JointGT (T5) achieved a 61.01 BLEU score, significantly outperforming vanilla T5 (58.66) and previous specialized models.
  • Few-Shot Robustness: When trained on only 0.5% of the WebNLG data, JointGT maintained a BLEU score of 37.18, while vanilla BART dropped to 33.92. This demonstrates that joint pre-training creates a much more robust starting point for low-resource scenarios.
  • Dynamic Representations: Unlike previous models that used fixed embeddings for entities, JointGT learns entity representations dynamically. This allows it to generalize much better to new, unseen entities during fine-tuning.
  • Complexity Handling: Ablation studies showed that the structure-aware module becomes increasingly helpful as the input graph grows more complex (e.g., moving from 3 triples to 7 triples).

Conclusion

JointGT successfully bridges the gap between structured data and natural language through its structure-aware architecture and cross-modal alignment. While the pre-training process is computationally intensive, the resulting model offers a robust foundation for high-fidelity text generation from complex knowledge graphs, significantly reducing hallucinations and improving factual adequacy.

Summary updated

BibTeX
@inproceedings{ke2021jointgt,
  author = {Pei Ke and Haozhe Ji and Yu Ran and Xin Cui and Liwei Wang and Linfeng Song and Xiaoyan Zhu and Minlie Huang},
  title = {{JointGT: Graph-Text Joint Representation Learning for Text Generation from Knowledge Graphs}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  doi = {10.18653/v1/2021.findings-acl.223},
}
Figure