TransWikia.com

Word2Vec: Why do some dimensions of an embedding have an interpretation, and why does addition/subtraction of embedding vectors work?

Data Science Asked by Shirish Kulhari on April 9, 2021

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?

One Answer

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.

Answered by Brian Spiering on April 9, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP