SlideShare a Scribd company logo
DeepStochLog:
Neural Stochastic Logic Programming
Thomas Winters*1
, Giuseppe Marra*1
Robin Manhaeve1
, Luc De Raedt1,2
1
KU Leuven, Belgium
2
AASS, Örebro University, Sweden
* shared first author
DeepStochLog =
★ Neural-Symbolic Framework
★ Introduces “Neural Definite Clause Grammars”
★ SOTA results on wide variety of tasks
★ Scales better than others
Neural Definite Clause Grammar
CFG: Context-Free Grammar
E --> N
E --> E, P, N
P --> [“+”]
N --> [“0”]
N --> [“1”]
…
N --> [“9”] 2 + 3 + 8
N
E
E
P N
E
P N
Useful for:
- Is sequence an element of the specified language?
- What is the “part of speech”-tag of a terminal
- Generate all elements of language
PCFG: Probabilistic Context-Free Grammar
0.5 :: E --> N
0.5 :: E --> E, P, N
1.0 :: P --> [“+”]
0.1 :: N --> [“0”]
0.1 :: N --> [“1”]
…
0.1 :: N --> [“9”] 2 + 3 + 8
N
E
E
P N
E
P N
Useful for:
- What is the most likely parse for this sequence of terminals? (useful for ambiguous grammars)
- What is the probability of generating this string?
0.5
0.1
1
1
0.1
0.1
0.5
0.5
Probability of this parse = 0.5*0.5*0.5*0.1*1*0.1*1*0.1 = 0.000125
Always
sums
to
1
per
non-terminal
DCG: Definite Clause Grammar
e(N) --> n(N).
e(N) --> e(N1), p, n(N2),
{N is N1 + N2}.
p --> [“+”].
n(0) --> [“0”].
n(1) --> [“1”].
…
n(9) --> [“9”]. 2 + 3 + 8
n(2)
e(2)
e(5)
p n(3)
e(13)
p n(8)
Useful for:
- Modelling more complex languages (e.g. context-sensitive)
- Adding constraints between non-terminals thanks to Prolog power (e.g. through unification)
- Extra inputs & outputs aside from terminal sequence (through unification of input variables)
SDCG: Stochastic Definite Clause Grammar
0.5 :: e(N) --> n(N).
0.5 :: e(N) --> e(N1), p, n(N2),
{N is N1 + N2}.
1.0 :: p --> [“+”].
0.1 :: n(0) --> [“0”].
0.1 :: n(1) --> [“1”].
…
0.1 :: n(9) --> [“9”]. 2 + 3 + 8
n(2)
e(2)
e(5)
p n(3)
e(13)
p n(8)
Useful for:
- Same benefits as PCFGs give to CFG (e.g. most likely parse)
- But: loss of probability mass possible due to failing derivations
0.5
0.1
1
1
0.1
0.1
0.5
0.5
Probability of this parse = 0.5*0.5*0.5*0.1*1*0.1*1*0.1 = 0.000125
NDCG: Neural Definite Clause Grammar (= DeepStochLog)
Useful for:
- Subsymbolic processing: e.g. tensors as terminals
- Learning rule probabilities using neural networks
0.5 :: e(N) --> n(N).
0.5 :: e(N) --> e(N1), p, n(N2),
{N is N1 + N2}.
1.0 :: p --> [“+”].
nn(number_nn,[X],[Y],[digit]) :: n(Y) --> [X].
digit(Y) :- member(Y,[0,1,2,3,4,5,6,7,8,9]).
2 + 3 + 8
n(2)
e(2)
e(5)
p n(3)
e(13)
p n(8)
0.5
pnumber_nn
( =2)
1
1
0.5
0.5
pnumber_nn
( =3)
pnumber_nn
( =8)
Probability of this parse =
0.5*0.5*0.5*pnumber_nn
( =2)*1*pnumber_nn
( =3)*1*pnumber_nn
( =8)
DeepStochLog NDCG definition
nn(m,[I1
,…,Im
],[O1
,…,OL
],[D1
,…,DL
]) :: nt --> g1
, …, gn
.
Where:
● nt is an atom
● g1
, …, gn
are goals (goal = atom or list of terminals & variables)
● I1
,…,Im
and O1
,…,OL
are variables occurring in g1
, …, gn
and are the
inputs and outputs of m
● D1
,…,DL
are the predicates specifying the domains of O1
,…,OL
● m is a neural network mapping I1
,…,Im
to probability distribution over
O1
,…,OL
(= over cross product of D1
,…,DL
)
DeepStochLog Inference
Derivation of SDCG
Deriving probability of goal for given terminals in NDCG
Proof derivations d(e(1), ) then turn it into and/or tree
And/Or tree + semiring for different inference types
Probability of goal Most likely derivation
MAX
0.96
0.5
0.5
0.5 0.5 0.5 0.5
0.5
0.5
0.04
0.02
0.98
0.96 0.04
0.02
0.98
PG
(derives(e(1), [ , +, ]) = 0.1141 dmax
(e(1), [ , +, ] ) = argmaxd(e(t))=[ , +, ]
PG
(d(e(1))) = [0,+,1]
Inference optimisation
Inference is optimized using
1. SLG resolution: Prolog tables the returned proof tree(s), and thus creates forest
→ Allows for reusing probability calculation results from intermediate nodes
2. Batched network calls: Evaluate all the required neural network queries first
→ Very natural for neural networks to evaluate multiple instances at once using batching
& less overhead in logic & neural network communication
Learning in DeepStochLog
Learning in DeepStochLog
● All AND/OR tree leafs are (neural) probabilities
○ → DeepStochLog “links” these predictions
● Minimize the loss w.r.t. rule probabilities p:
ti
= target probability
D = dataset
L = loss function
Gi
= Goal
θi
= substitution
Ti
= sequence of terminals
DeepStochLog ≈ DeepProbLog for SLP
Sibling of DeepProbLog, but different semantic (PLP vs SLP)
DeepProbLog: neural predicate probability (and thus implicitly over “possible worlds”)
nn(m,[I1
,…,Im
],O,[x1
,…,xL
]) :: neural_predicate(X).
DeepStochLog: neural grammar rule probability (and thus no disjoint sum problem)
nn(m,[I1
,…,Im
],[O1
,…,OL
],[D1
,…,DL
]) :: nt --> g1
, …, gn
.
PLP vs SLP ~ akin to difference between random graph and random walk
Experiments
Research questions
Q1: Does DeepStochLog reach state-of-the-art predictive performance on
neural-symbolic tasks?
Q2: How does the inference time of DeepStochLog compare to other neural-symbolic
frameworks and what is the role of tabling?
Q3: Can DeepStochLog handle larger-scale tasks?
Q4: Can DeepStochLog go beyond grammars and encode more general programs?
Mathematical expression outcome
T1: Summing MNIST numbers
with pre-specified # digits
T2: Expressions with images
representing operator or single
digit number.
+ = 137
= 19
Performance comparison
Classic grammars, but with MNIST images as terminals
T3: Well-formed brackets as input
(without parse). Task: predict parse.
T4: inputs are strings ak
bl
cm
(or
permutations of [a,b,c], and (k+l+m)%3=0).
Predict 1 if k=l=m, otherwise 0.
→ parse = ( ) ( ( ) ( ) )
= 1
= 0
Natural way of expressing this grammar knowledge
brackets_dom(X) :- member(X, ["(",")"]).
nn(bracket_nn, [X], Y, brackets_dom) :: bracket(Y) --> [X].
t(_) :: s --> s, s.
t(_) :: s --> bracket("("), s, bracket(")").
t(_) :: s --> bracket("("), bracket(")").
All power of Prolog DCGs (here: an
bn
cn
)
letter(X) :- member(X, [a,b,c]).
0.5 :: s(0) --> akblcm(K,L,M),
{K = L; L = M; M = K},
{K = 0, L = 0, M = 0}.
0.5 :: s(1) --> akblcm(N,N,N).
akblcm(K,L,M) --> rep(K,A),
rep(L,B),
rep(M,C),
{A = B, B = C, C = A}.
rep(0, _) --> [].
nn(mnist, [X], C, letter) :: rep(s(N), C) --> [X],
rep(N,C).
Citation networks
T5: Given scientific paper set with only few labels & citation network, find all labels
Word Algebra Problem
T6: natural language text describing algebra problem, predict outcome
E.g."Mark has 6 apples. He eats 2 and divides the remaining among his 2 friends. How many apples did each friend get?"
Uses “empty body trick” to emulate SLP logic rules through SDCGs:
nn(m,[I1
,…,Im
],[O1
,…,OL
],[D1
,…,DL
]) :: nt --> [].
Enables fairly straightforward translation of DeepProbLog programs for a lot of tasks
DeepStochLog performs equally well as DeepProbLog: 96% accuracy
Translating DPL to DSL
DeepProbLog DeepStochLog
Ongoing/future research
Ongoing/future DeepStochLog research
● Structure learning using t(_) (syntactic sugar for PRISM-like switches)
● Support for calculation of true probability (without probability mass loss) by dividing by
probabilities of all possible other possible outputs of given goal
● Larger-scale experiment(s) (e.g. on CLEVR)
● Comparing with more neural symbolic frameworks
● Generative setting (with generative neural networks and using grammar to aid generation)
Thanks!
Paper: DeepStochLog: Neural Stochastic Logic Programming
Code: https://github.com/ml-kuleuven/deepstochlog
Python: pip install deepstochlog
Authors: Thomas Winters*, Giuseppe Marra*, Robin Manhaeve, Luc De Raedt
Twitter: @thomas_wint, @giuseppe__marra, @ManhaeveRobin, @lucderaedt
* shared first author

More Related Content

What's hot

Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...
Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...
Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...
Stefan Marr
 
Flink Forward Berlin 2017: David Rodriguez - The Approximate Filter, Join, an...
Flink Forward Berlin 2017: David Rodriguez - The Approximate Filter, Join, an...Flink Forward Berlin 2017: David Rodriguez - The Approximate Filter, Join, an...
Flink Forward Berlin 2017: David Rodriguez - The Approximate Filter, Join, an...
Flink Forward
 
Introduction to TensorFlow 2 and Keras
Introduction to TensorFlow 2 and KerasIntroduction to TensorFlow 2 and Keras
Introduction to TensorFlow 2 and Keras
Oswald Campesato
 
Rajat Monga at AI Frontiers: Deep Learning with TensorFlow
Rajat Monga at AI Frontiers: Deep Learning with TensorFlowRajat Monga at AI Frontiers: Deep Learning with TensorFlow
Rajat Monga at AI Frontiers: Deep Learning with TensorFlow
AI Frontiers
 
Python tour
Python tourPython tour
Python tour
Tamer Abdul-Radi
 
[Pycon 2015] 오늘 당장 딥러닝 실험하기 제출용
[Pycon 2015] 오늘 당장 딥러닝 실험하기 제출용[Pycon 2015] 오늘 당장 딥러닝 실험하기 제출용
[Pycon 2015] 오늘 당장 딥러닝 실험하기 제출용
현호 김
 
Introduction to Homomorphic Encryption
Introduction to Homomorphic EncryptionIntroduction to Homomorphic Encryption
Introduction to Homomorphic Encryption
Christoph Matthies
 
Clojure class
Clojure classClojure class
Clojure class
Aysylu Greenberg
 
한국어와 NLTK, Gensim의 만남
한국어와 NLTK, Gensim의 만남한국어와 NLTK, Gensim의 만남
한국어와 NLTK, Gensim의 만남
Eunjeong (Lucy) Park
 
Profiling and optimization
Profiling and optimizationProfiling and optimization
Profiling and optimization
g3_nittala
 
Frsa
FrsaFrsa
Frsa
_111
 
同態加密
同態加密同態加密
同態加密
峻豪 呂
 
Assignment 2 interview preparation work COSC1285
Assignment 2 interview preparation work COSC1285Assignment 2 interview preparation work COSC1285
Assignment 2 interview preparation work COSC1285
MadelineLong2
 
HPX: C++11 runtime система для параллельных и распределённых вычислений
HPX: C++11 runtime система для параллельных и распределённых вычисленийHPX: C++11 runtime система для параллельных и распределённых вычислений
HPX: C++11 runtime система для параллельных и распределённых вычислений
Platonov Sergey
 
Spock Framework - Slidecast
Spock Framework - SlidecastSpock Framework - Slidecast
Spock Framework - Slidecast
Daniel Kolman
 
Python Training Tutorial for Frreshers
Python Training Tutorial for FrreshersPython Training Tutorial for Frreshers
Python Training Tutorial for Frreshers
rajkamaltibacademy
 
TensorFlow.Data 및 TensorFlow Hub
TensorFlow.Data 및 TensorFlow HubTensorFlow.Data 및 TensorFlow Hub
TensorFlow.Data 및 TensorFlow Hub
Jeongkyu Shin
 
Python classes in mumbai
Python classes in mumbaiPython classes in mumbai
Python classes in mumbai
Vibrant Technologies & Computers
 
Computing on Encrypted Data
Computing on Encrypted DataComputing on Encrypted Data
Computing on Encrypted Data
New York Technology Council
 
Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
Big_Data_Ukraine
 

What's hot (20)

Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...
Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...
Zero-Overhead Metaprogramming: Reflection and Metaobject Protocols Fast and w...
 
Flink Forward Berlin 2017: David Rodriguez - The Approximate Filter, Join, an...
Flink Forward Berlin 2017: David Rodriguez - The Approximate Filter, Join, an...Flink Forward Berlin 2017: David Rodriguez - The Approximate Filter, Join, an...
Flink Forward Berlin 2017: David Rodriguez - The Approximate Filter, Join, an...
 
Introduction to TensorFlow 2 and Keras
Introduction to TensorFlow 2 and KerasIntroduction to TensorFlow 2 and Keras
Introduction to TensorFlow 2 and Keras
 
Rajat Monga at AI Frontiers: Deep Learning with TensorFlow
Rajat Monga at AI Frontiers: Deep Learning with TensorFlowRajat Monga at AI Frontiers: Deep Learning with TensorFlow
Rajat Monga at AI Frontiers: Deep Learning with TensorFlow
 
Python tour
Python tourPython tour
Python tour
 
[Pycon 2015] 오늘 당장 딥러닝 실험하기 제출용
[Pycon 2015] 오늘 당장 딥러닝 실험하기 제출용[Pycon 2015] 오늘 당장 딥러닝 실험하기 제출용
[Pycon 2015] 오늘 당장 딥러닝 실험하기 제출용
 
Introduction to Homomorphic Encryption
Introduction to Homomorphic EncryptionIntroduction to Homomorphic Encryption
Introduction to Homomorphic Encryption
 
Clojure class
Clojure classClojure class
Clojure class
 
한국어와 NLTK, Gensim의 만남
한국어와 NLTK, Gensim의 만남한국어와 NLTK, Gensim의 만남
한국어와 NLTK, Gensim의 만남
 
Profiling and optimization
Profiling and optimizationProfiling and optimization
Profiling and optimization
 
Frsa
FrsaFrsa
Frsa
 
同態加密
同態加密同態加密
同態加密
 
Assignment 2 interview preparation work COSC1285
Assignment 2 interview preparation work COSC1285Assignment 2 interview preparation work COSC1285
Assignment 2 interview preparation work COSC1285
 
HPX: C++11 runtime система для параллельных и распределённых вычислений
HPX: C++11 runtime система для параллельных и распределённых вычисленийHPX: C++11 runtime система для параллельных и распределённых вычислений
HPX: C++11 runtime система для параллельных и распределённых вычислений
 
Spock Framework - Slidecast
Spock Framework - SlidecastSpock Framework - Slidecast
Spock Framework - Slidecast
 
Python Training Tutorial for Frreshers
Python Training Tutorial for FrreshersPython Training Tutorial for Frreshers
Python Training Tutorial for Frreshers
 
TensorFlow.Data 및 TensorFlow Hub
TensorFlow.Data 및 TensorFlow HubTensorFlow.Data 및 TensorFlow Hub
TensorFlow.Data 및 TensorFlow Hub
 
Python classes in mumbai
Python classes in mumbaiPython classes in mumbai
Python classes in mumbai
 
Computing on Encrypted Data
Computing on Encrypted DataComputing on Encrypted Data
Computing on Encrypted Data
 
Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
 

Similar to DeepStochLog: Neural Stochastic Logic Programming

Function Approx2009
Function Approx2009Function Approx2009
Function Approx2009
Imthias Ahamed
 
[PR12] PR-036 Learning to Remember Rare Events
[PR12] PR-036 Learning to Remember Rare Events[PR12] PR-036 Learning to Remember Rare Events
[PR12] PR-036 Learning to Remember Rare Events
Taegyun Jeon
 
Language translation with Deep Learning (RNN) with TensorFlow
Language translation with Deep Learning (RNN) with TensorFlowLanguage translation with Deep Learning (RNN) with TensorFlow
Language translation with Deep Learning (RNN) with TensorFlow
S N
 
The Mathematics of RSA Encryption
The Mathematics of RSA EncryptionThe Mathematics of RSA Encryption
The Mathematics of RSA Encryption
Nathan F. Dunn
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
Sathish Kumar
 
Compilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVMCompilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVM
Linaro
 
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
David Walker
 
Talk on Resource Allocation Strategies for Layered Multimedia Multicast Services
Talk on Resource Allocation Strategies for Layered Multimedia Multicast ServicesTalk on Resource Allocation Strategies for Layered Multimedia Multicast Services
Talk on Resource Allocation Strategies for Layered Multimedia Multicast Services
Andrea Tassi
 
Symbolic Regression on Network Properties
Symbolic Regression on Network PropertiesSymbolic Regression on Network Properties
Symbolic Regression on Network Properties
Marcus Märtens
 
Gpu workshop cluster universe: scripting cuda
Gpu workshop cluster universe: scripting cudaGpu workshop cluster universe: scripting cuda
Gpu workshop cluster universe: scripting cuda
Ferdinand Jamitzky
 
Complex models in ecology: challenges and solutions
Complex models in ecology: challenges and solutionsComplex models in ecology: challenges and solutions
Complex models in ecology: challenges and solutions
Peter Solymos
 
Deep Learning in Your Browser
Deep Learning in Your BrowserDeep Learning in Your Browser
Deep Learning in Your Browser
Oswald Campesato
 
Introduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlowIntroduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlow
Sri Ambati
 
Introduction to Deep Learning, Keras, and Tensorflow
Introduction to Deep Learning, Keras, and TensorflowIntroduction to Deep Learning, Keras, and Tensorflow
Introduction to Deep Learning, Keras, and Tensorflow
Oswald Campesato
 
Dsp manual print
Dsp manual printDsp manual print
Dsp manual print
Veerayya Javvaji
 
H2 o berkeleydltf
H2 o berkeleydltfH2 o berkeleydltf
H2 o berkeleydltf
Oswald Campesato
 
Introduction to Deep Learning and TensorFlow
Introduction to Deep Learning and TensorFlowIntroduction to Deep Learning and TensorFlow
Introduction to Deep Learning and TensorFlow
Oswald Campesato
 
TensorFlow in Your Browser
TensorFlow in Your BrowserTensorFlow in Your Browser
TensorFlow in Your Browser
Oswald Campesato
 
Intro to Deep Learning, TensorFlow, and tensorflow.js
Intro to Deep Learning, TensorFlow, and tensorflow.jsIntro to Deep Learning, TensorFlow, and tensorflow.js
Intro to Deep Learning, TensorFlow, and tensorflow.js
Oswald Campesato
 
Lecture12
Lecture12Lecture12
Lecture12
tt_aljobory
 

Similar to DeepStochLog: Neural Stochastic Logic Programming (20)

Function Approx2009
Function Approx2009Function Approx2009
Function Approx2009
 
[PR12] PR-036 Learning to Remember Rare Events
[PR12] PR-036 Learning to Remember Rare Events[PR12] PR-036 Learning to Remember Rare Events
[PR12] PR-036 Learning to Remember Rare Events
 
Language translation with Deep Learning (RNN) with TensorFlow
Language translation with Deep Learning (RNN) with TensorFlowLanguage translation with Deep Learning (RNN) with TensorFlow
Language translation with Deep Learning (RNN) with TensorFlow
 
The Mathematics of RSA Encryption
The Mathematics of RSA EncryptionThe Mathematics of RSA Encryption
The Mathematics of RSA Encryption
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
Compilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVMCompilation of COSMO for GPU using LLVM
Compilation of COSMO for GPU using LLVM
 
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
 
Talk on Resource Allocation Strategies for Layered Multimedia Multicast Services
Talk on Resource Allocation Strategies for Layered Multimedia Multicast ServicesTalk on Resource Allocation Strategies for Layered Multimedia Multicast Services
Talk on Resource Allocation Strategies for Layered Multimedia Multicast Services
 
Symbolic Regression on Network Properties
Symbolic Regression on Network PropertiesSymbolic Regression on Network Properties
Symbolic Regression on Network Properties
 
Gpu workshop cluster universe: scripting cuda
Gpu workshop cluster universe: scripting cudaGpu workshop cluster universe: scripting cuda
Gpu workshop cluster universe: scripting cuda
 
Complex models in ecology: challenges and solutions
Complex models in ecology: challenges and solutionsComplex models in ecology: challenges and solutions
Complex models in ecology: challenges and solutions
 
Deep Learning in Your Browser
Deep Learning in Your BrowserDeep Learning in Your Browser
Deep Learning in Your Browser
 
Introduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlowIntroduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlow
 
Introduction to Deep Learning, Keras, and Tensorflow
Introduction to Deep Learning, Keras, and TensorflowIntroduction to Deep Learning, Keras, and Tensorflow
Introduction to Deep Learning, Keras, and Tensorflow
 
Dsp manual print
Dsp manual printDsp manual print
Dsp manual print
 
H2 o berkeleydltf
H2 o berkeleydltfH2 o berkeleydltf
H2 o berkeleydltf
 
Introduction to Deep Learning and TensorFlow
Introduction to Deep Learning and TensorFlowIntroduction to Deep Learning and TensorFlow
Introduction to Deep Learning and TensorFlow
 
TensorFlow in Your Browser
TensorFlow in Your BrowserTensorFlow in Your Browser
TensorFlow in Your Browser
 
Intro to Deep Learning, TensorFlow, and tensorflow.js
Intro to Deep Learning, TensorFlow, and tensorflow.jsIntro to Deep Learning, TensorFlow, and tensorflow.js
Intro to Deep Learning, TensorFlow, and tensorflow.js
 
Lecture12
Lecture12Lecture12
Lecture12
 

More from Thomas Winters

Neuro-Symbolic Creative Artificial Intelligence for Humor (PhD Defense)
Neuro-Symbolic Creative Artificial Intelligence for Humor (PhD Defense)Neuro-Symbolic Creative Artificial Intelligence for Humor (PhD Defense)
Neuro-Symbolic Creative Artificial Intelligence for Humor (PhD Defense)
Thomas Winters
 
Prompt engineering: De kunst van het leren communiceren met AI
Prompt engineering: De kunst van het leren communiceren met AIPrompt engineering: De kunst van het leren communiceren met AI
Prompt engineering: De kunst van het leren communiceren met AI
Thomas Winters
 
Wetenschapscommunicatie on steroids
Wetenschapscommunicatie on steroidsWetenschapscommunicatie on steroids
Wetenschapscommunicatie on steroids
Thomas Winters
 
TorfsBot or Not? Evaluating User Perception on Imitative Text Generation (CLI...
TorfsBot or Not? Evaluating User Perception on Imitative Text Generation (CLI...TorfsBot or Not? Evaluating User Perception on Imitative Text Generation (CLI...
TorfsBot or Not? Evaluating User Perception on Imitative Text Generation (CLI...
Thomas Winters
 
Prompt engineering: de kunst van het leren communiceren met AI (Juni 2023)
Prompt engineering: de kunst van het leren communiceren met AI (Juni 2023)Prompt engineering: de kunst van het leren communiceren met AI (Juni 2023)
Prompt engineering: de kunst van het leren communiceren met AI (Juni 2023)
Thomas Winters
 
Hoe werken tekstgenerators? (Special Guest in Lieven Scheire's AI voorstelling)
Hoe werken tekstgenerators? (Special Guest in Lieven Scheire's AI voorstelling)Hoe werken tekstgenerators? (Special Guest in Lieven Scheire's AI voorstelling)
Hoe werken tekstgenerators? (Special Guest in Lieven Scheire's AI voorstelling)
Thomas Winters
 
Pret met Creatieve Computers
Pret met Creatieve ComputersPret met Creatieve Computers
Pret met Creatieve Computers
Thomas Winters
 
Hoe leer je computers humor?
Hoe leer je computers humor?Hoe leer je computers humor?
Hoe leer je computers humor?
Thomas Winters
 
How do you teach computers humor + Text Generators as Creative Partners (May ...
How do you teach computers humor + Text Generators as Creative Partners (May ...How do you teach computers humor + Text Generators as Creative Partners (May ...
How do you teach computers humor + Text Generators as Creative Partners (May ...
Thomas Winters
 
Hoe schrijven computers zelf tekst? (Kinderlezing)
Hoe schrijven computers zelf tekst? (Kinderlezing)Hoe schrijven computers zelf tekst? (Kinderlezing)
Hoe schrijven computers zelf tekst? (Kinderlezing)
Thomas Winters
 
AI als creatieve partner
AI als creatieve partnerAI als creatieve partner
AI als creatieve partner
Thomas Winters
 
De magie achter afbeeldingsgenerators
De magie achter afbeeldingsgeneratorsDe magie achter afbeeldingsgenerators
De magie achter afbeeldingsgenerators
Thomas Winters
 
Computational Humor: Can a machine have a sense of humor (December 2022)
Computational Humor: Can a machine have a sense of humor (December 2022)Computational Humor: Can a machine have a sense of humor (December 2022)
Computational Humor: Can a machine have a sense of humor (December 2022)
Thomas Winters
 
How to Attract & Survive Media Attention as PhD
How to Attract & Survive Media Attention as PhDHow to Attract & Survive Media Attention as PhD
How to Attract & Survive Media Attention as PhD
Thomas Winters
 
How can AI be a creative partner for PR & marketing?
How can AI be a creative partner for PR & marketing?How can AI be a creative partner for PR & marketing?
How can AI be a creative partner for PR & marketing?
Thomas Winters
 
Beter leren praten met Artificiële Intelligentie
Beter leren praten met Artificiële IntelligentieBeter leren praten met Artificiële Intelligentie
Beter leren praten met Artificiële Intelligentie
Thomas Winters
 
Computational Humor: Can a machine have a sense of humor (2022)
Computational Humor: Can a machine have a sense of humor (2022)Computational Humor: Can a machine have a sense of humor (2022)
Computational Humor: Can a machine have a sense of humor (2022)
Thomas Winters
 
TorfsBotOrNot @ Nerdland Festival
TorfsBotOrNot @ Nerdland FestivalTorfsBotOrNot @ Nerdland Festival
TorfsBotOrNot @ Nerdland Festival
Thomas Winters
 
Creative AI for Improv Theatre
Creative AI for Improv TheatreCreative AI for Improv Theatre
Creative AI for Improv Theatre
Thomas Winters
 
Computational Humor: Can a machine have a sense of humor? (2020)
Computational Humor: Can a machine have a sense of humor? (2020)Computational Humor: Can a machine have a sense of humor? (2020)
Computational Humor: Can a machine have a sense of humor? (2020)
Thomas Winters
 

More from Thomas Winters (20)

Neuro-Symbolic Creative Artificial Intelligence for Humor (PhD Defense)
Neuro-Symbolic Creative Artificial Intelligence for Humor (PhD Defense)Neuro-Symbolic Creative Artificial Intelligence for Humor (PhD Defense)
Neuro-Symbolic Creative Artificial Intelligence for Humor (PhD Defense)
 
Prompt engineering: De kunst van het leren communiceren met AI
Prompt engineering: De kunst van het leren communiceren met AIPrompt engineering: De kunst van het leren communiceren met AI
Prompt engineering: De kunst van het leren communiceren met AI
 
Wetenschapscommunicatie on steroids
Wetenschapscommunicatie on steroidsWetenschapscommunicatie on steroids
Wetenschapscommunicatie on steroids
 
TorfsBot or Not? Evaluating User Perception on Imitative Text Generation (CLI...
TorfsBot or Not? Evaluating User Perception on Imitative Text Generation (CLI...TorfsBot or Not? Evaluating User Perception on Imitative Text Generation (CLI...
TorfsBot or Not? Evaluating User Perception on Imitative Text Generation (CLI...
 
Prompt engineering: de kunst van het leren communiceren met AI (Juni 2023)
Prompt engineering: de kunst van het leren communiceren met AI (Juni 2023)Prompt engineering: de kunst van het leren communiceren met AI (Juni 2023)
Prompt engineering: de kunst van het leren communiceren met AI (Juni 2023)
 
Hoe werken tekstgenerators? (Special Guest in Lieven Scheire's AI voorstelling)
Hoe werken tekstgenerators? (Special Guest in Lieven Scheire's AI voorstelling)Hoe werken tekstgenerators? (Special Guest in Lieven Scheire's AI voorstelling)
Hoe werken tekstgenerators? (Special Guest in Lieven Scheire's AI voorstelling)
 
Pret met Creatieve Computers
Pret met Creatieve ComputersPret met Creatieve Computers
Pret met Creatieve Computers
 
Hoe leer je computers humor?
Hoe leer je computers humor?Hoe leer je computers humor?
Hoe leer je computers humor?
 
How do you teach computers humor + Text Generators as Creative Partners (May ...
How do you teach computers humor + Text Generators as Creative Partners (May ...How do you teach computers humor + Text Generators as Creative Partners (May ...
How do you teach computers humor + Text Generators as Creative Partners (May ...
 
Hoe schrijven computers zelf tekst? (Kinderlezing)
Hoe schrijven computers zelf tekst? (Kinderlezing)Hoe schrijven computers zelf tekst? (Kinderlezing)
Hoe schrijven computers zelf tekst? (Kinderlezing)
 
AI als creatieve partner
AI als creatieve partnerAI als creatieve partner
AI als creatieve partner
 
De magie achter afbeeldingsgenerators
De magie achter afbeeldingsgeneratorsDe magie achter afbeeldingsgenerators
De magie achter afbeeldingsgenerators
 
Computational Humor: Can a machine have a sense of humor (December 2022)
Computational Humor: Can a machine have a sense of humor (December 2022)Computational Humor: Can a machine have a sense of humor (December 2022)
Computational Humor: Can a machine have a sense of humor (December 2022)
 
How to Attract & Survive Media Attention as PhD
How to Attract & Survive Media Attention as PhDHow to Attract & Survive Media Attention as PhD
How to Attract & Survive Media Attention as PhD
 
How can AI be a creative partner for PR & marketing?
How can AI be a creative partner for PR & marketing?How can AI be a creative partner for PR & marketing?
How can AI be a creative partner for PR & marketing?
 
Beter leren praten met Artificiële Intelligentie
Beter leren praten met Artificiële IntelligentieBeter leren praten met Artificiële Intelligentie
Beter leren praten met Artificiële Intelligentie
 
Computational Humor: Can a machine have a sense of humor (2022)
Computational Humor: Can a machine have a sense of humor (2022)Computational Humor: Can a machine have a sense of humor (2022)
Computational Humor: Can a machine have a sense of humor (2022)
 
TorfsBotOrNot @ Nerdland Festival
TorfsBotOrNot @ Nerdland FestivalTorfsBotOrNot @ Nerdland Festival
TorfsBotOrNot @ Nerdland Festival
 
Creative AI for Improv Theatre
Creative AI for Improv TheatreCreative AI for Improv Theatre
Creative AI for Improv Theatre
 
Computational Humor: Can a machine have a sense of humor? (2020)
Computational Humor: Can a machine have a sense of humor? (2020)Computational Humor: Can a machine have a sense of humor? (2020)
Computational Humor: Can a machine have a sense of humor? (2020)
 

Recently uploaded

The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
TheFutureIsDynamic-BoxLang-CFCamp2024.pdf
TheFutureIsDynamic-BoxLang-CFCamp2024.pdfTheFutureIsDynamic-BoxLang-CFCamp2024.pdf
TheFutureIsDynamic-BoxLang-CFCamp2024.pdf
Ortus Solutions, Corp
 
Streamlining End-to-End Testing Automation
Streamlining End-to-End Testing AutomationStreamlining End-to-End Testing Automation
Streamlining End-to-End Testing Automation
Anand Bagmar
 
Hands-on with Apache Druid: Installation & Data Ingestion Steps
Hands-on with Apache Druid: Installation & Data Ingestion StepsHands-on with Apache Druid: Installation & Data Ingestion Steps
Hands-on with Apache Druid: Installation & Data Ingestion Steps
servicesNitor
 
Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...
Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...
Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...
Ortus Solutions, Corp
 
Beginner's Guide to Observability@Devoxx PL 2024
Beginner's  Guide to Observability@Devoxx PL 2024Beginner's  Guide to Observability@Devoxx PL 2024
Beginner's Guide to Observability@Devoxx PL 2024
michniczscribd
 
What is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdfWhat is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdf
kalichargn70th171
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
Penify - Let AI do the Documentation, you write the Code.
Penify - Let AI do the Documentation, you write the Code.Penify - Let AI do the Documentation, you write the Code.
Penify - Let AI do the Documentation, you write the Code.
KrishnaveniMohan1
 
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
widenerjobeyrl638
 
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
campbellclarkson
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
Maitrey Patel
 
Optimizing Your E-commerce with WooCommerce.pptx
Optimizing Your E-commerce with WooCommerce.pptxOptimizing Your E-commerce with WooCommerce.pptx
Optimizing Your E-commerce with WooCommerce.pptx
WebConnect Pvt Ltd
 
Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)
alowpalsadig
 
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies
 
Refactoring legacy systems using events commands and bubble contexts
Refactoring legacy systems using events commands and bubble contextsRefactoring legacy systems using events commands and bubble contexts
Refactoring legacy systems using events commands and bubble contexts
Michał Kurzeja
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
Paul Brebner
 
Hyperledger Besu 빨리 따라하기 (Private Networks)
Hyperledger Besu 빨리 따라하기 (Private Networks)Hyperledger Besu 빨리 따라하기 (Private Networks)
Hyperledger Besu 빨리 따라하기 (Private Networks)
wonyong hwang
 
Computer Science & Engineering VI Sem- New Syllabus.pdf
Computer Science & Engineering VI Sem- New Syllabus.pdfComputer Science & Engineering VI Sem- New Syllabus.pdf
Computer Science & Engineering VI Sem- New Syllabus.pdf
chandangoswami40933
 

Recently uploaded (20)

The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
TheFutureIsDynamic-BoxLang-CFCamp2024.pdf
TheFutureIsDynamic-BoxLang-CFCamp2024.pdfTheFutureIsDynamic-BoxLang-CFCamp2024.pdf
TheFutureIsDynamic-BoxLang-CFCamp2024.pdf
 
Streamlining End-to-End Testing Automation
Streamlining End-to-End Testing AutomationStreamlining End-to-End Testing Automation
Streamlining End-to-End Testing Automation
 
Hands-on with Apache Druid: Installation & Data Ingestion Steps
Hands-on with Apache Druid: Installation & Data Ingestion StepsHands-on with Apache Druid: Installation & Data Ingestion Steps
Hands-on with Apache Druid: Installation & Data Ingestion Steps
 
Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...
Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...
Strengthening Web Development with CommandBox 6: Seamless Transition and Scal...
 
Beginner's Guide to Observability@Devoxx PL 2024
Beginner's  Guide to Observability@Devoxx PL 2024Beginner's  Guide to Observability@Devoxx PL 2024
Beginner's Guide to Observability@Devoxx PL 2024
 
What is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdfWhat is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdf
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
Penify - Let AI do the Documentation, you write the Code.
Penify - Let AI do the Documentation, you write the Code.Penify - Let AI do the Documentation, you write the Code.
Penify - Let AI do the Documentation, you write the Code.
 
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
美洲杯赔率投注网【​网址​🎉3977·EE​🎉】
 
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
 
Optimizing Your E-commerce with WooCommerce.pptx
Optimizing Your E-commerce with WooCommerce.pptxOptimizing Your E-commerce with WooCommerce.pptx
Optimizing Your E-commerce with WooCommerce.pptx
 
Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)Photoshop Tutorial for Beginners (2024 Edition)
Photoshop Tutorial for Beginners (2024 Edition)
 
Upturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in NashikUpturn India Technologies - Web development company in Nashik
Upturn India Technologies - Web development company in Nashik
 
Refactoring legacy systems using events commands and bubble contexts
Refactoring legacy systems using events commands and bubble contextsRefactoring legacy systems using events commands and bubble contexts
Refactoring legacy systems using events commands and bubble contexts
 
Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...Superpower Your Apache Kafka Applications Development with Complementary Open...
Superpower Your Apache Kafka Applications Development with Complementary Open...
 
Hyperledger Besu 빨리 따라하기 (Private Networks)
Hyperledger Besu 빨리 따라하기 (Private Networks)Hyperledger Besu 빨리 따라하기 (Private Networks)
Hyperledger Besu 빨리 따라하기 (Private Networks)
 
Computer Science & Engineering VI Sem- New Syllabus.pdf
Computer Science & Engineering VI Sem- New Syllabus.pdfComputer Science & Engineering VI Sem- New Syllabus.pdf
Computer Science & Engineering VI Sem- New Syllabus.pdf
 

DeepStochLog: Neural Stochastic Logic Programming

  • 1. DeepStochLog: Neural Stochastic Logic Programming Thomas Winters*1 , Giuseppe Marra*1 Robin Manhaeve1 , Luc De Raedt1,2 1 KU Leuven, Belgium 2 AASS, Örebro University, Sweden * shared first author
  • 2. DeepStochLog = ★ Neural-Symbolic Framework ★ Introduces “Neural Definite Clause Grammars” ★ SOTA results on wide variety of tasks ★ Scales better than others
  • 4. CFG: Context-Free Grammar E --> N E --> E, P, N P --> [“+”] N --> [“0”] N --> [“1”] … N --> [“9”] 2 + 3 + 8 N E E P N E P N Useful for: - Is sequence an element of the specified language? - What is the “part of speech”-tag of a terminal - Generate all elements of language
  • 5. PCFG: Probabilistic Context-Free Grammar 0.5 :: E --> N 0.5 :: E --> E, P, N 1.0 :: P --> [“+”] 0.1 :: N --> [“0”] 0.1 :: N --> [“1”] … 0.1 :: N --> [“9”] 2 + 3 + 8 N E E P N E P N Useful for: - What is the most likely parse for this sequence of terminals? (useful for ambiguous grammars) - What is the probability of generating this string? 0.5 0.1 1 1 0.1 0.1 0.5 0.5 Probability of this parse = 0.5*0.5*0.5*0.1*1*0.1*1*0.1 = 0.000125 Always sums to 1 per non-terminal
  • 6. DCG: Definite Clause Grammar e(N) --> n(N). e(N) --> e(N1), p, n(N2), {N is N1 + N2}. p --> [“+”]. n(0) --> [“0”]. n(1) --> [“1”]. … n(9) --> [“9”]. 2 + 3 + 8 n(2) e(2) e(5) p n(3) e(13) p n(8) Useful for: - Modelling more complex languages (e.g. context-sensitive) - Adding constraints between non-terminals thanks to Prolog power (e.g. through unification) - Extra inputs & outputs aside from terminal sequence (through unification of input variables)
  • 7. SDCG: Stochastic Definite Clause Grammar 0.5 :: e(N) --> n(N). 0.5 :: e(N) --> e(N1), p, n(N2), {N is N1 + N2}. 1.0 :: p --> [“+”]. 0.1 :: n(0) --> [“0”]. 0.1 :: n(1) --> [“1”]. … 0.1 :: n(9) --> [“9”]. 2 + 3 + 8 n(2) e(2) e(5) p n(3) e(13) p n(8) Useful for: - Same benefits as PCFGs give to CFG (e.g. most likely parse) - But: loss of probability mass possible due to failing derivations 0.5 0.1 1 1 0.1 0.1 0.5 0.5 Probability of this parse = 0.5*0.5*0.5*0.1*1*0.1*1*0.1 = 0.000125
  • 8. NDCG: Neural Definite Clause Grammar (= DeepStochLog) Useful for: - Subsymbolic processing: e.g. tensors as terminals - Learning rule probabilities using neural networks 0.5 :: e(N) --> n(N). 0.5 :: e(N) --> e(N1), p, n(N2), {N is N1 + N2}. 1.0 :: p --> [“+”]. nn(number_nn,[X],[Y],[digit]) :: n(Y) --> [X]. digit(Y) :- member(Y,[0,1,2,3,4,5,6,7,8,9]). 2 + 3 + 8 n(2) e(2) e(5) p n(3) e(13) p n(8) 0.5 pnumber_nn ( =2) 1 1 0.5 0.5 pnumber_nn ( =3) pnumber_nn ( =8) Probability of this parse = 0.5*0.5*0.5*pnumber_nn ( =2)*1*pnumber_nn ( =3)*1*pnumber_nn ( =8)
  • 9. DeepStochLog NDCG definition nn(m,[I1 ,…,Im ],[O1 ,…,OL ],[D1 ,…,DL ]) :: nt --> g1 , …, gn . Where: ● nt is an atom ● g1 , …, gn are goals (goal = atom or list of terminals & variables) ● I1 ,…,Im and O1 ,…,OL are variables occurring in g1 , …, gn and are the inputs and outputs of m ● D1 ,…,DL are the predicates specifying the domains of O1 ,…,OL ● m is a neural network mapping I1 ,…,Im to probability distribution over O1 ,…,OL (= over cross product of D1 ,…,DL )
  • 12. Deriving probability of goal for given terminals in NDCG Proof derivations d(e(1), ) then turn it into and/or tree
  • 13. And/Or tree + semiring for different inference types Probability of goal Most likely derivation MAX 0.96 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.04 0.02 0.98 0.96 0.04 0.02 0.98 PG (derives(e(1), [ , +, ]) = 0.1141 dmax (e(1), [ , +, ] ) = argmaxd(e(t))=[ , +, ] PG (d(e(1))) = [0,+,1]
  • 14. Inference optimisation Inference is optimized using 1. SLG resolution: Prolog tables the returned proof tree(s), and thus creates forest → Allows for reusing probability calculation results from intermediate nodes 2. Batched network calls: Evaluate all the required neural network queries first → Very natural for neural networks to evaluate multiple instances at once using batching & less overhead in logic & neural network communication
  • 16. Learning in DeepStochLog ● All AND/OR tree leafs are (neural) probabilities ○ → DeepStochLog “links” these predictions ● Minimize the loss w.r.t. rule probabilities p: ti = target probability D = dataset L = loss function Gi = Goal θi = substitution Ti = sequence of terminals
  • 18. Sibling of DeepProbLog, but different semantic (PLP vs SLP) DeepProbLog: neural predicate probability (and thus implicitly over “possible worlds”) nn(m,[I1 ,…,Im ],O,[x1 ,…,xL ]) :: neural_predicate(X). DeepStochLog: neural grammar rule probability (and thus no disjoint sum problem) nn(m,[I1 ,…,Im ],[O1 ,…,OL ],[D1 ,…,DL ]) :: nt --> g1 , …, gn . PLP vs SLP ~ akin to difference between random graph and random walk
  • 20. Research questions Q1: Does DeepStochLog reach state-of-the-art predictive performance on neural-symbolic tasks? Q2: How does the inference time of DeepStochLog compare to other neural-symbolic frameworks and what is the role of tabling? Q3: Can DeepStochLog handle larger-scale tasks? Q4: Can DeepStochLog go beyond grammars and encode more general programs?
  • 21. Mathematical expression outcome T1: Summing MNIST numbers with pre-specified # digits T2: Expressions with images representing operator or single digit number. + = 137 = 19
  • 23. Classic grammars, but with MNIST images as terminals T3: Well-formed brackets as input (without parse). Task: predict parse. T4: inputs are strings ak bl cm (or permutations of [a,b,c], and (k+l+m)%3=0). Predict 1 if k=l=m, otherwise 0. → parse = ( ) ( ( ) ( ) ) = 1 = 0
  • 24. Natural way of expressing this grammar knowledge brackets_dom(X) :- member(X, ["(",")"]). nn(bracket_nn, [X], Y, brackets_dom) :: bracket(Y) --> [X]. t(_) :: s --> s, s. t(_) :: s --> bracket("("), s, bracket(")"). t(_) :: s --> bracket("("), bracket(")").
  • 25. All power of Prolog DCGs (here: an bn cn ) letter(X) :- member(X, [a,b,c]). 0.5 :: s(0) --> akblcm(K,L,M), {K = L; L = M; M = K}, {K = 0, L = 0, M = 0}. 0.5 :: s(1) --> akblcm(N,N,N). akblcm(K,L,M) --> rep(K,A), rep(L,B), rep(M,C), {A = B, B = C, C = A}. rep(0, _) --> []. nn(mnist, [X], C, letter) :: rep(s(N), C) --> [X], rep(N,C).
  • 26. Citation networks T5: Given scientific paper set with only few labels & citation network, find all labels
  • 27. Word Algebra Problem T6: natural language text describing algebra problem, predict outcome E.g."Mark has 6 apples. He eats 2 and divides the remaining among his 2 friends. How many apples did each friend get?" Uses “empty body trick” to emulate SLP logic rules through SDCGs: nn(m,[I1 ,…,Im ],[O1 ,…,OL ],[D1 ,…,DL ]) :: nt --> []. Enables fairly straightforward translation of DeepProbLog programs for a lot of tasks DeepStochLog performs equally well as DeepProbLog: 96% accuracy
  • 28. Translating DPL to DSL DeepProbLog DeepStochLog
  • 30. Ongoing/future DeepStochLog research ● Structure learning using t(_) (syntactic sugar for PRISM-like switches) ● Support for calculation of true probability (without probability mass loss) by dividing by probabilities of all possible other possible outputs of given goal ● Larger-scale experiment(s) (e.g. on CLEVR) ● Comparing with more neural symbolic frameworks ● Generative setting (with generative neural networks and using grammar to aid generation)
  • 31. Thanks! Paper: DeepStochLog: Neural Stochastic Logic Programming Code: https://github.com/ml-kuleuven/deepstochlog Python: pip install deepstochlog Authors: Thomas Winters*, Giuseppe Marra*, Robin Manhaeve, Luc De Raedt Twitter: @thomas_wint, @giuseppe__marra, @ManhaeveRobin, @lucderaedt * shared first author