Solving Probability Problems in Natural Language

Anton Dries, Angelika Kimmig, Jesse Davis, Vaishak Belle, Luc De Raedt

Abstract

This research presents an end-to-end automated system designed to solve probability word problems by translating natural language into a custom declarative modeling language. By leveraging the ProbLog probabilistic programming framework, the system performs complex mathematical reasoning, achieving a 97.5% success rate on correctly modeled problems. Additionally, the authors introduce a new benchmark dataset comprising over 2,000 exercises to facilitate future research in the field.

Introduction

While AI has made significant strides in solving algebraic and geometric word problems, probability problems have remained a challenge since the early 1970s. These problems are uniquely difficult because they require two distinct skills: linguistic parsing of ambiguous descriptions (e.g., "drawing a marble without replacement") and probabilistic reasoning over complex state spaces where the order of events or item identity may vary in importance. This paper bridges the gap between reading a problem and calculating its answer through an automated pipeline.

Methodology

Natural Language Processing (NLP)

The system utilizes Stanford CoreNLP to generate parse trees from problem text. Meaning extraction is handled through a hybrid approach involving neural classification and rule-based extraction. A multi-layer perceptron (MLP) classifier identifies the "role" of numbers (e.g., distinguishing between a total group size and a subset size), while hand-crafted rules extract object properties and identify the core question.

A linguistic parse tree for a sentence describing the contents of a jar, illustrating how the system breaks down natural language into structured components.

Modeling Language and Solver

Parsed data is converted into a declarative language that represents entities and containers as multisets. Operations such as take (sampling without replacement) or takeReplace (sampling with replacement) define actions within the model. The formal model is then processed by a ProbLog Solver using lifted inference. This technique exploits "exchangeability"—treating identical items (like 100 red marbles) as a single group rather than individual variables—to drastically reduce computational complexity.

A dependency graph and probability tree representing the state space of a bag of marbles, showing how sequential actions are modeled.

Benchmark Dataset

A major contribution of this work is a new benchmark of 2,160 probability word problems sourced from textbooks and online materials. The authors found that 90.9% of these problems were formalizable within their declarative language, while the remainder required advanced mathematical constraints not yet supported. This dataset provides a standardized challenge for future AI research in this sub-field.

Key Insights

  • Separation of Concerns: Decoupling NLP from the mathematical solver allows independent improvement of each component. The solver remains language-agnostic, while the NLP focuses on semantic mapping.
  • Probabilistic Programming: Using ProbLog enables the system to handle complex relational dependencies and observations naturally.
  • Implicit Knowledge: The solver can infer missing information (e.g., if a bag of 20 contains 4 white and 8 blue marbles, it assumes 8 "other" marbles) to ensure mathematical consistency.
  • Exchangeability: Recognizing that individual items in a set are often interchangeable prevents the "exponential explosion" of possible states during calculation.

Results and Performance

  • Solver Accuracy: Given a manually verified "perfect" model, the solver achieved 97.5% accuracy.
  • End-to-End Performance: The fully automated pipeline solved 12.5% of the total dataset.
  • Restricted Success: On the 869 problems specifically targeted by the NLP component's design, end-to-end accuracy rose to 31.1%.
  • Efficiency: Most problems were solved within 60 seconds, though massive outcome spaces (e.g., hundreds of die rolls) still lead to timeouts.

Limitations and Future Directions

The primary bottleneck remains the NLP component. Failures often stem from a lack of "common sense" (e.g., knowing names refer to people) or sensitivity to subtle phrasing variations. Future work will focus on incorporating richer language models and expanding the declarative language to support continuous distributions and more abstract mathematical strategies.

Summary updated

BibTeX
@inproceedings{dries2017solving,
  author = {Anton Dries and Angelika Kimmig and Jesse Davis and Vaishak Belle and Luc De Raedt},
  title = {{Solving Probability Problems in Natural Language}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2017},
  doi = {10.24963/ijcai.2017/556},
}
Figure