Leveraging Belief Propagation, Backtrack Search, and Statistics for Model Counting Lukas Kroc, Ashish Sabharwal, Bart Selman Cornell University May 23,

Slides:



Advertisements
Similar presentations
Sampling and Soundness: Can We Have Both? Carla Gomes, Bart Selman, Ashish Sabharwal Cornell University Jörg Hoffmann DERI Innsbruck …and I am: Frank van.
Advertisements

1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
1 Finite Constraint Domains. 2 u Constraint satisfaction problems (CSP) u A backtracking solver u Node and arc consistency u Bounds consistency u Generalized.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Chapter 6 Sampling and Sampling Distributions
Review: Constraint Satisfaction Problems How is a CSP defined? How do we solve CSPs?
Planning under Uncertainty
1 Statistical Inference H Plan: –Discuss statistical methods in simulations –Define concepts and terminology –Traditional approaches: u Hypothesis testing.
Phase Transitions of PP-Complete Satisfiability Problems D. Bailey, V. Dalmau, Ph.G. Kolaitis Computer Science Department UC Santa Cruz.
Continuous Random Variables & The Normal Probability Distribution
CP Formal Models of Heavy-Tailed Behavior in Combinatorial Search Hubie Chen, Carla P. Gomes, and Bart Selman
Chapter 7 Sampling and Sampling Distributions
1 Towards Efficient Sampling: Exploiting Random Walk Strategy Wei Wei, Jordan Erenrich, and Bart Selman.
Model Counting: A New Strategy for Obtaining Good Bounds Carla P. Gomes, Ashish Sabharwal, Bart Selman Cornell University AAAI Conference, 2006 Boston,
Combinatorial Problems II: Counting and Sampling Solutions Ashish Sabharwal Cornell University March 4, nd Asian-Pacific School on Statistical Physics.
The Theory of NP-Completeness
Phase Transitions of PP-Complete Satisfiability Problems D. Bailey, V. Dalmau, Ph.G. Kolaitis Computer Science Department UC Santa Cruz.
Evaluation.
Evaluating Hypotheses
Short XORs for Model Counting: From Theory to Practice Carla P. Gomes, Joerg Hoffmann, Ashish Sabharwal, Bart Selman Cornell University & Univ. of Innsbruck.
Fundamentals of Sampling Method
1 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Satisfiability (Reading R&N: Chapter 7)
1 Message Passing and Local Heuristics as Decimation Strategies for Satisfiability Lukas Kroc, Ashish Sabharwal, Bart Selman (presented by Sebastian Brand)
CS Bayesian Learning1 Bayesian Learning. CS Bayesian Learning2 States, causes, hypotheses. Observations, effect, data. We need to reconcile.
Solution Counting Methods for Combinatorial Problems Ashish Sabharwal [ Cornell University] Based on joint work with: Carla Gomes, Willem-Jan van Hoeve,
Relaxed DPLL Search for MaxSAT (short paper) Lukas Kroc, Ashish Sabharwal, Bart Selman Cornell University SAT-09 Conference Swansea, U.K. July 3, 2009.
Determining Sample Size
Estimating a Population Mean
Stochastic Algorithms Some of the fastest known algorithms for certain tasks rely on chance Stochastic/Randomized Algorithms Two common variations – Monte.
1 Decision Procedures for Linear Arithmetic Presented By Omer Katz 01/04/14 Based on slides by Ofer Strichman.
1 MCMC Style Sampling / Counting for SAT Can we extend SAT/CSP techniques to solve harder counting/sampling problems? Such an extension would lead us to.
Statistical Decision Making. Almost all problems in statistics can be formulated as a problem of making a decision. That is given some data observed from.
Section 8.1 Estimating  When  is Known In this section, we develop techniques for estimating the population mean μ using sample data. We assume that.
Statistics for Managers Using Microsoft Excel, 5e © 2008 Pearson Prentice-Hall, Inc.Chap 8-1 Statistics for Managers Using Microsoft® Excel 5th Edition.
Constraint Satisfaction Problems (CSPs) CPSC 322 – CSP 1 Poole & Mackworth textbook: Sections § Lecturer: Alan Mackworth September 28, 2012.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Chapter 6 Normal Probability Distributions 6-1 Review and Preview 6-2 The Standard Normal.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
+ The Practice of Statistics, 4 th edition – For AP* STARNES, YATES, MOORE Chapter 8: Estimating with Confidence Section 8.3 Estimating a Population Mean.
CP Summer School Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules.
Confidence Intervals for Proportions Chapter 8, Section 3 Statistical Methods II QM 3620.
Heavy-Tailed Phenomena in Satisfiability and Constraint Satisfaction Problems by Carla P. Gomes, Bart Selman, Nuno Crato and henry Kautz Presented by Yunho.
Sullivan – Fundamentals of Statistics – 2 nd Edition – Chapter 3 Section 2 – Slide 1 of 27 Chapter 3 Section 2 Measures of Dispersion.
TAMING THE CURSE OF DIMENSIONALITY: DISCRETE INTEGRATION BY HASHING AND OPTIMIZATION Stefano Ermon*, Carla P. Gomes*, Ashish Sabharwal +, and Bart Selman*
CSC 211 Data Structures Lecture 13
Survey Propagation. Outline Survey Propagation: an algorithm for satisfiability 1 – Warning Propagation – Belief Propagation – Survey Propagation Survey.
Lecture 16 Section 8.1 Objectives: Testing Statistical Hypotheses − Stating hypotheses statements − Type I and II errors − Conducting a hypothesis test.
U NIFORM S OLUTION S AMPLING U SING A C ONSTRAINT S OLVER A S AN O RACLE Stefano Ermon Cornell University August 16, 2012 Joint work with Carla P. Gomes.
Section 10.1 Confidence Intervals
Lecture 4: Statistics Review II Date: 9/5/02  Hypothesis tests: power  Estimation: likelihood, moment estimation, least square  Statistical properties.
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
CPSC 422, Lecture 11Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 11 Oct, 2, 2015.
1 Mean Field and Variational Methods finishing off Graphical Models – Carlos Guestrin Carnegie Mellon University November 5 th, 2008 Readings: K&F:
Today’s class Numerical differentiation Roots of equation Bracketing methods Numerical Methods, Lecture 4 1 Prof. Jinbo Bi CSE, UConn.
SAT 2009 Ashish Sabharwal Backdoors in the Context of Learning (short paper) Bistra Dilkina, Carla P. Gomes, Ashish Sabharwal Cornell University SAT-09.
1 Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. Example: In a recent poll, 70% of 1501 randomly selected adults said they believed.
Week 6. Statistics etc. GRS LX 865 Topics in Linguistics.
Arc Consistency CPSC 322 – CSP 3 Textbook § 4.5 February 2, 2011.
Probabilistic and Logical Inference Methods for Model Counting and Sampling Bart Selman with Lukas Kroc, Ashish Sabharwal, and Carla P. Gomes Cornell University.
Copyright © Cengage Learning. All rights reserved. 5 Joint Probability Distributions and Random Samples.
G. Cowan Lectures on Statistical Data Analysis Lecture 9 page 1 Statistical Data Analysis: Lecture 9 1Probability, Bayes’ theorem 2Random variables and.
+ The Practice of Statistics, 4 th edition – For AP* STARNES, YATES, MOORE Chapter 8: Estimating with Confidence Section 8.2 Estimating a Population Proportion.
Uncertainty and confidence Although the sample mean,, is a unique number for any particular sample, if you pick a different sample you will probably get.
+ Chapter 8 Estimating with Confidence 8.1Confidence Intervals: The Basics 8.2Estimating a Population Proportion 8.3Estimating a Population Mean.
Statistics for Business and Economics 8 th Edition Chapter 7 Estimation: Single Population Copyright © 2013 Pearson Education, Inc. Publishing as Prentice.
1 P NP P^#P PSPACE NP-complete: SAT, propositional reasoning, scheduling, graph coloring, puzzles, … PSPACE-complete: QBF, planning, chess (bounded), …
Statistical Decision Making. Almost all problems in statistics can be formulated as a problem of making a decision. That is given some data observed from.
Confidence Interval Estimation for a Population Proportion Lecture 33 Section 9.4 Mon, Nov 7, 2005.
THE NORMAL DISTRIBUTION
Emergence of Intelligent Machines: Challenges and Opportunities
Chapter 8: Estimating with Confidence
Presentation transcript:

