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.

Slides:



Advertisements
Similar presentations
Exact Inference. Inference Basic task for inference: – Compute a posterior distribution for some query variables given some observed evidence – Sum out.
Advertisements

Exact Inference in Bayes Nets
1 Backdoor Sets in SAT Instances Ryan Williams Carnegie Mellon University Joint work in IJCAI03 with: Carla Gomes and Bart Selman Cornell University.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Dynamic Bayesian Networks (DBNs)
MPE, MAP AND APPROXIMATIONS Lecture 10: Statistical Methods in AI/ML Vibhav Gogate The University of Texas at Dallas Readings: AD Chapter 10.
Survey Propagation Algorithm
CS774. Markov Random Field : Theory and Application Lecture 04 Kyomin Jung KAIST Sep
Approximate Counting via Correlation Decay Pinyan Lu Microsoft Research.
Planning under Uncertainty
GS 540 week 6. HMM basics Given a sequence, and state parameters: – Each possible path through the states has a certain probability of emitting the sequence.
Bayesian network inference
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
Tirgul 10 Rehearsal about Universal Hashing Solving two problems from theoretical exercises: –T2 q. 1 –T3 q. 2.
CP Formal Models of Heavy-Tailed Behavior in Combinatorial Search Hubie Chen, Carla P. Gomes, and Bart Selman
1 Boolean Satisfiability in Electronic Design Automation (EDA ) By Kunal P. Ganeshpure.
Ryan Kinworthy 2/26/20031 Chapter 7- Local Search part 1 Ryan Kinworthy CSCE Advanced Constraint Processing.
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,
1 Sampling, Counting, and Probabilistic Inference Wei joint work with Bart Selman.
Analysis of Algorithms CS 477/677
Short XORs for Model Counting: From Theory to Practice Carla P. Gomes, Joerg Hoffmann, Ashish Sabharwal, Bart Selman Cornell University & Univ. of Innsbruck.
1 Backdoors To Typical Case Complexity Ryan Williams Carnegie Mellon University Joint work with: Carla Gomes and Bart Selman Cornell University.
Chapter 11: Limitations of Algorithmic Power
CS 188: Artificial Intelligence Spring 2007 Lecture 14: Bayes Nets III 3/1/2007 Srini Narayanan – ICSI and UC Berkeley.
1 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Satisfiability (Reading R&N: Chapter 7)
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Hardness Results for Problems
Ryan Kinworthy 2/26/20031 Chapter 7- Local Search part 2 Ryan Kinworthy CSCE Advanced Constraint Processing.
1 Message Passing and Local Heuristics as Decimation Strategies for Satisfiability Lukas Kroc, Ashish Sabharwal, Bart Selman (presented by Sebastian Brand)
Sampling Combinatorial Space Using Biased Random Walks Jordan Erenrich, Wei Wei and Bart Selman Dept. of Computer Science Cornell University.
Solution Counting Methods for Combinatorial Problems Ashish Sabharwal [ Cornell University] Based on joint work with: Carla Gomes, Willem-Jan van Hoeve,
Distributions of Randomized Backtrack Search Key Properties: I Erratic behavior of mean II Distributions have “heavy tails”.
OPTIMIZATION WITH PARITY CONSTRAINTS: FROM BINARY CODES TO DISCRETE INTEGRATION Stefano Ermon*, Carla P. Gomes*, Ashish Sabharwal +, and Bart Selman* *Cornell.
Energy Efficient Routing and Self-Configuring Networks Stephen B. Wicker Bart Selman Terrence L. Fine Carla Gomes Bhaskar KrishnamachariDepartment of CS.
Chapter 11 Limitations of Algorithm Power. Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples:
Ragesh Jaiswal Indian Institute of Technology Delhi Threshold Direct Product Theorems: a survey.
Boolean Satisfiability and SAT Solvers
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.
Large-scale Hybrid Parallel SAT Solving Nishant Totla, Aditya Devarakonda, Sanjit Seshia.
Pricing Combinatorial Markets for Tournaments Presented by Rory Kulz.
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
TAMING THE CURSE OF DIMENSIONALITY: DISCRETE INTEGRATION BY HASHING AND OPTIMIZATION Stefano Ermon*, Carla P. Gomes*, Ashish Sabharwal +, and Bart Selman*
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module Logic Representations.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University.
CPSC 422, Lecture 11Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 11 Oct, 2, 2015.
Stochastic greedy local search Chapter 7 ICS-275 Spring 2009.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
SAT 2009 Ashish Sabharwal Backdoors in the Context of Learning (short paper) Bistra Dilkina, Carla P. Gomes, Ashish Sabharwal Cornell University SAT-09.
Review of Propositional Logic Syntax
Exact Inference in Bayes Nets. Notation U: set of nodes in a graph X i : random variable associated with node i π i : parents of node i Joint probability:
Inference Algorithms for Bayes Networks
Balance and Filtering in Structured Satisfiability Problems Henry Kautz University of Washington joint work with Yongshao Ruan (UW), Dimitris Achlioptas.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Probabilistic and Logical Inference Methods for Model Counting and Sampling Bart Selman with Lukas Kroc, Ashish Sabharwal, and Carla P. Gomes Cornell University.
Pattern Recognition and Machine Learning
NP Completeness Piyush Kumar. Today Reductions Proving Lower Bounds revisited Decision and Optimization Problems SAT and 3-SAT P Vs NP Dealing with NP-Complete.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
1 P NP P^#P PSPACE NP-complete: SAT, propositional reasoning, scheduling, graph coloring, puzzles, … PSPACE-complete: QBF, planning, chess (bounded), …
Markov Networks.
CSCI 5822 Probabilistic Models of Human and Machine Learning
Emergence of Intelligent Machines: Challenges and Opportunities
Chapter 11 Limitations of Algorithm Power
Graphs and Algorithms (2MMD30)
Expectation-Maximization & Belief Propagation
Presentation transcript:

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 and Bart Selman

