Source-linked AI summary

Knowledge Graph-Augmented Language Models for Knowledge-Grounded Dialogue Generation

Minki Kang, Jin Myung Kwak, Jinheon Baek, Sung Ju Hwang

arXiv:2305.18846v1cs.CLcs.AIcs.LG

TL;DR

Knowledge-grounded dialogue models may use irrelevant KG facts and generate responses that do not reflect retrieved knowledge. SURGE retrieves context-relevant subgraphs, encodes them with dialogue text, and uses contrastive learning. The authors report effective retrieval and response generation, with responses consistent with gold and retrieved knowledge.

  • Problem

    KG dialogue models may use irrelevant associated facts, and language models can generate responses inconsistent with factual knowledge.

    Source: §1 · pp. 1–2
  • Method

    SURGE jointly retrieves context-relevant KG subgraphs, encodes them with dialogue text, and uses graph-text contrastive learning to encourage knowledge-faithful generation.

    Source: §1 · p. 2
  • Results

    Experiments on OpendialKG and KOMODIS report effective retrieval and response generation, with responses agreeing with gold knowledge and consistent with retrieved KG knowledge.

    Source: §1 · p. 2, §6 · p. 9
  • Takeaways & Limitations

    The authors suggest that retrieving more relevant subgraph knowledge is important for informative responses in KG-based dialogue.

    Source: §6 · p. 9

    Public evaluation scope is limited: only one dataset provides diverse dialogue paired with a large-scale KG, constraining rigorous evaluation of adaptability across settings.

    Source: A Limitations · p. 15

Abstract

from arXiv · show

Language models have achieved impressive performances on dialogue generation tasks. However, when generating responses for a conversation that requires factual knowledge, they are far from perfect, due to an absence of mechanisms to retrieve, encode, and reflect the knowledge in the generated responses. Some knowledge-grounded dialogue generation methods tackle this problem by leveraging facts from Knowledge Graphs (KGs); however, they do not guarantee that the model utilizes a relevant piece of knowledge from the KG. To overcome this limitation, we propose SUbgraph Retrieval-augmented GEneration (SURGE), a framework for generating context-relevant and knowledge-grounded dialogues with the KG. Specifically, our SURGE framework first retrieves the relevant subgraph from the KG, and then enforces consistency across facts by perturbing their word embeddings conditioned by the retrieved subgraph. Then, we utilize contrastive learning to ensure that the generated texts have high similarity to the retrieved subgraphs. We validate our SURGE framework on OpendialKG and KOMODIS datasets, showing that it generates high-quality dialogues that faithfully reflect the knowledge from KG.

1 Introduction

Knowledge-grounded dialogue models can retrieve irrelevant KG facts and generate responses inconsistent with knowledge. SURGE retrieves context-relevant subgraphs, encodes them with dialogue text, and uses contrastive learning; experiments report responses that agree with gold and retrieved knowledge.

1 Introduction

  • Dialogue PLMs can produce fluent but factually incorrect responses, while KGs represent facts as entity-relation triplets that can ground responses.The paper describes KGs as compact symbolic structures and notes that PLMs may generate hallucinations by relying on memorized but incorrect knowledge.Source: §1 · pp. 1–2
  • Prior KG dialogue models often use all facts associated with context entities, although 87% of 1-hop KG facts are irrelevant in OpendialKG.Irrelevant facts can mislead generation, and encoding unnecessary facts is computationally inefficient.Source: §1 · p. 1
  • The authors identify irrelevant knowledge and inconsistent generation as limitations of KG-grounded dialogue models; Figure 1 states that only 12.6% of 1-hop facts help generate target responses.Source: Figure 1 · p. 2
  • SURGE retrieves context-relevant subgraphs, encodes them with dialogue text, and applies graph-text contrastive learning to encourage responses that reflect retrieved knowledge.Its retriever uses a GNN for KG relational structure and is jointly trained with generation by marginalizing over latent retrieved subgraphs.Source: §1 · p. 2
  • SURGE generates responses that agree with gold knowledge and remain consistent with retrieved KG knowledge, according to experiments on OpendialKG and KOMODIS.The authors introduce Knowledge-verifying Question Answering (KQA) to assess whether responses contain correct knowledge.Source: §1 · p. 2

2 Related Work

Prior dialogue methods use pretrained language models and external knowledge to address factual errors. For KG-based dialogue, the paper contrasts approaches conditioning on entities or all associated facts with its aim of retrieving only context-relevant subgraphs.

2 Related Work

  • Pretrained language models support fluent dialogue, but generated responses may be plausible yet factually incorrect, a problem addressed by retrieving external knowledge [35] [38].Source: §2 · pp. 2–3
  • Earlier KG dialogue methods condition generation on KG entities [39] or encode all k-hop facts, whereas this work retrieves only a context-relevant subgraph.The paper says retrieving all associated facts may introduce out-of-context responses or increase token-processing overhead.Source: §2 · p. 3

3 Method

SURGE models knowledge-grounded dialogue as retrieving a context-relevant KG subgraph and generating a response conditioned on it. Its method combines graph-aware retrieval, invariant and efficient graph encoding, graph–text contrastive learning, and joint training.

3.1 Preliminaries

  • Text is tokenized as a sequence and KG facts as head–relation–tail triples; entity and relation tokens map into PLM vocabulary, while GNNs aggregate neighboring entity embeddings.The framework also describes Transformer encoder–decoder representations for text.Source: §3.1 · p. 3

3.2 Problem Statement

  • The response likelihood marginalizes over possible retrieved subgraphs, with the generator modeling responses conditioned on dialogue history and a subgraph.The subgraph is treated as a latent variable in jointly optimizing retrieval and response generation.Source: §3.2 · p. 4

3.3 Context-Relevant Subgraph Retriever

  • The retriever independently scores candidate triplets associated with context entities using context–triplet similarity and GNN triplet embeddings that capture KG relational structure.Triplet representations use both graph nodes and relations.Source: §3.3 · pp. 4–5

3.4 Invariant Graph Encoding

  • SORT and inverse-triplet augmentation make graph encoding invariant to triplet order and equivalent relation inversion.The paper defines permutation invariance and relation-inversion invariance as desired properties of graph encoding.Source: §3.4 · p. 5
  • The efficient encoder uses O(k) space for unique entities and applies a relation-aware affine perturbation to their token embeddings based on the graph.Here k, the number of unique entities, is smaller than n, the number of triplets.Source: §3.4 · p. 5

3.5 Knowledge-Grounded Generation with Graph-Text Contrastive Learning

  • Graph–text contrastive learning addresses single-response teacher forcing and exposure bias, using averaged graph and decoder representations with cosine similarity and other minibatch texts or graphs as negatives.The method aims for responses to reflect retrieved subgraphs and for different subgraphs to yield different sequences for the same dialogue history.Source: §3.5 · p. 6

3.6 Training

  • Training approximates the infeasible full-subgraph marginal with sampled subgraphs and combines retrieval, supervised retrieval when gold subgraphs are partially available, and contrastive losses.The combined objective is L = Lret + Lsup + Lcont.Source: §3.6 · p. 6

4 KQA Metric: Knowledge-verifying QA

BLEU and ROUGE assess lexical overlap but do not measure whether generated responses contain factually correct knowledge. KQA uses extractive question answering to evaluate that knowledge against the dialogue history.

  • BLEU and ROUGE can score lexically mismatched but correct responses poorly and do not measure factual correctness.Source: §4 · p. 6
  • KQA automatically derives extractive question-answer pairs from dialogue and each dataset’s large-scale KG, then uses them to fine-tune BERT.Source: §4 · p. 6
  • The trained QA model receives the dialogue history concatenated with a generated response; a correct answer counts as evidence of accurate knowledge.Source: §4 · p. 7

5 Experiment

