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

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

TL;DR

This research introduces a highly effective unsupervised method for training Question Answering (QA) models without human-labeled data. By retrieving related sentences from Wikipedia and transforming them into questions using basic templates, the authors achieved a new state-of-the-art for unsupervised QA on the SQuAD dataset, outperforming previous methods by 14% in F1 score.

The Challenge of Data-Hungry QA Systems

Modern QA systems, particularly those based on transformer architectures like BERT or RoBERTa, are remarkably powerful but notoriously "data-hungry." Achieving high performance typically requires tens of thousands of human-labeled (context, question, answer) triples. Collecting such high-quality data for every new domain or language is often prohibitively expensive.

Unsupervised QA aims to bridge this gap by generating synthetic training data. Previous attempts often relied on "cloze" questions—simply masking a word in a sentence—or complex "style transfer" models. However, cloze questions are often too simplistic, leading models to learn string matching rather than deep comprehension. Conversely, style transfer models can be noisy and unreliable, introducing errors into the training set.

Methodology: Retrieval and Template-Based Generation

The authors propose a two-step pipeline to create high-quality synthetic training data that encourages deeper linguistic understanding.

Overview of the proposed unsupervised QA pipeline, showing the retrieval of related sentences and their conversion into questions.

1. Sentence Retrieval

Instead of generating a question from the original context sentence, the system uses that sentence as a query to find a similar sentence in a large corpus (Wikipedia) via ElasticSearch.

  • The Logic: If the model encounters the answer in a slightly different linguistic context during training than it sees at test time, it is forced to learn more complex relationships rather than just memorizing local patterns. This acts as a form of regularization.
  • Filtering: To ensure quality, the system verifies that the retrieved sentence contains the answer and at least one other matching entity, while ensuring it is not a direct duplicate of the original.

2. Template-Based Question Generation

The retrieved sentence is then transformed into a question using a template. For example, if a sentence follows the structure [Fragment A] [Answer] [Fragment B], it might be rearranged into Wh-word + [Fragment B] + [Fragment A] + ?. The "Wh-word" (Who, What, Where, etc.) is selected based on the Named Entity Recognition (NER) tag of the answer (e.g., "Who" for a PERSON).

Finally, a BERT-large model is fine-tuned on this generated synthetic data.

Key Results and Performance

The proposed method significantly advances the state-of-the-art for unsupervised QA. On the SQuAD test set, the model achieved 64.04 F1, a substantial jump over the previous unsupervised SOTA of 56.40 F1 (Lewis et al., 2019). Performance was even stronger when the answer was a named entity, reaching 77.55 F1.

Comparison of F1 scores against the number of training samples, highlighting the efficiency and superior performance of the synthetic template data compared to previous methods.

One of the most notable findings is the efficiency of this approach. While previous methods required up to 4 million synthetic examples, this approach reached peak performance with only 50,000 to 100,000 examples. This suggests that the quality and structural diversity of the synthetic data are more critical than sheer volume. For context, the unsupervised performance (64.04 F1) is roughly equivalent to a model trained on 3,000 human-labeled examples.

Insights and Future Directions

Several key insights emerged from this study:

  • Retrieval as Regularization: Training on a different but related sentence prevents the model from over-fitting to simple word-overlap patterns found in the original context.
  • Structure Matters: Simply adding a "Wh-" word and a question mark significantly boosts performance compared to fill-in-the-blank tasks, as it aligns the training data more closely with the actual SQuAD evaluation format.
  • Entity Matching: Requiring the retrieved sentence to share at least one other entity with the original context ensures the generated question remains topical and relevant.

Despite these successes, the method relies heavily on NER, making it excellent for "factoid" questions (Who, Where, When) but less effective for complex "Why" or "How" questions requiring multi-sentence reasoning. Future work may involve using language models to "smooth" the rigid templates and expanding the framework to multi-lingual settings.

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