Abstract
Traditional sequence-to-sequence models often struggle with structured data, such as semantic graphs or syntax trees, because they require flattening the input into a linear string. This paper introduces a novel graph-to-sequence (g2s) architecture that uses Gated Graph Neural Networks (GGNNs) to encode the full structural information of a graph directly. By transforming edges into nodes via a "Levi Graph" representation, the model effectively handles diverse edge types without parameter explosion. The proposed approach achieves state-of-the-art results on Abstract Meaning Representation (AMR)-to-text generation and syntax-based neural machine translation.
Introduction
Many Natural Language Processing (NLP) tasks involve transducing a graph into a sequence. Examples include generating a readable sentence from an Abstract Meaning Representation (AMR) graph or translating a sentence while respecting its dependency tree. Historically, these tasks were handled either through grammar-based methods, which suffer from error propagation in alignments, or through linearization, which flattens the graph into a string. Linearization often discards rich structural information, leading to issues like word repetition (overgeneration) and the loss of long-distance dependencies.
The challenge lies in building an encoder that can "read" the full graph directly while handling a large variety of edge labels without a massive increase in the model's parameter count.
Methods
The core of the proposed architecture is a graph-to-sequence model where the encoder is a Gated Graph Neural Network (GGNN).
The Levi Graph Transformation
Standard GGNNs typically require different weight matrices for every edge type. In datasets like AMR, which contain over 100 different predicates, this leads to a "parameter explosion." To mitigate this, the authors apply the Levi Graph transformation. In this transformation, every labeled edge in the original graph is converted into a new node. The original edge is then replaced by two unlabeled edges connecting the source node to the new "edge-node," and the "edge-node" to the target. This reduces the edge vocabulary to just three types: default, reverse, and self-loop.
Architecture Details
The g2s architecture consists of three main components:
- GGNN Encoder: The encoder performs several rounds of message passing. Due to the Levi transformation, the model generates hidden states for both the original concepts (nodes) and the relationships (edges). To help the model understand hierarchical structures, the authors incorporate positional embeddings based on the distance from the root node.
- Bilinear Attention: A standard 2-layer LSTM decoder uses a bilinear attention mechanism. Crucially, the attention can see the hidden states of both nodes and edges, providing richer context for word generation.
- RNN Decoder: The decoder generates the output sequence word by word, conditioned on the graph's structural representation.
Evaluation and Results
The authors evaluated their model on two primary benchmarks: AMR-to-text generation (LDC2017T10 corpus) and syntax-based Neural Machine Translation (NMT) for English-German and English-Czech (WMT16).
In AMR generation, the g2s model achieved a BLEU score of 23.3 (single model) and 27.5 (ensemble), significantly outperforming linearization baselines. In NMT, the graph-based model reached 16.7 BLEU on English-German translation, beating both standard sequence-to-sequence baselines and previous Graph Convolutional Network (GCN) architectures.
Qualitative analysis shows that the g2s model is much better at tracking which parts of the graph have already been "translated," effectively solving the overgeneration problem common in linearized models.
Discussion
A key insight of this work is treating edges as "first-class citizens." By turning edges into nodes, the decoder's attention mechanism can explicitly look at the relationships between concepts, not just the concepts themselves. Furthermore, the authors demonstrated that GNNs can capture sequential bias if explicitly provided with sequential edges, suggesting they are a more general architecture than RNNs for certain NLP tasks.
Future work may involve exploring dynamic message-passing steps based on graph diameter or using "Weave Module Networks" to further decouple node and edge representations in the semantic space.
Summary updated