Rsqrd AI: Discovering Natural Bugs Using Adversarial Perturbations

Discovering	Natural	Bugs	Using	
Adversarial	Perturbations
Sameer	Singh
AI2	Meetup	on	Robust	AI:	Debugging	NLP July	17th,	2019
circa	2005
[adapted	from	Zadeh 2005,	From	Search	Engines	to	Question-Answering	Systems	— The	Need	for	New	Tools]
2019
NLP	has	come	a	long	way!
But	we	know	models	are	brittle…
Feng	et	al,	EMNLP	2018
Anton van den Hengel, ACL 2018
Jia and	Liang,	EMNLP	2017
Black-box	Explanations	for	Debugging?
LIME Anchors
From: Keith Richards
Subject: Christianity is the answer
NTTP-Posting-Host: x.x.com
I think Christianity is the one true religion.
If you’d like to know more, send me a note
How	do	we	discover	these	“bugs”?
Original	
Instance
Original	PredictionML	Pipeline
ML	Pipeline Expected	PredictionChanged	
Instance
Perturb	it	in	a	
specific	way
Outline
Semantically	Equivalent	Adversaries
Semantically	Implied	Adversaries
Universal	Adversaries
Outline
Semantically	Equivalent	Adversaries
Semantically	Implied	Adversaries
Universal	Adversaries
Z.	Zhao, D.	Dua, S.	Singh.
Generating	Natural	Adversarial	Examples.
Int.	Conf.	on	Learning	Representations	(ICLR). 2018
M.	T.	Ribeiro, S.	Singh, C.	Guestrin.
Semantically	Equivalent	Adversarial	Rules	for	Debugging	NLP	models.
Annual	Meeting	of	the	Assoc for	Computational	Linguistics	(ACL). 2018
Adversarial	Examples:	Oversensitivity
Find	closest	example	with	different	prediction
x f y
x' f y
Adversarial	Attacks	on	Text
What	type	of	road	sign	is	shown?
>	STOP.
What	type	of	road	sign	is	
shown?
Perceptible	by	humans,	unlikely	in	real	world
What				type	of	road	sign	is	
sho wn?
Preserve	the	Semantics
What	type	of	road	sign	is	shown?
>	Do	not	Enter.
>	STOP.
What	type	of	road	sign	is	shown?
Bug,	and	likely	in	the	real	world
Preserve	the	Semantics
The	biggest	city	on	the	river	Rhine	is	
Cologne,	Germany	with	a	population	of	
more	than	1,050,000	people.
It	is	the	second-longest	river	in	Central	
and	Western	Europe	(after	the	Danube),	
at	about	1,230	km	(760	mi)
How	long	is	the	Rhine?
>	More	than	1,050,000
>	1230km
How	long	is	the	Rhine?
Bug,	and	likely	in	the	real	world
Transformation	“Rules”:	Sentiment	Analysis
fastText [Joulin et	al.,	2016]
Outline
Semantically	Equivalent	Adversaries
Semantically	Implied	Adversaries
Universal	Adversaries
M.	T.	Ribeiro, C.	Guestrin, S.	Singh.
Are	Red	Roses	Red?	Evaluating	Consistency	of	Question-Answering	Models.	
Association	for	Computational	Linguistics	(ACL).	2019
Consistency	in	Predictions
How	many	birds?			1
So	far,	we	have	considered	equivalence,	i.e.	(x, y) → (x’, y)
Yes
(x, y)
(x’, y’) Is	there	1	bird?
Visual	QA
(x, y): What	room	is	this?	bathroom
Logical	Equivalence
(x’, y’): Is	this	a	bathroom?	Yes
Necessary	Condition
(x’, y’): Is	there	a	bathroom	in	the	picture?	Yes
Mutual	Exclusion
(x’, y’): Is	this	a	kitchen?	No
57%
50%
35%
67%
97%	are	valid!
Implication	Adversaries
• We	shouldn’t	treat	each	prediction	in	isolation
• Inconsistency	leads	to	poor	user	experience
• Currently,	rule-based	system	for	generating	them
• Already	promising!
• Reveals	important	bugs	in	the	models
• Even	simple	data	augmentation	is	promising
Outline
Semantically	Equivalent	Adversaries
Semantically	Implied	Adversaries
Universal	Adversaries
under	review
Universal	Adversaries
• Instead	of	replacement,	let’s	consider	additions
• Are	there	tokens	that	make	the	model	misbehave?
b has	nothing	to	do	with	the	task,	and	is	not	specific	to	x
x f y
b+x f y
Language	Modeling	(GPTv2	small)
TH	PEOPLEMan god dreams Blacks are	the	worst	people	in	the	world.
A	few	token	prefix	that	makes	the	model	produce	racist	language	L
TH	PEOPLEMan god	dreams	Blacks	I	bought	a	mac and	a	soda	for	$10.00.	I’m	not	
a	racist,	but	I’m	not	saying	that	blacks	should	be	allowed	to	buy	a	soda.
TH	PEOPLEMan god	dreams	Blacks	yesterday	I’m	going	to	be	a	fucking	black	man.	
I	don’t	know	what	to	say	to	that,	but	fuck	you.
TH	PEOPLEMan god	dreams	Blacks	my	mother	says I’m	a	racist,	and	she’s	right.
Searched	so	that	we	even	user	input	after	prefix	causes	problems
WARNING:	Strong	Language
Debugging	by	Changing	Instances
• “Natural	Perturbations”	for	NLP
• Semantically	Equivalent	
• Semantic	Implications
• Universal	Tokens
• Useful	for	identifying	different	kinds	of	problems
• Not	all	of	them	are	traditional	“bugs”
• General	set	of	approaches	that	apply	for	most	models
Thanks!
sameer@uci.edu
sameersingh.org
@sameer_
Semantic	Adversaries	for	NLP			 [ACL	2018]
Semantically-Equivalent	Adversary
(SEA)
Semantically-Equivalent	Adversarial	Rules
(SEARs)
color	→	colour
x
Backtranslation
+	Filtering
x’ (x, x’)
Patterns
in	“diffs”
Rules
VQA	User	Study:	Detecting	adversaries
33.6
36
45
0
20
40
Human SEA Human	+	SEA
Human SEA Human	+	SEA
SEAs	find	adversaries	as	often	as	humans!
SEAs	+	Humans	better	than	humans!
Domain-Independent	Approach												[ICLR	2018]
x f y
x' f yG
Generator
Iz
Inverter
z'
VQA	User	study:	Can	experts	find	bugs?
3
14.2
0
20
Visual	QA
Experts SEARs
16.9
10.1
0
20
Visual	QA
Finding	Rules Evaluating	SEARs
%	predictions	flipped Time	(minutes)
SEARs	are	much	better	than	
expert-produced	rules
Evaluating	is	much	easier	
than	finding	them
Closing	the	loop	brings	it	down	to	1.4%
Oversensitivity	in	images
Adversaries	are	indistinguishable	to	humans…
But	unlikely in	the	real	world	(except	for	attacks)
“panda”
57.7%	confidence
“gibbon”
99.3%	confidence
Evaluating	Implication	Consistency
Validation
Data
(x, y)
Implication
Generation
Implications
(x,y), (x’,y’)
Model
f
Consistency
#	y y’ correct
#	y correct
based	on	parses,
POS,	WordNet,	etc.
Visual	QA	Results
Model Acc LogEq Mutex Nec Avg Augmentation
SAAA	(Kazemi,	Elqursh,	2017) 61.5 76.6 42.3 90.2 72.7 94.4
Count	(Zhang	et	al.,	2018) 65.2 81.2 42.8 92.0 75.0 94.1
BAN (Kim	et	al.,	2018) 64.5 73.1 50.4 87.3 72.5 95.0
Good	at	answer	w/	numbers,	but	not	questions	w/	numbers
e.g.	How	many	birds?	1 (12%)	→	Are	there	2	birds?	yes (<1%)
Transformation	“Rules”:	VisualQA
Visual7a-Telling	[Zhu	et	al	2016]
1 of 30

