SlideShare a Scribd company logo
1 of 55
Neural approaches to
machine reasoning
July 17th 2018
O'Reilly Institute, Trinity College Dublin
David Mack
david@octavian.ai
https://octavian.ai
David Mack
https://octavian.ai
david@octavian.ai
Today I’ll cover:
1. What is machine reasoning
2. Knowledge
3. Neural reasoning approaches
4. Iterative reasoning with MACnets
Goals for this session
• Introduce you to interesting ideas
• Get you excited about neural reasoning!
• We will not cover the full technical details, but I’ve
included links to all of the material
Background
What is machine reasoning?
• A system that answers questions about knowledge using
deduction or induction
• That is, doing something more complex than search-and-
retrieve
• E.g. “Who is most likely to win the world cup”
• E.g. “Which bus line visits the most pubs?”
• Can be single-shot (e.g. Google search) or interactive
(e.g. Chat bot)
What is machine reasoning?
• Many systems do reasoning on a limited set of questions
• We’re most interested in general(izeable) systems: How can we
answer a broad range of questions?
Google
maps
Knowledge
• Reasoning requires knowledge
• Many ways to represent knowledge:
• Sequences (e.g. language strings)
• Images
• Vectors
• Graphs
Knowledge graphs
Knowledge graphs
• Can represent a diverse range of
information
• Can be continually extended
• Google’s Knowledge Graph has
over 1bn entities and helps
answer 30bn monthly searches
• Wikidata contains 50bn entities
and is freely available
Approaches
A brief survey of neural reasoning approaches
Recurrent cell
(LSTM/GRU)
RNNTranslation
Question ->
Answer
Question ->
Database Query
Neural turing
machines
MACnets
Interactive Question
Answering
Reinforcement
learning
MacGraph
Note: These are just selected highlights, there are many many variations of these ideas in the literature
Recurrent neural network
Image source: Colah RNN tutorial
Time / Sequence ->
RNN extensions
Image source: Distil
Attention a differentiable way to query information from an array
Image source: Distil
Attention
Softmax
becomes
Attention mechanism
• Normalised sum of exponentials
• Result sums to 1.0
• “Increases contrast”
Image source: Distil
Iterative reasoning with
MACnets
The challenge: answer questions
about images
• The CLEVR dataset
• Synthetic
• Question, Answer, Image
• Question comes as
English and Functional
program
Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
Memory, Attention, and Composition
network (MACnet)
• Introduced by Drew
Hudson and Christopher
Manning at ICLR April
2018
• Answer questions on
CLEVR dataset to 99%
accuracy (humans get
93%)
Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
Key idea: use RNN iteration as
instruction cycle (from Neural Turing Machines)
Input
Answer
Key idea: Attention over image and
text gives interpretability
Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
Key idea: Use question words as the
instructions
Attention
Question
words
Control state Next control
state
Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
Can we achieve recursion/algorithms
through self-talk?
Key idea: have separate control and
memory states
Memory
Control c1 c2 c3 c4
m1 m2 m3 m4
Time →
Key idea: Preprocess image and text
through existing architectures
Image passed through
ResNet101 Text passed through biLSTM
“question words”
“question”
MAC network performs iterative
reasoning
Attention
Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
Attention
MAC cell
Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
Results
Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
Read more about everything
mentioned:
• Online Safari book on RNNs: https://www.safaribooksonline.com/library/view/neural-networks-
and/9781492037354/ch04.html
• Introduction to RNN/LSTM: http://colah.github.io/posts/2015-08-Understanding-LSTMs/
• Attention and Augmented Recurrent Neural Networks https://distill.pub/2016/augmented-rnns/
• TensorFlow Neural Machine Translation Tutorial https://github.com/tensorflow/nmt
• Differentiable neural computers (DeepMind nature publication) https://deepmind.com/blog/differentiable-neural-
computers/
• MACnets https://arxiv.org/abs/1803.03067
• IQA: Visual Question Answering in Interactive Environments (Reinforcement learning reasoning):
https://arxiv.org/abs/1712.03316
• English to Cypher translation https://medium.com/octavian-ai/answering-english-questions-using-knowledge-graphs-
and-sequence-translation-2acbaa35a21d
• Applying MACnet to knowledge graph (work in progress): https://github.com/Octavian-ai/mac-graph
• Octavian’s research https://www.octavian.ai/articles https://twitter.com/Octavian_ai
Q&A
https://octavian.ai
David Mack
david@octavian.ai
Appendix
Question to database
query translation
CLEVR-Graph: Answering questions
about mass transit graphs
• Synthetic dataset
• Question, Answer, Graph
triples
• Each question comes as
English, Functional
program and Cypher
Question to cypher query translation
Question to cypher query translation
How clean is Spoon Street?
MATCH (var1)
WHERE var1.name="Spoon Street"
WITH 1 AS foo, var1.cleanliness AS var2
RETURN var2
= DIRTY
Seq2Seq encodes then decodes
Image source: TensorFlow tutorials
Encoding the input
embedding
Encoded state
Encoded state
Image source: TensorFlow tutorials
… then decode
Image source: TensorFlow tutorials
In reality the output elements often
derive from specific input elements
Image source: Distil
This input-output mapping is hard work for the
RNN since everything is encoded together
Image source: TensorFlow tutorials
… therefore use attention
Image source: Distil
FREQUENTLY USED TECHNIQUE
… therefore use attention Softmax
becomes
Attention mechanism
• Normalised sum of
exponentials
• Result sums to 1.0
• “Increases contrast”
FREQUENTLY USED TECHNIQUE
Image source: Distil
… therefore use attention
Image source: TensorFlow tutorials
Seq2seq Results
• 100% translation accuracy on (reasonably simple)
CLEVR-graph question – cypher pairs
• Google: “Human evaluations show that [Seq2Seq] has
reduced translation errors by 60% compared to our
previous phrase-based system”
MACnets in more detail
Control cell: Decides what system
should do next
Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
Read cell: Reads from knowledge
using memory and control states
Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
Write cell: Updates memory state
(similar to LSTM)
Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
Results
Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
Assorted extras
Attention
1. Compare query to each element in array giving scores
2. Apply softmax to normalise and focus scores
3. Multiply each element by its score
4. Sum all the elements
Neural graph memory
• Store a table of nodes and table of edges
• Use attention (aka content addressing) to retrieve data
from_node edge_props to_node
from_node edge_props to_node
from_node edge_props to_node
from_node edge_props to_node
from_node edge_props to_node
node_id node_props
node_id node_props
node_id node_props
node_id node_props
Nodes Edges
Let RNN cell read from a memory
1 2 3 4
Image source: Distil
What is a neural network?
• Neural network is one which transforms signals through trainable
layers
What is a neural network?
• Trained via backpropagation of errors and gradient descent
ERROR
LSTM cell
Long term state
passes straight
through
Short term state
Short term state
Long term state
“If you consider the LSTM cell as a black box, it can be used very much like a basic cell, except it will perform much
better; training will converge faster and it will detect long-term dependencies in the data.” -- Safari Books
https://www.safaribooksonline.com/library/view/neural-networks-and/9781492037354/ch04.html

