Live data from Hacker News

Show HN: Semantic Calculator (king-man+woman=?)

calc.datova.ai

111–120 of 179 posts

Re: Show HN: Semantic Calculator (king-man+woman=?)

#111
post #64

data + plural = number data - plural = research king - crown = (didn't work... crown gets circled in red) king - princess = emperor king - queen = kingdom queen - king = worker king + queen = queen + king = kingdom boy + age = (didn't work... boy gets circled in red) man - age = woman woman - age = newswoman woman + age = adult female body (tied with man) girl + age = female child girl + old = female child The other…

For fun, I pasted these into ChatGPT o4-mini-high and asked it for an opinion: data + plural = datasets data - plural = datum king - crown = ruler king - princess = man king - queen = prince queen - king = woman king + queen = royalty boy + age = man man - age = boy woman - age = girl woman + age = elderly woman girl + age = woman girl + old = grandmother The results are surprisingly good, I don't think I could've do…

  > The results are surprisingly good, I don't think I could've done better as a human
I'm actually surprised that the performance is so poor and would expect a human to do much better. The GPT model has embedding PLUS a whole transformer model that can untangle the embedded structure.

To clarify some of the issues:

  data is both singular and plural, being a mass noun[0,1]. Datum is something you'll find in the dictionary, but not common in use[2]. The dictionary lags actual definitions. I mean words only mean what we collectively agree they mean (dictionary definitely helps with that but we also invent words all the time -- i.e. slang). I see how this one could trick up a human, feeling the need to change the output and would likely consult a dictionary but I don't think that's a fair comparison here as LLMs don't have these same biases.

  King - crown really seems like it should be something like "man" or "person". The crown is the manifestation of the ruling power. We still use phrases like "heavy is the head that wears the crown" in reference to general leaders, not just monarchs.

  king - princess I honestly don't know what to expect. Man is technically gender neutral so I'll take this one.

  king - queen I would expect similar outputs to the previous one. Don't quite agree here.

  queen - king I get why is removing royalty but given the previous (two) results I think is showing a weird gender bias. Remember that queen is something like (woman + crown) and king is akin to (man + crown). So subtracting should be woman - man. 

  The others I agree with. These were actually done because I was quite surprised at the results and was thinking about the aforementioned gender bias.

  > But keep in mind that this doesn't do embedding math like OP!
I think you are misunderstanding the architecture of these models. The embedding sub-network is the translation of text to numeric tokens. You'll find mention of the embedding sub-networks in both the GPT3[3] and GPT4 papers. Though they are given lower importance than other works. While much smaller than the main network, don't forget that embedding networks are still quite large. For the smaller models they constitute a significant part of the total parameter count[4]

After the embedding sub-network is your main transformer network. The purpose of this network is to perform embedding math! It is just that the goal is to do significantly more complicated math. Remember, these are learnable mappings (see Optimal Transport). We're just breaking it down into their two main intermediate mappings. But the embeddings still end up being a bottleneck. It is your literal gateway from words to numbers.

[0] https://en.wikipedia.org/wiki/Mass_noun

[1] https://www.merriam-webster.com/dictionary/data

[2] https://www.sciotoanalysis.com/news/2023/1/18/this-data-or-t...

[3] https://arxiv.org/abs/2005.14165

[4] https://arxiv.org/abs/2303.08774

[4] https://www.lesswrong.com/posts/3duR8CrvcHywrnhLo/how-does-g...

Re: Show HN: Semantic Calculator (king-man+woman=?)

#112

Earlier quoted context omitted.

This is an LLM approximating a semantic calculator, based solely on trained-in knowledge of what that is and probably a good amount of sample output, yet somehow beating the results of a "real" semantic calculator. That's crazy! The more I think about it the less surprised I am, but my initial thoughts were quite simply "now way" - surely an approximation of an NLP model made by another NLP model can't beat the origi…

This is basically the whole idea behind the transformer. Attention is much more powerful than embedding alone.

The transformers are initialized by embedding models...

