Skip to content

Cookies

We use cookies to enhance your experience. Learn more

ResearchPublication

De-biasing is hard! On bias and the illusion of objectivity in NLP

Earlier work, a post of July 2021. It surveys how prejudicial bias gets into language models such as BERT, how researchers find it and remove it, and why the author holds that bias in NLP is systemic and reaches beyond numerical optimization.

A long charcoal strip of paper across pale gray paper, crossed at a right angle by a short one, and above it a row of nine small squares, red and teal in turn, all at the same height.

Where this comes from

This is a post on the Prosus AI Tech Blog, written by Deep Kayal and published on 7 July 2021, and put on Prosus’s own site the same day. It is an essay on bias in language models, built on published research and a few small tests of its own, and it is listed here as earlier published work from the blog. What follows is from the post.

What the post asks

In machine learning, bias first meant prior knowledge about a task, chosen with care and given to a model. Transfer learning took over that role, and with it came a prejudicial kind of bias, learned from the human preconceptions in the data. The post’s example is a BERT model trained on text in which words such as gay or Islam often appear in abusive comments: used to classify sentiment, it can call a harmless sentence with those words toxic, a false positive bias that falls on communities that are already marginalized. The post asks how such bias shows, how it is found and removed, and whether it can be removed at all.

How bias shows

Early work found it in word embeddings such as Word2Vec: Bolukbasi and colleagues used analogies between word vectors to show systematic associations between gender and occupation. BERT behaves the same way, and the post shows it in a few lines of code: asked to fill the masked word in sentences such as [MASK] is a babysitter, it gives strongly gendered answers. The effect carries over to the tasks built on these models.

  • Coreference resolution, which finds the words in a text that refer to the same person or thing, can fail to link a female pronoun to certain occupations.
  • Text generation: Sheng and colleagues found GPT-2 writing abusive language about Black men, gay people and women.
  • Toxicity detection: tried on statements that are not abusive at all, Google’s Perspective API marked some of them toxic. The post explains that such a model likely tied words about race or disability to toxicity in place of the real context.

Finding bias and removing it

One of the earliest tests is WEAT, the Word Embedding Association Test, which measures by the cosine similarity of their vectors how strongly a model ties target words, such as names, to attribute words, such as pleasant and unpleasant ones. Run on Word2Vec and GloVe, it found human biases throughout them.

Lu and colleagues remove gender bias from training data by counterfactual data augmentation, copying each example with a male pronoun into one with a female pronoun, which greatly reduced occupation bias. That means training again, which may be out of reach for a model as large as BERT. Liang and colleagues work after training, on the sentence representations a model gives.

  1. Choose the bias

    Gender bias, for example.

  2. Find its subspace

    Encode sentences with gendered pronouns from open datasets, run principal component analysis on their vectors, and keep the top components.

  3. Remove it

    Make the representation of each sentence of the downstream task orthogonal to those components.

After this, BERT’s representations of the words man and woman lie equally far from the words for occupations.

Are we really de-biasing?

The post doubts it. Blodgett and colleagues surveyed papers on bias in NLP and found their motivations vague and inconsistent, and nearly all of them tackle a narrow range of the sources of bias without measuring what their de-biasing does elsewhere. That can do harm, the post argues: protecting one group can shift bias onto another, or onto people in two groups at once.

Waseem and colleagues go further. The choice of dataset, of model and of each step of the work is subjective, and papers that treat de-biasing as an optimization problem take themselves to be objective while resting on the same choices. In the post’s words, “bias and subjectivity in ML are inescapable”.

Where the post looks next

The post holds that fixing bias in systems goes beyond numerical optimization, and follows Blodgett and colleagues in four directions.

  • How language relates to social hierarchies, and whether NLP systems ease, uphold or exaggerate them.
  • How changes in language reach the models: whatever the story, a phrase such as illegal immigrant ties the two words together, and would fairer written language fix the bias in models?
  • Saying plainly why a behavior called bias is harmful, in what ways and to whom.
  • How communities meet NLP systems and whether they resist them: a chatbot that women use less serves them worse, so they use it less still, and why they used it less to begin with is the thing to understand first.

The post closes that bias in NLP is systemic, more nuanced than it seems, and is to be met by moving beyond mathematical optimization.

The post

De-biasing is hard!Deep Kayal. Prosus AI Tech Blog, 2021

Author

  • Deep Kayal

References

  1. De-biasing is hard!Deep Kayal. Prosus AI Tech Blog, Medium, 7 July 2021
  2. De-biasing is hard!Prosus, 7 July 2021 (the Wayback Machine’s capture of 2 August 2021)

Keep reading

  • Publication

    One model for the whole home page

    A shopping app’s home page is filled by many recommenders, each tuned for its own slot. This model writes one page per person, per meal moment: the title, the subtitle and what to show. In a live test on one slot it brought 137% more orders from that list.

  • Publication

    New robots, old tricks: teaching robots to speak AI

    A post of November 2026 on a year of wiring Darwin, the Prosus humanoid robot. Five parts spoke five protocols, and the post asks what a robot should tell an AI agent about its actions before the agent can use it.

  • Method

    Meet the large commerce model

    Language models learn from text. Magnet Decision learns from what people search for, look at, buy and come back for. Here’s how it’s built.