26
Background Message Passing Modifying the PMPF Conclusions An Ising Model inspired Extension of the Product-based MP Framework for SAT Oliver Gableske 1 1 Institute of Theoretical Computer Science Ulm University Germany [email protected] https://www.gableske.net SAT 2014, 17.07.2014 1 / 26

An Ising Model inspired Extension of the Product-based MP

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

An Ising Model inspired Extension of theProduct-based MP Framework for SAT

Oliver Gableske1

1Institute of Theoretical Computer ScienceUlm University

Germany

[email protected]://www.gableske.net

SAT 2014, 17.07.2014

1 / 26

Page 2: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Background and Motivation (1)

General context

Message Passing algorithms used in CNF-SAT solving

Message Passing algorithms

used to provide biases for variables in a given CNF formulaβ(v) ∈ [−1.0,+1.0]

a variable bias estimates the marginal assignment in all solutions

realize a variable ordering heuristic (via absolute value of bias)

realize a value ordering heuristic (via sign of bias)

2 / 26

Page 3: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Background and Motivation (2)

Message Passing algorithms

are comprised of two parts1 MP framework

governs the overall process to compute biasesdefines the message typesdefines how the message are updated (iterations)defines how long the updates are performed (convergence)defines how equilibrium messages are used to compute biases

2 MP heuristic

influences the overall process to compute biasesspecifies messagesspecifies equations to compute biases

apply an MP heuristic in an MP framework in order to compute biases

3 / 26

Page 4: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Background and Motivation (3)

Last years paper explained, that

all product-based MP algorithms (e.g. BP, SP, EM variants) currentlyavailable for SAT

can be represented with the same MP framework (PMPF)

in conjunction with the respective MP heuristics equations

It furthermore showed, that

all MP heuristics can be combined into a single heuristic (ρσPMP)

which interpolates between the “original” equations(ρ = 0, σ = 0→ BP equations; ρ = 1, σ = 0→ SP equations, . . . )

The final result was, that

all MP algorithms can be realized by applying the same MP heuristic(ρσPMP) in the same MP framework (PMPF)

4 / 26

Page 5: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Background and Motivation (4)

Current situation

we have a rather flexible MP heuristic (ρσPMP)

we have to implement only one heuristic to “get” all of theproduct-based MP algorithmsallows parameter tuning (adapt ρ, σ for a given type of CNF formula)allows us to understand “theoretical connections” between the variousMP heuristics

we have a totally static MP framework (PMPF)

the PMPF does influence the MP algorithmbut we cannot adapt it

One possible goal to improve the situation: extend the PMPF

in a “reasonable” (theoretically motivated) way

increase its flexibility in practice

increase its usefulness in theory

5 / 26

Page 6: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Message Passing on a conceptual level (1)

Example

F = (v1 ∨ v2 ∨ v3) ∧ (v1 ∨ v̄2 ∨ v3) ∧ (v̄1 ∨ v̄2 ∨ v̄3)

It is helpful to understand F as a factor graph.

v1

v2

v3

c1

c2

c3

Undirected, bipartite graph

Two types of nodes (variable nodes (circles), clause nodes (squares))

Two types of edges (positive edges (solid), negative edges (dashed))

Edges constitute literal occurrences

6 / 26

Page 7: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Message Passing on a conceptual level (2)

Example

F = (v1 ∨ v2 ∨ v3) ∧ (v1 ∨ v̄2 ∨ v3) ∧ (v̄1 ∨ v̄2 ∨ v̄3)

v1

v2

v3

c1

c2

c3

MP algorithm sends around messages along the edges

clauses and variables “negotiate” about possible assignments

assume variable v is contained in clause c as literal l

MP framework defines two types of messages.

7 / 26

Page 8: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Message Passing on a conceptual level (3)

Example

F = (v1 ∨ v2 ∨ v3) ∧ (v1 ∨ v̄2 ∨ v3) ∧ (v̄1 ∨ v̄2 ∨ v̄3)

v1 c1

c2

c3

d

d

d

1

2

3

1. Disrespect Messages (from variable nodes towards clause nodes):

δ(l, c) ∈ [0.0, 1.0]

The chance that l will not satisfy c

Intuitive meaning of δ(l, c) ≈ 1.0:Variable v tells clause c that it cannot satisfy it via its occurrence l.

8 / 26

Page 9: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Message Passing on a conceptual level (4)

Example

F = (v1 ∨ v2 ∨ v3) ∧ (v1 ∨ v̄2 ∨ v3) ∧ (v̄1 ∨ v̄2 ∨ v̄3)

v1 c1

c2

c3

w

w

w

1

2

3

2. Warning Messages (from clause nodes towards variable nodes):

ω(c, v) ∈ [0.0, 1.0]

The chance that no other literal in c can satisfy c

Intuitive meaning of ω(c, v) ≈ 1.0:Clause c is telling variable v that it needs it to be satisfied.

9 / 26