M OTIVATION : SIGNIFICANT PROGRESS IN COMBINATORIAL REASONING SAT/MIP: From 100 variables, 200 constraints (early 90’s) to over 1,000,000 variables and 5,000,000 constraints in 20 years. Applications: hardware and software verification (bounded model checking), planning, scheduling, protocol design, routing, supply-chain optimization, e-commerce (e-auctions and electronic trading agents) SAT: Given a Boolean formula Φ in CNF, Φ=C 1 ΛC 2 Λ…ΛC m, does Φ have a satisfying assignment? technical advances: automated constraint inference, dynamic variable ordering, randomization, etc. Can we apply these techniques to boost probabilistic reasoning?

B EYOND SAT: SOLUTION SAMPLING Probabilistic reasoning and graphical model inference tasks can be mapped into equivalent problems for weighted SAT formulas: Sampling for Weighted SAT: clauses (constraints) with weights Φ=(C 1,w 1 )Λ(C 2,w 2 ) Λ…Λ(C m,w m ) truth assignments sampled in proportion to the exponential of the negated sum of weights of violated constraints. Logic + Probability (Markov Logic) MRF X 1  {0,1} X 2  {0,1} X 3  {0,1}X 4  {0,1} Formula over X 1,X 2,X 3,X 4 : ….. X 2 V X 4, -a 1 ¬ X 2 V X 4, -a 2 X 2 V ¬ X 4, -a 3 ¬X 2 V¬ X 4, -a 4 … a1a1 a2a2 1 a3a3 a4a4 Potential  24 (X 2,X 4 ): P(X) ~ exp(  c (X C )) P(X) ~ exp(-  w i  i (X i )) violated when both X 2 and X 4 are 0 Clique CClause i

