SlideShare a Scribd company logo
Learning to Solve Circuit-SAT:
an Unsupervised
Differentiable Approach
Saeed Amizadeh, Sergiy Matusevych and Markus Weimer
Microsoft
ICLR 2019
Outline
• Abstract
• Introduction
• Background
• DAG embedding
• Application to the Circuit-SAT problem
• Experimental evaluation
• Discussion
Abstract
• New trend of applying rich neural architectures to solve classical
combinatorial optimization problems.
• Propose a neural framework that can learn to solve the Circuit-SAT
problem.
• Rich embedding architecture that encode the problem structure
• Differentiable training procedure that mimics RL
• Train the model directly toward solving the SAT problem
• Show the superior out-of-sample generalization performance
compared to NeuroSAT method.
Introduction
• The emergence of neural models for learning how to solve the
classical combinatorial optimization problems.
• In practice, for a given class of combinatorial problems, the
problem instances are typically drawn from a certain (unknown)
distribution.
• If there are sufficient number of problem instances, ML (DL) is
capable of extracting the common structures among these
instances and produce models that would outperform the carefully
hand-crafted algorithms.
• Supervised learning
• Be shown to be effective for various NP-complete problems.
• The resulted model is bounded by greedy strategy (sub-optimal in
general).
• Reinforcement learning
• Learn the optimal decision and search heuristics beyond the greedy
strategy.
• Challenging work to train such model.
• Propose a neural Circuit-SAT training the model directly toward
the end goal.
Represent the instance
• Classical architectures like RNNs or LSTMs
• Ignore the inherent structure present in the problem instances.
• Neural graph embedding embraces the information on graph that
represents the problem structure.
• Most methods synchronously propagate local information on an
underlying graph.
• The information is propagated sequentially rather than
synchronously in the proposed model.
Background
NP problem
Source: https://en.wikipedia.org/wiki/NP-completeness
SAT
• The problem of determining if there exists an assignment that satisfies
a given Boolean formula (consisted of variable, AND, OR and NOT).
• E.g.
• 𝑢1 ∨ ¬𝑢2 ∧ (¬𝑢1 ∨ 𝑢2)
• 𝑢1 = 𝑢2 = TRUE → SAT
• Variable: 𝑢1, 𝑢2
• Literals: 𝑢1, ¬𝑢1, 𝑢2, ¬𝑢2
• Clauses: 𝑢1 ∨ ¬𝑢2 , (¬𝑢1 ∨ 𝑢2)
• Conjunctive normal form (CNF)
• Conjunction (AND) of one or more clauses, where a clause is a disjunction (OR)
of literals.
Source: https://en.wikipedia.org/wiki/Conjunctive_normal_form
Circuit-SAT
• The decision problem of determining whether a given Boolean
circuit (only composed of AND, OR and NOT gate) has an
assignment of its inputs that makes the output true.
Source : https://en.wikipedia.org/wiki/Circuit_satisfiability_problem
𝒙 𝟏 𝒙 𝟐 𝒚
0 0 0
0 1 0
1 0 0
1 1 1
𝒙 𝒚
0 0
1 0
𝑥1
𝑥2
𝑦 𝑦𝑥
SAT UNSAT
NeuroSAT (Selsam et al. (2018))
• Approach the SAT problem as a binary classification problem.
• Find the SAT solution by clustering the latent representation
extracted from the learned classifier.
• NOT directly trained toward finding SAT solutions.
Source: https://github.com/dselsam/neurosat
Direct Acyclic Graph (DAG)
• Directed graph with no directed cycles.
• Topological sort
• Given a directed graph 𝐺, a linear ordering of its vertices such that for
every directed edge (𝑢, 𝑣), 𝑢 comes before 𝑣 in the ordering.
Source: http://www.csie.ntnu.edu.tw/~u91029/DirectedAcyclicGraph.html
DAG embedding
• DAG 𝐺 = 𝑉𝐺, 𝐸 𝐺
• Reversed DAG 𝐺 𝑟
with the same set of nodes but reversed edges
• For 𝑣 ∈ 𝑉𝐺, 𝜋 𝐺(𝑣) represents the set of direct predecessors
• DAG function 𝜇 𝐺: 𝑉𝐺 ↦ ℝ 𝑑
• Define 𝒢 𝑑 as the space of all possible 𝑑-dimensional functions 𝜇 𝐺
• Model ℱ 𝜃 𝜇 𝐺 = 𝒞 𝒶(𝒫(ℰℬ(𝜇 𝐺)))
• Embedding function ℰℬ: 𝒢 𝑑
↦ 𝒢 𝑞
• Pooling function 𝒫: 𝒢 𝑞
↦ 𝒢 𝑞
• Retrieve only the sink nodes in the input DAG
• Classification function 𝒞 𝒶: 𝒢 𝑞
↦ 𝒪
• For simplicity, define
• Feature vector 𝒙 𝑣 = 𝜇 𝐺 𝑣 ∈ ℝ 𝑑
• State vector 𝒉 𝑣 = 𝛿 𝐺 𝑣 ∈ ℝ 𝑞 where 𝛿 𝐺: 𝑉𝐺 ↦ ℝ 𝑞
• Update logic that applying on each node:
𝒉 𝑣 = 𝐺𝑅𝑈 𝒙 𝑣, 𝒉 𝑣
′
, where 𝒉 𝑣
′
= 𝒜({𝒉 𝑢|𝑢 ∈ 𝜋(𝑣)})
• Aggregator function 𝒜: 2 𝑉 𝐺 ↦ ℝ 𝑞
• Aggregate state of node’s direct predecessors.
• Apply the update logic sequentially in the topological sort order.
Deep-Gated DAG Recursive Neural
Network (DG-DAGRNN)
• Stack 𝐿-layer embedding layer where the 𝑖th layer has its own parameters ℬ𝑖
and output DAG function dimensionality 𝑞𝑖.
• Apply sequentially 𝑇 times on stacked 𝐿 layers.
ℰℬ 𝜇 𝐺 ≡ ℰℬ
𝑇
𝜇 𝐺 , where ℰℬ
𝑡
𝜇 𝐺 = ℰ 𝑠𝑡𝑎𝑐𝑘 𝑃𝑟𝑜𝑗 𝑯 ℰℬ
𝑡−1
𝜇 𝐺 , ∀𝑡 ∈ 2. . 𝑇
ℰℬ
1
𝜇 𝐺 = ℰ 𝑠𝑡𝑎𝑐𝑘(𝜇 𝐺)
s. t. ℰ 𝑠𝑡𝑎𝑐𝑘 = ℰℬ 𝐿
∘ ℰℬ 𝐿−1
∘ ℰ1
• 𝑤ℎ𝑒𝑟𝑒 ℬ = 〈ℬ1, … , ℬ 𝐿, 𝑯〉 is the list of parameters and 𝑃𝑟𝑜𝑗 𝑯: 𝒢 𝑞 𝐿 ↦ 𝒢 𝑑 is the
linear projection with the projection matrix 𝑯 𝑑×𝑞 𝐿
.
Paper study: Learning to solve circuit sat
Application to Circuit-SAT
problem
• DAG function 𝜇 𝐺: 𝑉𝐺 ↦ ℝ4
• 𝜇 𝐺 𝑣 = One−Hot 𝑡𝑦𝑝𝑒 𝑣
where 𝑡𝑦𝑝𝑒 v ∈ 𝐀𝐧𝐝, 𝐎𝐫, 𝐍𝐨𝐭, 𝐕𝐚𝐫𝐢𝐚𝐛𝐥𝐞
• Each node representing either a Boolean variable or a logical gate.
𝑥
1
2
3
0
0
0
1
0
0
1
0
1
0
0
0
Variables in sources Only one sink
Solver Network
• Embedding function ℰℬ:
• multi-layer recursive embedding with interleaving forward and
reversed layers
• Last layer is a reversed layer so we can read the output from
Variable nodes.
• Output space encode the soft assignment (in range [0−1]) to the
corresponding variable node in the input circuit.
• ℱ 𝜃 acts as policy network.
Pooling: Retrieve only the sink nodes
Evaluator Network
• 𝑆 𝑚𝑎𝑥 𝑎1, 𝑎2, … , 𝑎 𝑛 =
σ 𝑖=1
𝑛
𝑎 𝑖 𝑒 Τ𝑎 𝑖 𝜏
σ𝑖=1
𝑛
𝑒 Τ𝑎 𝑖 𝜏 , 𝑆 𝑚𝑖𝑛 𝑎1, 𝑎2, … , 𝑎 𝑛 =
σ 𝑖=1
𝑛
𝑎 𝑖 𝑒 Τ−𝑎 𝑖 𝜏
σ𝑖=1
𝑛
𝑒− Τ𝑎 𝑖 𝜏
• For 𝜏 = +∞, 𝑆 𝑚𝑎𝑥() and 𝑆 𝑚𝑖𝑛() are arithmetic mean.
• E.g.
• 𝒂 = 1, 2, 3 , 𝜏 = +∞
• 𝑆 𝑚𝑎𝑥 𝒂 = 𝑆 𝑚𝑖𝑛 𝒂 =
1⋅𝑒0+2⋅𝑒0+3⋅𝑒0
𝑒0+𝑒0+𝑒0 =
1+2+3
3
= 2
• For 𝜏 → 0, 𝑆 𝑚𝑎𝑥 → max(), 𝑆 𝑚𝑖𝑛 → min()
• E.g.
• 𝒂 = 1, 2, 3 , 𝜏 = 0.01
• 𝑆 𝑚𝑎𝑥 𝒂 =
1⋅𝑒 Τ1 0.01+2⋅𝑒 Τ2 0.01+3⋅𝑒 Τ3 0.01
𝑒 Τ1 0.01+𝑒 Τ2 0.01+𝑒 Τ3 0.01 =
1𝑒100+2𝑒200+3𝑒300
𝑒100+𝑒200+𝑒300 ≈
3𝑒300
𝑒300 = 3
• 𝑆 𝑚𝑖𝑛 𝒂 =
1⋅𝑒 Τ−1 0.01+2⋅𝑒 Τ−2 0.01+3⋅𝑒 Τ−3 0.01
𝑒 Τ−1 0.01+𝑒 Τ−2 0.01+𝑒 Τ−3 0.01 =
1𝑒−100+2𝑒−200+3𝑒−300
𝑒−100+𝑒−200+𝑒−300 ≈
𝑒−100
𝑒−100 = 1
Evaluator Network (cont’d)
• For any given circuit 𝜇 𝐺, define the soft evaluation function ℛ 𝐺 as a
DAG that shares the same topology 𝐺 with the circuit 𝜇 𝐺.
• Except that replace each
• And node to smooth min (𝑆 𝑚𝑎𝑥)
• Or node to smooth max (𝑆 𝑚𝑖𝑛)
• Not nodes to 𝒩 𝑧 = 1 − 𝑧
• At a low enough temperature (𝜏), if for a given input assignment,
ℛ 𝐺 yields a value strictly greater than 0.5, then that assignment
can be seen as a satisfying solution for the circuit.
• ℛ 𝐺 acts as reward network.
Optimization
• 𝒮 𝜃: 𝒢 ↦ [0, 1] as 𝑆 𝜃 𝜇 𝐺 = ℛ 𝐺(ℱ 𝜃(𝜇 𝐺))
• Use the policy network to produce assignment and feed to reward
network to validate the satisfiability.
• Minimize the loss function
ℒ 𝑠 =
1−𝑠 𝜅
1−𝑠 𝜅+𝑠 𝜅 where 𝑠 = 𝒮 𝜃(𝜇 𝐺) and 𝜅 ≥ 1
• Could be seen as the portion of un-satisfiability.
Experimental evaluation
• Baseline: NeuroSAT
• Assume input problems come in CNF.
• Convert the input CNF into circuit before feeding to proposed
model (DG-DAGRNN).
• Use the same generation process in NeuroSAT to produce the
random dataset.
• 300K SAT and UNSAT pairs
• Number of Boolean variables: 3 to 10
• Performance metric: the percentage of SAT problems in the test
set that each model can actually find a SAT solution for.
number of recurrences 𝑇 (for embedding) increases
In-Sample test Out-of-Sample test (Use 3-10 variables during training)
number of variables in test set
Graph k-coloring
• Given an undirected graph 𝐺 with 𝑘 color values, in graph k-
coloring decision problem, seek to find a mapping from the graph
nodes to the color set such that no adjacent nodes in the graph
have the same color.
Source: https://en.wikipedia.org/wiki/Graph_coloring
Graph k-coloring (cont’d)
• Given a graph with 𝑁 nodes and maximum 𝑘 allowed colors,
• Define 𝑥𝑖𝑗 for 1 ≤ 𝑖 ≤ 𝑁 and 1 ≤ 𝑗 ≤ 𝑘, where 𝑥𝑖𝑗 = 1 indicates
that the 𝑖th node is colored by the 𝑗th color.
• Transform the problem to SAT problem with Boolean CNF:
• ⋀𝑖=1
𝑁
(⋁𝑗=1
𝑘
𝑥𝑖𝑗) ∧ [⋀ 𝑝,𝑞 ∈𝐸(⋀𝑗=1
𝑘
(¬𝑥 𝑝𝑗 ∨ ¬𝑥 𝑞𝑗))]
• Left set of clauses (red): ensure that each node of the graph takes at least
one color.
• Right set of clauses (blue): constrain that the neighboring nodes cannot
take the same color. 𝒙 𝒑𝒋 𝒙 𝒒𝒋 (¬𝑥 𝑝𝑗 ∨ ¬𝑥 𝑞𝑗)
0 0 1
0 1 1
1 0 1
1 1 0
Example
blue green red
1 T F F
2 F F T
3 F T F
4 F F T
1
3
2
4
⋀𝑖=1
𝑁
(⋁𝑗=1
𝑘
𝑥𝑖𝑗) ∧ [⋀ 𝑝,𝑞 ∈𝐸(⋀𝑗=1
𝑘
(¬𝑥 𝑝𝑗 ∨ ¬𝑥 𝑞𝑗))]
colornode
• Dataset 1
• number of nodes: 6-10
• edge percentage: 37%
• Generate random graph from 6 different distributions and then pair with random k color in
the range of 2 ≤ 𝑘 ≤ 4.
• Dataset 2
• Generate random trees with the same node number in dataset 1.
• Add random edges to graph until it become UNSAT.
• Remove the last added edge to form SAT problem.
• Proposed model could solve 48% and 27% in Dataset 1 and Dataset 2, respectively.
• Surprisingly, NeuroSAT could not solve any problems, which does not consist to
original paper.
• NeuroSAT may be sensitive to the change of problem distribution.
Discussion
• Propose a neural framework for efficiently learning a Circuit-SAT
solver.
• Rely on DAG-embedding architecture and efficient training
procedure.
• Solve the SAT problem in a fewer number of iterations compared
to the baseline.

