Chat bots been have popping up everywhere for silly things, but what if they can help us make the world more safe and secure? The work of designing secure systems often involves iterating over designs with a team but what if you don’t have a team? What if you could iterate over system design and analysis in a chat window and have a design document with safety constraints as the end product? This talk will present an original chat bot that will do just that
2. Who Am I?
Data Scientist at Endgame
Got a PhD in Materials Science doing
nanoscale simulations on supercomputers
Play bass in a band (bleach bones)
@rseymour on twitter
2
10. Bots Boiled Down
Bots take words and turn them into actions.
“Alexa, turn on the lamp” “Ok”
“Open the pod bay doors HAL”
10
11. Voice Recognition and Speech Synthesis
We don’t need
these pieces to
have a bot
11
Text to
Speech
bot
Speech
to Text
12. Click-Through vs. Conversational Interfaces
12
+ 6 more steps
vs
Id like to order a cheese pizza.
Great! What size pizza would
you like?
Medium
Okay. I have an order for a
medium cheese pizza. Is that
all?
Yes. That is all.
13. Causes of the Bot Revolution?
Platform Diversity
• Messaging
• Intelligent assistants
• Team collaboration software
App Stagnation
• More users on messaging platforms
• Hard to gain traction w/in App Stores
Ease-of-Use
• Simplifies UI/UX
• Allows user to maintain focus on current
screen/activity
• Provide walkthroughs
• Eliminates need to know query languages
13
Cortana
14. Bot Development Kits (BDKs)
The rise of bots is largely due to an increase in BDKs
Companies like Chatfuel, Wit.ai, and API.ai
• Provide simple UI for development
• Closed-domain, Rule-based, goal-oriented bots
• No programming skills required
How popular have these frameworks become?
• Wit.ai purchased by Facebook (Jan 2015)
• API.ai purchased by Google (Sep 2016)
Major companies pushing out frameworks too!
• Microsoft Bot Framework
• Amazon Alexa Skills Kit
14
17. GOOD BOTS
DoNotPay Bot
• Bot helps people fight
parking tickets
• Wildly successfully in 3
major cities
Esterbot
• QA bot tied to a LinkedIn
account or resume.
• Recruiters talk to a bot
before they get to you
BAD BOTS
Microsoft TayBot
• Great idea gone terribly
awry
• Learning from internet
conversations sometimes
leads to being…
the worst.
17
Good Bots and Bad Bots
18. 18
GENERATIVE RETRIEVAL
PROS
• Bots of the future!
• Excellent recall ability
• Ability to learn as exposure to
user increases
• Simple to implement
• Smaller datasets
• No grammatical mistakes
CONS
• Requires a lot of data
• Complex models large
vocabularies massive training
time for model building
• Prone to grammatical errors
• Really, really inappropriate…
right TayBot?
• Not intelligent
• Limited “memory”
• Works best in closed-domain, short
conversation scenarios
Which is best?
21. Context & Intent
Context (teal)
• Current state
• Steers conversation
• Ensures all req’d parameters are
collected to perform Action
Intent (red)
• Maps Utterance (blue) specific
Action
• What does the user want?
21
22. Entities
Entities are parameters needed to
satisfy Intents and execute
Actions.
Entities can be anything
• File hash
• IP address
• Cities
Permutations of an entity allow for
diversity of vocabulary
• Regular Expressions
• Synonyms
22
23. Training Data
Few bot developers have necessary
training data
BDKs provide access to Domains or
pre-defined Knowledge packages:
• Reservations
• Small Talk
• Weather
BDKs log user interactions to constantly
update training set
23
24. Natural Language Processing & Machine Learning
BDKs have built in ML/NLP capabilities
NLP used to handle incoming data
• Tokenization
• Word Boundary & Word Sense
• Synonym generation
• Entity extraction
ML used to classify user input to an Intent and map
to an output
• Supervised Learning
• Features: n-gram or word-based vectors
• Model constantly updated as bot gets used
24
Input NLP
Output ML
features
25. NLP 101 Direct Matching (No ML)
Show flights from Washington to Denver on Monday
Show flights from Washington to Denver on Monday
Show flights from Washington to Denver on Monday
VB NNS IN NNP IN NNP IN NNP
if utterance contains show_vb AND flights_nns:
Utterance
Tokenization
Parts-of-
Speech
Tagging
(POS)
Show flights from Washington to Denver on MondayNamed Entity
Recognition
(NER) Location Location Date
SHOW_FLIGHTS(Washington, Denver, Monday)
Perform Action
25
26. NLP 101 ML-Based
Show flights from Washington to Denver on Monday
Show flights from Washington to Denver on Monday
Utterance
Tokenization
Show flights from Washington to Denver on Monday
Named Entity
Recognition
(NER) Location Location Date
0 1 1 0 1 0 1 0 1 1 0 0 1Bag-of-Words
(Feature Vector)
SHOW_FLIGHTS
CHANGE_FLIGHTS
BOOK_FLIGHTS
Intent
Classification SHOW_FLIGHTS(location, location, date)
SHOW_FLIGHTS(Washington, Denver, Monday)Perform Action
26
27. Getting started with this Language Stuff
I recommend spaCy available
at spacy.io
27
33. Search (but not security twitter, let’s say your logs)
33
“What can I help you with today?”
“Show me all of the processes running that started in the last hour”
“Ok which endpoints?”
34. Search (but not security twitter, let’s say your logs)
34
“What can I help you with today?”
“Show me all of the processes running that started in the last hour”
“Ok which endpoints?”
35. Search (but not security twitter, let’s say your logs)
35
“What can I help you with today?”
“Show me all of the processes running that started in the last hour”
“Ok which endpoints?”
“Everyone!”
“Ok”
Search results ensue
52. Engineering a Safer World
52
Engineering a Safer World
Systems Thinking Applied to Safety
Nancy G. Leveson
2012
Systems Theoretic Process Analysis
(STPA)
53. Engineering a Safer World
53
Engineering a Safer World
Systems Thinking Applied to Safety
Nancy G. Leveson
2012
Systems Theoretic Process Analysis
(STPA)
56. Safety Defined
56
Hazard: a system state or set of
conditions that combined with worst case
environmental conditions will lead to an
accident
Accident: an event that results in an
unacceptable level of loss
Safety: freedom from accidents
57. The Driving Force of Systems Safety
57
Accidents today happen while
the each component of the
system is working
58. The Driving Force of Systems Safety
58
The accidents we see now are:
Component Interaction
Accidents
59. The Driving Force (continued)
59
“Preventing future accidents requires
shifting from a focus on preventing
failures to the broader goal of
designing and implementing controls
that will enforce the necessary
constraints.”
60. What it doesn’t do
60
It doesn’t use Risk %s
It doesn’t catalog possible failure
It doesn’t blame operator error
It doesn’t triage
75. STPA takes a high level view, early in the design
75
What if we had a bot to help us
go through this process?
What if you had ~ 2 weeks to
write such a bot!
Working on making our product better using the techniques of data science
Bot is an application that assists in the automation of tasks
Chatbots
Conversational Agents
Dialog Systems
Mimics human conversation
Uses Natural Language Understanding to determine user intent and initiate a task
chat is more natural and can facilitate the completion of a task much faster than a clunky multi-step/page UI
The bot was made available to New Yorkers in March. In recent years and decades, residents of The Big Apple have seen a persistent increase in traffic fines. A record $1.9 billion in traffic fines was issued by the City of New York in 2015.
Since the first version of the bot was released in London last fall, 160,000 of 250,000 tickets have been successfully challenged with DoNotPay, Browder said.
“I think the people getting parking tickets are the most vulnerable in society,” said Browder. “These people aren’t looking to break the law. I think they’re being exploited as a revenue source by the local government.”
Session – current conversation w/ a specific user
Identity – (not mandatory) maintains credentials, addresses, etc of a given user for easy recall
Dialogue Script – Flow Chart on previous screen.
Action – step bot takes when intention is triggered by user utterance
https://api.ai/blog/2015/11/23/Contexts/
Joseph Weizenbaum Award in Information and Computer Ethics
- The templates key are user utterances that trigger this “intent”.
Contexts are affected by intent, here by saying “I want to make a bouquet, the user shift context from None to Compose/Bouquet
This is just moving down the tree show a few slides back.
“Speech” is the response the bot will give the user…
Is the shell the original ChatBot?
Working on making our product better using the techniques of data science
Electro mechanical systems
Fault trees, risk % etc.
Ludwig von Bertalanffy bio
Ludwig von Bertalanffy bio
Palomilla – followed a light 1950