Debiasing knowledge graph embeddings (2020)

Abstract: It has been shown that knowledge graph embeddings encode potentially harmful social biases, such as the information that women are more likely to be nurses, and men more likely to be bankers. As graph embeddings begin to be used more widely in NLP pipelines, there is a need to develop training methods which remove such biases. Previous approaches to this problem both significantly increase the training time, by a factor of eight or more, and decrease the accuracy of the model substantially. We present a novel approach, in which all embeddings are trained to be neutral to sensitive attributes such as gender by default using an adversarial loss. We then add sensitive attributes back on in whitelisted cases. Training time only marginally increases over a baseline model, and the debiased embeddings perform almost as accurately in the triple prediction task as their non-debiased counterparts.

## introduction and related literature learning embeddings of knowledge graph entities and relations is becoming an increasingly common first step in utilizing knowledge graphs for a range of graph and nlp tasks, from missing link prediction, @xcite , to more recent methods integrating learned embeddings into language models, @xcite @xcite . in @xcite , it is shown that knowledge graph embeddings encode similar social biases to those observed in word embeddings ( @xcite @xcite ), such as the information that men are more likely to be bankers and women more likely to be nurses. this is an unsurprising finding, given that the distribution of entities in knowledge graphs is highly skewed towards historically privileged * work completed whilst at amazon members of society; there are many more male bankers in wikidata than female bankers. such biases are potentially harmful as they can propagate to downstream tasks. if graph embeddings are used for knowledge base completion, the model would be less likely to be able to predict a female bankers profession than an equivalent male banker's profession. alternatively, if graph embeddings are used as input to a transformer @xcite encoder as in @xcite , the same effects on coreference resolution, entity linking and other downstream task as have been observed with word embeddings will re-occur. in light of this, it is important to develop methods which enable debiasing of the embeddings with respect to user-defined sensitive attributes (e.g. gender). a potential method for debiasing was presented in @xcite , in which the authors train a set of filter neural networks to remove sensitive information from embeddings. although the method proves effective on the movie-lens1m dataset, it results in a significant drop in performance as measured on the triple prediction task for the fb15k dataset, and proves ineffective in removing more than one source of bias concurrently. in addition, our benchmarks indicate the extra computation needed to train the neural network filters increase overall training time by a factor of 8 or more, making the approach unsuitable for large knowledge graphs. we present an alternative approach, which trains all embeddings to be neutral with respect to sensitive attributes such as gender by default using an adversarial loss. we then allow the user to add sensitive information back in for whitelisted cases. for example, we may allow the model to use nationality information when predicting the languages someone speaks. we evaluate the model on fb15k, fb3m and wikidata, and show that it is significantly faster than previous approaches, less disrup-tive to the model accuracy on the original triple prediction task, and effective at producing embeddings which are neutral with respect to user-defined sensitive attributes (we present two measures to evaluate the level of sensitive information which remains in the trained embeddings). ## knowledge graph embeddings a knowledge graph is a set of facts in triple form, where a triple consists of two entities and a relation, e.g. @xcite . the aim of graph embedding methods is to use these triples to learn a continuous vector representation of dimension d of all entities and relations. the standard approach defines a score function, g(.), which transforms a triple in vector form to a scalar score denoting how likely this triple is to be correct. for example the function transformation functions proposed in the literature include transe @xcite , com-plex @xcite and rotate @xcite . in this paper we use the transe function and the dot product similarity, though the debiasing methods are applicable to any choice: ## debiasing motivation to motivate our work, we begin by introducing how biases may be encoded into the embeddings of human entities. first, we define a set of "sensitive attributes"; human characteristics which may be associated with unwanted stereotypes. in this paper we define gender, ethnicity, religion and nationality as "sensitive attributes", though any choice is possible and we do not claim this list to be exhaustive/correct. for each knowledge graph, there will be a set of relations which provide these attributes (e.g. for freebase the relation "/people/person/gender" provides a person's gender), which we term "sensitive relations". when embeddings are trained with positive triples such as (person1, gender, male), the embedding of person1 will be updated with information related to the rhs entity "male" in order to score this triple higher than negative triples, including (person1, gender, female). this in itself is uncontroversial -we do not mind if the model is able to predict a person's gender. however, as gender information is now encoded in the embedding of person1, the model is also able to use this information when scoring other triples, such as (person1, profession, banker). @xcite shows that as knowledge graphs such as wikidata and freebase include, for example, many more male bankers than female bankers, the model learns to use the encoded gender information when predicting the likelihood a person is a banker, alongside other harmful stereotypes. as knowledge graphs are based in reality, it is not easy to mitigate this effect by manually balancing the graph foot_1 . instead we aim to train all human's embeddings to be neutral with respect to sensitive attributes. that is, we wish to make it impossible to predict, for example, a person's gender, from their embedding. as a result, predictions made using these embeddings (such as about profession) will also be independent of these attributes. note this imposes the constraint that we can no longer predict any unknown gender, religion, ethnicity or nationality of a human. foot_2 4 debiasing architecture ## results we present results from three perspectives: speed (training time), accuracy (ability to predict correct triples given the embeddings), and debiasing (how much sensitive information remains in the trained embeddings). ## summary we have presented a novel method for debiasing knowledge graph embeddings, which is both significantly faster (allowing training on large knowledge graphs such as wikidata in realistic timeframes) and less disruptive to accuracy than previous approaches. we demonstrated that the approach is also more effective in removing sensitive information from trained embeddings than previous methods, and through attribute vectors, give the user the flexibility to allow sensitive information to be used in predictions when desired.