Graph-to-Sequence Learning using Gated Graph Neural Networks

Daniel Beck, Gholamreza Haffari, Trevor Cohn

Abstract

Many NLP applications can be framed as a graph-to-sequence learning problem. Previous work proposing neural architectures on this setting obtained promising results compared to grammar-based approaches but still rely on linearisation heuristics and/or standard recurrent networks to achieve the best performance. In this work, we propose a new model that encodes the full structural information contained in the graph. Our architecture couples the recently proposed Gated Graph Neural Networks with an input transformation that allows nodes and edges to have their own hidden representations, while tackling the parameter explosion problem present in previous work. Experimental results show that our model outperforms strong baselines in generation from AMR graphs and syntax-based neural machine translation.

Introduction

Many natural language processing (NLP) tasks involve structured data, such as Abstract Meaning Representations (AMR) or dependency trees. Traditionally, researchers handle these by "linearizing" the graph—turning it into a string of tokens—so it can be processed by standard sequence-to-sequence (s2s) models like LSTMs.

However, linearization has two major flaws: it discards the explicit hierarchical and relational structure of the graph, and it relies on arbitrary heuristic rules to decide the order of nodes in the string. While Graph Neural Networks (GNNs) can process graphs directly, they often suffer from parameter explosion when dealing with many edge types (like the 100+ predicates in AMR), as standard GNNs assign unique weight matrices to every edge label. This paper introduces a novel graph-to-sequence (g2s) model that uses Gated Graph Neural Networks (GGNNs) to encode the full structural information of input graphs without the need for lossy linearization.

Methodology

The proposed g2s architecture consists of a GGNN encoder and a standard RNN decoder with attention. The model is designed to maintain the integrity of the input graph while remaining computationally efficient.

The overall graph-to-sequence architecture featuring a GGNN encoder and RNN decoder with attention.

The Levi Graph Transformation

To avoid parameter explosion, the authors transform the input graph into a Levi graph. In this setup, every original edge becomes a node itself. For example, a relationship (boy) --ARG0--> (want) becomes (boy) -> [ARG0] -> (want).

The Levi graph transformation turns edges into nodes, allowing the model to handle many edge types without parameter explosion.

This turns the graph into a bipartite structure where all original edge labels are now treated as node embeddings. This transformation is the "secret sauce" of the model: it allows the attention mechanism to explicitly "look" at the relations (now nodes), providing the decoder with more granular information than just looking at the concepts alone.

Enhancements for Flow and Hierarchy

  • Bidirectionality and Self-loops: To ensure information flows effectively across the graph, reverse edges and self-loops are added to the transformed structure.
  • Positional Embeddings: Since the graph becomes essentially undirected after adding reverse edges, the authors add embeddings representing the minimum distance from the root node to preserve the hierarchy.
  • Sequential Edges (g2s+): For translation tasks, they add edges between contiguous words in the source sentence. This allows the graph model to capture word order (sequential bias) without needing a separate BiRNN layer.

Experimental Evaluation

The model was evaluated on two primary tasks:

  1. AMR-to-Text Generation: Using the LDC2017T10 corpus. The g2s model achieved 23.3 BLEU, significantly outperforming the s2s baseline (21.7 BLEU). An ensemble of g2s models reached 27.5 BLEU, setting a new benchmark.
  2. Syntax-based Neural Machine Translation (NMT): English-to-German and English-to-Czech using WMT16 corpora. In English-German, the g2s+ model scored 16.7 BLEU, beating both the s2s baseline (15.5) and a previous BiRNN+GCN hybrid model (16.1).

Key Insights and Discussion

  • Structural Integrity Prevents "Hallucinations": A major finding was that the g2s model significantly reduced overgeneration. Linearized s2s models often repeat phrases because they lose track of which parts of the graph have been visited. The graph encoder maintains a clearer map of the concepts.
  • Unified Architecture: The "g2s+" experiment proved that sequential information is just another type of edge. This suggests that a well-constructed graph can represent both syntax and sequence simultaneously, removing the need for hybrid RNN-GNN architectures.

Limitations

Despite its success, the model has limitations. The GGNN uses a fixed number of message-passing steps (8), which may prevent information from propagating across the entire diameter of very large, sparse graphs. Furthermore, in the Levi transformation, nodes and edges share the same vocabulary and embedding space, which is not ideal as they represent fundamentally different entities.

Conclusion

By coupling GGNNs with the Levi graph transformation, this work provides a robust framework for graph-to-sequence learning. The results demonstrate that preserving structural information leads to more precise and fluent generation in complex NLP tasks like AMR-to-text and syntax-based translation.

Summary updated

BibTeX
@inproceedings{beck2018graph,
  author = {Daniel Beck and Gholamreza Haffari and Trevor Cohn},
  title = {{Graph-to-Sequence Learning using Gated Graph Neural Networks}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2018},
  url = {https://openreview.net/forum?id=rk-lsseu-S},
}
Figure