SlideShare a Scribd company logo
1 of 31
Download to read offline
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 KerasOswald 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 TensorFlowAI Frontiers
 
[Pycon 2015] 오늘 당장 딥러닝 실험하기 제출용
[Pycon 2015] 오늘 당장 딥러닝 실험하기 제출용[Pycon 2015] 오늘 당장 딥러닝 실험하기 제출용
[Pycon 2015] 오늘 당장 딥러닝 실험하기 제출용현호 김
 
Introduction to Homomorphic Encryption
Introduction to Homomorphic EncryptionIntroduction to Homomorphic Encryption
Introduction to Homomorphic EncryptionChristoph Matthies
 
한국어와 NLTK, Gensim의 만남
한국어와 NLTK, Gensim의 만남한국어와 NLTK, Gensim의 만남
한국어와 NLTK, Gensim의 만남Eunjeong (Lucy) Park
 
Profiling and optimization
Profiling and optimizationProfiling and optimization
Profiling and optimizationg3_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 COSC1285MadelineLong2
 
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 - SlidecastDaniel Kolman
 
Python Training Tutorial for Frreshers
Python Training Tutorial for FrreshersPython Training Tutorial for Frreshers
Python Training Tutorial for Frreshersrajkamaltibacademy
 
TensorFlow.Data 및 TensorFlow Hub
TensorFlow.Data 및 TensorFlow HubTensorFlow.Data 및 TensorFlow Hub
TensorFlow.Data 및 TensorFlow HubJeongkyu Shin
 
Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine LearningBig_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

[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 EventsTaegyun 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 TensorFlowS N
 
The Mathematics of RSA Encryption
The Mathematics of RSA EncryptionThe Mathematics of RSA Encryption
The Mathematics of RSA EncryptionNathan F. Dunn
 
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 LLVMLinaro
 
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 ServicesAndrea Tassi
 
Symbolic Regression on Network Properties
Symbolic Regression on Network PropertiesSymbolic Regression on Network Properties
Symbolic Regression on Network PropertiesMarcus Märtens
 
Gpu workshop cluster universe: scripting cuda
Gpu workshop cluster universe: scripting cudaGpu workshop cluster universe: scripting cuda
Gpu workshop cluster universe: scripting cudaFerdinand 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 solutionsPeter Solymos
 
Deep Learning in Your Browser
Deep Learning in Your BrowserDeep Learning in Your Browser
Deep Learning in Your BrowserOswald 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 TensorflowOswald 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 TensorFlowSri Ambati
 
Introduction to Deep Learning and TensorFlow
Introduction to Deep Learning and TensorFlowIntroduction to Deep Learning and TensorFlow
Introduction to Deep Learning and TensorFlowOswald Campesato
 
TensorFlow in Your Browser
TensorFlow in Your BrowserTensorFlow in Your Browser
TensorFlow in Your BrowserOswald 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.jsOswald Campesato
 

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 AIThomas Winters
 
Wetenschapscommunicatie on steroids
Wetenschapscommunicatie on steroidsWetenschapscommunicatie on steroids
Wetenschapscommunicatie on steroidsThomas 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 ComputersThomas 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 partnerThomas Winters
 
De magie achter afbeeldingsgenerators
De magie achter afbeeldingsgeneratorsDe magie achter afbeeldingsgenerators
De magie achter afbeeldingsgeneratorsThomas 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 PhDThomas 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 IntelligentieThomas 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 FestivalThomas Winters
 
Creative AI for Improv Theatre
Creative AI for Improv TheatreCreative AI for Improv Theatre
Creative AI for Improv TheatreThomas 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

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 

Recently uploaded (20)

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 

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