NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Template Guided Text Generation for Task-Oriented Dialogue

Mihir Kale, Abhinav Rastogi

Introduction

Virtual assistants must scale across thousands of APIs and domains. Traditional Natural Language Generation (NLG) approaches struggle with this scale, either requiring labor-intensive manual templates or massive amounts of labeled data for every new service. In "Template Guided Text Generation for Task-Oriented Dialogue," Mihir Kale and Abhinav Rastogi present T2G2, a method that leverages pre-trained language models to achieve high-quality, data-efficient dialogue generation.

The Challenge: Data-Efficient Generalization

Modern assistants face a "long tail" of services. Developers typically choose between:

  1. Hand-written templates: High control but unscalable.
  2. Data-driven models: These translate structured data (e.g., inform(price=cheap)) into text but often require thousands of examples per domain to avoid hallucinations or failures in zero-shot scenarios.

The authors aim to bridge this gap by enabling a single NLG model to generalize to unseen APIs with minimal or zero training data.

Methodology: T2G2

The core innovation is Template-Guided Text Generation (T2G2). Instead of training a model to translate structured code directly into natural language—a task that is "alien" to models pre-trained on natural text—the authors formulate NLG as a text-rewriting task.

The T2G2 workflow: converting structured intent into robotic templates, which are then rewritten by T5 into natural responses.

The process involves three steps:

  1. Action to Template: Convert individual system actions into simple, "robotic" sentences (e.g., inform(rating="4") becomes "Its rating is 4").
  2. Concatenation: Combine these sentences into a single, potentially clunky string.
  3. T5 Rewriting: Use a pre-trained T5 model to rewrite the string into a fluent, natural-sounding response.

By providing "robotic" templates as semantic scaffolding, T2G2 reduces representation bias, allowing the model to focus on stylistic refinement rather than structural translation.

Evaluation and Datasets

The researchers evaluated T2G2 on several benchmarks, most notably the Schema-Guided Dialogue (SGD) dataset. SGD includes 45 APIs across 20 domains and is specifically designed to test generalization to unseen services. To further explore data efficiency, the authors introduced FewShotSGD, a standardized split for few-shot learning with training sets ranging from 5 to 80 dialogues.

Key Results

T2G2 demonstrated remarkable performance across several metrics:

  • Zero-Shot Mastery: On unseen domains, T2G2 achieved a 22.2 BLEU score, significantly higher than the 14.9 achieved by naive baselines.
  • Extreme Data Efficiency: A T2G2 model trained on just 80 dialogues outperformed a standard model trained on the entire dataset (over 20 times more data).
  • Accuracy: The model achieved a 0.0% Slot Error Rate (SER) on unseen domains, ensuring no information was lost or hallucinated.
Slot Error Rate (SER) comparison across different training data sizes, showing T2G2's superior performance in few-shot settings.

Human evaluations further validated these results, with T2G2 often rated as more natural than human-authored ground truth responses.

Conclusion

T2G2 proves that pre-trained language models are exceptionally effective at editing text. By using simple templates to bridge the gap between structured data and natural language, the authors provide a scalable, data-efficient path for building sophisticated virtual assistants capable of supporting an ever-expanding ecosystem of services.

Summary updated

BibTeX
@inproceedings{kale2020template,
  author = {Mihir Kale and Abhinav Rastogi},
  title = {{Template Guided Text Generation for Task-Oriented Dialogue}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.emnlp-main.527},
}
Figure