Learning to Select External Knowledge with Multi-Scale Negative Sampling

Huang He, Hua Lu, Siqi Bao, Fan Wang, Hua Wu, Zhengyu Niu, Haifeng WangIEEE/ACM Trans. ASLP 2021 · DOI

Introduction

Task-oriented dialogue systems (TDS), such as virtual assistants, typically rely on structured APIs and databases to fulfill user requests. While effective for predefined tasks like booking a flight or checking the weather, these systems often fail when a user's query falls outside the narrow scope of the API schema. For instance, a user might ask about the specific amenities or policies of a hotel that aren't captured in the database.

To address this, researchers are increasingly incorporating unstructured external knowledge—such as FAQs or website snippets—into dialogue pipelines. This paper presents a state-of-the-art approach developed for the DSTC9 Track-1 challenge, utilizing schema-guided decision-making and multi-scale negative sampling to bridge the gap between structured task completion and unstructured knowledge retrieval.

Methodology

The proposed system follows a three-stage pipeline built upon the PLATO-2 architecture, a large-scale pre-trained dialogue model designed for high-quality response generation.

1. Schema-Guided Knowledge Decision

A critical challenge in hybrid dialogue systems is determining when to search for external knowledge versus when to rely on internal APIs. Traditional models often make this decision based solely on the conversation history. This paper introduces a schema-guided approach where the system "understands" its own capabilities through natural language descriptions of its APIs (schemas).

Example of service schemas for hotel and attraction domains.

By comparing the dialogue context against both these API schemas and potential knowledge snippets, the model can more accurately decide whether a user's request can be handled by an existing function or requires an external search. This provides a "safety net" that allows the model to generalize to new domains by reading descriptions rather than relying on memorized patterns.

2. Multi-Scale Negative Sampling

The core innovation of this work lies in its retrieval strategy. Standard retrieval models are trained to distinguish a correct document from a random incorrect one. However, in complex dialogue scenarios, "random" negatives are often too distinct to provide a meaningful training signal. The authors propose Multi-Scale Negative Sampling, which introduces four levels of difficulty:

  • Random: Snippets from entirely unrelated domains.
  • In-Domain: Snippets from the same domain (e.g., a different hotel).
  • In-Entity: Snippets regarding the same specific entity (e.g., a different fact about the same hotel).
  • Cross-Entity: Snippets about an entity mentioned earlier in the conversation but not currently relevant.

This hierarchical approach forces the model to learn fine-grained semantic distinctions, significantly improving its ability to find the "needle in the haystack" among thousands of similar documents.

3. Knowledge-Grounded Generation

Once the correct knowledge snippet is retrieved, it must be integrated into a natural-sounding response. The system employs a Transformer-based generator that balances context awareness with factual accuracy.

Transformer-based architecture for response generation.

As shown in the architecture, the model uses a mix of bi-directional attention to process the conversation context and retrieved knowledge, and uni-directional attention to generate the response token-by-token. This ensures the output remains coherent with the history while strictly adhering to the provided information, avoiding the "hallucinations" common in simpler generative models.

Experimental Results

The model was evaluated on the DSTC9 Track-1 dataset, an augmented version of MultiWOZ 2.1 containing over 71,000 samples and 12,000 knowledge snippets. The test set specifically included "unseen" domains and locales to evaluate the system's generalization capabilities.

The proposed method achieved exceptional results, ranking 1st place in the DSTC9 human evaluation with a score of 4.39/5.0 for both Accuracy and Appropriateness—very close to the ground-truth human score of 4.52. In terms of automated metrics, the system achieved a Recall@1 of 0.9235 for knowledge selection and an F1-score of 0.9886 for knowledge search detection.

Conclusion

The success of this pipeline highlights two key insights: first, that harder training through multi-scale negative sampling is essential for high-precision retrieval; and second, that natural language schemas provide a robust framework for generalizing to new domains. While the model occasionally struggles with highly complex snippets containing multiple information segments, it represents a significant step forward in creating dialogue agents that can seamlessly navigate both structured and unstructured information.

Summary updated

BibTeX
@article{he2021learning,
  author = {Huang He and Hua Lu and Siqi Bao and Fan Wang and Hua Wu and Zhengyu Niu and Haifeng Wang},
  title = {{Learning to Select External Knowledge with Multi-Scale Negative Sampling}},
  journal = {IEEE ACM Trans. Audio Speech Lang. Process.},
  year = {2021},
  doi = {10.1109/taslp.2023.3301222},
}
Figure