Abstract: Automatic question generation can benefit many applications ranging from dialogue systems to reading comprehension. While questions are often asked with respect to long documents, there are many challenges with modeling such long documents. Many existing techniques generate questions by effectively looking at one sentence at a time, leading to questions that are easy and not reflective of the human process of question generation. Our goal is to incorporate interactions across multiple sentences to generate realistic questions for long documents. In order to link a broad document context to the target answer, we represent the relevant context via a multi-stage attention mechanism, which forms the foundation of a sequence to sequence model. We outperform state-of-the-art methods on question generation on three question-answering datasets - SQuAD, MS MARCO and NewsQA.
Introduction
Automatic Question Generation (QG) involves taking a document and a specific answer span to generate a relevant, natural-sounding question. Historically, QG models have suffered from "myopia," focusing almost exclusively on the single sentence containing the answer. This approach fails to capture the complexity of human-generated questions; analysis of the SQuAD dataset reveals that approximately 30% of human questions rely on information found in surrounding sentences. When models ignore this broader context, they produce simplistic questions that lack depth and fail to capture the semantic nuances of the source material. The primary challenge lies in modeling these long-distance dependencies without being overwhelmed by the "noise" inherent in long documents.
Methodology
To address the limitations of single-sentence models, we propose a multi-stage recursive attention mechanism integrated into a sequence-to-sequence (Seq2Seq) framework. The architecture consists of several key components:
- Input Encoding: Both the document and the target answer are encoded using a shared Bidirectional Long Short-Term Memory (BiLSTM) network to capture contextual information.
- Multi-Stage Attention: The model employs a recursive attention process. In the initial stage, it identifies document words directly related to the answer. In the subsequent stage, the model uses the representation from the first stage to attend to the document again. This allows the model to identify indirect relationships—linking words related to the context of the first stage rather than just the literal answer.
- Answer Masking: To prevent the model from simply copying the answer into the question, the answer's representation in the final context is replaced with a special masking vector. This forces the model to understand the semantic role of the answer within the document.
- Decoding via Pointer-Generator: A Pointer-Generator Network allows the model to either generate words from a fixed vocabulary or copy specific terms (like names or dates) directly from the document.
Experimental Results
We evaluated our model on three major reading comprehension datasets: SQuAD (Wikipedia-based), MS MARCO (search query-based), and NewsQA (news article-based). The latter is particularly challenging due to its longer document lengths (averaging 583 words).
Our model established a new state-of-the-art across all benchmarks. On SQuAD, the model achieved a 45.89 ROUGE-L score, a significant improvement over previous baselines. On MS MARCO, it achieved an 18.25 Bleu-4 score, nearly doubling the performance of earlier seminal models like LTA. Even on the long-form documents of NewsQA, our model outperformed the CGC-QG baseline by 1.3 points in Bleu-4.
The "Sweet Spot" of Context
A critical finding of our research is the existence of an optimal depth for recursive attention. As shown in Figure 2, performance peaks at two stages of attention. While one stage is insufficient to capture indirect relationships, three stages lead to a decrease in performance. We hypothesize that beyond two stages, the context becomes "cloudy" or diluted, as the model begins to attend to irrelevant noise within the document.
Furthermore, ablation studies highlighted the necessity of answer masking. Removing the masking mechanism resulted in a Bleu-4 score drop of over 12 points, confirming that masking is essential for forcing the model to reason about the answer's context.
Conclusion
By incorporating a multi-stage attention mechanism, we have demonstrated that models can effectively move beyond single-sentence myopia to generate more sophisticated and human-like questions. While our model sets a new standard for performance, challenges remain in scaling to even deeper contexts without losing focus. Future work will explore methods to further bridge the gap between machine-generated and human-generated questions, particularly in terms of naturalness and reasoning complexity in very long documents.
Summary updated