B EYOND SAT: SOLUTION SAMPLING First step: uniform solution sampling infinite weights case: probability zero when a constraint is violated equivalent to sampling from a uniform probability distribution Q over the set of solutions of a formula F useful for the weighted case (MC-SAT [Poon & Domingos, 2006] ): idea: solve unweighted problems on a subset of constraints selected according to their weights still computationally hard: decide if support of Q is empty or not is NP-complete (SAT) sampling is believed to be harder (#P-complete) still very difficult for MCMC techniques Weighted Sampler Uniform Sampler Constraint Solver

W HY SAMPLING IS HARD ? Variable 1 Naïve Rejection Sampling: 1.randomly select paths in the tree 2.if the leaf (complete assignment) is a solution, output it. extremely inefficient if there are only few solutions.  Variable 2 Variable n = a solution

S AMPLING WITH AN O RACLE Counting Oracle: How many solutions in the subtree rooted at a certain node? 5 ? 0 Variable 1 Variable 2 Variable n ?

S AMPLING WITH AN O RACLE Counting Oracle: How many solutions in the subtree rooted at a certain node? uniform sampling no rejections but counting is hard (#P-Complete) X k =0 2 ? X k =1 ? 3 3/52/5 marginals Variable 1 Variable 2 Variable n 1/5

S AMPLING WITH A SAT O RACLE Satisfiability Oracle: Is there at least a solution in the subtree rooted at a certain node? 1.computationally “easier” (NP- complete) 2.mature technology Can we use this to sample? ? NO Variable 1 Variable 2 Variable n YES ?

S AMPLING WITH A SAT O RACLE X k =0 NO ? X k =1 ? YES 10 Satisfiability Oracle: Is there at least a solution in the subtree rooted at a certain node? We know how to pick the marginals Variable 1 Variable 2 Variable n

S AMPLING WITH A SAT O RACLE X k =0 YES ? X k =1 ? YES ??? Satisfiability Oracle: Is there at least a solution in the subtree rooted at a certain node? How to pick the marginals in this case? Variable 1 Variable 2 Variable n

empty assignment X 1 =0X 1 =1 F = X 1 V X 2 X 2 =0 P = 0.5P = Suppose we pick 0.5 / 0.5 as we did for rejection sampling. X k =0 YES ? X k =1 ? YES 0.5 X 2 =1 It is NOT uniform! Sample anyways and correct for it in sample averages. Knuth [1975], Jerrum et al. [1986], Gomes et. al [2006], Gogate et. al [2007,2011], Kroc et. al [2008] U NIFORM M ARGINALS

A C HALLENGING E XAMPLE … 2 60 solutions “Large” importance 100 variables has to guess 40 variables correctly in order to reach the other 2 60 solutions 40 isolated solutions “Small” importance Needs on average 2 40 samples before reaching the big cluster … gets here with probability 2 -40

S EARCH T REE S AMPLER : A RECURSIVE APPROACH Definitions: variable ordering (X 1, …, X n ) pseudosolution at level i = assignment to first i variables that can be extended to form a solution pseudosolutions of level n are the solutions level i constraint solver can tell us this (YES/NO answer) = can be extended to form a solution = cannot be extended to form a solution

S EARCH T REE S AMPLER : A RECURSIVE APPROACH Recursive idea: Suppose we have a way to sample pseudosolutions of level n-1 Can we sample pseudosolutions of level n (= solutions)? sample one (uniformly) S = descendants that can be extended to a solution (SAT solver) sample one from S and output not uniform (some solutions are sampled twice as often) S pseudosolutions of level n are the solutions level n-1 = can be extended to form a solution = cannot be extended to form a solution

S EARCH T REE S AMPLER : A RECURSIVE APPROACH Recursive idea: Suppose we have a way to sample pseudosolutions of level n-1 Can we sample pseudosolutions of level n (= solutions)? sample all pseudosolutions of level n-1 S = union of descendants that can be extended to a solution (SAT solver) sample one from S and output perfectly uniform, but still inefficient (S might be too big) level n-1 S pseudosolutions of level n are the solutions = can be extended to form a solution = cannot be extended to form a solution

S EARCH T REE S AMPLER : A RECURSIVE APPROACH Recursive idea: Suppose we have a way to sample pseudosolutions of level n-1 Can we sample pseudosolutions of level n (= solutions)? sample k pseudosolutions of level n-1 S = union of descendants that can be extended to a solution (SAT solver) sample one from S and output approximately uniform: k/(k+1) ≤ P(s) / P(s’) ≤ (k+1)/k level n-1 k=2 sampling from S ≈ sampling from the solution set pseudosolutions of level n are the solutions S How to sample pseudosolutions of level n-1?

S EARCH T REE S AMPLER : A RECURSIVE APPROACH Recursive idea: Suppose we have a way to sample pseudosolutions of level n-2 Can we sample pseudosolutions of level n-1? sample k pseudosolutions of level n-2 S = descendants that can be extended to a solution (SAT solver) sample from S and output previous bound on the uniformity still holds level n-1 level n-2 sampling from S ≈ sampling from the pseudosolution set of level n-1 S

S EARCH T REE S AMPLER D EMO Input: k (=2) 0. variable ordering 1. root = empty assignment 2. check SAT 3. generate descendants check F Λ (X 1 =0) check F Λ (X 1 =1) 4. sample up to k from level 1 5. generate descendants 6. sample up to k from level 2 7. generate descendants … sample up to k from level n-1 generate descendants (solutions) level 0 level 1 n-1 need fast SAT solver! at most 2 samples per level = can be extended to form a solution = cannot be extended to form a solution

C OMPLEXITY Search tree can be divided into less than n levels uniformity bound: k/(2 L +k-1) ≤ P(s) / P(s’) ≤ (2 L +k-1)/k Parameterized scheme: levels height L max samples per level k Performance requires O((n/L)*2 L *k) calls to a SAT solver to generate k samples k ↑ increases uniformity, L↑ reduces the number of recursions increased complexity ↑ increased uniformity ↑ (L=1,k=1) ↔ uniform marginals(L=n) ↔ 1 level ↔ enumeration (uniform) What happens for intermediate values of k and L? generate descendants at the lower level using the SAT solver L L,kL,k

C HALLENGING D OMAINS Golf-course landscape: Energy barriers: Energy = # violated constraints E = 0 E = 1 solutions h Energy = # violated constraints asymmetric space

C HALLENGING D OMAINS Random + Energy barriers only SearchTreeSample provides uniform samples

C HALLENGING D OMAINS Asymmetric spaces + Energy barriers clusters of solutions of different sizes on the sides h E SampleSAT oversamples this solution

C HALLENGING D OMAINS MethodInstanceParameterTime(s)P-value SAlogisticT= SampleSATlogistic SearchTreeSamplerlogistick= SearchTreeSamplerlogistick= SearchTreeSamplerlogistick= SAlogistic+BarrierT= SampleSATlogistic+Barrier SearchTreeSamplerlogistic+Barrierk= >2 orders of magnitude faster Probability of observing an event at least as extreme NOT affected by barriers

C HALLENGING D OMAINS MethodInstanceParameterTime(s)P-value SAcoloringT= SampleSATcoloring SearchTreeSamplercoloringk= SearchTreeSamplercoloringk= SearchTreeSamplercoloringk= SAcoloring+BarrierT= SampleSATcoloring+Barrier SearchTreeSamplercoloring+Barrierk= >2 orders of magnitude faster NOT affected by barriers

C HALLENGING D OMAINS MethodInstanceParameterTime(s)P-value SArandomT= SampleSATrandom-7400 SearchTreeSamplerrandomk= SearchTreeSamplerrandomk= SearchTreeSamplerrandomk= SArandom+BarrierT= SampleSATrandom+Barrier-7440 SearchTreeSamplerrandom+Barrierk= What happens if # solutions >> k? >2 orders of magnitude faster NOT affected by barriers

M ODEL C OUNTING How to evaluate uniformity when the solution set of F is very large (e.g., )? cannot estimate the empirical distribution cannot validate the sampling quality directly (e.g., via Pearson’s chi-squared test) Model counting: Let S F be the set of solutions of F. Indirect validation: use samples to estimate |S F |. Better samples should provide more accurate counts. New model counting technique: intermediate samples of SearchTreeSampler provide us with additional information about the model count

E XPERIMENTAL R ESULTS x x x 10 5 x 10 8

T HE B IG P ICTURE Combinatorial Search local search backtrack search (YES/NO) MCMC sampling Gibbs Sampling Simulated Annealing No clear analogous XORSampling [2006] SampleSearch [2007] SearchTreeSampler Probabilistic InferenceCombinatorial Reasoning Message-Passing / Variational Belief Propagation (BP) Variable elimination Junction Tree Constraint Propagation faster in industrial applications Conditioning on variables key component

C ONCLUSIONS Combinatorial reasoning techniques for probabilistic reasoning New technique for solution sampling Samples the search tree level by level leverages state-of-the-art SAT-solver as a black-box parameterized scheme: trade-off between computational cost and uniformity of the samples Demonstrated performance on challenging domains for MCMC methods significantly faster more uniform (Pearson’s Test) New model counting technique: vertical vs. horizontal division of the search tree intermediate samples provide information about the model count

THANK YOU!