Stylized Knowledge-Grounded Dialogue Generation via Disentangled Template Rewriting

Qingfeng Sun, Can Xu, Huang Hu, Yujing Wang, Jian Miao, Xiubo Geng, Yining Chen, Fei Xu, Daxin Jiang

Introduction

Knowledge-Grounded Dialogue (KDG) systems are designed to provide informative responses by leveraging external knowledge sources like Wikipedia. However, these models often suffer from a "pedantic" communication style, frequently copying technical text verbatim. This results in robotic interactions that lack the personality and engagement necessary for natural human-AI conversation. The primary challenge in addressing this is the scarcity of parallel datasets that contain both factual knowledge and specific linguistic styles (e.g., politeness or enthusiasm), alongside the risk that introducing style might lead to factual hallucinations.

To bridge this gap, we present Disentangled Template Rewriting (DTR), a novel framework that decouples factual content from linguistic style. By treating style as a modular layer applied to a factual foundation, DTR enables the generation of knowledgeable, stylized responses without the need for expensive, human-labeled stylized-factual datasets.

The DTR Framework

The DTR framework operates on a Generate-Disentangle-Rewrite paradigm. Rather than attempting to generate a stylized factual response in a single pass—which often leads to a trade-off between accuracy and style—the process is broken into three distinct stages:

  1. Generate: A standard KDG model produces an initial "pedantic" but factually accurate response based on the dialogue context and a retrieved knowledge document.
  2. Disentangle: A Sequential Style Disentangler, powered by a BERT-based architecture, identifies tokens associated with linguistic style (e.g., "dislike," "horrible," "wonderful") and replaces them with a generic [*] placeholder. This creates a style-agnostic template that preserves the core factual entities and relational structure.
  3. Rewrite: A Style Rewriter takes the template and fills the placeholders with tokens that align with the target style (e.g., transforming a neutral statement into one that is polite or enthusiastic).

Training Strategy and Weak Supervision

Training such a system is difficult because there is no "ground truth" for how a specific fact should look in a specific style. To overcome this, DTR utilizes Reinforcement Learning (REINFORCE). The model is optimized based on two primary reward signals:

  • Style Intensity: A pre-trained classifier evaluates how well the output matches the target style.
  • Semantic Similarity: The model is rewarded for maintaining the factual integrity of the original pedantic response.

To stabilize the inherently fragile RL training process, the researchers implemented a Weakly Supervised initialization. They observed that style fragments are often "low-entropy"—they are easier for a denoising autoencoder to reconstruct than specific factual entities. This allows the model to learn which words to mask as style before the reinforcement learning phase begins, providing a much stronger starting point for the rewriter.

Experimental Evaluation

The model was evaluated using two major dialogue benchmarks: Wizard of Wikipedia (WoW) and Topical Chat. For style transfer, the researchers utilized the Amazon Dataset (for sentiment) and the P9-bucket (for politeness).

DTR was compared against state-of-the-art stylized dialogue models, including StyleDGPT and StylizedDU. The results demonstrated significant improvements across multiple dimensions:

  • Factual Relevance: On the Wizard of Wikipedia dataset, DTR achieved an F1 score of 31.3, a substantial increase over the 21.7 achieved by the next best stylized baseline.
  • Style Accuracy: DTR consistently reached higher style intensity targets while maintaining superior factual grounding compared to end-to-end models.
  • Human Evaluation: In head-to-head comparisons, human annotators preferred DTR's responses over baselines more than 50% of the time, citing better style consistency, knowledge preservation, and overall fluency.

Discussion and Future Work

The success of DTR highlights that decoupling style from knowledge is a highly effective strategy for KDG. By creating a physical template, the model is structurally prevented from overwriting facts while attempting to be stylish. Furthermore, the study suggests that engagement is not just about being "positive"; even negative or polite styles can significantly improve user retention compared to standard pedantic outputs.

Despite these gains, limitations remain. DTR is dependent on the quality of the initial base model; if the first factual response is incorrect, the stylized rewrite will propagate that error. Additionally, the current disentangler operates primarily at the token and phrase level. Future research could explore more complex structural rewriting, such as altering the entire syntax of a sentence to better reflect a target persona. Finally, while weak supervision helps, the computational cost of Reinforcement Learning remains a factor for large-scale deployment.

Summary updated

BibTeX
@inproceedings{sun2022stylized,
  author = {Qingfeng Sun and Can Xu and Huang Hu and Yujing Wang and Jian Miao and Xiubo Geng and Yining Chen and Fei Xu and Daxin Jiang},
  title = {{Stylized Knowledge-Grounded Dialogue Generation via Disentangled Template Rewriting}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.naacl-main.241},
}
Figure