Word Embeddings Explained
Hmm. There was some discussion on the chatbot thread about the use of models of reality in language processing, and that looks like the best way to understand this idea.<p>&gt; The easiest you can do is to represent words as one-hot vectors: for the i-th word in the vocabulary, the vector has 1 on the i-th dimension and 0 on the rest. In Machine Learning, this is the most simple way to represent categorical features.<p>&gt; You probably can guess why one-hot vectors are not the best way to represent words. One of the problems is that for large vocabularies, these vectors will be very long: vector dimensionality is equal to the vocabulary size.<p>&gt; What is really important, is that these vectors know nothing about the words they represent. For example, one-hot vectors &quot;think&quot; that cat is as close to dog as it is to table! We can say that one-hot vectors do not capture meaning.<p>Well, the obvious improvement to this would be to use numeric identifiers rather than implicit numeric identifiers where you derive the number from the position of the only set bit in a very long bitstring. That approach is considered and rejected:<p>&gt; we can easily understand the text &quot;I saw a cat&quot;, but <i>our models can not - they need vectors of features</i>. [my emphasis]<p>but I would suggest that what this means is that the whole approach to model design is flawed. Get a model that can handle opaque identifiers on their own terms.<p>However, the approach described here has some valuable things to say about modeling the world, even if it pretends that what it&#x27;s really modeling are words.<p>The little slideshow working through an example ends up undermining the theory that it means to support. The examples are carefully chosen to suggest that the approach has much more validity than it really does. But if we add &quot;syrup&quot; to the list of words to which &quot;tezgüino&quot; is being compared, we immediately see that it satisfies conditions (1), (2), and (4), but not (3). This puts it on an equal footing with &quot;wine&quot;, which satisfies conditions (1), (2), and (3), but not (4). The problem is that tezgüino, a grain alcohol, is much more similar to wine, a fruit alcohol, than it is to corn syrup. We shouldn&#x27;t be calling this a tossup.<p>So we&#x27;ve highlighted a couple of problems:<p>- Condition (2) is worthless. &quot;Everybody likes ____&quot; can be applied to any noun phrase. This yields exactly zero information about the semantics of the phrase. By including it as 1&#x2F;4 of our test battery, we&#x27;re making ourselves stupider, seeing similarities and dissimilarities that aren&#x27;t there.<p>- Condition (3), which tells us that something is alcoholic, is much more valuable than condition (1), which tells us that something is a liquid, which is in turn more valuable than condition (4), which tells us that something is derived from corn. It makes no sense to weight these equally.<p>This is the problem in the distributional hypothesis as described: similarity of rows in the table doesn&#x27;t lead to any useful inferences, because which rows are similar to which other rows is subject to too much discretion on the part of the person who assembles the model. The conditions being checked, considered as a set, <i>are</i> our model of reality, and we need to be careful what that looks like. In this example, we have a very badly designed model (which more or less defines liquids, alcohol, and corn products, plus making a semantically-irrelevant grammatical distinction) which has to be saved by a very carefully chosen set of words being modeled. (Also, the example claims that it is more incorrect to say &quot;everyone likes motor oil&quot; than it is to say &quot;everyone likes wine&quot;. This is false.)<p>The post goes on to discuss how we can derive a model of reality automatically from a textual corpus, and I think this approach is a big problem in language processing today. You need the model of reality to exist independently, and then you can hook up a model of language to the model of reality. Without an independent model of reality, you&#x27;ll always be limited to language models that can produce and understand grammatical sentences at the same level as someone who is severely mentally retarded. (In fact, there is a mental disorder of exactly this kind: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Receptive_aphasia" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Receptive_aphasia</a> .) Reality exists outside of language, and language refers to it.<p>Reading this post has actually significantly lowered my opinion of vector representations of words, which I previously knew essentially nothing about. I&#x27;ve seen people raving about how cool it is that &quot;king&quot; - [male] + [female] is &quot;queen&quot;, but again that just highlights that the vector representation is a shoddy approximation of the model you want. What&#x27;s &quot;king&quot; if you subtract [male] without simultaneously adding [female]? Why does the model even consider that a possibility? In a more accurate model, &quot;king&quot; (along with many other words) has a gender attribute, and the possible values of the gender attribute are [male] and [female], and &quot;king&quot; requires the [male] value.