# Graph2Seq: Graph to Sequence Learning with Attention-based Neural Networks

arXiv: https://arxiv.org/abs/1804.00823 · HTML: https://mlsanity.com/paper/1804.00823/

## Key facts

- Cited by 37 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 3 Apr 2018.

## Built on by (most cited first, 30 of 37)

- [Retrieval-Augmented Generation with Graphs (GraphRAG)](https://mlsanity.com/paper/2501.00309/) (2024)
- [Retrieval-Augmented Generation for Code Summarization via Hybrid GNN](https://mlsanity.com/paper/2006.05405/) (2020)
- [Permutation invariant graph-to-sequence model for template-free retrosynthesis and reaction prediction](https://mlsanity.com/paper/2110.09681/) (2021)
- [Attention, please! A survey of Neural Attention Models in Deep Learning](https://mlsanity.com/paper/2103.16775/) (2021)
- [TreeBERT: A Tree-Based Pre-Trained Model for Programming Language](https://mlsanity.com/paper/2105.12485/) (2021)
- [A Survey on Graph Diffusion Models: Generative AI in Science for Molecule, Protein and Material](https://mlsanity.com/paper/2304.01565/) (2023)
- [Heterogeneous Global Graph Neural Networks for Personalized Session-based Recommendation](https://mlsanity.com/paper/2107.03813/) (2021)
- [GraphSearchNet: Enhancing GNNs via Capturing Global Dependencies for Semantic Code Search](https://mlsanity.com/paper/2111.02671/) (2021)
- [M2TS: Multi-Scale Multi-Modal Approach Based on Transformer for Source Code Summarization](https://mlsanity.com/paper/2203.09707/) (2022)
- [Forest2Seq: Revitalizing Order Prior for Sequential Indoor Scene Synthesis](https://mlsanity.com/paper/2407.05388/) (2024)
- [Medical Entity Disambiguation Using Graph Neural Networks](https://mlsanity.com/paper/2104.01488/) (2021)
- [TrustGNN: Graph Neural Network based Trust Evaluation via Learnable Propagative and Composable Nature](https://mlsanity.com/paper/2205.12784/) (2022)
- [A Research Agenda for AI Planning in the Field of Flexible Production Systems](https://mlsanity.com/paper/2112.15484/) (2021)
- [HAConvGNN: Hierarchical Attention Based Convolutional Graph Neural Network for Code Documentation Generation in Jupyter Notebooks](https://mlsanity.com/paper/2104.01002/) (2021)
- [Graph-to-SFILES: Control structure prediction from process topologies using generative artificial intelligence](https://mlsanity.com/paper/2412.00508/) (2024)
- [Radflow: A Recurrent, Aggregated, and Decomposable Model for Networks of Time Series](https://mlsanity.com/paper/2102.07289/) (2021)
- [Neural Machine Translation with Dynamic Graph Convolutional Decoder](https://mlsanity.com/paper/2305.17698/) (2023)
- [CATS: A Pragmatic Chinese Answer-to-Sequence Dataset with Large Scale and High Quality](https://mlsanity.com/paper/2306.11477/) (2023)
- [Laziness Is a Virtue When It Comes to Compositionality in Neural Semantic Parsing](https://mlsanity.com/paper/2305.04346/) (2023)
- [Generating Diverse Descriptions from Semantic Graphs](https://mlsanity.com/paper/2108.05659/) (2021)
- [Triples-to-Text Generation with Reinforcement Learning Based Graph-augmented Neural Networks](https://mlsanity.com/paper/2111.10545/) (2021)
- [Scenario-based Multi-product Advertising Copywriting Generation for E-Commerce](https://mlsanity.com/paper/2205.10530/) (2022)
- [Neural Controller Synthesis for Signal Temporal Logic Specifications Using Encoder-Decoder Structured Networks](https://mlsanity.com/paper/2212.05200/) (2022)
- [Semantic Parsing for Question Answering over Knowledge Graphs](https://mlsanity.com/paper/2401.06772/) (2023)
- [Ask Questions with Double Hints: Visual Question Generation with Answer-awareness and Region-reference](https://mlsanity.com/paper/2407.05100/) (2024)
- [GEDAN: Learning the Edit Costs for Graph Edit Distance](https://mlsanity.com/paper/2508.03111/) (2025)
- [BIM-Native Tokenization for Constraint-Aware Room Layout Synthesis](https://mlsanity.com/paper/2512.04832/) (2025)
- [Understanding in Artificial Intelligence](https://mlsanity.com/paper/2101.06573/) (2021)
- [Graph Neural Networks for Natural Language Processing: A Survey](https://mlsanity.com/paper/2106.06090/) (2021)
- [Compositionality-Aware Graph2Seq Learning](https://mlsanity.com/paper/2201.12178/) (2022)

## Abstract (arXiv)

The celebrated Sequence to Sequence learning (Seq2Seq) technique and its numerous variants achieve excellent performance on many tasks. However, many machine learning tasks have inputs naturally represented as graphs; existing Seq2Seq models face a significant challenge in achieving accurate conversion from graph form to the appropriate sequence. To address this challenge, we introduce a novel general end-to-end graph-to-sequence neural encoder-decoder model that maps an input graph to a sequence of vectors and uses an attention-based LSTM method to decode the target sequence from these vectors. Our method first generates the node and graph embeddings using an improved graph-based neural network with a novel aggregation strategy to incorporate edge direction information in the node embeddings. We further introduce an attention mechanism that aligns node embeddings and the decoding sequence to better cope with large graphs. Experimental results on bAbI, Shortest Path, and Natural Language Generation tasks demonstrate that our model achieves state-of-the-art performance and significantly outperforms existing graph neural networks, Seq2Seq, and Tree2Seq models; using the proposed bi-directional node embedding aggregation strategy, the model can converge rapidly to the optimal performance.