Recommended

Rsqrd AI: Making Conversational AI Work for Everybody by
Rsqrd AI: Making Conversational AI Work for EverybodyRsqrd AI: Making Conversational AI Work for Everybody
Rsqrd AI: Making Conversational AI Work for EverybodySanjana Chowdhury
2.4K views23 slides
Rsqrd AI: Application of Explanation Model in Healthcare by
Rsqrd AI: Application of Explanation Model in HealthcareRsqrd AI: Application of Explanation Model in Healthcare
Rsqrd AI: Application of Explanation Model in HealthcareSanjana Chowdhury
78 views16 slides
Rsqrd AI: Recent Advances in Explainable Machine Learning Research by
Rsqrd AI: Recent Advances in Explainable Machine Learning ResearchRsqrd AI: Recent Advances in Explainable Machine Learning Research
Rsqrd AI: Recent Advances in Explainable Machine Learning ResearchSanjana Chowdhury
189 views35 slides
Rsqrd AI: Incorporating Priors with Feature Attribution on Text Classification by
Rsqrd AI: Incorporating Priors with Feature Attribution on Text ClassificationRsqrd AI: Incorporating Priors with Feature Attribution on Text Classification
Rsqrd AI: Incorporating Priors with Feature Attribution on Text ClassificationSanjana Chowdhury
89 views13 slides
Rsqrd AI: A Survey of The Current Ecosystem of Explainability Techniques by
Rsqrd AI: A Survey of The Current Ecosystem of Explainability TechniquesRsqrd AI: A Survey of The Current Ecosystem of Explainability Techniques
Rsqrd AI: A Survey of The Current Ecosystem of Explainability TechniquesSanjana Chowdhury
90 views17 slides
Rsqrd AI: Explaining ML Models w/ Geometric Intuition by
Rsqrd AI: Explaining ML Models w/ Geometric IntuitionRsqrd AI: Explaining ML Models w/ Geometric Intuition
Rsqrd AI: Explaining ML Models w/ Geometric IntuitionSanjana Chowdhury
78 views35 slides

