Abstract
Pretrained Language Models (PLMs) have demonstrated exceptional performance in natural language tasks but often struggle with the explicit structural connectivity found in graph-based data, such as Knowledge Graphs (KGs). This paper introduces GraSAME, a novel architecture designed to bridge the gap between sequential text processing and structural graph reasoning. By injecting token-level graph information directly into the PLM's self-attention mechanism, GraSAME allows the model to perceive structural relationships without the need for massive parameter expansion. Our experiments on the WebNLG 2.1 benchmark demonstrate that GraSAME achieves state-of-the-art results, particularly in complex graph-to-text generation, while maintaining high parameter efficiency.
Introduction
While PLMs like T5 and GPT are highly proficient in processing sequential text, they are inherently "structurally blind." When tasked with interpreting data from Knowledge Graphs or molecular structures, researchers typically rely on two suboptimal strategies: linearization or separate Graph Neural Network (GNN) integration. Linearization flattens the graph into a string, which often destroys explicit connectivity (edges). Conversely, using a separate GNN to encode structure often leads to a "modality gap" between graph and text embeddings, requiring complex alignment and extensive training.
GraSAME (Graph-guided Self-Attention MEchanism) offers a lightweight, end-to-end solution. It enables the PLM to "see" the graph structure by modifying the fundamental attention mechanism, preserving the model's pre-trained linguistic knowledge while incorporating structural awareness.
Methodology
The core innovation of GraSAME lies in its ability to guide the Transformer's attention through structural data. This is achieved through three primary components:
1. Hierarchical Graph Construction
Unlike previous methods that operate at the node level, GraSAME constructs a token-level hierarchy. Every token in the input sequence is treated as a node. The authors define five specific relation types—ranging from linking global graph tokens to entities to connecting consecutive tokens within an entity—to ensure that information flows logically through the structure in a way that aligns with the PLM's tokenizer.
2. Graph-guided Self-Attention
In a standard Transformer, the Query ($Q$), Key ($K$), and Value ($V$) vectors are derived from the same text embedding. GraSAME modifies this by first processing the text embedding through a GNN (such as GraphSAGE or GAT) to create a "graph-aware" embedding. This structural embedding is then used to induce the Query ($Q$) vector. Consequently, the graph structure dictates which parts of the text the model focuses on, effectively using the graph as a map for attention.
3. Multi-Task Learning and Efficiency
The model is trained using a dual-objective approach:
- Natural Language Generation: Standard cross-entropy loss for text production.
- Graph Reconstruction: Predicting the relationships between nodes to ensure the GNN component maintains structural integrity.
During fine-tuning, the PLM's original parameters are frozen. Only the GNN and the attention-guiding parameters are updated, making GraSAME significantly more parameter-efficient than full-model fine-tuning.
Experimental Results
The researchers evaluated GraSAME on the WebNLG 2.1 benchmark using both "Unconstrained" and "Constrained" splits. The latter is particularly challenging as it ensures no overlap of individual triples between the training and test sets.
Performance and Complexity
GraSAME-SAGE outperformed the T5-large baseline across all primary metrics, including BLEU, METEOR, ROUGE, and chrF++. On the WebNLG unconstrained test set, GraSAME achieved a BLEU score of 65.55, compared to 61.41 for the baseline T5 model.
The model's superiority was most evident in complex scenarios. For input graphs containing seven triples, GraSAME outperformed the baseline by 8.61 BLEU points, suggesting that structural guidance becomes increasingly critical as the complexity of the data grows.
Parameter Efficiency and Hallucination Reduction
GraSAME-SAGE utilizes approximately 151M trainable parameters, which is roughly 100M fewer than competing state-of-the-art models like JointGT (~265M). Furthermore, human evaluation indicated that GraSAME is significantly less prone to "hallucinations"—the invention of facts not present in the source graph—which is a common failure mode for standard PLMs when processing structured data.
Discussion and Limitations
While GraSAME represents a significant advancement in graph-to-text generation, the authors note several areas for improvement:
- Template Dependency: The hierarchical graph structure currently requires manual definition for different tasks, necessitating the future development of a "universal template."
- Convergence Speed: Because the GNN is trained from scratch while the PLM remains frozen, the model converges more slowly than standard text-only models.
- Linearization Reliance: The model still utilizes a linearized graph as part of its input, which may cause slight misalignment with the PLM's original natural language pre-training.
Conclusion
GraSAME demonstrates that injecting structural information directly into the self-attention mechanism is a highly effective and efficient way to enhance PLMs for graph-based tasks. By moving to a token-level integration and using the graph to steer the Query vector, GraSAME achieves superior performance on complex datasets while maintaining a smaller parameter footprint than its predecessors.
Summary updated