More Related Content

PDF
Rpp bab 1 (eksponen dan logaritma)
DOCX
1. Kisi Matematika KurikulumMerdeka.docx
PDF
RPP SMA Matematika Peminatan Kelas XII
DOCX
Rpp barisan-geometri
DOCX
Rpp matematika sma xii bab 2 (bunga, pertumbuhan, dan peluruhan)
DOCX
Rpp melukis sudut
DOC
Rpp matematika SMA (statistika)
PDF
Tesis latex
Rpp bab 1 (eksponen dan logaritma)
1. Kisi Matematika KurikulumMerdeka.docx
RPP SMA Matematika Peminatan Kelas XII
Rpp barisan-geometri
Rpp matematika sma xii bab 2 (bunga, pertumbuhan, dan peluruhan)
Rpp melukis sudut
Rpp matematika SMA (statistika)
Tesis latex

What's hot (13)

PDF
Cơ sở dữ liệu - Luyện thi cao học CNTT
DOCX
Relasi rekursif
PPT
csdl - buoi5-6
DOCX
RPP GARIS SINGGUNG PERSEKUTUAN DUA LINGKARAN
PDF
Cyclic code
PDF
Tugas individu 3_filsafat
PDF
Luận văn: Thuật toán tìm cơ sở của các môđun con của môđun tự do hữu hạn sinh...
DOCX
Rpp 2 - koordinat cartesius
DOCX
Aplikasi sistem persamaan diferensial_
PPTX
Sifat khusus integral tentu
PDF
KBK SD 04. matematika
PPTX
Normal forms and normalization CÁC DẠNG CHUẨN VÀ CHUẨN HÓA
PDF
LaTeX ; Notasi Matematika
Cơ sở dữ liệu - Luyện thi cao học CNTT
Relasi rekursif
csdl - buoi5-6
RPP GARIS SINGGUNG PERSEKUTUAN DUA LINGKARAN
Cyclic code
Tugas individu 3_filsafat
Luận văn: Thuật toán tìm cơ sở của các môđun con của môđun tự do hữu hạn sinh...
Rpp 2 - koordinat cartesius
Aplikasi sistem persamaan diferensial_
Sifat khusus integral tentu
KBK SD 04. matematika
Normal forms and normalization CÁC DẠNG CHUẨN VÀ CHUẨN HÓA
LaTeX ; Notasi Matematika
Ad

