On the Interpretability and Significance of Bias Metrics in Texts: a PMI -based Approach (2023)

Abstract: In recent years, word embeddings have been widely used to measure biases in texts. Even if they have proven to be effective in detecting a wide variety of biases, metrics based on word embeddings lack transparency and interpretability. We analyze an alternative PMI-based metric to quantify biases in texts. It can be expressed as a function of conditional probabilities, which provides a simple interpretation in terms of word co-occurrences. We also prove that it can be approximated by an odds ratio, which allows estimating confidence intervals and statistical significance of textual biases. This approach produces similar results to metrics based on word embeddings when capturing gender gaps of the real world embedded in large corpora.

## introduction word embedding-based approaches have been used for detecting and quantifying gender, ethnic, racial, and other stereotypes present in corpora. while some research has focused on investigating biases by training embeddings on a specific corpus of interest @xcite @xcite , others have employed pretrained word embeddings to assess potential biases inherent in the training corpus @xcite @xcite . though not as popular, pointwise mutual information (pmi) is a measure of word similarity which has also been used to study biases @xcite @xcite . however, the statistical properties and advantages of this measure as compared to the widely used word embeddings have not been studied yet. in this article we study a pmi-based metric to measure bias in corpora and explain its statistical and interpretability benefits, which have been overlooked until now. our contributions are as follows: scope: the detection and mitigation of bias in models is a research topic that is beyond the scope of this paper. our paper's contribution focuses on the measurement of bias in raw corpora (not models), which is a relevant task in computational social science. ## background consider two sets of context words a and b, and a set of target words c. textual bias measures quantify how much more the words of c are associated with the words of a than with those of b. most metrics can be expressed as a difference between the similarities between a and c, on the one hand, and b and c, on the other: for instance, to estimate the female vs. male gender bias of occupations, context words are often gendered pronouns or nouns, e.g., @xmath0, her, woman,..} and @xmath1, him, man,...}; whereas c is usually considered one word at a time, estimating for each specific job (nurse, doctor, engineer, etc.) the relative association to a and b. one particularly popular metric which uses word embeddings (we) is that of @xcite : permutations tests that shuffle context words have been used to calculate the statistical significance of bias we @xcite . these tests permute the words from a and b repeatedly and compute the bias metric in each iteration to simulate a null distribution of bias. the two-tailed p-value is calculated as the fraction of times the absolute value of bias from the null distribution is equal to or greater than the one observed @xcite . with a similar re-sampling approach, bootstrap can also be performed @xcite . the bootstrap distribution is obtained by calculating the bias metric over many bootstrap samples from a and b, sampled separately for each group. the standard error of bias is then estimated as the sample standard deviation of the bootstrap distribution, and the quantiles of the distribution are used to obtain percentile confidence intervals @xcite . ## bias measurement with pmi here we introduce a bias metric that follows equation 1 but uses pointwise mutual information (pmi) @xcite as a measure of word similarity: bias @xmath2, c) -pmi(b, c) (3) pmi measures the first-order association between two lists of words x and y : ## experiments to compare bias pmi with bias we we replicate three experiments that compare the gender biases measured in texts with the ones from other datasets: details about these datasets are in appendix c. we train glove, sgns and pmi on two corpora: the 2014 english wikipedia and english subtitles from opensubtitles @xcite . we pre-process both corpora by converting all text to lowercase, removing non alpha-numeric symbols and applying sentence splitting, so that one sentence equates to one document. after preprocessing, the wikipedia corpus is made up of 1.2 billion tokens and 53.9 million documents, whereas the opensubtitles corpus contains 2.4 billion tokens and 447.9 million documents. refer to appendix d for additional details about each corpus and to appendix e for implementation details. for each of the three settings, we assess the correlation between the dataset's female metric and the female bias as measured by pmi (equation 5), and sgns and glove (equation 2). female bias refers to the bias metrics where a and b represent lists of female and male words, respectively. 2 positive values imply that the target word is more associated with female terms than with male ones. we measure correlation with pearson's r. we also compute a weighted pearson's r, which takes into account the standard error of each bias estimate and reduces the influence of noisy estimates on the correlation. finally, for each word in each experiment we compute confidence intervals and p-values for the null hypothesis of absence of bias. 3 the aim of these experiments is not to find which method produces greater correlations in each task; it is rather to check whether bias pmi produces similar results to the widely used bias we . if it does, it means our metric can extract trends from large corpora that correlate with gender stereotypes at least as well as embedding-based metrics can. all in all, bias pmi and bias we yield comparable results in these settings. there is no single method which consistently has the largest or lowest correlations. weights tend to either increase the correlation considerably or to make it slightly weaker. this implies that in these experiments, noisy textual bias estimates usually agree less with the gender bias in the validation datasets. however, this does not mean that for each individual bias estimate the standard errors of each method are mutually interchangeable or equally useful (see section 6.2). in figure 1 we compare the p-values of the permutation test of bias we with sgns, with the pvalues of the log odds ratio test of bias pmi for the names-gender test conducted in wikipedia. a benjamini-hochberg correction was applied to the p-values obtained by both methods to account for multiple comparisons @xcite . appendix f.2 shows this example is consistent with the rest of the experiments. in this example, only the word with the highest bias we is significantly different from zero at a 0.10 significance level. in contrast, most words have a bias pmi significantly different from zero, with the exception of some points with bias values close to zero. this is because the procedures that compute p-values for each type of metric capture essentially different types of variability (see section 6.2). ## conclusion we presented a pmi-based metric to quantify biases in texts, which (a) allows for simple and computationally inexpensive statistical inference, (b) has a simple interpretation in terms of word cooccurrences, and (c) is explicit and transparent in the associations that it is quantifying, since it captures exclusively first-order co-occurrences. our method produces similar results to the glove-based and sgns-based metrics in experiments which compare gender biases measured in large corpora to the gender gaps of independent empirical data.