More Related Content

Recently uploaded

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Recently uploaded (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

Neural network approaches to machine reasoning

  • 1. Neural approaches to machine reasoning July 17th 2018 O'Reilly Institute, Trinity College Dublin David Mack david@octavian.ai https://octavian.ai
  • 3. Today I’ll cover: 1. What is machine reasoning 2. Knowledge 3. Neural reasoning approaches 4. Iterative reasoning with MACnets
  • 4. Goals for this session • Introduce you to interesting ideas • Get you excited about neural reasoning! • We will not cover the full technical details, but I’ve included links to all of the material
  • 6. What is machine reasoning? • A system that answers questions about knowledge using deduction or induction • That is, doing something more complex than search-and- retrieve • E.g. “Who is most likely to win the world cup” • E.g. “Which bus line visits the most pubs?” • Can be single-shot (e.g. Google search) or interactive (e.g. Chat bot)
  • 7. What is machine reasoning? • Many systems do reasoning on a limited set of questions • We’re most interested in general(izeable) systems: How can we answer a broad range of questions? Google maps
  • 8. Knowledge • Reasoning requires knowledge • Many ways to represent knowledge: • Sequences (e.g. language strings) • Images • Vectors • Graphs
  • 10. Knowledge graphs • Can represent a diverse range of information • Can be continually extended • Google’s Knowledge Graph has over 1bn entities and helps answer 30bn monthly searches • Wikidata contains 50bn entities and is freely available
  • 12. A brief survey of neural reasoning approaches Recurrent cell (LSTM/GRU) RNNTranslation Question -> Answer Question -> Database Query Neural turing machines MACnets Interactive Question Answering Reinforcement learning MacGraph Note: These are just selected highlights, there are many many variations of these ideas in the literature
  • 13. Recurrent neural network Image source: Colah RNN tutorial Time / Sequence ->
  • 15. Attention a differentiable way to query information from an array Image source: Distil
  • 16. Attention Softmax becomes Attention mechanism • Normalised sum of exponentials • Result sums to 1.0 • “Increases contrast” Image source: Distil
  • 18. The challenge: answer questions about images • The CLEVR dataset • Synthetic • Question, Answer, Image • Question comes as English and Functional program Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
  • 19. Memory, Attention, and Composition network (MACnet) • Introduced by Drew Hudson and Christopher Manning at ICLR April 2018 • Answer questions on CLEVR dataset to 99% accuracy (humans get 93%) Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
  • 20. Key idea: use RNN iteration as instruction cycle (from Neural Turing Machines) Input Answer
  • 21. Key idea: Attention over image and text gives interpretability Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
  • 22. Key idea: Use question words as the instructions Attention Question words Control state Next control state Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING Can we achieve recursion/algorithms through self-talk?
  • 23. Key idea: have separate control and memory states Memory Control c1 c2 c3 c4 m1 m2 m3 m4 Time →
  • 24. Key idea: Preprocess image and text through existing architectures Image passed through ResNet101 Text passed through biLSTM “question words” “question”
  • 25. MAC network performs iterative reasoning Attention Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING Attention
  • 26. MAC cell Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
  • 27. Results Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
  • 28. Read more about everything mentioned: • Online Safari book on RNNs: https://www.safaribooksonline.com/library/view/neural-networks- and/9781492037354/ch04.html • Introduction to RNN/LSTM: http://colah.github.io/posts/2015-08-Understanding-LSTMs/ • Attention and Augmented Recurrent Neural Networks https://distill.pub/2016/augmented-rnns/ • TensorFlow Neural Machine Translation Tutorial https://github.com/tensorflow/nmt • Differentiable neural computers (DeepMind nature publication) https://deepmind.com/blog/differentiable-neural- computers/ • MACnets https://arxiv.org/abs/1803.03067 • IQA: Visual Question Answering in Interactive Environments (Reinforcement learning reasoning): https://arxiv.org/abs/1712.03316 • English to Cypher translation https://medium.com/octavian-ai/answering-english-questions-using-knowledge-graphs- and-sequence-translation-2acbaa35a21d • Applying MACnet to knowledge graph (work in progress): https://github.com/Octavian-ai/mac-graph • Octavian’s research https://www.octavian.ai/articles https://twitter.com/Octavian_ai
  • 32. CLEVR-Graph: Answering questions about mass transit graphs • Synthetic dataset • Question, Answer, Graph triples • Each question comes as English, Functional program and Cypher
  • 33. Question to cypher query translation
  • 34. Question to cypher query translation How clean is Spoon Street? MATCH (var1) WHERE var1.name="Spoon Street" WITH 1 AS foo, var1.cleanliness AS var2 RETURN var2 = DIRTY
  • 35. Seq2Seq encodes then decodes Image source: TensorFlow tutorials
  • 36. Encoding the input embedding Encoded state Encoded state Image source: TensorFlow tutorials
  • 37. … then decode Image source: TensorFlow tutorials
  • 38. In reality the output elements often derive from specific input elements Image source: Distil
  • 39. This input-output mapping is hard work for the RNN since everything is encoded together Image source: TensorFlow tutorials
  • 40. … therefore use attention Image source: Distil FREQUENTLY USED TECHNIQUE
  • 41. … therefore use attention Softmax becomes Attention mechanism • Normalised sum of exponentials • Result sums to 1.0 • “Increases contrast” FREQUENTLY USED TECHNIQUE Image source: Distil
  • 42. … therefore use attention Image source: TensorFlow tutorials
  • 43. Seq2seq Results • 100% translation accuracy on (reasonably simple) CLEVR-graph question – cypher pairs • Google: “Human evaluations show that [Seq2Seq] has reduced translation errors by 60% compared to our previous phrase-based system”
  • 44. MACnets in more detail
  • 45. Control cell: Decides what system should do next Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
  • 46. Read cell: Reads from knowledge using memory and control states Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
  • 47. Write cell: Updates memory state (similar to LSTM) Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
  • 48. Results Image source: COMPOSITIONAL ATTENTION NETWORKS FOR MACHINE REASONING
  • 50. Attention 1. Compare query to each element in array giving scores 2. Apply softmax to normalise and focus scores 3. Multiply each element by its score 4. Sum all the elements
  • 51. Neural graph memory • Store a table of nodes and table of edges • Use attention (aka content addressing) to retrieve data from_node edge_props to_node from_node edge_props to_node from_node edge_props to_node from_node edge_props to_node from_node edge_props to_node node_id node_props node_id node_props node_id node_props node_id node_props Nodes Edges
  • 52. Let RNN cell read from a memory 1 2 3 4 Image source: Distil
  • 53. What is a neural network? • Neural network is one which transforms signals through trainable layers
  • 54. What is a neural network? • Trained via backpropagation of errors and gradient descent ERROR
  • 55. LSTM cell Long term state passes straight through Short term state Short term state Long term state “If you consider the LSTM cell as a black box, it can be used very much like a basic cell, except it will perform much better; training will converge faster and it will detect long-term dependencies in the data.” -- Safari Books https://www.safaribooksonline.com/library/view/neural-networks-and/9781492037354/ch04.html