Algorithm Bias
Fairness in natural language processing
Raphael Ottoni
<raphael@hekima.com.br>, <rapha@dcc.ufmg.br>
Summary
. Problem Introduction
. F.A.T
- Fairness
- Accountability
- Transparency
. Background on bias detection
. Current methods for Word Emb.
- WEAT
- Test Statistic
- Exemple of application
- B.E.A.T
Summary
Problem introduction
Machine Learning is Everywhere
Classification (hate speech)
Content Generation
Prediction
What we expect
What we expect
Machine Learning
Classifying
Clustering
Recommending
Curating
Simulating
?
XKCD (2017)
https://www.xkcd.com/1838/
Summary
Blind application of machine
learning algorithms may amplify
biases present in the data
BOLUKBASI ET AL. (2016)
Man is to computer programmer as woman is to homemaker?
debiasing word embeddings ‹
Huskies (Classification)
Google Home (Content Generation)
Predict Future Criminals (Prediction)
What we expect
Human(bias) and Algorithms
Google DeepMind
New York Times
GDPR’16
MAY
2018
Right to be Forgotten
MAY
2018
Right to Explanation
MAY
2018
What if

New research opportunities
F.A.T
Fairness
Neuralscience (definitions)
. Equity
. Fair Compensation For Effort
. Social Good
. Consequences for Acting
Unfairly
Accountability
Accountability
“The question of whether Machines Can
Think... is about as relevant as the question of
whether Submarines Can Swim.” ―Edsger Dijkstra
Accountability
De quem Ă© a culpa?
What we expect
Transparency
Transparency
Bias detection techniques ‹
NLP
𝚯Cognition Algorithmic
1) Word Testing
2) Implicit Association Test
Word Testing (Megasenha)
IAT ( classes lists)
.Amy
. Joan
. Lisa
. Sarah
. Diana
. Kate
. Ann
. Donna
IAT (attributes list)
.John
. Paul
. Mike
. Kevin
. Steve
. Greg
. Jeff
. Bill
Attribute list 1 Attribute list 2
Amy
IAT(Test 1 sample)
John
Amy
IAT (Test 2 sample)
John
IAT idea
. Difference between test 3 & 4
indicates implicit gender bias
𝚯
1) POS tagging, Lexicon
2) Word Embeddings
vector space
3) Test Statistics
POS / Semantic Parsing / Lexicon
VERB
She growled, clenching a hammer
PRP
} NNDT
11%
8%
23%


Strong
Arrogant
Afraid
Female
{intense, smash, intimidating 
}
{cocky, smirk, smug, rude 
}
{shriek, frightened, shiver 
}
35%
30%
7%


Male
POS / Semantic Parsing / Lexicon
Word Embedding
D2
Word Embedding D1
Dog
York
Cat
Yorkshire
England
Brazil
Wales
Fire
Water
Corgi
Word
England
Dp Dp+1 D
 Dk
York
Dog 0.3
-1.3
2.0
2.5
1.5
-0.3
0.1
1.1
1.3
-0.1
0.9
-0.4
Word
England
Dp Dp+1 D
 Dk
York
Dog 0.3
-1.3
2.0
2.5
1.5
-0.3
0.1
1.1
5.3
-0.1
0.9
-0.4
Word
England
Dp Dp+1 D
 Dk
