Graph Guided Question Answer Generation for Procedural Question-Answering

Hai X. Pham, Isma Hadji, Xinnuo Xu, Ziedune Degutyte, Jay Rainey, Evangelos Kazakos, Afsaneh Fazly, Georgios Tzimiropoulos, Brais Martínez

Abstract

In this paper, we focus on task-specific question answering (QA). To this end, we introduce a method for generating exhaustive and high-quality training data, which allows us to train compact (e.g., run on a mobile device), task-specific QA models that are competitive against GPT variants. The key technological enabler is a novel mechanism for automatic question-answer generation from procedural text which can ingest large amounts of textual instructions and produce exhaustive in-domain QA training data. While current QA data generation methods can produce well-formed and varied data, their non-exhaustive nature is sub-optimal for training a QA model. In contrast, we leverage the highly structured aspect of procedural text and represent each step and the overall flow of the procedure as graphs. We then condition on graph nodes to automatically generate QA pairs in an exhaustive and controllable manner. Comprehensive evaluations of our method show that: 1) small models trained with our data achieve excellent performance on the target QA task, even exceeding that of GPT3 and ChatGPT despite being several orders of magnitude smaller. 2) semantic coverage is the key indicator for downstream QA performance. Crucially, while large language models excel at syntactic diversity, this does not necessarily result in improvements on the end QA model. In contrast, the higher semantic coverage provided by our method is critical for QA performance.

Introduction

While Large Language Models (LLMs) have demonstrated remarkable general-purpose capabilities, their deployment on resource-constrained devices like mobile phones or smart assistants remains a challenge due to high computational requirements. To develop efficient, task-specific models, high-quality training data is essential. However, existing datasets often lack the specificity required for procedural text—instructions for tasks such as cooking or hardware assembly.

Procedural text presents unique challenges, including the need for precise factual details (e.g., "What tool is required for this step?") and complex temporal reasoning (e.g., "What ingredients are in the mixture after step 3?"). Current automatic data generation methods are frequently non-exhaustive, failing to capture the full breadth of potential user queries. This research addresses these gaps by utilizing the inherent structure of instructions to generate a comprehensive set of Question-Answering (QA) pairs.

Methodology

The proposed pipeline transforms raw procedural text into structured semantic representations to guide the generation process through two primary graph types:

1. Abstract Meaning Representation (AMR)

For individual instructional steps, the text is converted into an AMR graph. This semantic representation identifies core components such as actions, agents, and objects. By systematically "masking" specific nodes (e.g., ingredients, tools, or durations) and transforming the graph into a "Question AMR," the system can generate targeted questions. A pre-trained AMR-to-text model then converts these structured queries back into natural language.

Figure 1: The process of masking nodes within an AMR graph to generate specific, controllable questions.

2. Action Flow Graphs

To address temporal and compositional questions, the system utilizes Action Flow graphs. These graphs track the state of ingredients as they transform and move throughout a procedure. This allows the model to generate questions regarding the order of operations and the specific composition of intermediate mixtures that are not explicitly named in the text.

3. Hybrid Augmentation

While graph-based methods ensure high semantic coverage, the authors incorporate LLMs (such as GPT-3) to enhance syntactic diversity. This hybrid approach uses paraphrasing and answer-based augmentation to ensure the model is robust to various ways a user might phrase a question.

Experimental Evaluation

The models were evaluated using a source dataset of 100 recipes from BBC Food. To provide a rigorous benchmark, the authors introduced a new Human-Annotated PQA Set consisting of 1,857 QA pairs collected through interactive simulations where humans asked natural questions during a cooking task.

Key Results

The evaluation demonstrated that semantic coverage is a superior indicator of downstream QA performance compared to syntactic diversity. A compact T5-base model (220M parameters) trained on this graph-generated data achieved an F1 score of 42.8, outperforming significantly larger models including GPT-3 (42.1) and ChatGPT (41.6).

Figure 2: Performance metrics comparing various T5 model sizes and LLM baselines on the procedural QA task.

Even the T5-small variant (60M parameters) showed competitive performance, validating the hypothesis that exhaustive, in-domain data can compensate for smaller model scales. Human evaluations further confirmed that graph-guided questions, when combined with LLM augmentation, nearly match human-generated questions in terms of correctness, adequacy, and answerability.

Conclusion and Future Work

This work proves that "small but mighty" models can achieve state-of-the-art performance in specialized domains when provided with exhaustive training data. The use of AMR and Action Flow graphs provides a level of control and coverage that raw LLM prompting cannot currently replicate.

Future research directions include expanding these semantic infrastructures to support non-English languages and extending the graph representations to multi-modal contexts, such as generating QA pairs directly from instructional video content. While the current method is highly effective for linear procedures like recipes, further refinement may be needed for non-linear documentation containing complex conditional branches.

Summary updated

BibTeX
@inproceedings{pham2024graph,
  author = {Hai X. Pham and Isma Hadji and Xinnuo Xu and Ziedune Degutyte and Jay Rainey and Evangelos Kazakos and Afsaneh Fazly and Georgios Tzimiropoulos and Brais Martínez},
  title = {{Graph Guided Question Answer Generation for Procedural Question-Answering}},
  booktitle = {EACL},
  year = {2024},
  url = {https://openreview.net/forum?id=cpUQu8wluh},
}
Figure