Sub topic 18
Limitations: polysemy, unknown words and bias
Assume you know basic Python, vectors, cosine similarity, gradient descent, and tokenization. This chapter focuses on when word embeddings give misleading results and how to test or reduce those problems.
One vector can represent many meanings
A traditional word2vec or GloVe model assigns one vector to each word form. The word bank therefore has one vector whether it means a financial institution or the edge of a river. Its vector mixes the contexts of both meanings.
This problem is called polysemy. Polysemy is when one word has several related or unrelated meanings. Nearest-neighbour queries can reveal the mixture, but they cannot separate the meanings:
bankmay be nearloan,money,river, andshore.- A classifier may use the mixed representation when the sentence requires only one meaning.
- More training data does not solve the problem completely because the model still stores one vector.
Contextual models, such as transformer language models, produce a different vector for a word each time it appears. They can represent “river bank” and “bank account” differently. They cost more to train and run, so static embeddings can still be useful for small systems or simple features.
Unknown words and vocabulary limits
A fixed vocabulary creates an out-of-vocabulary (OOV) problem. An OOV word is a token absent from the model's vocabulary. A lookup table cannot return a vector for a new name, spelling, technical term, or inflected form.
Common strategies have different trade-offs:
| Strategy | Advantage | Limitation |
|---|---|---|
| Map to `<UNK>` | Simple and fast | All unknown words share one vector |
| Use subword vectors | Handles names and word parts | May produce poor vectors for unusual meanings |
| Retrain or update the model | Learns the new domain | Needs data and maintenance |
| Use a contextual model | Handles many forms and contexts | Requires more computation |
Subword methods represent a word using character n-grams or smaller pieces. For example, unhelpful may share pieces with helpful and unhappy. This helps with spelling variants, but shared pieces do not guarantee shared meaning.
Bias encoded in training data
Embeddings learn statistical regularities from their source text. If that text contains stereotypes, exclusion, or unequal coverage, the vectors can reproduce those patterns. An analogy such as “man is to programmer as woman is to ...” may expose a harmful association.
Bias can enter through:
- unequal representation of groups or languages;
- stereotypes repeated in news, books, or online text;
- occupational or demographic associations;
- historical facts that a downstream application treats as neutral.
Debiasing methods can reduce a measured association, but they do not remove all bias. They may also hide information that a legitimate task needs. Measure the model on representative data, inspect errors by subgroup, compare multiple embedding sources, and include human review for high-impact decisions.
Exercise
Why does adding more occurrences of “bank” not automatically solve polysemy in word2vec?
Show answer
Word2vec still assigns one vector to the word form “bank,” so additional occurrences improve the mixed representation rather than creating separate vectors for its meanings.