York
Dog 0.3
-1.3
2.0
2.5
1.5
-0.3
0.1
1.1
5.3
-0.1
0.9
-0.4
Word Embedding (evaluation)
Man is to King, as woman is to ____
King(vec) - Man(vec) + Woman(vec) = Queen(vec)
Rio is to Brazil, as Paris is to ____
Rio(vec) - Brazil(vec) + Paris(vec) = France(vec)
Man is to King, as woman is to ____
King(vec) - Man(vec) + Woman(vec) = Queen(vec)
Man is to King, as woman is to ____
King(vec) - Man(vec) + Woman(vec) = Lioness(vec)
Word Embedding (evaluation)
Man is to King, as woman is to ____
King(vec) - Man(vec) + Woman(vec) = Queen(vec)
Man is to doctor, as woman is to ____
doctor(vec) - Man(vec) + Woman(vec) = Nurse(vec)
Word Embedding (bias)
Closest words to ‘Woman'
(Word2Vec)
Unbias
BOLUKBASI ET AL. (2016)
Man is to computer programmer as woman is to homemaker?
debiasing word embeddings ‹
Man is to computer programer, as woman is to ____
Computer_programmer(vec) - Man(vec) + Woman(vec) = Homemaker(vec)
Unbias
D2
D1
Doctor
Men
Woman
Nurse
Unbias
D2
D1
Doctor
Men
Woman
Unbias
D2
D1
Doctor
Men
Woman
Hater
Fragile
Strong
Bad
Smart
Smart
Unbias
➕
Word Embedding
Association Test
WEAT
𝚯
WEAT idea
=
Cultural biases are expressed in
people’s language
CALISKAN ET AL. (2017)
Semantics derived automatically from language corpora contain human-like biases
IAT/WEAT Findings
Effect Size
In statistics, an effect size is a quantitative measure of the
strength of a phenomenon. (e.g. Pearson’s correlation)
Cohen’s D
Spooled
Cohen's D Interpretation
0.01 very small
0.20 small
0.50 medium
0.80 large
1.20 very large
2.00 huge
Cohen’s D interpretation
Null Hypotesis testing
In statistical hypothesis testing, the alternative
hypothesis and the null hypothesis are the two rival
hypotheses which are compared by a statistical hypothesis
test.
IAT/WEAT Findings
Flowers/Insects IAT
Insects
Flowers
Attribute
Pleasant
{ant, moth, cockroach, wasp 
}
{aster, clover, marigold, azalea, violet 
}
{love, peace, heaven, pleasure, rainbow
}
Unpleasant {death, abuse, rotten, filth, ugly 
}
Class
Test statistic of null hypothesis
Classes
Attr
CALISKAN ET AL. (2017)
Semantics derived automatically from language corpora contain human-like biases
Hypotesis testing
CALISKAN ET AL. (2017)
Semantics derived automatically from language corpora contain human-like biases
Hypotesis testing XKCD (201?)
https://www.xkcd.com/1478/
CALISKAN ET AL. (2017)
Semantics derived automatically from language corpora contain human-like biases
P-Value / Cohen’s d
CALISKAN ET AL. (2017)
Semantics derived automatically from language corpora contain human-like biases
Dist1 Dist2
Flower / Insect
Example of Application
B.E.A.T
Hate Speech
Hate speech can then be deïŹned as the viliïŹcation of a
group’s Identity in order to oppress its members and deny
them equal rights.
Cherian ET AL. (2016)
Hate Spin: The Manufacture of Religious Offense and Its Threat to Democracy
Group Identity
Hate speech communicates extremely negative ideas about a
group, or a representative of that group, as deïŹned by
identity markers such as race, religion and sexual
orientation.
Cherian ET AL. (2016)
Hate Spin: The Manufacture of Religious Offense and Its Threat to Democracy
See Group language’s biases as
potentially offense-giving/taking
Relegion IAT
Islam
Christianity
Attribute
Good
{Mosque, Koran, Muslim, Islam}
{Church, Bible, Christian, Christianity}
{lovely, cheerful, friendship, glad, beautiful 
}
Bad {horrible, tragic, sadness, humiliate 
}
Class
Sexuality IAT
Hetero
Homo
Attribute
Good
{straight, heterosexual 
}
{gay, homosexual 
}
{lovely, cheerful, friend, smiling 
}
Bad {horrible, evil, scorn, awful 
}
Class
BEAT (bias embedding association test)
1.02
1.73


Trump
Sexuality bias
Religion bias
Cohen’s D
Identify offense-given and offense taking
Compare Languages with BEAT
1.02
1.73


Trump
Sexuality bias
Religion bias
Cohen’s D
0.35
0.62


English
Cohen’s D
Explore relations in vector space
Trump is to White Supremacists, as
Hillary is to ____
White_Supremacists(vec) - Trump(vec) + Hillary(vec) = ?(vec)
0.76
0.1


Real Word values into online world?
.Modern Liberalism
.Gender equality
.Freedom of religion


Democratic Party’s
BEAT
Sexuality bias
Religion bias
Algorithm Bias
Fairness in natural language processing
Raphael Ottoni
<raphael@hekima.com.br>, <rapha@dcc.ufmg.br>
IAT e WEAT usam cohen’d
A premissa para que o mapeamento IAT -> WEAT Ă© que o
tempo de resposta Ă© equivalente a similaridade de cosseno
no embedding
É Preciso provar que o WEAT pode ser usado em diferentes
contexto, além dos testados no paper origianl
Algorithm Bias
Fairness in natural language processing
Raphael Ottoni
<raphael@hekima.com.br>, <rapha@dcc.ufmg.br>
Of Language and Values
Characterizing political groups by its ideology biases

Algorithm Bias