Experiments evaluate SURGE on OpendialKG and KOMODIS using T5-small, with dialogue-generation, knowledge, and retrieval metrics. SURGE generally outperforms baselines, while further analyses examine retrieval, knowledge consistency, encoding, human judgments, and graph-text embeddings.

5.1 Experimental Setup

  • Experiments use OpendialKG’s 1-hop and KOMODIS’s 2-hop retrieval candidates; OpendialKG has 15K dialogues and KOMODIS 7.5K.Source: §5.1 · p. 7

5.2 Baselines and Our Models

  • Comparisons include no-knowledge, all-knowledge, gold-knowledge, space-efficient, EARL, DiffKG, random/sparse retrieval, dense retrieval, and SURGE training variants.Source: §5.2 · p. 7

5.3 Evaluation Metrics

  • Evaluation uses BLEU, ROUGE, F1, and KQA; Knowledge F1 measures unigram overlap between retrieved knowledge and generated responses.Source: §5.3 · p. 8

5.4 Experimental Results and Analysis

  • SURGE significantly outperforms non-oracle baselines across evaluation metrics on OpendialKG, and SURGE (contrastive) also outperforms baselines on KOMODIS.Source: §5.4 · p. 8
  • On the 45% of test dialogues containing gold knowledge, SURGE retrievers outperform baselines, and contrastive plus semi-supervised training beats the unsupervised variant.Source: §5.4 · p. 8
  • With modified gold subgraphs, the contrastive model achieves the strongest KF1, indicating more accurate reflection of encoded knowledge in generated responses.Source: §5.4 · p. 9
  • Examples show SURGE retrieving relevant facts and generating correct or informative responses where Space Efficient produces responses distracted by irrelevant entities or wrong facts.Source: Table 4 · p. 8, §5.4 · p. 9
  • SURGE’s graph encoding performs best while using less encoding space; human ratings favor SURGE on consistency, informativeness, and fluency, and contrastive learning yields more distinct response embeddings for different subgraphs.Source: Table 6 · p. 8, Table 7 · p. 8, Figure 5 · p. 8

6 Conclusion

SURGE retrieves context-relevant subgraphs, encodes them with text, and generates natural, informative responses. Quantitative and qualitative experiments support its effectiveness, and the analysis identifies retrieval, encoding, and graph-text representation learning as contributing components.

  • SURGE is an end-to-end framework that retrieves context-relevant subgraphs, encodes them with text, and generates responses based on them.Source: §6 · p. 9
  • Quantitative and qualitative experiments demonstrate the framework’s effectiveness in knowledge retrieval and response generation.Source: §6 · p. 9
  • The analysis identifies retrieval, encoding, and graph-text representation learning as contributing components, and supports retrieving relevant subgraph knowledge rather than using all KG knowledge.Source: §6 · p. 9

A Limitations

The paper identifies limitations in public evaluation data, retrieval scope, and generation quality. It also notes potential deployment risks and explains why graph encoding should preserve permutation and relation-inversion invariances.

A Limitations

  • Evaluation is constrained by the scarcity of public knowledge-consistent dialogue datasets; retrieval searches only k-hop neighborhoods rooted in dialogue entities, and small PLMs can limit generation quality.Source: A Limitations · p. 15

B Broader Impacts

  • Real-world deployment may expose dialogue models to harmful or misleading responses, adversarial feedback, and biases inherited from training data.Source: B Broader Impacts · p. 15

D.1 Intuitions

  • Permutation-invariant encoding addresses the mismatch between order-sensitive PLMs and order-invariant graph triplets; relation-inversion invariance targets equivalent triplets with reversed relations.Source: §D.1 · pp. 15–16

D.2 Proofs

The proofs show that naïve encoding changes under triplet permutation and relation inversion, while the proposed encoding is invariant to both transformations. The experimental-setup section introduces the implementation, dataset, training, and model-details subsections.

