A Template-guided Hybrid Pointer Network for Knowledge-based Task-oriented Dialogue Systems

Dingmin Wang, Ziyao Chen, Wanwei He, Li Zhong, Yunzhe Tao, Min Yang

Abstract

Task-oriented dialogue systems often struggle with a "Goldilocks" problem: they are either too rigid (rule-based) or too unpredictable (purely generative). Purely generative models often suffer from exposure bias, where a single error early in a sequence can derail the entire response. We present the Template-guided Hybrid Pointer Network (THPN), a novel architecture that retrieves similar past conversations to serve as "guidance templates." By utilizing a hybrid pointer network to copy sentence structures from these templates and specific facts from a knowledge base, THPN produces more stable, readable, and accurate responses than standard generative models.

Introduction

In modern task-oriented dialogue systems, neural networks have become the standard. However, standard encoder-decoder architectures often ignore the underlying structure of human conversation in specific tasks. For example, navigation responses frequently follow predictable patterns like: "I will be navigating you to [Destination] right now." Standard models try to learn this structure from scratch for every turn, leading to instability and low informativeness. To address this, THPN combines the flexibility of neural generation with the structural reliability of traditional template-based systems.

The THPN Framework

THPN introduces a three-pronged approach to response generation, mediated by a retrieval module and a hybrid pointer network.

1. Retrieval and Guidance

When a user submits a query, the system uses BERT to search a repository of previous dialogues for the most similar questions. The corresponding answers are retrieved to serve as guidance templates. This provides a structural "scaffolding" for the model to follow.

Figure 3: Examples of navigation and weather dialogues showing how retrieved templates (q1, a1) provide structural guidance for the gold response.

2. Hybrid Pointer Network Architecture

The core innovation of THPN is its hybrid pointer network, which features three distinct generation heads:

  • Vocabulary Generator: Predicts common linguistic tokens (e.g., "the", "is") from a standard dictionary.
  • Entity Pointer Network (EPN): Specifically trained to "point to" and copy factual entities (e.g., restaurant names, addresses) from the dialogue history or Knowledge Base (KB).
  • Pattern Pointer Network (PPN): Trained to copy the structural "pattern words" from the retrieved guidance templates.
Figure 2: The full THPN architecture, illustrating the interaction between the Memory Information, the Hybrid Pointer Network (PPN and EPN), and the gating mechanism (G).

3. Masking and Gating Mechanisms

To ensure the model correctly distinguishes between facts and structure, a masking strategy is employed: non-entity words are masked in the dialogue history, while entity words are masked in the retrieved templates. This forces the EPN to focus on facts and the PPN to focus on structure. A gating mechanism then decides the relative weight of the retrieved template versus the current dialogue context, effectively filtering out "noise" if a retrieved template is not a strong match.

Experimental Results

THPN was evaluated on four major benchmarks: bAbI, In-Car Assistant (KVRET), DSTC2, and CamRest. The model consistently outperformed state-of-the-art baselines such as GLMP and Mem2Seq.

  • Accuracy: On the bAbI dataset, THPN achieved nearly 100% per-response accuracy across most tasks, significantly outperforming older models on complex multi-turn tasks.
  • Informativeness: On the KVRET dataset, THPN reached an Entity F1 score of 37.8, compared to 33.4 for Mem2Seq, demonstrating superior ability in retrieving correct database facts.
  • Readability: On the DSTC2 dataset, the model achieved a BLEU score of 59.8, indicating that its generated text closely mirrors human-written responses.

Conclusion

By separating the concerns of what to say (entities) from how to say it (patterns), THPN provides a robust framework for task-oriented dialogue. The use of retrieved templates as structural scaffolding prevents the "drifting" common in long-form neural generation. Future work will explore multi-turn retrieval strategies to further refine the relevance of guidance templates and optimize the computational overhead of the BERT-based retrieval step.

Summary updated

BibTeX
@inproceedings{wang2021template,
  author = {Dingmin Wang and Ziyao Chen and Wanwei He and Li Zhong and Yunzhe Tao and Min Yang},
  title = {{A Template-guided Hybrid Pointer Network for Knowledge-based Task-oriented Dialogue Systems}},
  booktitle = {DialDoc @ ACL},
  year = {2021},
  doi = {10.18653/v1/2021.dialdoc-1.3},
}
Figure