Leveraging Belief Propagation, Backtrack Search, and Statistics for Model Counting Lukas Kroc, Ashish Sabharwal, Bart Selman Cornell University May 23, 2008 CPAIOR-08 Conference, Paris

Ashish Sabharwal May 23, Talk Outline  Model counting / solution counting  Problem, motivation, background  Lower bound estimates  Fast, using belief propagation for guidance  Probabilistic correctness guarantees  Experiments  Upper bound estimates  Fast, using multiple runs of backtrack search solvers  Statistical correctness guarantees  Experiments

Ashish Sabharwal May 23, Model/Solution Counting [model  solution  satisfying assignment] Model Counting (#CSP): Given a constraint satisfaction problem P, how many solutions does P have? Techniques generic for CSPs, but presented and evaluated for SAT E.g. propositional formula F = ( a or b ) and (not ( a and ( b or c ))) Boolean variables: a, b, c Total 2 3 possible 0-1 truth assignments F has exactly 3 satisfying assignments ( a, b, c ) : (1,0,0), (0,1,0), (0,1,1)  Must continue searching after one solution is found  With N variables, can have anywhere from 0 to 2 N solutions  Will denote the model count by #F

Ashish Sabharwal May 23, This Work … brings together several techniques for fast solution count estimates with correctness guarantees Statistical estimates, confidence intervals Message passing algorithms, probabilistic inference, graphical models Backtrack search, branch-and-cut Model counting for CSPs

Ashish Sabharwal May 23, Why Model Counting and Sampling? Efficient model counting techniques will extend the success of constraint reasoning to a whole new range of applications  Probabilistic reasoning / uncertainty / Bayesian inference e.g. Markov logic networks [Richardson-Domingos-06]  Multi-agent / adversarial reasoning (bounded)  New avenues in planning and model checking [Roth-96, Littman-etal-01, Sang-etal-04, Darwiche-05, Domingos-06, …] … 1 out of 10 2 out of 9 4 out of 8 Planning with uncertain outcomes

Ashish Sabharwal May 23, P NP P #P PSPACE NP-complete: SAT, scheduling, graph coloring, puzzles, … PSPACE-complete: QBF, adversarial planning, chess (bounded), … EXP-complete: games like Go, … P-complete: circuit-value, … Note: widely believed hierarchy; know P≠EXP for sure In P: sorting, shortest path, … Computational Complexity Hierarchy Easy Hard PH EXP #P-complete/hard: #SAT, sampling, probabilistic inference, …

Ashish Sabharwal May 23, The Challenge of Model Counting  In theory  Model counting is #P-complete (believed to be much harder than NP-complete problems)  Even for 2CNF-SAT and Horn-SAT!  Practical issues  Often finding even a single solution is quite difficult!  Typically have huge search spaces E.g  truth assignments for a 1000 variable formula  Solutions often sprinkled unevenly throughout this space E.g. with solutions, the chance of hitting a solution at random is 10  240

Main message: If you can solve the problem, you can often count solutions very well!  Solve using Belief Propagation  Earlier work: “if you can sample using local search…”  Solve using standard backtrack search  Earlier work: lower bounds, “xor” constraints

Ashish Sabharwal May 23, How Might One Count? Problem characteristics:  Space naturally divided into rows, columns, sections, …  Many seats empty  Uneven distribution of people (e.g. more near door, aisles, front, etc.) How many people are present in the hall?

Ashish Sabharwal May 23, How Might One Count? Previous approaches: 1. Brute force 2. Branch-and-bound 3. Estimation by sampling 4. Knowledge compilation (BDD, DNNF) Contribution from our group: randomized strategies using random XOR/parity constraints [AAAI-06/07, SAT-07] solution samples from local search [IJCAI-07] belief propagation + statistical upper bounds [CPAIOR-08] : occupied seats (47) : empty seats (49)

Ashish Sabharwal May 23, #1: Brute-Force Counting Idea:  Go through every seat  If occupied, increment counter Advantage:  Simplicity, accuracy Drawback:  Scalability

Ashish Sabharwal May 23, #2: Branch-and-Bound (DPLL-style) Idea:  Split space into sections e.g. front/back, left/right/ctr, …  Use smart detection of full/empty sections  Add up all partial counts Advantage:  Relatively faster, exact Drawback:  Still “accounts for” every single person present: need extremely fine granularity  Scalability Framework used in DPLL-based systematic exact counters e.g. Relsat [Bayardo-etal-00], Cachet [Sang-etal-04]

Ashish Sabharwal May 23,  For an N variable formula, if the residual formula is satisfiable after fixing d variables, count 2 N-d as the model count for this branch and backtrack. F = (a  b)  (c  d)  (  d  e) c d a b d ee c d d 01 …… 2 1 solns. 2 2 solns. 2 1 solns. 4 solns. Total 12 solutions  0  0  0  0 #2: Branch-and-Bound (DPLL-style)

Ashish Sabharwal May 23, #3: Estimation By Sampling -- Naïve Idea:  Randomly select a region  Count within this region  Scale up appropriately Advantage:  Quite fast Drawback:  Robustness: can easily under- or over-estimate  Scalability in sparse spaces: e.g solutions out of means need region much larger than to “hit” any solutions

Ashish Sabharwal May 23, #3: Estimation By Sampling -- Smarter Idea:  Randomly sample k occupied seats  Compute fraction in front & back  Recursively count only front  Scale with appropriate multiplier Advantage:  Quite fast Drawback:  Relies on uniform sampling of occupied seats -- not any easier than counting itself!  Robustness: often under- or over- estimates; no guarantees Framework used in approximate counters like ApproxCount [Wei-Selman-05]

Ashish Sabharwal May 23, Talk Outline  Model counting / solution counting  Problem, motivation, background  Lower bound estimates  Fast, using belief propagation for guidance  Probabilistic correctness guarantees  Experiments  Upper bound estimates  Fast, using multiple runs of backtrack search solvers  Statistical correctness guarantees  Experiments

Ashish Sabharwal May 23, Idea:  Identify a “balanced” row split or column split (roughly equal number of people on each side) Use sampling for estimate  Pick one side at random  Count on that side recursively  Multiply result by 2 This provably yields the true count on average!  Even when an unbalanced row/column is picked accidentally for the split, e.g. even when samples are biased or insufficiently many  Provides probabilistic correctness guarantees on the estimated count  Surprisingly good in practice, using SampleSat as the sampler Estimation with Guarantees “decimation”

Ashish Sabharwal May 23, The Desired Effect of Decimation If each setting cut the solution space roughly in half, would get down to a unique solution in roughly log 2 #F steps!

Ashish Sabharwal May 23,  Idea borrowed from SampleCount:  Select a balanced variable (appears same number of times positively and negatively in solutions)  Fix it to a random value  Recursively count the subformula  Scale up the result by 2  Resulting count, #F dec, is thus a random variable  Key proposition: E[#F dec ] = #F (next slide)  Variance limits how well we can estimate E[#F dec ] Balanced variables  smaller variance  tighter bounds But method is robust to inaccuracies Difference from SampleCount: Choose most balanced variables efficiently using Belief Propagation Lower Bounds by Decimation

Ashish Sabharwal May 23, Why Does This Work? Proposition: E[#F dec ] = #F where #F dec is a count estimate and #F is true solution count of F a = TF Chance:50%50% Count:pM(1-p)M Scaling:22 Average:½.pM.2+ ½.(1-p)M.2 = M M=full count, p=(unknown) fraction in left subtree b,c,…

Ashish Sabharwal May 23, What if there aren’t any Balanced Vars?  I.e. for every variable, p is far from 1/2  Or perhaps p is not estimated well  E[#F dec ] still equals #F  Thus, the method is robust  Can we do better if we have confidence in the estimate of p?  Yes! Can reduce variance by using biased coin: Pr[heads] = q ≠1/2  Scale up by 1/q or 1/(1-q)  Average = q.pM.(1/q)+ (1-q).(1-p)M.(1/(1-q)) = M decimated count = M when q = p

Ashish Sabharwal May 23, From E[#F dec ] to Lower Bound on #F  Simple but useful application of Markov’s Inequality Pr [#F dec ≥ c E[#F]] ≤ 1/c i.e. Pr [#F dec ≥ c #F] ≤ 1/c Theorem: #F lower = (#F dec / c) is a correct lower bound on #F with probability at least (1-1/c) Would work even if E[#F dec ] ≤ #F Would not work if E[#F dec ] ≥ #F  will run into this soon!

Ashish Sabharwal May 23,  Identifying balanced variables by sampling is slow  Requires finding ~50 solutions per variable  Replace sampling by Belief Propagation (BPCount)  Message-passing algorithm that (tries to) compute marginal probabilities of variables in graphical models (still a #P-complete problem!)  Balanced variables = those with marginals 0.5  Advantage: quick  Drawbacks: hard to make it work for many problems. Not accurate.  Quick: big plus! We need it many times.  Hard to make work: Ok, can use a “damped” version  Not accurate: Ok, the underlying method is robust  Quick: big plus! We need it many times.  Hard to make work: Ok, can use a “damped” version  Not accurate: Ok, the underlying method is robust Adding Belief Propagation

Ashish Sabharwal May 23, Aside: Belief Propagation for CSPs  A general iterative message-passing algorithm to compute marginal probabilities over “graphical models”  Based on fixed-point computations of recursive equations  For CSPs, marginal probabilities = solution densities  Convert F into a two-layer Bayesian network abcde f1f2f3 (a  b)(c  d) (  d  e) variables of F  variable nodes constraints of F  function nodes Iterative message passing

Ashish Sabharwal May 23, Experiments: BPCount Always very fast! Sometimes better Sometimes not

Ashish Sabharwal May 23, Talk Outline  Model counting / solution counting  Problem, motivation, background  Lower bound estimates  Fast, using belief propagation for guidance  Probabilistic correctness guarantees  Experiments  Upper bound estimates  Fast, using multiple runs of backtrack search solvers  Statistical correctness guarantees  Experiments

Ashish Sabharwal May 23, Why is Upper Bounding “Harder”? Solution spaces are often relatively sparse compared to the raw search space E.g. consider F with 1000 variables and solutions  Suppose we have explored 1/16 of the search space  Likely number of solutions encountered = /16 =  Fairly good lower bound: #F ≥  Likely number of non-solutions encountered = ( )/16 >  Very bad naïve upper bound: #F ≤ ≈ 2 999

Ashish Sabharwal May 23,  DPLL-style backtrack search involves:  Choose a variable to fix  Select its truth value (True or False)  If unsatisfied constraint, revise some previous decision (backtrack)  Some of the decisions are randomized  no. of vars, d, fixed on a path to a solution is a random variable  Certain properties of the search process make it possible to infer the solution count from d  MiniSat solver [Eén-Sörensson ’05] can be used!  Powerful solver can be used to assess solution counts  MiniCount DPLL Search as a Random Process

Ashish Sabharwal May 23,  Desired property: the solver does not specify which truth value a selected variable gets  truth value can be assigned at random  similar probabilistic reasoning as for BPCount can be used to get: Proposition: E[#F MiniCount ] ≥ #F where #F MiniCount = 2 d is a count estimate and #F = true solution count of F  Inequality because can’t correct for infeasible branches not visited  No hope of retrieving lower bound using #FMiniCount Recall: E[#Fdec] equals #F  probabilistic lower bounds Upper Bound using MiniCount due to backtracks!

Ashish Sabharwal May 23, Goal: Estimate E[#F MiniCount ]  Naïve estimation  Run process multiple times; obtain samples of #F MiniCount  Compute sample average Not very robust  #F MiniCount might have high variance (fixed variables typically not balanced)  Too slow: need many samples  Can we do better?  Use statistics to bound the expectation

Ashish Sabharwal May 23, Bounding E[#F MiniCount ]  Will use confidence interval for E[#F MiniCount ]  Need samples of the random variable (OK)  Need to know the shape of the distribution (?)  Key empirical observation: For many problems, the distribution of #F MiniCount is approximately log-normal  Can be checked using normality tests (like Shapiro-Wilk)  Can be assessed graphically (QQ-plots) In either case, log-normality cannot be guaranteed, only “not disproved”

Ashish Sabharwal May 23,  Generate independent samples from #F MiniCount by independent runs of MiniCount #F MiniCount freq  Assess whether the samples come from a log-normal distribution, or a sufficiently similar one  Calculate the (one-sided) confidence interval for E[#F MiniCount ] and use it as the upper bound for #F Upper bound Mean Sample average might easily underestimate the mean, due to the heavy tail of the distribution MiniCount in a Nutshell

Ashish Sabharwal May 23, MiniCount Results Very fast! Applicable for most problems Sometimes not well applicable Simple average often good, but not a bound

Ashish Sabharwal May 23, What Happens When Not Log-Normal? Luckily, often easy to detect in practice Langford problems:

Ashish Sabharwal May 23, Summary  Fast lower bounds with probabilistic guarantees  Using an earlier randomized framework  Adding the power of Belief Propagation Key improvement: speed!  Fast upper bounds with statistical guarantees  Upper bounds turn out to be more difficult than lower bounds  First efficient way to tackle the problem, albeit not with any probabilistic guarantees