Stylized Dialogue Generation with Feature-Guided Knowledge Augmentation

Jinpeng Li, Zekai Zhang, Xiuying Chen, Dongyan Zhao, Rui Yan

Abstract

Generating dialogue responses in specific styles—such as formal, academic, or literary—is a significant challenge in natural language processing due to the scarcity of parallel training data. We present KASDG (Knowledge-Augmented Stylized Dialogue Generation), a framework that leverages external style-rich corpora through a novel feature-guided selection module. By retrieving stylistic sentences and filtering them based on the conversation context, KASDG generates responses that are both contextually relevant and stylistically consistent. Our evaluation on the arXiv and Holmes datasets shows that KASDG significantly outperforms existing baselines in both automated metrics and human evaluation.

Introduction

The primary hurdle in stylized dialogue generation is the lack of parallel data. While researchers have access to millions of standard dialogue pairs and vast collections of stylized text (e.g., the works of Arthur Conan Doyle), they rarely possess "Normal Context → Stylized Response" pairs for direct training. Existing methods often rely on back-translation to create pseudo-data, but these signals are frequently noisy and context-agnostic, leading to responses that may use the correct vocabulary but fail to address the dialogue's actual topic. KASDG addresses this by explicitly injecting style knowledge and filtering it to ensure it fits the specific conversational context.

Methodology

KASDG utilizes a BART-based encoder-decoder architecture enhanced by three primary components designed to bridge the gap between style and context.

Style Sentence Retrieval and Feature Selection

The model first employs Sentence-BERT to retrieve semantically similar sentences from a "Style Corpus" (e.g., arXiv papers or Holmes novels) based on the current conversation context. To prevent the model from simply copy-pasting irrelevant stylistic phrases, a Feature-Guided Selection Module uses an attention mechanism to filter these retrieved sentences. This module uses the conversation context as a guide to extract only the stylistic features that are relevant to the current topic.

The KASDG architecture, highlighting the Style Encoder, Context Encoder, and the Style-aware Attention mechanism used for response generation.

Advanced Loss Functions

The framework is optimized using two specialized loss functions:

  1. Response-Related Contrastive Learning (CL): This ensures that the filtered style features are mathematically closer to the target response than the raw retrieved sentences.
  2. Style Responsiveness Kullback-Leibler (SRKL) Loss: This minimizes the gap between the "prior" style (predicted from context) and the "posterior" style (observed in the final response), ensuring the style reacts dynamically to the input.

Experiments and Results

We evaluated KASDG against several strong baselines, including DialoGPT and StyleDGPT, using the TCFC (Topical Chat Formality Corpus), arXiv, and Holmes datasets.

Quantitative Performance

KASDG demonstrated substantial improvements across all automated metrics. On the arXiv dataset, KASDG achieved a BLEU-1 score of 35.11, nearly doubling the 19.04 achieved by StyleDGPT. Similar trends were observed in the Holmes dataset, where KASDG reached a BLEU-1 of 36.86.

Comparison of KASDG against baselines on arXiv and Holmes datasets, showing significant gains in BLEU and Rouge-L metrics.

Human Evaluation and Qualitative Analysis

In blind human tests, KASDG was rated higher in Fluency, Relevance, and Style Consistency. Qualitatively, the model successfully adopts complex personas. For instance, in the Holmes style, instead of a generic "I agree," the model might generate: "I would suggest that the professor's conduct should be reported to the police," effectively blending topical context with the detective's characteristic vocabulary.

Discussion and Conclusion

A key insight of this work is that retrieval alone is insufficient; style must be treated as a responsive element of the dialogue. By using the context to filter stylistic features, KASDG avoids "style-bleeding"—the inclusion of stylistic but irrelevant content.

While KASDG effectively mitigates the need for parallel data, it remains dependent on the quality of the external Style Corpus. Future work will explore integrating the explicit knowledge-augmentation of KASDG with the broad reasoning capabilities of Large Language Models (LLMs) to further refine stylistic nuances in low-resource settings.

Summary updated

BibTeX
@inproceedings{li2023stylized,
  author = {Jinpeng Li and Zekai Zhang and Xiuying Chen and Dongyan Zhao and Rui Yan},
  title = {{Stylized Dialogue Generation with Feature-Guided Knowledge Augmentation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.findings-emnlp.475},
}
Figure