["King" - "Man" + "Woman" = ?] 3 Secrets to Quickly Understanding Word Vector Calculations
Hello, this is Komaten.
"Subtract man from king, and add woman...? Word calculations make no sense!"
Many of you might have been puzzled by the title.
That is understandable, as words are not numbers.
Actually, when I first saw this formula, I seriously doubted if the AI experts had finally lost their minds (laughs).
For someone like me who comes from a humanities background and only had a sense of aversion toward mathematics, the word "vector" was just a sleep-inducing spell.
However, when I learned the mechanism behind this "addition and subtraction of words," the scattered pieces of AI knowledge in my head clicked together like a puzzle.
In this article, I will explain the magic of vectors behind how AI understands human language, without using technical jargon as much as possible.
If you read to the end, you should be able to clearly understand, "I see, so that's why ChatGPT is so smart!"
Knowing the basics of AI is a powerful weapon for surviving smartly in the coming era.
Now, let's set off together into the mysterious world where words turn into numbers!
1. What does it actually mean to "calculate words"?
First, let's talk about the biggest question: the mechanism of "calculating words."
As a major premise, AI (computers) cannot understand characters like "A, B, C" or Japanese kana through "atmosphere" or "emotion" like humans do.
All AI can understand, when it comes down to it, is "numbers."
That is why we need to somehow convert words into numerical data.
This is where the concept of vectors comes in.
It sounds difficult, but in short, it is perfect if you imagine the "status screen of an RPG game."
For example, a hero in a game has numerical parameters like "HP: 100, Attack: 80, Agility: 50."
Words also have parameters by quantifying several "features" in the same way.
For example, if the word is "apple," it becomes a status like this.
Sweetness: 80
Redness: 90
Mechanicalness: 0
On the other hand, what about "computer"?
Sweetness: 0
Redness: 10
Mechanicalness: 100
In this way, a list (array) of numbers representing the features that words possess. This is the true identity of word vectors .
By likening words to game characters and quantifying them, AI can finally distinguish that "Oh, apple and computer are words with completely different attributes."
2. Unraveling the calculation of "King - Man + Woman = Queen"
The fact that words have become "numerical parameters (vectors)" naturally means that addition and subtraction are now possible.
Let's finally take on the challenge of solving the mystery of "King - Man + Woman = ?".
Let's represent each word using the three parameters from earlier: "Royalty level," "Masculinity level," and "Femininity level." (*This is a rough image for the sake of clarity.)
King = [Royalty: 100, Masculinity: 100, Femininity: 0]
Man = [Royalty: 0, Masculinity: 100, Femininity: 0]
Woman = [Royalty: 0, Masculinity: 0, Femininity: 100]
The preparations are complete. Let's start calculating right away!
First, we subtract "Man" from "King".
[Royalty: 100, Masculinity: 100, Femininity: 0] - [Royalty: 0, Masculinity: 100, Femininity: 0]
= [Royalty: 100, Masculinity: 0, Femininity: 0]
By subtracting the element of "masculinity" from King, a mysterious parameter of "pure royalty (no gender)" remains.
Next, let's add "Woman" to this.
[Royalty: 100, Masculinity: 0, Femininity: 0] + [Royalty: 0, Masculinity: 0, Femininity: 100]
= [Royalty: 100, Masculinity: 0, Femininity: 100]
The calculation result is "a word with a royalty level of 100 and a femininity level of 100."
...Yes, the word that perfectly fits this condition is Queen , isn't it!
This is the mechanism behind "King - Man + Woman = Queen."
When you break down the meaning of words into numbers and add or subtract them, they brilliantly transform into the meaning of other words. Don't you think it's interesting, almost like magic or a little riddle?
3. The Evolution of AI Brought About by Vector Addition and Subtraction
This technology of word vectorization (technically called Word2Vec, etc.) actually revolutionized the world of AI.
AI doesn't need humans to teach it one by one that "a king is a man"; by reading vast amounts of text on the internet, it analyzes "what words are used with what other words" and automatically creates these parameters (vectors).
As a result, a magnificent "cosmic map of words" is created inside the AI's brain.
On this map, words with similar meanings gather close together, while words with different meanings move far apart.
And this technology has also sent shockwaves through the work of us professional web writers and SEO experts.
Google search in the past was just a "character puzzle."
It was an era where rankings were determined solely by whether the characters entered into the search bar "matched" the characters in the article. That's why so-called "keyword stuffing" was rampant, where even unreadable articles packed with unnatural keywords would appear at the top.
However, today's Google uses this vector technology to read search intent.
When "Apple" is searched, it accurately discerns whether it means "the fruit" or "the iPhone company" based on the surrounding context (its position in vector space).
That is precisely why "superficial techniques" no longer work in modern SEO.
By empathizing with the reader's concerns and delving deeply into the information they truly seek using natural language.
It is precisely because AI has become able to understand the "meaning and distance of words" that we humans are now required to create more "human-like, valuable content."
It is quite profound, as if the evolution of AI is telling humans to "return to the essence."
Summary: The inside of an AI's mind is surprisingly simple
In this article, I explained the mechanism by which AI understands language, using the famous equation "King - Man + Woman = Queen" as a starting point.
The three important points are as follows.
AI cannot understand words as they are, but converts them into numbers (parameters).
These numerical values are called vectors and can be added and subtracted just like RPG stats.
Thanks to this technology, AI has become able to deeply understand the "meaning of words" and "what humans really want to know."
You might feel intimidated when you hear terms like "AI" or "vector."
But when you open the lid, it operates on a surprisingly simple and charming mechanism: "it is just calculating the characteristics of words as numbers."
Knowing just a little bit about this mechanism should make it easier to grasp the tips for using AI tools like ChatGPT. From today on, please try to think of AI not as a "distant magic," but as a "reliable junior colleague who is good at calculating words," and try to get along with it.
If you have had similar experiences or realizations, please leave a comment, as it will encourage me in my writing! It might take a while, but I will definitely reply!
[Recommended articles for you]
Once you understand the basics of word vector calculations, why not take a peek at how AI captures "images" as numbers? The mechanism behind image processing is actually just as simple and interesting as these vectors.
If you want to understand the mechanism of AI more intuitively, this article, which explains the mathematical hurdle of "differentiation" without using formulas, is perfect. You will find hints on how AI, which can perform word calculations, proceeds with its learning.
Now that AI can understand the meaning and distance of words, what is required of us humans is the ability to grasp the "nuances of emotion." This is recommended for those who want to delve deeper into how to provide value that only humans can offer, while understanding the technology.
