MAP Inference for Probabilistic Logic Programming

Elena Bellodi, Marco Alberti, Fabrizio Riguzzi, Riccardo ZesearXiv 2020 · DOI

In the world of artificial intelligence, combining logic and probability is a powerful way to model complex, uncertain domains. This field, known as Probabilistic Logic Programming (PLP), usually focuses on answering one question: "How likely is this specific outcome?" However, in many real-world scenarios—from medical diagnosis to fault detection—we need to ask a different question: "Given what I see, what is the most likely explanation?"

A recent paper by Elena Bellodi and colleagues at the University of Ferrara introduces a new way to answer these "most likely" questions by extending the PITA (Probabilistic Inference with Tabling and Answer subsumption) reasoner.

TL;DR

Researchers have extended the PITA reasoner to efficiently solve Maximum-A-Posteriori (MAP) and Most Probable Explanation (MPE) tasks in Probabilistic Logic Programming. By leveraging highly optimized Binary Decision Diagram (BDD) libraries and a clever variable-reordering strategy, their approach often outperforms the state-of-the-art ProbLog tool on complex synthetic benchmarks.

What Problem Does This Paper Address?

Most PLP research focuses on marginal inference—calculating the probability that a query is true. But two other tasks are equally vital:

  1. Most Probable Explanation (MPE): Finding the single most likely "world" (set of random choices) that is consistent with observed evidence.
  2. Maximum-A-Posteriori (MAP): Finding the most likely values for a specific subset of variables, regardless of what happens to the others.

MAP is particularly challenging because it requires mixing two mathematical operations that don't usually play well together: summation (to account for all possibilities of irrelevant variables) and maximization (to find the best values for the variables we care about). Existing tools often struggle with the scale and complexity of these tasks.

Methods

The authors integrated MAP and MPE capabilities into the PITA system using Binary Decision Diagrams (BDDs). A BDD is a data structure that represents a Boolean function as a rooted, directed acyclic graph, which PITA uses to represent the logic of a program.

![Fig.

  1. A BDD representing a simple probabilistic logic query.](/figures/art_2654eff6073343c990527a6612d60059)

Key technical contributions include:

  • Dynamic Programming on BDDs: For MPE, the algorithm traverses the BDD bottom-up, replacing standard probability sums with "max" operations to find the most probable path to a successful outcome.
  • Variable Reordering for MAP: To handle the tricky mix of summation and maximization in MAP tasks, the authors use the CUDD library to dynamically reorder the BDD. By pushing the "query" variables to the top of the diagram, they can sum out the "non-query" variables at the bottom and then maximize over the results at the top.
  • Constraint Encoding: They implemented a specific encoding for multi-valued random variables to ensure that the "most likely" explanation found is actually a valid one (e.g., ensuring a person isn't assigned two different blood types simultaneously).

The paper also discusses how BDDs relate to other structures like d-DNNFs (decomposable Deterministic Negation Normal Forms), which are used by competitors like ProbLog.

![Fig.

  1. How a BDD node (a) translates into a d-DNNF portion (b) and an arithmetic circuit (c).](/figures/art_51eb1a156dfe4dbcbfe84da322f7fc8b)

Datasets

The authors evaluated their system against ProbLog 2.1 using four synthetic datasets designed to test different types of scaling:

  • Growing Head (gh): Programs where disjunctive clauses have an increasing number of possible outcomes in the head.
  • Growing Negated Body (gnb): Programs with an increasing number of negated conditions.
  • Blood: A dataset modeling the inheritance of blood types through increasing generations of ancestors.
  • Probabilistic Graphs: Randomly generated graphs (using the Barabási-Albert model) with 50 to 500 nodes, testing path-finding probabilities.

Key Insights and Ideas

  • Software Optimization Trumps Theory: Theoretically, d-DNNFs are more "succinct" (smaller) than BDDs. However, the authors found that because BDD libraries like CUDD are so highly optimized and mature, BDD-based PITA often ran faster and used memory more efficiently than d-DNNF-based ProbLog.
  • The Power of Reordering: The ability to "shuffle" the internal structure of a BDD (variable reordering) is a unique advantage. It allows PITA to transform a difficult MAP problem into a sequence of simple summations followed by simple maximizations.
  • MAP vs. MPE Sensitivity: The paper demonstrates through examples (like a disease diagnosis model) that the "most likely" answer can change depending on whether you are looking for a full explanation (MPE) or just the most likely state of one specific variable (MAP).

Key Results

  • MPE Performance: PITA significantly outperformed ProbLog on the gh and blood datasets. In the blood tests, ProbLog timed out almost immediately, while PITA handled up to 100 ancestors.
  • MAP Performance: PITA was faster than ProbLog on nearly all datasets. For the probabilistic graph problems, PITA could provide answers for 500-node graphs, whereas ProbLog hit memory errors or "program errors" on much smaller instances.
  • Scalability: While PITA eventually slowed down as programs grew very large, it consistently pushed the boundaries further than existing state-of-the-art tools for these specific tasks.

Limitations and Future Work

The authors acknowledge that while BDDs are powerful, they are not a silver bullet; for extremely complex logic, the BDD size can still explode, leading to memory issues.

Future work aims to explore Viterbi proofs—finding partial assignments of variables that are sufficient to explain a query, rather than full "worlds." This could lead to even faster inference by ignoring irrelevant parts of the problem space.

Summary updated

BibTeX
@misc{bellodi2020map,
  author = {Elena Bellodi and Marco Alberti and Fabrizio Riguzzi and Riccardo Zese},
  title = {{MAP Inference for Probabilistic Logic Programming}},
  year = {2020},
  eprint = {2008.01394},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2008.01394},
}
Figure