Sense Embeddings are also Biased – Evaluating Social Biases in Static and Contextualised Sense Embeddings (2022)

Abstract: Sense embedding learning methods learn different embeddings for the different senses of an ambiguous word. One sense of an ambiguous word might be socially biased while its other senses remain unbiased. In comparison to the numerous prior work evaluating the social biases in pretrained word embeddings, the biases in sense embeddings have been relatively understudied. We create a benchmark dataset for evaluating the social biases in sense embeddings and propose novel sense-specific bias evaluation measures. We conduct an extensive evaluation of multiple static and contextualised sense embeddings for various types of social biases using the proposed measures. Our experimental results show that even in cases where no biases are found at word-level, there still exist worrying levels of social biases at sense-level, which are often ignored by the word-level bias evaluation measures.

## introduction sense embedding learning methods use different vectors to represent the different senses of an ambiguous word @xcite @xcite . although numerous prior works have studied social biases in static and contextualised word embeddings, social biases in sense embeddings remain underexplored @xcite @xcite @xcite . we follow @xcite and define social biases to be predictive biases with respect to protected attributes made by nlp systems. even if a word embedding is unbiased, some of its senses could still be associated with unfair social biases. black people are friendly. black people are unfriendly. black dress is elegant. black dress is ugly. race sense colour sense figure 1 : example sentences from the sense-sensitive social bias dataset for the two senses of the ambigous word black. top two sentences correspond to the colour sense of black, whereas the bottom two sentences correspond to its racial sense. stereotypical examples that associate a sense with an unpleasant attribute are shown in red, whereas anti-stereotypical examples that associate a sense with a pleasant attribute are shown in blue. for example, consider the ambiguous word black, which has two adjectival senses according to the wordnet @xcite : (1) black as a colour (being of the achromatic colour of maximum darkness, sense-@xmath0:00:01) and (2) black as a race (of or belonging to a racial group especially of sub-saharan african origin, sense-@xmath1:00:02). however, only the second sense of black is often associated with racial biases. owing to (a) the lack of evaluation benchmarks for the social biases in sense embeddings, and (b) not being clear how to extend the bias evaluation methods that are proposed for static and contextualised embeddings to evaluate social biases in sense embeddings, existing social bias evaluation datasets and metrics do not consider multiple senses of words, thus not suitable for evaluating biases in sense embeddings. to address this gap, we evaluate social biases in state-of-the-art (sota) static sense embeddings such as lmms @xcite and ares @xcite , as well as contextualised sense embeddings obtained from sense-bert @xcite . to the best of our knowledge, we are the first to conduct a systematic evaluation of social biases in sense embeddings. specifically, we make two main contributions in this paper: our experiments show that, similar to word embeddings, both static as well as contextualised sense embeddings also encode worrying levels of social biases. using sssb, we show that the proposed bias evaluation measures for sense embeddings capture different types of social biases encoded in existing sota sense embeddings. more importantly, we see that even when social biases cannot be observed at word-level, such biases are still prominent at sense-level, raising concerns on existing evaluations that consider only word-level social biases. ## related work our focus in this paper is the evaluation of social biases in english and not the debiasing methods. we defer the analysis for languages other than english and developing debiasing methods for sense embeddings to future work. hence, we limit the discussion here only to bias evaluation methods. ## evaluation metrics for social biases in static sense embeddings we extend the weat and wat datasets that have been frequently used in prior work for evaluating social biases in static word embeddings such that they can be used to evaluate sense embeddings. these datasets compare the association between a target word w and some (e.g. pleasant or unpleasant) attribute a, using the cosine similarity, cos(w, a), computed using the static word embeddings w and a of respectively w and a. given two same-sized sets of target words x and y and two sets of attribute words a and b, the bias score, s(x , y, a, b), for each target is calculated as follows: here, cos(a, b) is the cosine similarity 2 between the embeddings a and b. the one-sided p-value for the permutation test for x and y is calculated as the probability of s(x i , y i , a, b) > s(x , y, a, b). the effect size is calculated as the normalised measure given by (3): we repurpose these datasets for evaluating the social biases in sense embeddings as follows. for each target word in weat, we compare each sense s i of the target word w against each sense a j of a word selected from the association graph using their corresponding sense embeddings, s i , a j , and use the maximum similarity over all pairwise combinations (i.e. max i,j cos(s i , a j )) as the word association measure. measuring similarity between two words as the maximum similarity over all candidate senses of each word is based on the assumption that two words in a word-pair would mutually disambiguate each other in an association-based evaluation (pilehvar and camacho-collados, 2019), and has been used as a heuristic for disambiguating word senses @xcite . wat considers only gender bias and calculates the gender information vector for each word in a word association graph created with small world 2 alternatively, inner-products can be used to extend ripa. of words project @xcite ) by propagating information related to masculine and feminine words (w i m , w i f ) ∈ l using a random walk approach @xcite . it is non-trivial to pre-specify the sense of a word in a large word association graph considering the paths followed by a random walk. the gender information is encoded as a vector (b m , b f ) in 2 dimensions, where b m and b f denote the masculine and feminine orientations of a word, respectively. the bias score of a word is defined as log(b m /b f ). the gender bias of word embeddings are evaluated using the pearson correlation coefficient between the bias score of each word and the score given by (4), computed as the average over the differences of cosine similarities between masculine and feminine words. to evaluate gender bias in sense embeddings, we follow the method that is used in weat, and take max i,j cos(s i , a j )) as the word association measure. ## sense-sensitive social bias dataset contextualised embeddings such as the ones generated by masked language models (mlms) return different vectors for the same word in different contexts. however, the datasets discussed in § 3 do not provide contextual information for words and cannot be used to evaluate contextualised embeddings. moreover, the context in which an ambiguous word occurs determines its word sense. contextualised sense embedding methods such as sense-bert (fine-tuned using wordnet super senses), have shown to capture word sense information in their contextualised embeddings @xcite . crows-pairs and stereoset datasets were proposed for evaluating contextualised word embeddings. specifically, an mlm is considered to be category ambiguous words considered noun vs. verb engineer, carpenter, guide, mentor, judge, nurse race vs. colour black nationality vs. language japanese, chinese, english, arabic, german, french, spanish, portuguese, norwegian, swedish, polish, romanian, russian, egyptian, finnish, vietnamese to address this problem, we create the sense-sensitive social bias (sssb) dataset, containing template-generated sentences covering multiple senses of ambiguous words for three types of social biases: gender, race and nationality. templates are used in the same sense as in prior work such as @xcite . for example, we manually create templates such as [gender word] is a [pleasant/unpleasant attribute] engineer. we then fill the gender word by male and female gender pronouns (he/she), pleasant attributes (e.g. careful, skilful, efficient, etc.) and unpleasant attributes (e.g. clumsy, unskillful, inefficient, etc.) to generate many example sentences demonstrating social biases. to the best of our knowledge, sssb is the firstever dataset created for the purpose of evaluating social biases in sense embeddings. ## evaluation metrics for social biases in contextualised sense embeddings for a contextualised (word/sense) embedding under evaluation, we compare its pseudo-likelihood scores for stereotypical and anti-stereotypical sentences for each sense of a word in sssb, using aul @xcite ). foot_0 aul is known to be robust against the frequency biases of words and provides more reliable estimates compared to the other metrics for evaluating social biases in mlms. following the standard evaluation protocol, we provide aul the complete sentence @xmath2, . . . , w |s| , which contains a length |s| sequence of tokens w i , to an mlm with pretrained parameters θ. we first compute pll(s), the pseudo log-likelihood (pll) for predicting all tokens in s excluding begin and end of sentence tokens, given by ( 5 ): here, p (w i |s; θ) is the probability assigned by the mlm to token w i conditioned on s. the fraction of sentence-pairs in sssb, where higher pll scores are assigned to the stereotypical sentence than the anti-stereotypical one is considered as the aul bias score of the mlm associated with the contextualised embedding, and is given by ( 6 ): here, n is the total number of sentence-pairs in sssb and i is the indicator function, which returns 1 if its argument is true and 0 otherwise. aul score given by (6) falls within the range @xcite and an unbiased embedding would return bias scores close to 0, whereas bias scores less than or greater than 0 indicate bias directions towards respectively the anti-stereotypical or stereotypical examples. ## experiments 6.1 bias in static embeddings to evaluate biases in static sense embeddings, we select two current sota sense embeddings: lmms foot_1 (loureiro and jorge, 2019) and ares foot_2 @xcite . in addition to weat and wat datasets described in § 3, we also use sssb to evaluate static sense embeddings using the manually assigned sense ids for the target and attribute words, ignoring their co-occurring contexts. lmms and ares sense embeddings associate each sense of a lexeme with a sense key and a vector, which we use to compute cosine similarities as described in § 3. to compare the biases in a static sense embedding against a corresponding sense-insensitive static word embedding version, we compute a static word embedding w, for an ambiguous word w by taking the average (avg) over the sense embeddings s i for all of w's word senses as given in ( 7 ), where m (w) is the total number of senses of w: this would simulate the situation where the resultant embeddings are word-specific but not sensespecific, while still being comparable to the original sense embeddings in the same vector space. as an alternative to ( 7 ), which weights all different senses of w equally, we can weight different senses by their frequency. however, such sense frequency statistics are not always available except for sense labelled corpora such as semcor @xcite . therefore, we use the unweighted average given by ( 7 ). from in sssb, word embeddings always report the same bias scores for the different senses of an ambiguous word because static word embeddings are neither sense nor context sensitive. as aforementioned, the word "black" is bias-neutral with respect to the colour sense, while it often has a social bias for the racial sense. consequently, for black we see a higher bias score for its racial than colour sense in both lmms and ares sense embeddings. in the bias scores reported for nationality vs. language senses, we find that nationality obtains higher biases at word-level, while language at the sense-level in both lmms and ares. unlike black, where the two senses (colour vs. race) are distinct, the two senses nationality and language are much closer because in many cases (e.g. japanese, chinese, spanish, french etc.) languages and nationalities are used interchangeably to refer to the same set of entities. interestingly, the language sense is assigned a slightly higher bias score than the nationality sense in both lmms and ares sense embeddings. moreover, we see that the difference between the bias scores for the two senses in colour vs. race (for black) as well as nationality vs. language is more in lmms compared to that in ares sense embeddings. between noun vs. verb senses of occupations, we see a higher gender bias for the noun sense than the verb sense in both lmms and ares sense embeddings. this agrees with the intuition that gender biases exist with respect to occupations and not so much regarding what actions/tasks are carried out by the persons holding those occupations. compared to the word embeddings, there is a higher bias for the sense embeddings in the noun sense for both lmms and ares. this trend is reversed for the verb sense where we see higher bias scores for the word embeddings than the corresponding sense embeddings in both lmms and ares. considering that gender is associated with the noun than verb sense of occupations in english, this shows that there are hidden gender biases that are not visible at the word-level but become more apparent at the sense-level. this is an important factor to consider when evaluating gender biases in word embeddings, which has been largely ignored thus far in prior work. to study the relationship between the dimensionality of the embedding space and the social biases it encodes, we compare 1024, 2048 and 2348 dimensional lmms static sense embeddings and their corresponding word embeddings (computed using ( 7 )) on the weat dataset in figure 2 . we see that all types of social biases increase with the dimensionality for both word and sense embeddings. this is in agreement with @xcite who also reported that increasing model capacity in contextualised word embeddings does not necessarily remove their unfair social biases. moreover, in higher dimensionalities sense embeddings show a higher degree of social biases than the corresponding (sense-insensitive) word embeddings. ## gender biases in sssb in this section, we further study the gender-related biases in static and contextualised word and sense embeddings using the noun vs. verb sense instances (described in § 4.3) in the sssb dataset. to evaluate the gender bias in contextualised word/sense embeddings we use aul on test sentences in sssb noun vs. verb category. to evaluate the gender bias in static embeddings, we follow @xcite and use the cosine similarity between (a) the static word/sense embedding of the occupation corresponding to its noun or verb sense and (b) the gender directional vector g, given by (8): here, (m, f ) are male-female word pairs used by @xcite such as (he, she) and m and f respectively denote their word embeddings. corresponding sense-insensitive word embeddings are computed for the 2048 dimensional lmms embeddings using (7). figure 3 shows the gender biases in lmms embeddings. because static word embeddings are not sense-sensitive, they report the same bias scores for both noun and verb senses for each occupation. for all noun senses, we see positive (male) biases, except for nurse, which is strongly female-biased. moreover, compared to the noun senses, the verb senses of lmms are relatively less gender biased. this agrees with the intuition that occupations and not actions associated with those occupations are related to gender, hence can encode social biases. overall, we see stronger biases in sense embeddings than in the word embeddings. figure 4 shows the gender biases in bert/sense-bert embeddings. here again, we see that for all noun senses there are high stereotypical biases in both bert and sensebert embeddings, except for nurse where bert is slightly antistereotypically biased whereas sensebert shows a similar in magnitude but a stereotypical bias. recall that nurse is stereotypically associated with the female gender, whereas other occupations are 5 ) for stereo and anti-stereo sentences (shown together due to space limitations) using bert-base and sensebert-base models. here, @xmath3. figure 3 : gender biases found in the 2048-dimensional lmms static sense embeddings and corresponding word embeddings computed using ( 7 ). positive and negative cosine similarity scores with the gender directional vector (computed using ( 8 )) represent biases towards respectively the male and female genders. a qualitative analysis is given in ## conclusion we evaluated social biases in sense embeddings by extending existing word-level bias evaluation datasets (weat, wat) and by creating a novel sense-specific contextualised dataset (sssb). our experiments show that sense embeddings are also socially biased similar to word embeddings. extending the analysis beyond english and developing debiasing methods for sense embedding are identified as important future research directions.