Similar to Paper study: Learning to solve circuit sat (20)

PPT
Satisfiability
PDF
11_winter_lecture-2023-2024————————-.pdf
PDF
Keynote: Machine Learning for Design Automation at DAC 2018
PPT
002-functions-and-circuits.ppt
PPTX
Undecidable Problems and Approximation Algorithms
PPTX
Keynote at IWLS 2017
PDF
np hard, np complete, polynomial and non polynomial
PPT
Learning to Search Henry Kautz
PPT
Learning to Search Henry Kautz
PPT
ppt
PPT
ppt
PDF
Big Data and Small Devices by Katharina Morik
PDF
Easy to learn deep learning guide - elementry
PDF
9. chapter 8 np hard and np complete problems
PDF
Algorithm chapter 10
PPT
003 bd ds
PDF
From deep learning to deep reasoning
PDF
Grl book
PDF
A Stochastic Limit Approach To The SAT Problem
Satisfiability
11_winter_lecture-2023-2024————————-.pdf
Keynote: Machine Learning for Design Automation at DAC 2018
002-functions-and-circuits.ppt
Undecidable Problems and Approximation Algorithms
Keynote at IWLS 2017
np hard, np complete, polynomial and non polynomial
Learning to Search Henry Kautz
Learning to Search Henry Kautz
ppt
ppt
Big Data and Small Devices by Katharina Morik
Easy to learn deep learning guide - elementry
9. chapter 8 np hard and np complete problems
Algorithm chapter 10
003 bd ds
From deep learning to deep reasoning
Grl book
A Stochastic Limit Approach To The SAT Problem
Ad

More from ChenYiHuang5 (10)

PDF
Upgrading Loki with a Canary Deployment: Enhancing Performance and Reducing C...
PDF
Grafana Alloy Best Practice presented in COSCUP 2024
PDF
The Journey to the Kubernetes networking.pdf
PPTX
The journey to the kubernetes metrics
PDF
Paper Study: Transformer dissection
PDF
Paper Study: A learning based iterative method for solving vehicle routing
PDF
Paper study: Attention, learn to solve routing problems!
PDF
Paper Study: OptNet: Differentiable Optimization as a Layer in Neural Networks
PDF
Buddy system
PDF
Paper Study: Melding the data decision pipeline
Upgrading Loki with a Canary Deployment: Enhancing Performance and Reducing C...
Grafana Alloy Best Practice presented in COSCUP 2024
The Journey to the Kubernetes networking.pdf
The journey to the kubernetes metrics
Paper Study: Transformer dissection
Paper Study: A learning based iterative method for solving vehicle routing
Paper study: Attention, learn to solve routing problems!
Paper Study: OptNet: Differentiable Optimization as a Layer in Neural Networks
Buddy system
Paper Study: Melding the data decision pipeline

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PPT
Teaching material agriculture food technology
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Modernizing your data center with Dell and AMD
PDF
Approach and Philosophy of On baking technology
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Empathic Computing: Creating Shared Understanding
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Encapsulation_ Review paper, used for researhc scholars
Teaching material agriculture food technology
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Dropbox Q2 2025 Financial Results & Investor Presentation
Chapter 3 Spatial Domain Image Processing.pdf
Spectral efficient network and resource selection model in 5G networks
The AUB Centre for AI in Media Proposal.docx
MYSQL Presentation for SQL database connectivity
Modernizing your data center with Dell and AMD
Approach and Philosophy of On baking technology
Reach Out and Touch Someone: Haptics and Empathic Computing
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Diabetes mellitus diagnosis method based random forest with bat algorithm
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
“AI and Expert System Decision Support & Business Intelligence Systems”
Empathic Computing: Creating Shared Understanding
Agricultural_Statistics_at_a_Glance_2022_0.pdf

Paper study: Learning to solve circuit sat

  • 1. Learning to Solve Circuit-SAT: an Unsupervised Differentiable Approach Saeed Amizadeh, Sergiy Matusevych and Markus Weimer Microsoft ICLR 2019
  • 2. Outline • Abstract • Introduction • Background • DAG embedding • Application to the Circuit-SAT problem • Experimental evaluation • Discussion
  • 3. Abstract • New trend of applying rich neural architectures to solve classical combinatorial optimization problems. • Propose a neural framework that can learn to solve the Circuit-SAT problem. • Rich embedding architecture that encode the problem structure • Differentiable training procedure that mimics RL • Train the model directly toward solving the SAT problem • Show the superior out-of-sample generalization performance compared to NeuroSAT method.
  • 5. • The emergence of neural models for learning how to solve the classical combinatorial optimization problems. • In practice, for a given class of combinatorial problems, the problem instances are typically drawn from a certain (unknown) distribution. • If there are sufficient number of problem instances, ML (DL) is capable of extracting the common structures among these instances and produce models that would outperform the carefully hand-crafted algorithms.
  • 6. • Supervised learning • Be shown to be effective for various NP-complete problems. • The resulted model is bounded by greedy strategy (sub-optimal in general). • Reinforcement learning • Learn the optimal decision and search heuristics beyond the greedy strategy. • Challenging work to train such model. • Propose a neural Circuit-SAT training the model directly toward the end goal.
  • 7. Represent the instance • Classical architectures like RNNs or LSTMs • Ignore the inherent structure present in the problem instances. • Neural graph embedding embraces the information on graph that represents the problem structure. • Most methods synchronously propagate local information on an underlying graph. • The information is propagated sequentially rather than synchronously in the proposed model.
  • 10. SAT • The problem of determining if there exists an assignment that satisfies a given Boolean formula (consisted of variable, AND, OR and NOT). • E.g. • 𝑢1 ∨ ¬𝑢2 ∧ (¬𝑢1 ∨ 𝑢2) • 𝑢1 = 𝑢2 = TRUE → SAT • Variable: 𝑢1, 𝑢2 • Literals: 𝑢1, ¬𝑢1, 𝑢2, ¬𝑢2 • Clauses: 𝑢1 ∨ ¬𝑢2 , (¬𝑢1 ∨ 𝑢2) • Conjunctive normal form (CNF) • Conjunction (AND) of one or more clauses, where a clause is a disjunction (OR) of literals. Source: https://en.wikipedia.org/wiki/Conjunctive_normal_form
  • 11. Circuit-SAT • The decision problem of determining whether a given Boolean circuit (only composed of AND, OR and NOT gate) has an assignment of its inputs that makes the output true. Source : https://en.wikipedia.org/wiki/Circuit_satisfiability_problem 𝒙 𝟏 𝒙 𝟐 𝒚 0 0 0 0 1 0 1 0 0 1 1 1 𝒙 𝒚 0 0 1 0 𝑥1 𝑥2 𝑦 𝑦𝑥 SAT UNSAT
  • 12. NeuroSAT (Selsam et al. (2018)) • Approach the SAT problem as a binary classification problem. • Find the SAT solution by clustering the latent representation extracted from the learned classifier. • NOT directly trained toward finding SAT solutions. Source: https://github.com/dselsam/neurosat
  • 13. Direct Acyclic Graph (DAG) • Directed graph with no directed cycles. • Topological sort • Given a directed graph 𝐺, a linear ordering of its vertices such that for every directed edge (𝑢, 𝑣), 𝑢 comes before 𝑣 in the ordering. Source: http://www.csie.ntnu.edu.tw/~u91029/DirectedAcyclicGraph.html
  • 15. • DAG 𝐺 = 𝑉𝐺, 𝐸 𝐺 • Reversed DAG 𝐺 𝑟 with the same set of nodes but reversed edges • For 𝑣 ∈ 𝑉𝐺, 𝜋 𝐺(𝑣) represents the set of direct predecessors • DAG function 𝜇 𝐺: 𝑉𝐺 ↦ ℝ 𝑑 • Define 𝒢 𝑑 as the space of all possible 𝑑-dimensional functions 𝜇 𝐺 • Model ℱ 𝜃 𝜇 𝐺 = 𝒞 𝒶(𝒫(ℰℬ(𝜇 𝐺))) • Embedding function ℰℬ: 𝒢 𝑑 ↦ 𝒢 𝑞 • Pooling function 𝒫: 𝒢 𝑞 ↦ 𝒢 𝑞 • Retrieve only the sink nodes in the input DAG • Classification function 𝒞 𝒶: 𝒢 𝑞 ↦ 𝒪
  • 16. • For simplicity, define • Feature vector 𝒙 𝑣 = 𝜇 𝐺 𝑣 ∈ ℝ 𝑑 • State vector 𝒉 𝑣 = 𝛿 𝐺 𝑣 ∈ ℝ 𝑞 where 𝛿 𝐺: 𝑉𝐺 ↦ ℝ 𝑞 • Update logic that applying on each node: 𝒉 𝑣 = 𝐺𝑅𝑈 𝒙 𝑣, 𝒉 𝑣 ′ , where 𝒉 𝑣 ′ = 𝒜({𝒉 𝑢|𝑢 ∈ 𝜋(𝑣)}) • Aggregator function 𝒜: 2 𝑉 𝐺 ↦ ℝ 𝑞 • Aggregate state of node’s direct predecessors. • Apply the update logic sequentially in the topological sort order.
  • 17. Deep-Gated DAG Recursive Neural Network (DG-DAGRNN) • Stack 𝐿-layer embedding layer where the 𝑖th layer has its own parameters ℬ𝑖 and output DAG function dimensionality 𝑞𝑖. • Apply sequentially 𝑇 times on stacked 𝐿 layers. ℰℬ 𝜇 𝐺 ≡ ℰℬ 𝑇 𝜇 𝐺 , where ℰℬ 𝑡 𝜇 𝐺 = ℰ 𝑠𝑡𝑎𝑐𝑘 𝑃𝑟𝑜𝑗 𝑯 ℰℬ 𝑡−1 𝜇 𝐺 , ∀𝑡 ∈ 2. . 𝑇 ℰℬ 1 𝜇 𝐺 = ℰ 𝑠𝑡𝑎𝑐𝑘(𝜇 𝐺) s. t. ℰ 𝑠𝑡𝑎𝑐𝑘 = ℰℬ 𝐿 ∘ ℰℬ 𝐿−1 ∘ ℰ1 • 𝑤ℎ𝑒𝑟𝑒 ℬ = 〈ℬ1, … , ℬ 𝐿, 𝑯〉 is the list of parameters and 𝑃𝑟𝑜𝑗 𝑯: 𝒢 𝑞 𝐿 ↦ 𝒢 𝑑 is the linear projection with the projection matrix 𝑯 𝑑×𝑞 𝐿 .
  • 20. • DAG function 𝜇 𝐺: 𝑉𝐺 ↦ ℝ4 • 𝜇 𝐺 𝑣 = One−Hot 𝑡𝑦𝑝𝑒 𝑣 where 𝑡𝑦𝑝𝑒 v ∈ 𝐀𝐧𝐝, 𝐎𝐫, 𝐍𝐨𝐭, 𝐕𝐚𝐫𝐢𝐚𝐛𝐥𝐞 • Each node representing either a Boolean variable or a logical gate. 𝑥 1 2 3 0 0 0 1 0 0 1 0 1 0 0 0 Variables in sources Only one sink
  • 21. Solver Network • Embedding function ℰℬ: • multi-layer recursive embedding with interleaving forward and reversed layers • Last layer is a reversed layer so we can read the output from Variable nodes. • Output space encode the soft assignment (in range [0−1]) to the corresponding variable node in the input circuit. • ℱ 𝜃 acts as policy network. Pooling: Retrieve only the sink nodes
  • 22. Evaluator Network • 𝑆 𝑚𝑎𝑥 𝑎1, 𝑎2, … , 𝑎 𝑛 = σ 𝑖=1 𝑛 𝑎 𝑖 𝑒 Τ𝑎 𝑖 𝜏 σ𝑖=1 𝑛 𝑒 Τ𝑎 𝑖 𝜏 , 𝑆 𝑚𝑖𝑛 𝑎1, 𝑎2, … , 𝑎 𝑛 = σ 𝑖=1 𝑛 𝑎 𝑖 𝑒 Τ−𝑎 𝑖 𝜏 σ𝑖=1 𝑛 𝑒− Τ𝑎 𝑖 𝜏 • For 𝜏 = +∞, 𝑆 𝑚𝑎𝑥() and 𝑆 𝑚𝑖𝑛() are arithmetic mean. • E.g. • 𝒂 = 1, 2, 3 , 𝜏 = +∞ • 𝑆 𝑚𝑎𝑥 𝒂 = 𝑆 𝑚𝑖𝑛 𝒂 = 1⋅𝑒0+2⋅𝑒0+3⋅𝑒0 𝑒0+𝑒0+𝑒0 = 1+2+3 3 = 2 • For 𝜏 → 0, 𝑆 𝑚𝑎𝑥 → max(), 𝑆 𝑚𝑖𝑛 → min() • E.g. • 𝒂 = 1, 2, 3 , 𝜏 = 0.01 • 𝑆 𝑚𝑎𝑥 𝒂 = 1⋅𝑒 Τ1 0.01+2⋅𝑒 Τ2 0.01+3⋅𝑒 Τ3 0.01 𝑒 Τ1 0.01+𝑒 Τ2 0.01+𝑒 Τ3 0.01 = 1𝑒100+2𝑒200+3𝑒300 𝑒100+𝑒200+𝑒300 ≈ 3𝑒300 𝑒300 = 3 • 𝑆 𝑚𝑖𝑛 𝒂 = 1⋅𝑒 Τ−1 0.01+2⋅𝑒 Τ−2 0.01+3⋅𝑒 Τ−3 0.01 𝑒 Τ−1 0.01+𝑒 Τ−2 0.01+𝑒 Τ−3 0.01 = 1𝑒−100+2𝑒−200+3𝑒−300 𝑒−100+𝑒−200+𝑒−300 ≈ 𝑒−100 𝑒−100 = 1
  • 23. Evaluator Network (cont’d) • For any given circuit 𝜇 𝐺, define the soft evaluation function ℛ 𝐺 as a DAG that shares the same topology 𝐺 with the circuit 𝜇 𝐺. • Except that replace each • And node to smooth min (𝑆 𝑚𝑎𝑥) • Or node to smooth max (𝑆 𝑚𝑖𝑛) • Not nodes to 𝒩 𝑧 = 1 − 𝑧 • At a low enough temperature (𝜏), if for a given input assignment, ℛ 𝐺 yields a value strictly greater than 0.5, then that assignment can be seen as a satisfying solution for the circuit. • ℛ 𝐺 acts as reward network.
  • 24. Optimization • 𝒮 𝜃: 𝒢 ↦ [0, 1] as 𝑆 𝜃 𝜇 𝐺 = ℛ 𝐺(ℱ 𝜃(𝜇 𝐺)) • Use the policy network to produce assignment and feed to reward network to validate the satisfiability. • Minimize the loss function ℒ 𝑠 = 1−𝑠 𝜅 1−𝑠 𝜅+𝑠 𝜅 where 𝑠 = 𝒮 𝜃(𝜇 𝐺) and 𝜅 ≥ 1 • Could be seen as the portion of un-satisfiability.
  • 26. • Baseline: NeuroSAT • Assume input problems come in CNF. • Convert the input CNF into circuit before feeding to proposed model (DG-DAGRNN). • Use the same generation process in NeuroSAT to produce the random dataset. • 300K SAT and UNSAT pairs • Number of Boolean variables: 3 to 10 • Performance metric: the percentage of SAT problems in the test set that each model can actually find a SAT solution for.
  • 27. number of recurrences 𝑇 (for embedding) increases In-Sample test Out-of-Sample test (Use 3-10 variables during training) number of variables in test set
  • 28. Graph k-coloring • Given an undirected graph 𝐺 with 𝑘 color values, in graph k- coloring decision problem, seek to find a mapping from the graph nodes to the color set such that no adjacent nodes in the graph have the same color. Source: https://en.wikipedia.org/wiki/Graph_coloring
  • 29. Graph k-coloring (cont’d) • Given a graph with 𝑁 nodes and maximum 𝑘 allowed colors, • Define 𝑥𝑖𝑗 for 1 ≤ 𝑖 ≤ 𝑁 and 1 ≤ 𝑗 ≤ 𝑘, where 𝑥𝑖𝑗 = 1 indicates that the 𝑖th node is colored by the 𝑗th color. • Transform the problem to SAT problem with Boolean CNF: • ⋀𝑖=1 𝑁 (⋁𝑗=1 𝑘 𝑥𝑖𝑗) ∧ [⋀ 𝑝,𝑞 ∈𝐸(⋀𝑗=1 𝑘 (¬𝑥 𝑝𝑗 ∨ ¬𝑥 𝑞𝑗))] • Left set of clauses (red): ensure that each node of the graph takes at least one color. • Right set of clauses (blue): constrain that the neighboring nodes cannot take the same color. 𝒙 𝒑𝒋 𝒙 𝒒𝒋 (¬𝑥 𝑝𝑗 ∨ ¬𝑥 𝑞𝑗) 0 0 1 0 1 1 1 0 1 1 1 0
  • 30. Example blue green red 1 T F F 2 F F T 3 F T F 4 F F T 1 3 2 4 ⋀𝑖=1 𝑁 (⋁𝑗=1 𝑘 𝑥𝑖𝑗) ∧ [⋀ 𝑝,𝑞 ∈𝐸(⋀𝑗=1 𝑘 (¬𝑥 𝑝𝑗 ∨ ¬𝑥 𝑞𝑗))] colornode
  • 31. • Dataset 1 • number of nodes: 6-10 • edge percentage: 37% • Generate random graph from 6 different distributions and then pair with random k color in the range of 2 ≤ 𝑘 ≤ 4. • Dataset 2 • Generate random trees with the same node number in dataset 1. • Add random edges to graph until it become UNSAT. • Remove the last added edge to form SAT problem. • Proposed model could solve 48% and 27% in Dataset 1 and Dataset 2, respectively. • Surprisingly, NeuroSAT could not solve any problems, which does not consist to original paper. • NeuroSAT may be sensitive to the change of problem distribution.
  • 32. Discussion • Propose a neural framework for efficiently learning a Circuit-SAT solver. • Rely on DAG-embedding architecture and efficient training procedure. • Solve the SAT problem in a fewer number of iterations compared to the baseline.