liveBook · Manning

Bias

As explained in Natural Language Processing in Action, Second Edition

Word vector bias is systematic distortion in learned word associations caused by stereotypes and imbalances in the training corpus.

Word vector bias is systematic distortion in learned word associations caused by stereotypes and imbalances in the training corpus. Embeddings reflect the average meanings and associations present in the documents used to train them, rather than neutral definitions. section 6.4.5

The same word can acquire different associations from different corpora. A finance corpus may associate “bank” with deposits, while a geology corpus may associate it with rivers; a corpus shaped by gender stereotypes can encode those stereotypes as geometric relationships. section 6.4.5

Bias becomes visible when comparing distances or similarities between words:

  • A Google News word model places “woman” closer to “nurse” than “man,” with distances of 0.5586 and 0.7453 respectively. section 6.4.5
  • Such measurements expose associations learned from a biased world; they do not establish that the associations are fair, accurate, or desirable. section 6.4.5

Inspecting a gender association

Compare word-model distances directly: word_model.distance('man', 'nurse') returns 0.7453, while word_model.distance('woman', 'nurse') returns 0.5586. The unequal distances provide a concrete diagnostic for gender bias. section 6.4.5

>>> word_model.distance('man', 'nurse')
0.7453
>>> word_model.distance('woman', 'nurse')
0.5586

Inspect the runnable distance comparison between “man,” “woman,” and “nurse.” section 6.4.5

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Explains corpus dependence and demonstrates distance-based diagnosis, but stops short of specifying a mitigation algorithm.
Examples
Uses the “bank” domain contrast, Google News distances for “man,” “woman,” and “nurse,” and city-vector relationships.
What it assumes
Assumes familiarity with word relationships and NLP pipelines while explaining corpus effects and bias implications in accessible terms.
What you can do after
Diagnose with word-model distance comparisons and recognize how corpus composition can reproduce or amplify social stereotypes.
How it connects
Connects word embeddings with training corpora, semantic similarity, gender bias, coreference resolution, and natural-language understanding.

Also explained in

Compare how 28 books explain bias →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.