Page 10: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Message Passing on a conceptual level (5)

Example

F = (v1 ∨ v2 ∨ v3) ∧ (v1 ∨ v̄2 ∨ v3) ∧ (v̄1 ∨ v̄2 ∨ v̄3)

The MP framework defines the warning computation as

ω(c, v) =∏

l∈c\{v,v̄}

δ(l, c)

v1

v2

v3

c1d1d3w d12

.=

d3

10 / 26

Page 11: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Message Passing on a conceptual level (6)

The MP framework defines the cavity freedom value computations.1. Cavity freedom of l to satisfy c.

[0.0, 1.0] 3 S(l, c) =∏

d∈C¬l

[1− ω(d,Var(l))]

2. Cavity freedom of l to not satisfy c.

[0.0, 1.0] 3 U (l, c) =∏

d∈Cl\{c}

[1− ω(d, (V ar)(l))]

11 / 26

Page 12: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Message Passing on a conceptual level (7)

In summary, the MP framework defines, that

δ values are used to compute the ω values

ω values are used to compute the S, U values

However, the MP algorithms do not update the values arbitrarily.MP framework governs the overall process to update values.

following a random clause permutation π ∈ Smupdate one clause at a time (clause-update). ∀i ∈ {1, . . . ,m} :

1 ∀l ∈ cπ(i) : update δ(l, cπ(i))2 ∀v ∈ Var(cπ(i)) : update ω(cπ(i), v)3 ∀l ∈ cπ(i) : update S(l, cπ(i)), U (l, cπ(i))

updating all clauses once is called an iteration (z = 0, 1, 2, . . .)

multiple iterations form a cycle (y = 1, 2, 3, . . .)

the cycle of iterations is over in case an abort condition holds

12 / 26

Page 13: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Message Passing on a conceptual level (8)

Conceptually, a cycle y of iterations z = 0, 1, . . . , ∗ looks as follows.

The MP heuristic “links” the consecutive iterations.For example, the Belief Propagation (BP) heuristic defines

yzδBP(l, c) =

yz−1UBP(l, c)

yz−1UBP(l, c) + y

z−1SBP(l, c)

(=

U

U + S

)

13 / 26

Page 14: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Message Passing on a conceptual level (9)

The MP framework defines how to compute the biases using the y∗ω(c, v).

1 Compute the variable freedom to be assigned to true (T ) or false (F )

yT (v) =∏

c∈C−v

[1− y∗ω(c, v)] yF (v) =

∏c∈C+

v

[1− y∗ω(c, v)]

2 Compute magnetization values using T and F

yµ+(v), yµ−(v), yµ±(v) ∈ [0.0, 1.0]

These give yµ(v) = yµ+(v) + yµ−(v) + yµ±(v)

3 Compute the biases

yβ+(v) =yµ+(v)yµ(v)

yβ−(v) =yµ−(v)yµ(v)

yβ(v) = yβ+(v)− yβ−(v)

14 / 26

Page 15: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Message Passing on a conceptual level (10)

Here, all computations are defined by the MP framework except the µ.The exact µ equations are defined by the MP heuristic.

The Belief Propagation (BP) heuristic definesyµ+

BP(v) = yTBP(v)yµ−BP(v) = yFBP(v)yµ±BP(v) = 0

Using the BP heuristic in the MP framework then results in

yβBP(v) =yTBP(v)− yFBP(v)yTBP(v) + yFBP(v)

15 / 26

Page 16: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Heuristics vs. Frameworks (1)

In summary, we have the following set of equations (defined by either theMP framework or the MP heuristic).During the iterations we compute

disrespect messages δ(l, c)

warning messages ω(l, c)

cavity freedom values S(l, c), U (l, c)

After convergence we compute

variable freedom values T (v),F (v)

variable magnetization values µ+(v), µ−(v), µ±(v), µ(v)

variable bias value β+(v), β−(v), β(v)

If we want to extend the MP framework

we must not touch the MP heuristic equations

we must influence the equations for the iterations16 / 26

Page 17: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Heuristics vs. Frameworks (2)

The focus lies on the waring message, currently defined as

ω(c, v) =∏

l∈c\{v,v̄}

δ(l, c)

How can we modify this equation in a meaningful way?

Check Statistical Mechanics and the Ising Model

has served in the derivation of the SP equationsprovides concepts that have been ignored so far

However. . .

quite substantial theory

In the following, modifications of ω are presented

but the “bottom-up” explanations of the underlying ideas are omitted

17 / 26

Page 18: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Site Agitation with Arbitrary Coupling Strength (1)

Originally, the MP framework defines

ω(c, v) =∏

l∈c\{v,v̄}

δ(l, c)

all literals have the same “weight” in the warning computation

ignores arbitrary coupling strength in spin glasses

Introducing literal-weights. . .

as a set Ψ = {ψi,l|ψi,l ∈ [0,∞), ci ∈ F, l ∈ ci}