More Related Content

Recently uploaded

Network Source of Truth and Infrastructure as Code revisited by
Network Source of Truth and Infrastructure as Code revisitedNetwork Source of Truth and Infrastructure as Code revisited
Network Source of Truth and Infrastructure as Code revisitedNetwork Automation Forum
52 views45 slides
DRBD Deep Dive - Philipp Reisner - LINBIT by
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBITShapeBlue
140 views21 slides
Future of AR - Facebook Presentation by
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook PresentationRob McCarty
62 views27 slides
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueCloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueShapeBlue
94 views13 slides
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...Bernd Ruecker
50 views69 slides
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool by
Extending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPoolExtending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPool
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPoolShapeBlue
84 views10 slides

Recently uploaded(20)

DRBD Deep Dive - Philipp Reisner - LINBIT by ShapeBlue
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBIT
ShapeBlue140 views
Future of AR - Facebook Presentation by Rob McCarty
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
Rob McCarty62 views
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue by ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlueCloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
CloudStack Managed User Data and Demo - Harikrishna Patnala - ShapeBlue
ShapeBlue94 views
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker50 views
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool by ShapeBlue
Extending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPoolExtending KVM Host HA for Non-NFS Storage -  Alex Ivanov - StorPool
Extending KVM Host HA for Non-NFS Storage - Alex Ivanov - StorPool
ShapeBlue84 views
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue166 views
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc160 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson156 views
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by ShapeBlue
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
ShapeBlue181 views
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava... by ShapeBlue
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
ShapeBlue101 views
Digital Personal Data Protection (DPDP) Practical Approach For CISOs by Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash153 views
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by ShapeBlue
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
ShapeBlue120 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software385 views
Business Analyst Series 2023 - Week 4 Session 7 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10126 views
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates by ShapeBlue
Keynote Talk: Open Source is Not Dead - Charles Schulz - VatesKeynote Talk: Open Source is Not Dead - Charles Schulz - Vates
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates
ShapeBlue210 views
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O... by ShapeBlue
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
Declarative Kubernetes Cluster Deployment with Cloudstack and Cluster API - O...
ShapeBlue88 views
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
ShapeBlue222 views

Featured

ChatGPT and the Future of Work - Clark Boyd by
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
27.1K views69 slides
Getting into the tech field. what next by
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
6.4K views22 slides
Google's Just Not That Into You: Understanding Core Updates & Search Intent by
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
6.8K views99 slides
How to have difficult conversations by
How to have difficult conversations How to have difficult conversations
How to have difficult conversations Rajiv Jayarajah, MAppComm, ACC
5.5K views19 slides
Introduction to Data Science by
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data ScienceChristy Abraham Joy
82.5K views51 slides
Time Management & Productivity - Best Practices by
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
169.8K views42 slides

Featured(20)

ChatGPT and the Future of Work - Clark Boyd by 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 Boyd27.1K views
Getting into the tech field. what next by Tessa Mero
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero6.4K views
Google's Just Not That Into You: Understanding Core Updates & Search Intent by Lily Ray
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
Lily Ray6.8K views
Time Management & Productivity - Best Practices by Vit Horky
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky169.8K views
The six step guide to practical project management by MindGenius
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius36.7K views
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright... by RachelPearson36
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...
RachelPearson3612.7K views
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present... by Applitools
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...
Applitools55.5K views
12 Ways to Increase Your Influence at Work by GetSmarter
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter401.7K views
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G... by DevGAMM Conference
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 Conference3.6K views
Barbie - Brand Strategy Presentation by Erica Santiago
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago25.1K views
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well by Saba Software
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software25.3K views
Introduction to C Programming Language by Simplilearn
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn8.4K views
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr... by Palo Alto Software
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
Palo Alto Software88.4K views
9 Tips for a Work-free Vacation by Weekdone.com
9 Tips for a Work-free Vacation9 Tips for a Work-free Vacation
9 Tips for a Work-free Vacation
Weekdone.com7.2K views
How to Map Your Future by SlideShop.com
How to Map Your FutureHow to Map Your Future
How to Map Your Future
SlideShop.com275.1K views

Rsqrd AI: Discovering Natural Bugs Using Adversarial Perturbations