Template-Based Question Generation from Retrieved Sentences for Improved Unsupervised Question Answering

Alexander R. Fabbri, Patrick Ng, Zhiguo Wang, Ramesh Nallapati, Bing Xiang · DOI

Introduction

Modern Question Answering (QA) systems typically rely on massive, human-labeled datasets like SQuAD. However, creating these datasets is expensive and lacks scalability for specialized domains such as medical or legal documentation. This paper introduces a novel unsupervised approach for training QA models by generating synthetic training data from retrieved sentences. By using a simple template-based system on sentences related to—but distinct from—the target context, the authors force the model to learn complex relationships rather than simple pattern matching, achieving state-of-the-art performance for unsupervised QA.

Methods

The authors propose a three-step pipeline to create higher-quality, non-trivial synthetic training data:

  1. Sentence Retrieval: Instead of generating a question from the context sentence itself, they use that sentence as a query in an ElasticSearch index of Wikipedia. They look for a different sentence that contains the same answer entity but isn't a direct copy (plagiarism check).
  2. Template-Based Generation: Once a related sentence is found, they break it into fragments around the answer: [Fragment A] [Answer] [Fragment B]. They then apply a template to turn this into a question, such as: Wh-word + Fragment B + Fragment A + ?.
  3. Wh-word Selection: They use a Named Entity Recognition (NER) system (spaCy) to identify the answer type and sample an appropriate "Wh-word" (Who, Where, What, etc.) based on the probability of that word appearing with that entity type in existing datasets.
Example of the question generation pipeline from a retrieved sentence.

Finally, they fine-tune a BERT-large model on this synthetic data generated from Wikipedia and evaluated on benchmarks like SQuAD v1.1.

Key Insights

  • Retrieval as a Regularizer: The most significant innovation is using a retrieved sentence. Because the question is based on a sentence that isn't in the context paragraph, the model cannot rely on simple string matching. This acts as a form of regularization, forcing the model to understand the semantic relationship between the question and the context.
  • Simplicity Wins: While many researchers attempt to use complex neural networks (Seq2Seq) to generate questions, this paper shows that simple, well-structured templates often perform better for unsupervised tasks because they maintain grammatical structure and clear intent.
  • The "Wh-" Signal: The authors found that including the correct Wh-word (like "Where" for a location) is a massive boost for the model, as it provides a strong prior for the type of entity the model should be looking for in the text.

Key Results

The proposed method significantly outperformed previous unsupervised benchmarks:

  • SQuAD Test F1: Achieved 64.04, a substantial jump from the previous state-of-the-art of 56.40.
  • Named Entity Performance: On the SQuAD-NER subset, the model reached an F1 of 77.55.
  • Efficiency: The unsupervised model performed as well as a supervised model trained on roughly 3,000 human-labeled examples.
  • Data Scaling: Interestingly, performance peaked at around 100,000 synthetic examples. Beyond that, the "distributional mismatch" between synthetic data and real human questions started to hurt performance.
F1 score performance relative to the number of training samples.

Limitations and Future Work

The method is heavily reliant on Named Entity Recognition, meaning it excels at "Who/Where/When" questions but might struggle with "Why" or "How" questions that require more abstract answers. Additionally, while templates are reliable, they can sometimes produce awkward phrasing. Future work aims to test this framework on more diverse domains and explore using language models to "smooth" the generated questions.

Summary updated

BibTeX
@inproceedings{fabbri2020template,
  author = {Alexander R. Fabbri and Patrick Ng and Zhiguo Wang and Ramesh Nallapati and Bing Xiang},
  title = {{Template-Based Question Generation from Retrieved Sentences for Improved Unsupervised Question Answering}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.acl-main.413},
}
Figure