Embedding Bias Analysis
Description
Embedding bias analysis tests whether the numerical representations a model uses for words, images or documents link social groups to stereotyped attributes. An embedding places each item at a point in a many-dimensional space so that similar items sit close together. The best-known test, the Word Embedding Association Test (Caliskan et al., 2017), compares how close two sets of target words, such as engineering and nursing occupations, sit to two sets of attribute words, such as male and female terms, and reports an effect size and a significance level. Other analyses project embeddings onto a gender or ethnicity direction, or cluster them to see whether groups separate. The scores describe the representation itself, and any link to bias in an application built on it has to be tested separately.
Example Use Cases
Fairness
A team building a CV-screening tool must choose between two pretrained word embedding sets. It runs association tests on each, comparing how close male and female terms sit to career and family words, and drops or mitigates the set with the larger stereotyped association before building on it.
Analysing clinical note embeddings in a medical diagnosis support system to detect whether disease associations cluster along demographic lines (for example, certain conditions being systematically closer to particular age or ethnic groups in the embedding space), which could lead to biased treatment recommendations.
Auditing loan application embeddings to detect whether protected characteristics (ethnicity, gender, age) cluster near creditworthiness concepts in ways that could enable indirect discrimination in lending decisions.
Limitations
- Bias found in an embedding space does not reliably predict bias in the systems built on it. Goldfarb-Tarrant et al. (2021) found no consistent correlation between association-test scores and gaps between groups in downstream tasks, so a clean or a biased result here needs a separate test on the application itself.
- Results depend on the word or sentence lists chosen to represent each group and attribute. Swapping one published list of pleasant words for another moved the effect size in the original study from 1.50 to 1.28, so a single list can overstate or understate bias, and lists written in one culture or language may not transfer.
- A passing score does not show that bias is absent. Tests and projections look only for the pattern they are built to find, and Gonen and Goldberg (2019) showed that gender information removed by projection could still be recovered from the distances between words.
- There is no agreed threshold for an acceptable association. An effect size describes how strongly two groups of terms differ in closeness, not how much harm follows, so what counts as a pass depends on the application and has to be set and justified by the team.
- Needs the embedding vectors themselves, so it cannot be run on a system that exposes only final decisions or text. Pretrained vectors can be tested without the training data, as the original study did with published GloVe vectors.
Resources
Research Papers
Semantics derived automatically from language corpora contain human-like biases
Machines learn what people know implicitly AlphaGo has demonstrated that a machine can learn how to do things that people spend many years of concentrated study learning, and it can rapidly learn how to do them better than any human can. Caliskan et al. now show that machines can learn word associations from written texts and that these associations mirror those learned by humans, as measured by the Implicit Association Test (IAT) (see the Perspective by Greenwald). Why does this matter? Because the IAT has predictive value in uncovering the association between concepts, such as pleasantness and flowers or unpleasantness and insects. It can also tease out attitudes and beliefs—for example, associations between female names and family or male names and career. Such biases may not be expressed explicitly, yet they can prove influential in behavior. Science , this issue p. 183 ; see also p. 133
Software Packages
WEFE: The Word Embeddings Fairness Evaluation Framework
WEFE: The Word Embeddings Fairness Evaluation Framework. WEFE is a framework that standardizes the bias measurement and mitigation in Word Embeddings models. Please feel welcome to open an issue in case you have any questions or a pull request if you want to contribute to the project!