Word Embedding
- 21Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is 1-of-N encoding for representing words?
21 questions
- 1
What is 1-of-N encoding for representing words?
Model answer
1-of-N encoding represents each word as a vector of length equal to the vocabulary size, where only one dimension is 1 and the rest are 0.
Explanation
Each word gets a unique index, so the vector is sparse and carries no semantic information between words.
- 2
What is a major limitation of using 1-of-N encoding for word representation?
Model answer
It does not capture any semantic similarity between words; every word vector is orthogonal and independent.
Explanation
For example, 'cat' and 'dog' have no overlapping information in their 1-of-N vectors.
- 3
How does word class clustering attempt to improve on 1-of-N encoding?
Model answer
It groups similar words into classes and represents each word by its class label.
Explanation
Words like dog, cat, bird can be clustered as 'animal', but this loses relationships between classes (e.g., animals and actions).
- 4
What is the key limitation of word class representation?
Model answer
It cannot capture relationships between different classes, such as that animals can perform certain actions.
Explanation
Classes are discrete; there is no way to express that class 1 (animals) and class 2 (actions) are related.
- 5
What is word embedding and how does it differ from 1-of-N encoding?
Model answer
Word embedding projects each word into a dense, low-dimensional vector (e.g., 50-100 dimensions) where semantically similar words are close in the space.
Explanation
Unlike 1-of-N, word embedding captures semantic relationships through vector distances and directions.
- 6
Is word embedding a supervised or unsupervised learning problem?
Model answer
It is unsupervised because we only have input text and no predefined output vectors for each word.
Explanation
The model learns word vectors by predicting context from a large corpus without labeled data.
- 7
Why can't we use an auto-encoder for word embedding with 1-of-N input?
Model answer
Because 1-of-N vectors are independent and orthogonal; an auto-encoder would simply learn the identity, producing no informative reduction.
Explanation
Auto-encoder tries to reconstruct input, but since each word is already one-hot, the bottleneck would not capture semantic similarities.
- 8
Describe count-based methods for word embedding, and give an example.
Model answer
They use co-occurrence statistics (e.g., how often two words appear in the same document) and learn vectors such that inner product between vectors approximates log co-occurrence count. GloVe is a well-known count-based method.
Explanation
GloVe tries to satisfy V(wi)⋅V(wj)≈logNij, where Nij is co-occurrence count.
- 9
How do prediction-based word embedding methods work in principle?
Model answer
A neural network is trained to predict a target word given its context (e.g., previous words); the hidden layer weights are used as word vectors.
Explanation
By forcing the network to predict the next word, the hidden layer learns semantic representations because similar contexts lead to similar vectors.
- 10
What is CBOW (Continuous Bag of Words)?
Model answer
CBOW predicts the current word from the surrounding context words (e.g., wi−1 and wi+1).
Explanation
The model uses all context words together to predict the missing word, aggregating their vectors.
- 11
What is Skip-gram?
Model answer
Skip-gram predicts the surrounding context words from the current word (e.g., wi−1 and wi+1 given wi).
Explanation
The model takes the target word and tries to predict its neighbors, effectively learning word vectors that can predict context.
- 12
Why do prediction-based models usually use only one hidden layer (shallow network)?
Model answer
Because it reduces computational cost, allowing the model to be trained on very large datasets; also, the task itself does not require deep architectures to achieve good performance.
Explanation
Tomas Mikolov argued that shallow models are sufficient and more efficient for word embedding, enabling scaling to massive corpora.
- 13
In prediction-based models with multiple context words, why is weight tying used?
Model answer
To ensure that the same word gets the same embedding regardless of its position in the context, and to reduce the number of parameters.
Explanation
Without weight tying, a word at position i−2 would have different weights than at i−1, leading to different embeddings for the same word.
- 14
How is weight tying implemented during training?
Model answer
Initialize tied weights to the same values, then update each weight by subtracting the sum of gradients from all tied weights (e.g., wi−∂wi∂C−∂wj∂C).
Explanation
This ensures that the weights remain equal after each update.
- 15
What is the training objective for a prediction-based word embedding model?
Model answer
Minimize the cross-entropy between the network's output (probability distribution over the vocabulary) and the 1-of-N encoding of the target word.
Explanation
For each context-target pair, the correct target word is a one-hot vector; the network output should assign high probability to that word.
- 16
Give an example of a word analogy that can be solved using word vector arithmetic.
Model answer
V(Berlin)−V(Germany)+V(France)≈V(Paris).
Explanation
Word vectors capture relational similarities: the vector offset from a country to its capital is consistent across countries.
- 17
How can word vectors be used to answer analogy questions like 'Rome is to Italy as Berlin is to ?'
Model answer
Compute V(Berlin)−V(Rome)+V(Italy) and find the nearest word vector (Germany).
Explanation
The relationship (capital to country) is encoded as a constant vector difference.
- 18
Explain the concept of cross-lingual word embedding alignment.
Model answer
Train separate word embeddings for two languages, then learn a linear projection to map words with known translations to the same point, enabling zero-shot translation.
Explanation
Once aligned, a new word in one language can be projected and matched to its translation in the other language.
- 19
How can word embeddings be applied to image classification for unseen categories?
Model answer
Train a model to map images to the word vector space of category names; for a new image, its predicted vector is compared to known word vectors to find the closest category.
Explanation
This enables zero-shot learning: even if the model never saw 'cat' images during training, if it projects the image near the word vector 'cat', it can recognize it.
- 20
Why is bag-of-words insufficient for document embedding?
Model answer
Because it ignores word order, which can completely change meaning (e.g., 'white blood cells destroying an infection' vs. 'an infection destroying white blood cells').
Explanation
Bag-of-words treats both sentences as identical, but they have opposite meanings.
- 21
Name one unsupervised method for document embedding mentioned in the lecture.
Model answer
Auto-encoder on bag-of-words, though it has limitations; the lecture references several unsupervised approaches (without detailing them).
Explanation
Auto-encoder can learn a compressed representation but loses word order information.

Ask anything
We've read this whole study set, so questions about it get the best answers.