Enhancing Dialogue Generation via Dynamic Graph Knowledge Aggregation (2023)

Abstract: Incorporating external graph knowledge into neural chatbot models has been proven effective for enhancing dialogue generation. However, in conventional graph neural networks (GNNs), message passing on a graph is independent from text, resulting in the graph representation hidden space differing from that of the text. This training regime of existing models therefore leads to a semantic gap between graph knowledge and text. In this study, we propose a novel framework for knowledge graph enhanced dialogue generation. We dynamically construct a multi-hop knowledge graph with pseudo nodes to involve the language model in feature aggregation within the graph at all steps. To avoid the semantic biases caused by learning on vanilla subgraphs, the proposed framework applies hierarchical graph attention to aggregate graph features on pseudo nodes and then attains a global feature. Therefore, the framework can better utilise the heterogeneous features from both the post and external graph knowledge. Extensive experiments demonstrate that our framework outperforms state-of-the-art (SOTA) baselines on dialogue generation. Further analysis also shows that our representation learning framework can fill the semantic gap by coagulating representations of both text and graph knowledge. Moreover, the language model also learns how to better select knowledge triples for a more informative response via exploiting subgraph patterns within our feature aggregation process. Our code and resources are available at https://github.com/tangg555/SaBART .

## introduction recent years have seen a surge of interest in developing chatbots with the facilitation of large-scale knowledge @xcite . as a highly expressive data format, knowledge graphs (e.g. conceptnet and dbpedia), which include world facts, are considered to be a key factor in building an effective * corresponding author. dialogue generation system @xcite . in order to incorporate graph-structured knowledge, a range of graph neural networks such as graph attention networks (gats) @xcite and graph convolutional networks (gcns) (kipf and welling, 2016) have been proposed to learn representations of the topological structure of the knowledge graph via message passing between entities. in open-domain dialogue generation, these gnns are further embedded into generative frameworks to feed graph knowledge features into the language models (lms). despite prior success in leveraging graph knowledge with graph neural networks (gnn) @xcite , current generative frameworks are still hindered by the representation gap in the hidden space between the lms and gnns, which poses significant challenges in exploiting graph knowledge in the subsequent text decoding process. as illustrated in figure 1 , prior works using gnns @xcite @xcite tend to fuse the graph features by transforming them into text form and then feeding them into the language model, which acts as a "copy" mechanism. in other words, these networks run as a pipeline where the graph knowledge is firstly transformed into additional text to avoid the problem of language model encoding brought about by the heterogeneous graph features. however, these separate encoding stages result in neural networks learning suboptimal representations of graph knowledge, which leads to information loss. with large-scale pretrained models such as gpt-2 @xcite , bart @xcite and t5 @xcite being widely adopted in recent advances in dialogue generation, the drawbacks that arise from incompatibility between gnns and lms becomes a more severe problem, prohibiting chatbot systems from leveraging graph structured data effectively. in order to address the aforementioned challenges, we propose a novel representation learning framework to facilitate language understanding and generation, which permits effective incorporation of heterogeneous features via a dynamic graph knowledge aggregation mechanism. in contrast to existing works @xcite @xcite which incorporate graph knowledge with conventional gnns (causing inadequacies in representation learning), we propose to involve language models in both text and graph knowledge incorporation at all steps via hierarchically aggregating knowledge on a dynamic pseudo graph. during the knowledge aggregation process, knowledge triples are reorganised as shown in figure 1 (b) , where pseudo nodes are created to learn conceptual representations from original knowledge triples. conceptual semantics are forced to coagulate into pseudo nodes, and finally merge into a condensed feature vector to fill the semantic gap of the encoded text features. our approach for incorporating text and graph knowledge features can be adapted to all language models with an encoder-decoder architecture. in this study, we choose bart @xcite , a sota language model for generation, as our language model in our experiments. this framework will hereinafter be referred to as sabart (subgraph-aggregation bart). during subgraph knowledge aggregation, the language model is involved in learning three levels of features: (1) subword-level, where conceptual embeddings are connected to entity mentions within text; (2) knowledge-level, where original triples are transformed by language encoding; and ## related works in this section, we introduce related works by summarising recent advances in the knowledge enhanced dialogue generation task, as well as the sota approaches for injecting graph knowledge into generative frameworks. knowledge enhanced dialogue generation as a data-driven approach, deep learning based chatbots rely on access to large amounts of knowledge @xcite to generate interesting and informative dialogues like humans. in order to realise a commonsense-aware and semantic-aware chatbot, more and more studies @xcite @xcite aim to consider external knowledge beyond pure dialogue exchanges to facilitate generation, where knowledge graphs containing topological structural knowledge are an important research direction to facilitate logical reasoning. in this study, we aim to improve multi-head cross attention add & norm feed forward add & norm lm head knowledge aggregation post: that is 20 ounces of milk …... multi-head attention add & norm feed forward add & norm [cls] embeddings text encoding second forward resp: i don't drink coffee with milk. retrieved knowledge: (quart, relatedto, ounces); (weight, distinctfrom, ounces); (coffee, relatedto, milk); ……. 𝒈 𝟏 𝒈 𝟐 group knowledge to pseudo nodes 𝒈 𝟏 𝒈 𝟐 (b) dynamic subgraph construction (a) text encoding (c) hierarchical graph attention (d) feature decoding & training embeddings sharing fuse features decoding 𝒈 𝟏 ′ 𝒈 𝟐 ′ 𝒈 𝟏 ′ 𝒈 𝟐 ′ 𝑮 ′ 𝒈 𝟏 ′ 𝒈 𝟐 ′ 𝑮 ′ dynamic subgraph 𝝉 ′ ∈ 𝒈 𝟏 ′ 𝝉 ′ ∈ 𝒈 𝟐 ′ static aggregation fc max 𝒒 first forward ## methods as illustrated in figure 2 , our approach aims to improve dialogue generation of language models by better incorporating heterogeneous features with an effective knowledge aggregation framework on retrieved knowledge triples. ## conclusion in this study, we propose a novel dynamic graph aggregation framework for the task of knowledge graph enhanced dialogue generation. we dynamically construct a graph with created pseudo nodes, and hierarchically aggregate graph knowledge to attain a global feature which better represents the topological structure and semantics contained in the knowledge graph. due to the superior ability in leveraging the heterogeneous features of input text and graph knowledge, our framework can fill the semantic gap between the language model and knowledge graph and consequently generate an informative response. the extensive experiments demonstrate that our model significantly outper-forms all baseline models, and can generate more appropriate and informative responses utilising external graph knowledge.