Lexical Knowledge Internalization for Neural Dialog Generation

Zhiyong Wu, Wei Bi, Xiang Li, Lingpeng Kong, Ben Kao

Introduction

End-to-end neural dialog models often struggle with the "vacuous response" problem, frequently generating generic and uninformative replies such as "I don't know" or "That's cool." While traditional Knowledge-Grounded Dialog (KGD) models attempt to mitigate this by retrieving external information from large databases, they face significant challenges. Retrieval typically occurs at a coarse sentence or paragraph level, often missing the fine-grained nuances of individual tokens. Furthermore, the computational overhead of searching external databases during live inference introduces latency that is unsuitable for real-time applications.

Methodology: Knowledge Internalization (KI)

To address these limitations, we propose Knowledge Internalization (KI), a framework that embeds fine-grained lexical knowledge directly into the model's parameters during training. This approach eliminates the need for an external retriever at inference time.

Token-Level Alignment and Retrieval

Unlike standard KGD models that ground entire conversations in a single document, KI aligns individual tokens within an utterance to descriptive sentences from Wikipedia. Since human-annotated datasets for token-level grounding are unavailable, we utilize a weak supervision strategy. We treat the lead sentence of a Wikipedia article as the "lexical knowledge" for the article's title, using BERT-based encoders to learn these associations.

An illustration of token-level alignment where specific words like 'J.K. Rowling' and 'donates' are mapped to descriptive knowledge snippets.

Contrastive Learning Objective

During training, the model optimizes a dual-objective loss function. In addition to the standard negative log-likelihood for response generation, we introduce a contrastive loss. This objective pushes the model's internal representation of a word closer to its corresponding Wikipedia definition while distancing it from unrelated concepts. Once training is complete, the external retriever is discarded, and the knowledge remains "baked into" the Transformer's weights.

Experimental Setup

The KI framework was evaluated across three diverse benchmarks:

  • DailyDialog: High-quality human daily conversations.
  • Wizard of Wikipedia (WoW): A dataset designed for knowledge-grounded dialog, featuring both "Seen" and "Unseen" topics.
  • Commonsense Reddit Dataset (CRD): A dataset paired with triples from ConceptNet.

Results and Analysis

Improved Informativeness and Diversity

KI-enhanced models demonstrated a significant reduction in generic responses. On the WoW dataset, the frequency of "safe" responses dropped from 83.69% to 35.18%. The models also showed superior performance in wikiF1 (knowledge overlap) and Entity scores, indicating a higher density of unique, factual information in generated responses.

Internal Representation Shifts

Visualization of the embedding space reveals that KI successfully restructures the model's internal knowledge. As shown in the PCA analysis below, the KI-enhanced Transformer develops more distinct and semantically coherent clusters for related entities compared to the base model.

PCA visualization comparing word embeddings in a standard Transformer versus a Transformer with KI, showing tighter semantic clustering.

Efficiency and Latency

Because the knowledge is parametric, the KI model maintains the same inference speed as a standard Transformer. This provides a significant advantage over traditional KGD models, which are bottlenecked by the retrieval step during real-time interaction.

Discussion and Limitations

While KI effectively internalizes knowledge, it is subject to "imperfect knowledge transfer," where the model may occasionally hallucinate specific details (e.g., misidentifying a company's rank). Additionally, as a parametric approach, the model's knowledge is frozen at the time of training, creating a "knowledge cutoff" that prevents it from accessing information about events occurring after the training phase. Future work will explore methods to update this internal knowledge without full retraining and investigate how KI can better leverage the latent knowledge already present in massive pre-trained language models.

Summary updated

BibTeX
@inproceedings{wu2022lexical,
  author = {Zhiyong Wu and Wei Bi and Xiang Li and Lingpeng Kong and Ben Kao},
  title = {{Lexical Knowledge Internalization for Neural Dialog Generation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.acl-long.547},
}
Figure