TL;DR
The paper introduces GA-S2S (Graph-Augmented Sequence-to-Sequence), a hybrid framework that combines the text-generation capabilities of a T5 transformer with the structural awareness of a Relational Graph Attention Network (RGAT). By jointly encoding textual descriptions and multi-hop graph topology, GA-S2S overcomes the limitations of text-only models, achieving up to a 19% relative gain in knowledge graph link prediction accuracy.
What Problem Does This Paper Address?
Knowledge Graphs (KGs) are foundational for applications like question answering and recommendation systems, yet real-world KGs are notoriously incomplete. Link prediction aims to solve this by predicting missing facts (triples consisting of a head entity, relation, and tail entity).
Traditional approaches fall into two camps:
- Embedding-based and GNN-based methods: These excel at capturing graph structure but scale poorly during inference, requiring a computationally expensive scoring step across every entity candidate in the graph ($O(|E|)$).
- Generative Sequence-to-Sequence (Seq2Seq) methods: Recent state-of-the-art models recast link prediction as a text-generation task (e.g., inputting "Predict tail: Michael Jackson | occupation" to generate "musician"). While highly efficient, these models operate purely on flattened text strings, completely discarding the local multi-hop graph topology surrounding the query entity.
The authors address this gap by asking: How can we retain the inference efficiency of generative Seq2Seq models while explicitly exploiting local graph structures?
Methods
The authors propose GA-S2S, which integrates a T5-small architecture with a Relational Graph Attention Network (RGAT). Crucially, the entire model is trained from scratch to prevent negative transfer from natural language priors, as the input data consists of highly structured templates rather than standard prose.
The pipeline operates in three main stages:
- Input & Text Encoding: Given a query, the model samples a $k$-hop subgraph around the query entity. Each triple in this neighborhood is verbalized using a
[CLS]token prefix. The T5 encoder processes both the query and the neighborhood text sequences. - Structural Enrichment (RGAT): To capture graph topology, the model extracts the hidden states of the
[CLS]tokens for all neighborhood triples, aggregates them to form entity features, and passes them along with an adjacency matrix into the RGAT module. The RGAT performs relation-aware message passing to update the embeddings with structural context. - Combined Decoding: Not all text tokens are useful, so a lightweight self-attention layer distills the raw encoder outputs down to the $m$ ($m=3$) most salient vectors. The T5 decoder then receives a concatenated input of these distilled text vectors and the graph-enhanced embeddings from the RGAT to generate the final target text.
Datasets
The model was evaluated on the CoDEx benchmark, which includes three datasets extracted from Wikidata and Wikipedia:
- CoDEx-S: 2,034 entities, 42 relations, ~32k training triples.
- CoDEx-M: 17,050 entities, 51 relations, ~185k training triples.
- CoDEx-L: 77,951 entities, 69 relations, ~551k training triples.
CoDEx is specifically designed to be harder than older benchmarks by mitigating train/test data leakage and avoiding trivial relational patterns.
Key Insights and Ideas
- Naive flattening hurts performance: Previous attempts like KGT5-context tried to feed neighborhood data into Seq2Seq models by simply appending linearized text strings to the input. The authors show this actually degrades performance on medium-to-large graphs because excessively long, unstructured sequences confuse the text decoder.
- Separation of concerns is key: By routing text through the T5 encoder and structural topology through the RGAT, GA-S2S successfully injects multi-hop graph context without overwhelming the decoder's text-generation capabilities.
- The $k$-hop advantage: Moving from 1-hop neighborhoods to 2-hop neighborhoods consistently improves performance, proving that capturing broader subgraph patterns is highly advantageous for link prediction.
Key Results
GA-S2S was benchmarked against competitive generative baselines, including KG-S2S, KGT5, and KGT5-context, using Mean Reciprocal Rank (MRR) and Hit@k metrics.
- Outperforming Baselines: GA-S2S achieved the highest MRR scores on both the medium (CoDEx-M) and large (CoDEx-L) datasets.
- The Power of 2-Hop: On CoDEx-M, incorporating a 2-hop neighborhood pushed the MRR to 0.289, outperforming the baseline KGT5 (0.276) and KGT5-context (0.271). On the small dataset (CoDEx-S), 2-hop context provided a 19.5% relative MRR gain over KGT5-context.
- Exception on Small Graphs: On CoDEx-S, the vanilla text-only KGT5 remained the top performer. The authors attribute this to the high density of small graphs, which creates overly long and redundant inputs that can still bottleneck the current decoder design.
Limitations and Future Work
Despite its success against text-based baselines, GA-S2S still lags behind pure KG embedding methods (like ComplEx or TuckER) on small-to-medium datasets, though this gap narrows significantly as the graph size increases.
Additionally, the GNN module introduces noticeable computational overhead, increasing the number of processed tokens per query. To scale to massive KGs with millions of entities, the authors suggest exploring Graph Transformers as a future direction. Graph transformers natively process graph-structured data via topology-aware attention mechanisms, eliminating the need to flatten neighborhoods entirely and allowing for a cleaner, more scalable fusion of text and structure.
Summary updated