Improving Empathetic Dialogue Generation by Dynamically Infusing Commonsense Knowledge

Hua Cai, Xuli Shen, Qing Xu, Weilin Shen, Xiaomei Wang, Weifeng Ge, Xiaoqing Zheng, Xiangyang Xue

Abstract

Empathetic dialogue generation requires a model to understand a speaker's situation and feelings by leveraging commonsense knowledge. However, existing methods often suffer from "knowledge confusion," where the inclusion of irrelevant or conflicting commonsense relations introduces noise into the generation process. In this paper, we present the DCKS (Dynamically Infusing Commonsense Knowledge) framework. By implementing a competition mechanism inspired by cognitive science's Global Workspace Theory, DCKS dynamically filters irrelevant knowledge to focus on the most salient emotional and situational context. Experimental results on the EmpatheticDialogues dataset demonstrate that DCKS significantly outperforms state-of-the-art baselines in both automatic and human evaluations, achieving a 56% reduction in perplexity and a 34% improvement in emotion accuracy.

1. Introduction

In human conversation, empathy is predicated on the ability to infer a speaker's underlying emotional state and the situational context that triggered it. While large-scale language models have improved the fluency of dialogue systems, they often lack the commonsense reasoning required for true empathy. Recent attempts to bridge this gap have utilized external knowledge bases like ATOMIC to provide models with social commonsense.

However, these approaches frequently encounter the problem of "knowledge confusion." A single event can trigger a wide array of commonsense relations—such as what the speaker needs, what they intend, or how they might react. When a model is presented with all these relations simultaneously, it often struggles to distinguish relevant information from noise, leading to responses that may contradict the speaker's actual emotional state. This research addresses the challenge of dynamically selecting relevant commonsense knowledge to ensure logical and empathetic responses.

2. The DCKS Framework

The proposed DCKS framework is built upon a BART-based Transformer architecture and operates through three distinct stages designed to refine the infusion of knowledge.

2.1 Contextual Probing

To understand the speaker's context, the model utilizes COMET (a generative commonsense model) to produce five specific types of inferences from the input: xReact (reaction), xWant (desires), xNeed (preconditions), xIntent (motivation), and xEffect (results). This provides a broad spectrum of potential commonsense background for any given utterance.

2.2 Contextual Unification Workspace

Inspired by Global Workspace Theory in cognitive science, this module acts as the system's central processing unit. It employs a two-stage process to manage the information flow:

  • Competition Stage: The model recursively evaluates which commonsense relations conflict with the predicted emotion. Using a nonlinear regression method, it calculates dynamics ($\delta$) to identify and eliminate irrelevant knowledge. This "competition" ensures that only the most contextually appropriate information survives.
  • Broadcasting Stage: The "winner" of the competition—the most relevant knowledge—is used to rectify the internal representations before they are passed to the decoder.

2.3 Knowledge-Aware Decoder

Rather than using a standard decoder, DCKS implements a Knowledge Refiner. This gating mechanism dynamically weights the refined commonsense knowledge against the original dialogue history. This ensures that the final response is grounded in both the immediate conversation and the deeper commonsense context.

3. Experimental Setup

3.1 Dataset

The model was evaluated using the EmpatheticDialogues dataset, which contains approximately 25,000 multi-turn conversations grounded in 32 distinct emotion labels (e.g., proud, furious, nostalgic). The data was partitioned into an 8:1:1 split for training, validation, and testing.

3.2 Baselines

DCKS was compared against several competitive baselines, including:

  • MoEL: A model that uses multiple emotion-specific decoders.
  • MIME: A model that mimics the speaker's emotion to generate responses.
  • CEM: A state-of-the-art model that incorporates both affective and cognitive information.

4. Results and Discussion

4.1 Automatic Evaluation

DCKS demonstrated superior performance across all primary metrics. Most notably, the model achieved a Perplexity (PPL) of 16.08, representing a 56% improvement over the previous state-of-the-art (CEM at 36.33). This indicates a significantly higher level of confidence and coherence in the generated text. Additionally, the model's Emotion Accuracy reached 49.16%, a 34% improvement over CEM, suggesting that the filtering mechanism effectively clarifies the emotional intent of the speaker.

4.2 Human Evaluation

In blind human evaluations, DCKS was rated higher in Coherence, Empathy, Informativeness, and Continuity. The significant lead in "Continuity" suggests that by reducing knowledge noise, the model generates responses that are more engaging and better at sustaining a natural conversation flow.

4.3 Low-Resource Performance

An analysis of the model's efficiency revealed that DCKS is highly robust. When trained on only 25% of the available data, it performed comparably to baseline models trained on the full dataset, highlighting the effectiveness of its knowledge-infusion strategy.

5. Conclusion

The primary insight of this work is that in the context of empathetic AI, "less is more." By dynamically filtering commonsense knowledge rather than simply accumulating it, the DCKS model avoids the pitfalls of knowledge confusion. The integration of cognitive science principles, specifically Global Workspace Theory, provides a successful framework for managing complex information in dialogue systems.

Future work will address the limitations of current NLP metrics, which often fail to capture the nuances of empathy, and explore the application of DCKS in task-oriented dialogues where empathy must be balanced with functional objectives.

Summary updated

BibTeX
@inproceedings{cai2023improving,
  author = {Hua Cai and Xuli Shen and Qing Xu and Weilin Shen and Xiaomei Wang and Weifeng Ge and Xiaoqing Zheng and Xiangyang Xue},
  title = {{Improving Empathetic Dialogue Generation by Dynamically Infusing Commonsense Knowledge}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.498},
}
Figure