Mapping probability word problems to executable representations

Simon Suster, Pieter Fivez, Pietro Totis, Angelika Kimmig, Jesse Davis, Luc De Raedt, Walter Daelemans

Abstract

Solving probability word problems requires navigating complex linguistic structures and underlying mathematical logic. This paper presents a two-step pipeline that translates natural language into a declarative representation, which is then executed by a probabilistic programming solver. Our results demonstrate that this symbolic approach, particularly when combined with transfer learning from broader mathematical datasets, significantly outperforms end-to-end neural baselines.

Introduction

While large language models have made strides in general reasoning, probability word problems remain a distinct challenge. These problems involve concepts like multisets (e.g., a deck of cards), sampling methods (with or without replacement), and intricate Boolean constraints ("at least one," "given that"). Unlike simple arithmetic, a minor logical error in a probability problem leads to a completely incorrect result, making "near-miss" numerical predictions insufficient.

Methodology

The researchers propose a modular architecture consisting of two primary stages:

  1. Mapping: A sequence-to-sequence model translates the natural language problem into a domain-specific declarative language. This language uses a set of predicates to define the problem's mathematical constraints.
  2. Execution: The generated symbolic code is executed using ProbLog, a probabilistic logic programming system, to derive the exact numerical answer.
Table 1: Predicates and descriptions for the domain-specific language used in the mapping stage.

The study evaluated several encoders for the mapping stage, including BiLSTM, BERT, and GPT-2. To improve performance, the authors also implemented Transfer Learning, pre-training a BERT model on the MathQA dataset to instill a general sense of mathematical logic before fine-tuning on probability-specific data.

Datasets

The primary evaluation was conducted on the NLP4PLP dataset, which contains approximately 2,000 English probability problems. The MathQA dataset, containing over 37,000 problems, served as the source for transfer learning.

Results and Analysis

The experiments revealed a significant gap between "surface" accuracy (how well the model generates the symbolic code) and "execution" accuracy (whether that code produces the correct answer). Even when models achieved high F1 scores on the generated text, small logical errors often led to execution failure.

Table 2: Main results comparing execution and surface accuracy across various models.

As shown in Table 2, the MathQA-BERT (finetuned) model achieved the best performance with an execution accuracy of 42.5%. This represents a substantial improvement over the rule-based baseline (14.9%) and the standard BiLSTM (31.8%). Notably, end-to-end regression models failed to solve any problems exactly, highlighting the necessity of the intermediate symbolic representation.

Conclusion

This research demonstrates that a two-step approach—mapping text to a symbolic representation before execution—is a robust strategy for solving complex probability problems. While challenges remain regarding implicit information and nested Boolean logic, the use of pretrained contextual representations and transfer learning provides a strong foundation for future work in automated mathematical reasoning.

Summary updated

BibTeX
@inproceedings{suster2021mapping,
  author = {Simon Suster and Pieter Fivez and Pietro Totis and Angelika Kimmig and Jesse Davis and Luc De Raedt and Walter Daelemans},
  title = {{Mapping probability word problems to executable representations}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.emnlp-main.294},
}
Figure