Solving Marginal MAP Problems with NP Oracles and Parity Constraints

Yexiang Xue, Zhiyuan Li, Stefano Ermon, Carla P. Gomes, Bart Selman

Overview

This paper introduces XOR_MMAP, a novel algorithm designed to tackle the notoriously difficult Marginal Maximum A Posteriori (MMAP) problem. By "folding" intractable counting subproblems into a single optimization task using random parity (XOR) constraints and NP oracles, the authors provide a constant-factor approximation for a problem class generally considered harder than both standard optimization and counting.

The Marginal MAP Challenge

In probabilistic machine learning and decision-making, we often encounter the Marginal MAP (MMAP) problem. This arises when you need to make an optimal decision (maximization) while averaging over many uncertain, hidden scenarios (marginalization or counting).

Mathematically, this is expressed as: $\max_{a} \sum_{x} w(x, a)$.

The fundamental challenge is that MMAP is $NP^{PP}$-complete. To put that computational complexity into perspective:

  1. MAP inference (just maximization) is $NP$-hard.
  2. Marginal inference (just counting/summing) is $\#P$-complete.
  3. MMAP combines both, making it significantly harder than either task alone.

Existing methods usually treat the "max" and the "sum" separately. For example, they might use variational methods to approximate the sum or rely on sampling (Sample Average Approximation, or SAA). These approaches often fail when the underlying model is highly combinatorial or features complex dependencies.

The XOR_MMAP Approach

The authors propose XOR_MMAP, which leverages a clever trick from theoretical computer science: hashing-based counting.

The Core Mechanism: XOR Constraints

The key idea is that you can estimate the size of a set (the "sum" part) by seeing if any elements remain after you randomly "sieve" the space with parity constraints (XOR equations). If you add $k$ random XOR constraints and an optimizer can still find a solution, the original set likely has at least $2^k$ elements.

The Innovation: Integrated Optimization

Instead of solving the counting problem separately for every possible decision $a$, XOR_MMAP "folds" the process into a unified pipeline:

  1. Replication: It creates $T$ replicates of the original variables $x$.
  2. Constraint Injection: It applies independent, random XOR constraints to each replicate.
  3. Single Global Optimization: It solves a single, larger optimization problem that maximizes the sum of these replicates over a shared decision variable $a$.

By doing this, the algorithm reduces an $NP^{PP}$ problem to a single (albeit larger) $NP$ problem. This allows the system to utilize highly efficient, off-the-shelf NP oracles like Mixed Integer Programming (MIP) or SAT solvers.

Experimental Domains

The authors evaluated XOR_MMAP across four distinct domains to test its versatility and robustness:

  • Random 2-SAT Instances: Unweighted problems with 60 variables, testing the algorithm's ability to find satisfiable assignments under complex constraints.
  • Ising Models: Weighted 12x12 grids with varying "coupling strengths," representing classic Markov Random Field challenges.
  • Image Completion (MNIST): Using a two-layer Deep Belief Network on 14x14 MNIST digits to complete the bottom half of a digit given the top half.
  • Network Cascade Spread: A sustainability-focused application aiming to purchase a set of nodes in a stochastic graph to maximize the probability of a cascade reaching a target node.

Empirical Results

Superior Accuracy on 2-SAT

On random 2-SAT instances, XOR_MMAP found solutions with significantly higher objectives than Sample Average Approximation (SAA) and Mixed Loopy Belief Propagation (Mixed LBP). It consistently stayed within a tight bound of the optimal solution even as the number of clauses increased.

Robustness to Coupling in Ising Models

In Ising models, the "coupling strength" dictates the difficulty of the variable dependencies. As this strength increased, the performance gap between XOR_MMAP and the baselines widened dramatically. XOR_MMAP remained highly effective and maintained near-zero error where others degraded.

Vision and Real-World Tasks

  • Vision Tasks: In MNIST image completion, SAA produced blurry or "light" results, while XOR_MMAP and Mixed LBP produced clear, recognizable digit completions.
  • Real-world Utility: In the network cascade application—which cannot be easily modeled by standard graphical models—XOR_MMAP consistently found better node-purchase strategies than SAA across various budgets.

Key Insights and Limitations

The biggest takeaway from this research is that solving the maximization and marginalization tasks simultaneously in one optimization framework provides significant computational benefits over treating them as nested loops. Modern MIP solvers are robust enough to handle these larger, parity-constrained problems effectively, allowing XOR_MMAP to provide a constant-factor approximation with upper and lower bounds.

However, there are practical limitations:

  • Solver Dependency: Performance is heavily tied to the efficiency of the underlying NP oracle. If the solver struggles with specific XOR encodings, the algorithm slows down.
  • Replicate Overhead: The memory and time requirements grow with the number of replicates ($T$). Finding the optimal balance between $T$ and the approximation factor remains a practical challenge.
  • Constant Factor Gap: While a constant-factor approximation is a strong theoretical result, the factor used in experiments (e.g., 1024-approximation) can still be quite loose in practice, even if empirical results far exceed the worst-case bound.

Summary updated

BibTeX
@inproceedings{xue2016solving,
  author = {Yexiang Xue and Zhiyuan Li and Stefano Ermon and Carla P. Gomes and Bart Selman},
  title = {{Solving Marginal MAP Problems with NP Oracles and Parity Constraints}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2016},
}
Figure