Question Directed Graph Attention Network for Numerical Reasoning over Text

Kunlong Chen, Weidi Xu, Xingyi Cheng, Zou Xiaochuan, Yuyu Zhang, Le Song, Taifeng Wang, Yuan Qi, Wei Chu

Introduction

While Large Language Models (LLMs) like BERT and RoBERTa excel at extracting text spans, they frequently struggle with "discrete reasoning" tasks such as addition, subtraction, sorting, or counting. Current approaches often lack contextual grounding—failing to distinguish between different types of numbers like dates versus population counts—and rely on static reasoning paths that do not adapt to the specific nuances of a question.

To address these gaps, the Question Directed Graph Attention Network (QDGAT) represents passages as heterogeneous graphs of numbers and entities. By using the question to dynamically guide message-passing across these graphs, the model achieves state-of-the-art performance on numerical reasoning benchmarks.

Methodology: Question-Directed Reasoning

The QDGAT framework operates in three distinct stages: graph construction, question-directed attention, and answer prediction.

The QDGAT architecture: text and questions are encoded via RoBERTa, followed by iterative question-conditioned reasoning steps on a heterogeneous graph, leading to a specialized prediction module.

1. Heterogeneous Graph Construction

The model builds a graph where nodes represent both numbers and entities (e.g., people, places). Numbers are categorized into eight types, such as Date, Percentage, or Yardage, to prevent "mixing apples and oranges." Edges connect numbers of the same type and link numbers to entities mentioned in the same sentence, creating relational "bridges" across the text.

2. Question Directed Graph Attention (QDGAT)

In a standard Graph Attention Network (GAT), nodes attend to neighbors based on their own features. In QDGAT, the question representation acts as a "command vector" that modulates the attention mechanism. This allows the model to prioritize relevant nodes—for instance, focusing on casualty figures while ignoring dates when asked about battle losses.

Visualization of the reasoning process: the question acts as a pivot, directing attention across the graph over multiple steps (T=1, T=2, etc.) to isolate relevant numerical information.

3. Prediction Module

The final node representations are processed by specialized heads designed for different answer types: span extraction, counting (0-9), or arithmetic. For arithmetic, the model assigns a coefficient (+1, -1, or 0) to each number to compute the final sum.

Experimental Results

The model was evaluated on the DROP (Discrete Reasoning Over Paragraphs) benchmark, a collection of ~96,000 questions requiring mathematical operations over Wikipedia articles. QDGAT achieved a state-of-the-art 86.38 F1 score, significantly outperforming previous models like NumNet+.

To test generalization, the researchers used RACENum, a subset of English exams for Chinese students. QDGAT outperformed competitors by an average of 4.41 points, suggesting it learns fundamental reasoning principles rather than just dataset-specific patterns. Ablation studies confirmed that both the "Question Direction" and the inclusion of number types/entities are essential for high performance.

Conclusion and Future Directions

QDGAT demonstrates that type-awareness and dynamic, question-conditioned reasoning are critical for machine reading comprehension. By using entities as "relational glue," the model can connect disparate pieces of information across a passage.

Current limitations include a reliance on heuristic graph building (NER and rule-based extraction) and a focus on basic arithmetic. Future work aims to move toward automatically learned graph structures and support for more complex operations like multiplication and multi-step nested logic.

Summary updated

BibTeX
@inproceedings{chen2020question,
  author = {Kunlong Chen and Weidi Xu and Xingyi Cheng and Zou Xiaochuan and Yuyu Zhang and Le Song and Taifeng Wang and Yuan Qi and Wei Chu},
  title = {{Question Directed Graph Attention Network for Numerical Reasoning over Text}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  doi = {10.18653/v1/2020.emnlp-main.549},
}
Figure