Unearthing Bias in our language
Sometimes models learn things that are a cause for concern especially when machine learning models are used to make decisions for humans. This time we shall use the Word2Vec All corpus and search for the word Engineer to see its nearest neighbours. The embedding projector also allows us to reorient the visualization in order to perform more sophisticated tests for these cases so we shall re-orient our results using the Custom Projections tab.
I fixed an axis that goes from man to woman so words closed to man lie towards left while words similar to woman will be found on the right. Let’s look at the results for our anchor word which is Engineer, given the above axis.
It appears that the word engineer is already closer to man than woman. The words closer to man are in orange and include
astronomer, physicist, mathematician while words like
dancer, songwriter, teacher appear closer to woman.
How about changing the anchor word to math? Are the results affected? Let’s see for ourselves:
We have words like
computational, geometry, arithmetic next to man, while the nearest neighbours to woman are
music, teaching, philosophy etc.
Imagine if a machine learning algorithm trained on this dataset is used to predict how good someone is at their job related to art or math? Also, what will happen if a company relies on such an algorithm to hire potential engineers? The model might mistakenly believe that gender affected how good a candidate they were and the resulting decisions will be gender biased.