# A Survey on Bias in Deep NLP
## 2 Defining Bias
### A Reflection on Bias in Language Models  
A language model (LM) estimates the probability of a sequence of words \(P(w_{1},...,w_{m})\). This allows for, given a sequence of words, estimating the next most probable word. The machinery behind the learning of model parameters can be used for solving many different tasks, like machine translation, text generation, text classification or token labeling (as for named entity recognition), among others [23]. Bias is present in language models as it is present in humans. Bias is intrinsic to human language, and it is not always source of unfairness. A car full of breakdowns is prone to accidents; fans of sci-fi movies are willing to watch similar movies; a patient with a chronic disease could have more risk of worsening, and so on. What we mark as \"unfair\" is established at a high semantic level. Remember that bias is not about prediction error, it is about skewed behavior regarding semantic expectations.  
Definition 1: The stereotyping bias in a language model is the undesired variation of the probability distribution of certain words in that language model according to certain prior words in a given domain.  
Those prior words are terms that can be linked to a protected attribute. Staying within the \"gender\" domain, those terms could be _actress_, _woman_, _girl_, etc. That is, in a language model, we expect the distribution of probabilities after word _woman_ to be equal (or very close) to that of the word _man_ for certain words, like those related to professional skills. Both, _man_ and _woman_ are certain words in the _gender_ domain (the protected attribute). It raises the problem of defining precisely the domain and those expected \"certain\" words. Following this example, the words within the gender domain would be split into two different classes where _stereotypes_ are willing to occur, one class for men (actor, waiter...) and another class for women (actress, waitress...). Then, words regarding, in this case, attributes on professional skills (intelligence, efficiency, cleanness, creativity...) could be used to analyzed how they appear over the different probability distributions associated to each class, that is, when words in the domain are present, as priors of the distributions. Therefore, we could identify that the probability of the word \"creativity\" in the presence of a man is different from that of a woman.  
This language modeling-based approach to the bias phenomena makes clear that bias is not a fault of the language model by itself, it is just the effect of the data from which this model was generated and of the desired behavior of the model at semantic level. Thus, is up to the language engineer to decide which domains and which expected distributions must be monitored or, eventually, corrected. To that end, stereotyped concepts must be identified within the domain and related attributes or concepts biased by those stereotypes must be selected. To overcome a clean definition of the bias problem, we propose an ontology-based approach, as the bias problem is firstly identified at a semantic level and, later on, treated at model-parameter level.