D.2 Proofs

  • Naïve encoding is not permutation invariant: reordering the same triplets produces a different encoded sequence.The proof compares two different orders of the same triplet set.Source: §D.2 · pp. 16–17
  • Naïve encoding is not relation inversion invariant: replacing a triplet with its inverse changes the encoded sequence.The proof uses a triplet whose relation is replaced by its inverse as a counterexample.Source: §D.2 · pp. 16–17
  • The proposed encoding ψ∗ is both permutation invariant and relation inversion invariant.Sorting entity lists and using permutation-invariant aggregation supports permutation invariance; making graphs bidirectional supports relation-inversion invariance.Source: §D.2 · p. 17

E Experimental Setup

E.1 Implementation Details

The implementation uses T5-small and builds graph-aware triplet and token representations for retrieval and generation. It also describes contrastive-learning and KQA evaluation procedures.

E.1 Implementation Details

  • T5-small is the base pretrained language model used for all experiments.The implementation uses the authors’ released checkpoint, PyTorch, and Hugging Face Transformers.Source: §E.1 · p. 17
  • The retriever embeds dialogue history with frozen T5-small encoder parameters and learns point-wise attention over its tokens.For an entity mentioned in the dialogue, its node embedding reuses the mean of its contextual token representations; absent entities receive zero vectors, while relations use trainable embeddings.Source: §E.1 · p. 18
  • Triplet retrieval representations use GCN node embeddings and EHGNN edge embeddings to account for graph structure.Figure 6 illustrates neighborhood message passing for entities and relations.Source: §E.1 · p. 18, Figure 6 · p. 18
  • Graph-conditioned token perturbation forms affine parameters γ and δ from GNN representations, while CompGCN supplies relation-aware graph encoding.The perturbation is β(f(a), Z) = (1 + γ) * f(a) + δ; contrastive learning initializes τ to 0.01.Source: §E.1 · p. 19, Figure 7 · p. 19
  • KQA is implemented with a BERT-base model trained on 200k constructed examples, with 88.89 F1 on held-out validation data.Evaluation rebuilds the QA set using generated responses rather than gold responses.Source: §E.1 · p. 19

E.2 Dataset Details

The appendix specifies the datasets, training setup, and model variants, then examines retrieval size and larger pretrained language models. Its experiments report gains with ten retrieved facts and show that a larger PLM does not necessarily improve SURGE’s knowledge-grounded KQA performance.

E.2 Dataset Details

  • OpendialKG pairs Freebase with 1,190,658 fact triplets over 100,813 entities and 1,358 relations; among its multi-turn role-playing dialogue data, 51% has no gold knowledge.Entity linking uses exact matching; sessions are randomly split 70%/15%/15% into train/validation/test, and KOMOIDS [7] receives the same preprocessing as OpendialKG.Source: §E.2 · pp. 19–20

E.3 Training Details

  • Training uses one 48GB Quadro 8000 GPU, takes 12 GPU hours, and reports results from a single run.SURGE is fine-tuned for 30 epochs; retrieval uses subgraph size n = 3 and sample size k = 4.Source: §E.3 · p. 20

E.4 Model & Baselines Details

  • The model suite includes knowledge-free and gold-knowledge baselines, retrieval baselines, and SURGE variants with unsupervised, semi-supervised, or contrastive training.The contrastive variant adds graph-text contrastive learning to semi-supervised graph retrieval.Source: §E.4 · pp. 20–21

F.1 Varying the Number of Facts in Subgraphs

  • About 40% of subgraphs retrieved with ten facts contain at least one necessary fact, alongside significant generation-performance gains over three or five facts.The comparison uses the semi-supervised model without contrastive loss; the difference between three and five facts is marginal.Source: Figure 8 · p. 21, §F.1 · p. 22

F.2 Discussions on Using Larger PLMs

  • With ten retrieved facts, SURGE using T5-small scores better than SURGE using BART-base on KQA, despite BART-base having about three times as many parameters.BART-base improves no-knowledge performance and BLEU/ROUGE, but does not significantly improve SURGE’s KQA performance.Source: Table 9 · p. 21, §F.2 · p. 22