ω(ci, v,Ψ) =∏

l∈ci\{v,v̄}

ψi,l√δ(l, ci,Ψ)

ψi,l = 1 results in no modification

ψi,l > 1 will increase the factor for the product

ψi,l < 1 will decrease the factor for the product18 / 26

Page 19: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Site Agitation with Arbitrary Coupling Strength (2)

What can we do with the ψi,l values?In theory we can

study the effects of Ψ→∞ or Ψ→ 0 on an MP algorithm’s behaviorusing Ψ→∞ forces the MP algorithm to simulate

a literal-occurrence based variable orderingthat acts conflict avoiding

β(v) =|C+

v |−|C−v |

|Cv|using Ψ→ 0 forces the MP algorithm to simulate

a literal-occurrence based variable orderingthat acts conflict seeking

β(v) =|C−

v |−|C+v |

|Cv|

In practice we can

gradually interpolate between conflict avoiding/seeking behavioruse these values to realize feedback from the search to the MP alg.

bi-directional flow of information is important for performanceVSIDS/PS and the CDCL searchincrease weights in conflict clauses

19 / 26

Page 20: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Magnetic Agitation (1)

Originally, the MP framework defines

ω(c, v) =∏

l∈c\{v,v̄}

δ(l, c)

there is no way to influence an “overall direction”

ignores external magnetic flields in spin glasses

Introducing a direction preference. . .

as a parameter Φ ∈ [−1.0,+1.0] (magnetic field parameter)

ω(c, v,Φ) = (1− |Φ|)

∏l∈c\{v,v̄}

δ(l, c,Φ)

+|Φ|+ sgn(v, c) · Φ

2

Φ = 0 results in no modification

Φ > 0 will increase warnings send from positive literals

Φ < 0 will increase warnings send from negative literals20 / 26

Page 21: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Magnetic Agitation (2)

What can we do with the Φ value?In theory we can

study the effects of Φ→ −1 or Φ + 1 on an MP algorithm’s behaviorusing Φ→ −1 forces the MP algorithm to simulate

the zero-first value orderingβ(v) = −1

using Φ→ 1 forces the MP algorithm to simulate

the one-first value orderingβ(v) = +1

In practice we can

gradually interpolate between zero-first/one-first

harness a-priori knowledge about “0-1 ratios” in satisfyingassignments

21 / 26

Page 22: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Thermal Agitation (1)

Originally, the MP framework defines

ω(c, v) =∏

l∈c\{v,v̄}

δ(l, c)

clauses constitute a “link” between variables in the formula

information can “travel unhindered” through the clauses

ignores thermal agitation in spin glasses

Introducing a dampening effect. . .

as a parameter Υ ∈ [0, 1] (temparature parameter)

ω(c, v,Φ) = (1−Υ)

∏l∈c\{v,v̄}

δ(l, c,Υ)

Υ > 0 smaller warnings (variables become more independent)

Υ = 1 results in zero-warnings (variables are completely independent)22 / 26

Page 23: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Thermal Agitation (2)

What can we do with the Υ value?In theory we can

use Υ to define a new measure for variables: heat resistance

increase Υ gradually and monitor the biases

biases will decay at high temperature, but not necessarily equally fast

large biases for large temperature values constitute a high heatrestistance

suggests more stable assignments

In practice we can

use Υ to control how much computational time is spend

higher temperature values result in faster convergence during the cyclescomputing biases at various temperature levels can sugges the“stability” of assignments

allows a trade-off between computational time and bias quality

23 / 26

Page 24: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Putting it all together

Replacing

ω(c, v) =∏

l∈c\{v,v̄}

δ(l, c)

in the original product-based MP framework with ω(ci, v,Ψ,Φ,Υ) =

(1−Υ)

(1− |Φ|)

∏l∈ci\{v,v}

ψi,l√δ(l, ci,Ψ,Φ,Υ)

+|Φ|+ sgn(v, c) · Φ

2

results in the extended product-based MP framework (ePMPF).

24 / 26

Page 25: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Conclusions

Modifying the ω equation in the product-based MP framework allows usto

influence the behavior of the MP algorithm (and the biases itcomputes)

by harnessing additional concepts from physicssite agitation with arbitrary coupling strength, Ψ

gradually interpolate between conflict avoiding/seeking behaviorrealize feedback from the search to the MP algorithm

magnetic agitation, Φ

gradually interpolate between zero-first/one-first direction preferencesharness a-priori knowledge about 0-1 ratios in solutionstuneable parameter

thermal agitation, Υ

allows to define a heat resistance measure for variablescontrol how much computational effort is spend by MP algorithmtuneable parameter

25 / 26

Page 26: An Ising Model inspired Extension of the Product-based MP

Background Message Passing Modifying the PMPF Conclusions

Thanks you for your attention!

An Ising Model inspired Extension of theProduct-based MP Framework for SAT

Oliver [email protected]

Thank you for your attention.

26 / 26