Your embedding model is literally the translation layer converting the text to numbers. The transformers are the main processing unit of the embeddings. You can even see some self-reflection in the model as the transformer is composed of attention and a MLP sub-network. The attention mechanism generates the interrelational dependence of the data and the MLP projects up into a higher dimension before coming down so that this can untangle these relationships. But the idea is that you just repeat this process over and over. The attention mechanism has the benefit over CNN models because it has a larger receptive field, so can better process long range relationships (long range being across the input data) where CNNs bias for local relationships.

Re: Show HN: Semantic Calculator (king-man+woman=?)

#113

> king-man+woman=queen Is the famous example everyone uses when talking about word vectors, but is it actually just very cherry picked? I.e. are there a great number of other "meaningful" examples like this, or actually the majority of the time you end up with some kind of vaguely tangentially related word when adding and subtracting word vectors. (Which seems to be what this tool is helping to illustrate, having bri…

Well when it works out it is quite satisfying India - Asia + Europe = Italy Japan - Asia + Europe = Netherlands China - Asia + Europe = Soviet-Union Russia - Asia + Europe = European Russia calculation + machine = computer

democracy - vote = progressivism

I'll have to mediate on that.

Re: Show HN: Semantic Calculator (king-man+woman=?)

#116
post #64

Earlier quoted context omitted.

For fun, I pasted these into ChatGPT o4-mini-high and asked it for an opinion: data + plural = datasets data - plural = datum king - crown = ruler king - princess = man king - queen = prince queen - king = woman king + queen = royalty boy + age = man man - age = boy woman - age = girl woman + age = elderly woman girl + age = woman girl + old = grandmother The results are surprisingly good, I don't think I could've do…

> The results are surprisingly good, I don't think I could've done better as a human I'm actually surprised that the performance is so poor and would expect a human to do much better. The GPT model has embedding PLUS a whole transformer model that can untangle the embedded structure. To clarify some of the issues: data is both singular and plural, being a mass noun[0,1]. Datum is something you'll find in the dictiona…

You are being unnecessarily cynical. These are all subjective. I thought "datum" and "datasets" was quite clever, and while I would've chosen "man" for "king - crown" myself, I actually find "ruler" a better solution after seeing it. But each to their own.

The rant about network architecture misses my point, which is that an LLM does not just do a linear transformation and a similarity search. Sure, in the most abstract sense it still just computes an output embedding from two input embeddings, but only in a very distant, pedantic way. (Actually, to be VERY pedantic, that would not even be true, because ChatGPT's tokenizer embeds tokens, not words. The in- and output of the model is more than just the semantic embedding of words; using two different but semantically equivalent words may result in different outputs with a transformer LLM, but not in a word semantics model.)

I just thought it was cool that ChatGPT is so good at it.

Re: Show HN: Semantic Calculator (king-man+woman=?)

#117
post #79
post #64

Earlier quoted context omitted.

For fun, I pasted these into ChatGPT o4-mini-high and asked it for an opinion: data + plural = datasets data - plural = datum king - crown = ruler king - princess = man king - queen = prince queen - king = woman king + queen = royalty boy + age = man man - age = boy woman - age = girl woman + age = elderly woman girl + age = woman girl + old = grandmother The results are surprisingly good, I don't think I could've do…

I hate to be pedantic, but the llm is definitely doing embedding math. In fact that’s all it does.

Sure! Although I think we both agree that the way those embeddings are transformed is significantly different ;)

(what I meant to say is that it doesn't do embedding math "LIKE" the OP — not that it doesn't do embedding math at all.)

Re: Show HN: Semantic Calculator (king-man+woman=?)

#119
post #86

Here's a challenge: find something to subtract from "hammer" which does not result in a word that has "gun" as a substring. I've been unsuccessful so far.

The word "gun" itself seems to work. Package this as a game and you've got a pretty fun game on your hands :)

Doh why didn't I think of that

Re: Show HN: Semantic Calculator (king-man+woman=?)

#120

data + plural = number data - plural = research king - crown = (didn't work... crown gets circled in red) king - princess = emperor king - queen = kingdom queen - king = worker king + queen = queen + king = kingdom boy + age = (didn't work... boy gets circled in red) man - age = woman woman - age = newswoman woman + age = adult female body (tied with man) girl + age = female child girl + old = female child The other…

Distance is extremely well defined in high dimensional spaces. That isn't the problem.

Would you care to elaborate? To clarify, I mean that variance reduces as dimensionality increases
Post reply on HN