F.3 Full Experimental Results on KOMODIS

On KOMODIS, SURGE outperforms the baselines, though that dataset usually does not require knowledge and lacks OpendialKG’s large-scale KG. Additional analyses report more diverse responses, the importance of relation-aware graph encoding, and consistent trends across knowledge-groundedness metrics.

F.3 Full Experimental Results on KOMODIS

  • SURGE outperforms baselines on KOMODIS, where most responses do not require knowledge and no corresponding large-scale KG is provided.The authors use automatic evaluation on KOMODIS and describe the result as evidence of generalization beyond OpendialKG.Source: §F.3 · p. 22

F.4 Diversity Evaluation

  • SURGE generates more diverse responses than all other baselines under the distinct metric.Source: §F.4 · p. 23

F.5 Ablations Studies on GNN Design Choices

  • Replacing the node GCN with GAT has little impact, while removing relation awareness from graph encoding reduces performance substantially.The ablation compares GAT for triplet-node embeddings and GCN instead of CompGCN for relation-aware token-embedding perturbation.Source: §F.5 · p. 23

F.6 Automatic Evaluations on Knowledge Groundedness

  • Knowledge F1, string matching, and entity F1 follow the same trend as KQA, but the rule-based metrics can be affected by response length or miss partial entity names.The authors note that KQA’s trained QA model can compensate for shortcomings of rule-based metrics.Source: §F.6 · p. 23

G Human Evaluation

Human evaluation compared SURGE with ALL Knowledge and Space Efficient using consistency, informativeness, and fluency criteria. The supplied table captions identify additional diversity, GNN-variant, and knowledge-appropriateness evaluations.

G Human Evaluation

  • Annotators evaluated responses from ALL Knowledge, Space Efficient, and SURGE against the same dialogue contexts.The instructions organize evaluation around consistency, informativeness, and fluency.Source: G Human Evaluation · p. 23
  • Table 11 covers Distinct diversity and GNN-variant ablations, while Table 12 covers three additional metrics for appropriate knowledge.The captions specify evaluation scope but provide no result values here.Source: Table 11 · p. 24, Table 12 · p. 24
  • Figure 9 provides annotator instructions for judging consistency, informativeness, and fluency.The criteria ask whether responses fit the conversation, contain correct and enough information, and sound grammatical and natural.Source: Figure 9 · p. 24, G Human Evaluation · p. 25
  • Informativeness meant correct and sufficient information, with internet searches and Freebase facts available for fact-checking.Consistency concerned fit with the conversation; fluency concerned grammatical correctness and natural sound.Source: G Human Evaluation · p. 25

H Retrieval and Generation Examples

The examples illustrate SURGE’s retrieval and generation behavior: its retrieval is context-sensitive, and its responses can reflect retrieved facts, but failures also arise from data, retrieval, or generation.

H Retrieval and Generation Examples

  • With graph-text contrastive learning, responses are more distinct across subgraphs; without it, responses show less variety despite different graphs.Figure 10 visualizes graph embeddings as stars and generated-text embeddings as circles after t-SNE dimensionality reduction.Source: H Retrieval and Generation Examples · p. 25
  • SURGE’s end-to-end retriever contextualizes the dialogue context before accurately retrieving relevant knowledge, whereas random and BM25 baselines select irrelevant entity-associated facts, and BM25 may retrieve facts associated with frequent words.Source: H Retrieval and Generation Examples · p. 25
  • Correct examples pair context-relevant subgraphs with factual responses, while the failure examples span ambiguous data, irrelevant retrieval, and repeated meaningless output.The Wicked example gives two release years, 2008 and 2014; another retrieval misses a question about The Bourne Legacy, and a generation example repeats words despite relevant retrieval.Source: H Retrieval and Generation Examples · p. 25, Figure 12 · p. 27, Figure 13 · p. 28
Loading 2305.18846v1…