3
$\begingroup$

I'm reading about Word2Vec from this source: http://jalammar.github.io/illustrated-word2vec/. Below is the heatmap of the embeddings for various words. In the source, it's claimed that we can get an idea on what the different dimensions "mean" (their interpretation) based on their values for different words. For example, there's a column that's dark blue for every word except WATER, so that dimension may have something to do with the word representing a person. enter image description here

Secondly, there's a famous example that "king" - "man" + "woman" ~= "queen", where the word in quotation means the embedding of that word.

My questions are:

  1. I don't quite understand the mechanism as to how any dimension of an embedding goes on to have a tangible, interpretable meaning. I mean, the individual components of embedding vectors could've very well been completely arbitrary devoid of meaning, and the whole embedding approach still could've worked in that scenario, since we're interested in the vector as a whole. Is there an online explanation or a paper that I can look at to understand this phenomenon?
  2. Why does this addition/subtraction of vectors to give the relevant embedding vector for "queen" work so nicely? In one source, the explanation is given as follows:

This works because the way that the neural network ended up learning about related frequencies of terms ended up getting encoded into the W2V matrix. Analogous relationships like the differences in relative occurrences of Man and Woman end up matching the relative occurrences of King and Queen in certain ways that the W2V captures.

This seems like a broad, vague kind of an explanation. Is there any online resource or paper that explains (or better yet, proves) why this property of embedding vectors should hold?

$\endgroup$
13
  • 1
    $\begingroup$ Towards 2: kawine.github.io/blog/nlp/2019/06/21/word-analogies.html $\endgroup$ – Ben Reiniger Dec 24 '20 at 16:21
  • $\begingroup$ @BenReiniger: Thank you! That's super helpful $\endgroup$ – Shirish Kulhari Dec 24 '20 at 17:41
  • 1
    $\begingroup$ I suspect that 1 is mostly a coincidence. There are trillions of concepts you might think of as defining some linear scale, millions of which are partially captured by the embedding space, and some of those are bound to (completely by chance) lie principally along one of the dimensions of the embedding. (But that's all speculation, so I'll leave this as a comment.) $\endgroup$ – Ben Reiniger Dec 26 '20 at 4:41
  • $\begingroup$ @BenReiniger: Yeah there's a lot of follow-up questions one could ask related to 1. For example if we change the dimension from 300 to something else, would concepts be still captured in individual dimensions? I guess one could answer this through explicit experimentation if one has bandwidth $\endgroup$ – Shirish Kulhari Dec 26 '20 at 8:53
  • $\begingroup$ One possible explanation for 1. (useful for 2. as well) is that word2vec and similar tools extract the features through a process which checks inter-relations between words in a corpus (eg how many times this word is close to that word). But exactly these same inter-relations is what expresses meaning in natural language (eg natural language grammars). For example "water" would be distant on average from concepts/words such as "king" or "queen" and so on.. On the other hand "water" would be close on averege to "thirsty", "wet" and so on.. $\endgroup$ – Nikos M. Dec 26 '20 at 17:57
0
$\begingroup$

The dimensions for an embedding space are only be accidentally interpretable.

However, vectors through the space can be interpretable. That is why word analogies are possible in an embedding space . The addition / subtraction of word vectors describe another vector through the embedding space. For example, "king" - "man" + "woman" approximate the "queen" vector.

Words are consistently used in relationship to other words. Word embeddings can model these consistent relationship by finding which words co-occur together and projection the words into lower dimension space that retains the most common occurrences.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.