Meaning through the eyes of AI: the story of embeddings and five experiments with figures

From 1950s linguists and "king − man + woman = queen" to Google search and ChatGPT. How embeddings are built, five experiments with figures ("cheap" and "expensive" flights score 0.72 for the model) and advice for your site's texts.

Until October 2019, Google answered the query "2019 brazil traveler to usa need a visa" with articles about Americans travelling to Brazil. The person asked whether a Brazilian needs a visa for the US and got an answer to the opposite question.

The mistake came from the way search read the query. It found pages containing "Brazil", "USA" and "visa" and paid no attention to the little word "to". For years search engines treated such function words as noise and skipped them. Yet "to" is what sets the direction of the trip: from Brazil to the US, not the other way round. For a search that counts words, both questions looked the same because they consist of the same words. Google gave this example itself when it announced the biggest change to its search in five years.

After that change, Google reads a query as a whole sentence and compares the meaning of the query with the meaning of the page. The same mechanism helps ChatGPT understand a question full of mistakes, and helps a chatbot on a website find the answer in a company's documents even when the customer asks in different words from the ones in the document. The mechanism is called embeddings: a model turns a text into a set of numbers, and texts with similar meanings get similar sets.

You can look at embeddings up close in Similar words by vector. You type a word, and the tool shows which words the model considers close to it in meaning, and how close. The rest of this article covers where the idea came from, how it works inside, what surprising results a few simple experiments give, and what to take from it for your own site.

An idea 70 years old

Tesgüino

Let's start with a small puzzle. Read four sentences with a word you have most likely never heard:

A bottle of tesgüino is on the table.
Everybody likes tesgüino.
Tesgüino makes you drunk.
We make tesgüino out of corn.

You will guess that tesgüino is an alcoholic drink, something like beer. It is: a corn beer brewed in Mexico. You did not open a dictionary. Each sentence added a clue: "bottle" says it is a liquid, "drunk" says it contains alcohol, "out of corn" says what it is made from. You assembled the meaning of the word from its surroundings.

Linguists have used this example in textbooks for half a century because it shows how we learn most words. A child does not read a dictionary. A child hears a word in different sentences and gradually works out what it means. In 1954 the American linguist Zellig Harris stated this as the distributional hypothesis: words that occur in similar surroundings have similar meanings. In 1957 the British linguist John Firth said the same thing more briefly: "You shall know a word by the company it keeps."

Here is how it works with ordinary words. In texts, "coffee" appears next to "cup", "morning", "hot" and "order". "Tea" appears next to the same "cup", the same "morning" and "hot", except that "brew" often takes the place of "order". Coffee and tea keep almost the same company, and that is why their meanings are similar: both are hot drinks you drink from a cup. "Football" keeps company with "ball", "goal" and "coach", and shares no neighbours with coffee. So in meaning, football is far from coffee.

This idea leads to a conclusion that matters for us. For a computer to "understand" a word, it needs no dictionary definitions. It is enough to show it a great deal of text and count which words stand next to which.

A table that did not fit in memory

There was only one way to test Harris's and Firth's idea: take a great deal of text and count which words appear next to each other. Each word needs a list of its neighbours with the number of times they met: "coffee" next to "cup" thousands of times, next to "morning" hundreds of times, next to "football" a handful of times. If the lists for "coffee" and "tea" look alike, the idea works.

Picture this count as a table. Every word of the language in the rows, every possible neighbour in the columns, the number of meetings in each cell. For English that means hundreds of thousands of rows by hundreds of thousands of columns, tens of billions of cells. Even with one short number per cell, the table takes gigabytes.

Computers of the 1950s had memory measured in kilobytes, millions of times less. And there was nothing to count from: books, newspapers and letters existed only on paper, and nobody would have typed millions of pages into a computer by hand. So linguists had the idea but no tool to test it. The tool arrived thirty years later.

1990: search that understands synonyms

By the late 1980s, companies had electronic archives of documents, and people needed to search them. Engineers at Bellcore, the research centre of the American telephone companies, studied why searches in such archives so often found nothing. They ran a simple experiment: they showed people the same objects or actions and asked them to name each with one word. Two people picked the same word less than 20% of the time.

For search, that is a disaster. The author of a document wrote "automobile", and the reader searches for "car". Search at the time compared words literally, so a document about automobiles did not show up for "car" even if it answered the question completely. And this is the rule rather than the exception: in four cases out of five, the author and the reader use different words.

In 1990 the group published a method they called latent semantic analysis (LSA). "Latent" means "hidden": the method looked for hidden topics in texts that nobody had defined in advance. The researchers built a big table: words in the rows, documents in the columns, and in each cell how many times the word appeared in the document. Then they squeezed it from tens of thousands of columns down to a few hundred, using a mathematical method called singular value decomposition.

The squeeze is the key part, so here it is in more detail. The method looks for words in the table that often go together. For example, "engine", "wheels", "driver", "petrol" and "parking" keep appearing in the same documents. The method merges them into one hidden topic, roughly an "automotive" one. It finds a few hundred such topics, and each word gets a set of numbers: how much it belongs to each topic. "Automobile" and "car" rarely share a sentence, because an author usually picks one of the two. But both appear in documents with "engine", "wheels" and "driver", so both get a high number in the "automotive" topic. After the squeeze, their sets of numbers are almost the same, even though the two words never stood next to each other in the text.

That was the first time researchers turned words and documents into vectors, sets of numbers you can compare. Search built on LSA turned both the query and every document into vectors, and then showed the documents with the closest vectors. A document about a "car" now showed up for the query "automobile".

In 1997 the authors of LSA tested the method on an exam people take. They took 80 synonym questions from the TOEFL, the English exam for foreign students. Each question looks like this: a word and four options, pick the one closest in meaning. LSA had learned only from the texts of one encyclopaedia, and it chose answers in a simple way: the option whose vector was closest to the word's vector. The model got 64.4% of the questions right. Foreign applicants who took the same test averaged 64.5%. A program that had never seen a dictionary did as well as real students.

LSA had two weak points, and we will need both later. First, it counted which words a document contained and ignored their order. For LSA, "the dog bit the man" and "the man bit the dog" are the same, because they consist of the same words. Second, each word got one vector, however many meanings it had. More on that below, in the section on multiple meanings.

2013: king − man + woman

In the early 2000s another approach appeared, and modern models grew out of it. Researchers started training neural networks to guess the next word in a sentence. The network gets "I drink hot …" and has to suggest a continuation. To guess well, it has to learn that "coffee" and "tea" fit this slot and "football" does not. To do that, it gives every word a set of numbers and gradually adjusts them so that words fitting the same slots in sentences end up with similar sets. These sets are the word vectors. The network produced them as a by-product of training.

The approach worked, but training took weeks. The most expensive part was the choice of the word itself: to score the option "coffee", the network computed a probability for every word in the dictionary at every step, tens of thousands of words. On large amounts of text the method made no practical sense.

In 2013 Tomas Mikolov and his team at Google found a way around this problem and released a program called word2vec. It plays the same game, only simpler. One word is hidden from a sentence, for example "I drink ___ with milk every morning", and the program has to guess it from the neighbours. Instead of going through the whole dictionary, it compares the right answer with a few random wrong words and learns to tell them apart. This shortcut made training many times faster. One server could now run a billion words through the model in less than a day. Google published ready-made vectors for three million words and phrases, trained on 100 billion words of news.

Researchers then noticed that you could do arithmetic with these vectors, as with numbers. Take the vector for "king", subtract the vector for "man", add the vector for "woman", and look for the word closest to the result. It turns out to be "queen". In the same way, "Paris" − "France" + "Italy" gives "Rome". Nobody taught word2vec geography or family relations. The program only saw which words stood next to each other in the news.

Here is why this works. Picture a simplified model that describes each word with just two numbers: "how much the word is about power and the crown" and "how much it is about a man". Then:

  • king: power 0.9, male 0.9
  • queen: power 0.9, male 0.1
  • man: power 0.1, male 0.9
  • woman: power 0.1, male 0.1

Compute "king − man + woman" one number at a time. Power: 0.9 − 0.1 + 0.1 = 0.9. Male: 0.9 − 0.9 + 0.1 = 0.1. The result (0.9; 0.1) matches "queen". Subtracting "man" removes the male part from "king", adding "woman" adds the female part, and "power" stays. In a real model there are hundreds of numbers, and none is labelled "power" or "male". But the model forms such directions on its own, because the same changes of context repeat across thousands of word pairs: "she" instead of "he", "her" instead of "his", in pairs like uncle and aunt, son and daughter, king and queen.

I checked this arithmetic on the current OpenAI model our tool uses. The result of "king − man + woman" is 0.62 similar to "queen" and 0.39 to "prince". So the "male → female" direction exists in the model: the result is closer to the queen than to the prince. But it is even more similar to "king" itself: 0.76. The reason is that "king" contributed the most to the result, and the subtraction and addition shifted it only part of the way. So the famous example works on one condition: you look for the answer among all words except the ones you calculated from. The word2vec authors did exactly that. Popular articles rarely mention this condition, but without it the arithmetic mostly returns the starting word.

Stereotypes from human texts

A model learns from texts people wrote, and it picks up their stereotypes along with their knowledge. In news, the word "programmer" appears next to "he" more often than next to "she", and "nurse" the other way round. The model does not know this is a stereotype. It only sees the statistics of neighbours and shifts the vectors accordingly.

In 2016 researchers from Boston University and Microsoft Research showed this with the same arithmetic. Asked "man is to computer programmer as woman is to…", word2vec trained on news answered "homemaker". The vector for "surgeon" lay closer to the male side, "nurse" closer to the female one.

In 2017 the authors of a paper in Science went further. Psychologists have long measured hidden associations in people with a special test: a person sorts words quickly, and reaction times show which concepts they link, for example "flowers" with "pleasant". The researchers carried this test over to embeddings and found the same associations, including those about gender and race, that psychologists find in people.

For business this creates a practical risk. Picture a system that ranks CVs by their similarity to a description of a "successful engineer". If engineers in the model's training texts were more often men, CVs with women's names may end up lower, and without a dedicated check you will not notice. Since then, separate research groups have worked on finding and removing such skews from vectors.

One word, many meanings

word2vec and its successors, GloVe from Stanford (2014) and fastText from Facebook (2016), inherited the flaw from LSA mentioned above: one word gets one vector. Take the English word "bank". It is a place for money, the side of a river, a row of switches and the tilt of a turning plane. The model saw the word in all these contexts and squeezed them into one set of numbers. The result was a vector halfway between all the meanings that described none of them precisely. In practice, a search for "river bank" could return pages about banking.

fastText also solved another problem, one that matters for languages such as Ukrainian. A Ukrainian noun has many forms: "кава", "кави", "каві", "каву", "кавою" are all "coffee". word2vec treated each form as a separate word, and for rare forms it had too few examples to learn a good vector. fastText splits a word into short chunks of letters and builds the word's vector from the vectors of those chunks. All forms of "кава" share chunks, so they get close vectors, even if one form appeared in the texts only a few times. In 2018 Facebook published ready-made fastText vectors for 157 languages.

2017–2019: the sentence sets the meaning

Google researchers solved the problem of multiple meanings. In 2017 they described the Transformer architecture in a paper titled "Attention Is All You Need". The central idea of this architecture is called the attention mechanism. The model reads the whole sentence and, for each word, weighs which other words in the sentence affect its meaning.

Here is what that looks like in practice. In "I deposited the cheque at the bank", the model notices "deposited" and "cheque" next to "bank" and builds a vector for "bank" close to a financial institution. In "we had a picnic on the river bank", the neighbours are "river" and "picnic", and the same "bank" gets a vector close to a riverside. A word's vector is no longer fixed: the model builds it anew for each sentence.

In October 2018 Google released a model built on the Transformer called BERT. It was trained on a game similar to word2vec's but harder: in each sentence, about one word in seven was hidden, and the model had to restore it by looking at the words on both the left and the right. After training, BERT beat earlier records in almost every test of text understanding.

In October 2019 Google switched BERT on in search, first for one in ten English queries in the US. These were mostly long queries written in everyday language, where function words like "to", "for" or "without" change the meaning. In December Google extended BERT to more than 70 languages. The company called it one of the biggest leaps in the history of search. That is when the query about a Brazilian who needs a visa for the US started finding the right pages: the model read "to" as part of the sentence and understood the direction of travel.

Embeddings had appeared in Google search even earlier. In 2015 the company launched RankBrain, the first search system to match queries by meaning. It solved a specific problem: about 15% of the queries Google receives each day are new to it. For such queries there is no history showing which pages people found useful. RankBrain turned a new query into a vector, found familiar queries with close vectors and used their results as a hint. Soon after launch, a Google employee called RankBrain the third most important ranking signal.

2022: embeddings for two cents

Vectors of single words are poorly suited to comparing a query with a page. If you average the vectors of all the words on a page, the meaning blurs: a page about repairing coffee machines and a page of coffee recipes end up with similar averages. So researchers trained a new generation of models to return one vector for a whole sentence, paragraph or document. These models learn from pairs of texts that should be close: a question and its answer, a headline and its article. Now you can compare a customer's question with every paragraph of a site and find the one that answers it, even when the words differ.

In December 2022, two weeks after ChatGPT launched, OpenAI released text-embedding-ada-002. It was better than the company's earlier models and many times cheaper, and after it embeddings became available to any developer, not only to large companies. In 2024 OpenAI released text-embedding-3-small, the model our tool uses. The model is priced in tokens, pieces of words: a million tokens is about 750,000 English words and costs 2 cents. For comparison, turning all the texts of a 500-page site with a thousand words per page into vectors costs about one and a half cents. In 1990 this work took a research lab.

Today developers build embeddings into site search, into product recommendations ("similar products" are often found by the vectors of their descriptions), into duplicate detection and into chatbots that answer from a company's documents. More on chatbots in the section about your site.

Inside a vector

A word as a point in space

Let's start with a simple model you can draw. Say each word is described by three numbers from 0 to 1: "how much the word is about food and drink", "how much about sport" and "how much about warmth". Then:

  • coffee: food 0.9, sport 0.0, warmth 0.8
  • tea: food 0.85, sport 0.0, warmth 0.7
  • ice cream: food 0.9, sport 0.0, warmth 0.1
  • football: food 0.0, sport 0.95, warmth 0.2

Compare the numbers and you will see that coffee and tea are almost the same, ice cream resembles them in "food" but differs in "warmth", and football resembles none of them. Each word here is a point in three-dimensional space, and words with similar meanings stand close together, like cafés in one block on a city map.

Real models work the same way, with two differences. First, there are not three dimensions but hundreds or thousands, because three numbers cannot describe the difference between "espresso" and "cappuccino" or between a formal and a casual tone. text-embedding-3-small describes each text with 1,536 numbers. Second, nobody defines or labels the dimensions. The model decides during training what each dimension means, and meaning is usually spread across many dimensions at once. So no single number out of the 1,536 means "food" or "sport", and a person cannot read a vector the way they read coordinates on a map. A computer, however, compares millions of vectors in seconds, and search needs nothing more.

Cosine similarity

Think of each vector as an arrow from the centre of the space to the word's point. Texts with similar meanings have arrows pointing in similar directions. The tool measures closeness with cosine similarity, the cosine of the angle between two arrows.

The cosine is handy because it gives a simple scale. If the arrows point the same way, the angle is zero and the cosine is 1: the texts are about the same thing. If the arrows are perpendicular, the angle is 90 degrees and the cosine is 0: the texts are unrelated. Negative values would mean opposite directions, but in modern models they are rare.

The angle is used instead of the distance between arrow tips for this reason. In some models the length of the arrow depends on things unrelated to meaning, such as the length of the text. The angle ignores length. In OpenAI's models all vectors have the same length, so angle and distance give the same order, and the cosine is just easier to read.

A compressed scale

This surprises everyone on their first day with embeddings. On paper the scale runs from 0 to 1, but in practice it is compressed. With text-embedding-3-small, close synonyms score 0.5–0.7, and completely unrelated words score not 0 but 0.1–0.25. A score of 0.9 appears only for nearly identical phrases.

Researchers found the reason. The vectors of modern models do not spread out in every direction of the space; they occupy a narrow "cone". Imagine all the arrows pointing roughly into one half of the sky: then even between the farthest of them the angle is less than 90 degrees, and the cosine does not drop to zero. Any two texts have something in common simply because they are texts: grammar, common words, sentence structure.

This gives a practical rule: a single number tells you little. Is 0.5 a lot? The answer depends on what unrelated words score. That is why the tool deliberately adds eight words from other areas of life to the result. They show the floor of the scale. If "pasta" and "raincoat" score 0.1–0.2, then 0.5 means serious closeness, three times the floor. Compare the order of words and the gaps between groups, not absolute numbers. And never compare scores from two different models: each has its own floor and its own ceiling.

The tool step by step

An embedding can compare two ready texts, but it cannot make a list of a word's neighbours by itself. To find the closest words, you need vectors for every word of a language and you compare your word with all of them. Search engines do exactly this: they turn billions of pages into vectors in advance and compare the query with all of them. For the tool, such a dictionary would have to be built separately for each language, hundreds of thousands of words per language. So the tool works in two steps.

  1. Candidates. A chat model suggests about 40 words in the language of your phrase, in three groups: 10 synonyms and paraphrases, about 20 associations (related things, actions, places, qualities) and 8 words from other areas of life. The last group serves as the scale described above.
  2. Measurement. The tool turns each word and your phrase into vectors and computes cosine similarity for each pair. The order in the ranking depends on these numbers alone. The chat model sets the "synonym" or "association" label, and that is its opinion. The measurement gives the score. When they disagree, trust the score: these are the numbers search engines use.

The limitation of this approach: the list of candidates depends on what the chat model suggested. A word it did not name will not get into the ranking, even if it is very close. In return, the tool works for any language and any phrase.

The tool shows the result in five ways, and each answers its own question:

  • Radar. Your phrase sits in the centre, and each word sits at a distance that depends on its score: the higher the score, the closer to the centre. The radar's scale stretches to the range of your result so the differences between words stay visible. The radar quickly shows which words the model treats as close and which stand apart.
  • 2D map. You cannot draw 1,536 dimensions, so the tool squeezes them into two with principal component analysis. The method finds the two directions along which your words differ the most and lays the words out along them. It is like the shadow a three-dimensional object casts on a wall: you see the shape, but some information is lost. The map shows groups of words that resemble each other, not only your phrase, for example a cluster of technology words and a separate one about people. But a shadow distorts distances: two points side by side on the map are not necessarily close in the real space. For precise conclusions, use the ranking.
  • Ranking. All words from the closest to the farthest, with exact scores from 0 to 1. The filter above the map hides and shows groups: you can keep only synonyms or remove the unrelated words.
  • Where the vectors agree. The first 192 of the 1,536 numbers as cells. A cell is green when the number has the same sign in your phrase and in the word: it makes them more similar. Red when the signs differ: the number pulls them apart. Brightness shows how strong the effect is. For close words the strip is almost all green; for distant ones green and red are mixed. For "artificial intelligence" and "machine intelligence" it is 120 green cells against 19 red, for "mountain" 77 against 64. The same strip appears in the tooltip when you point at a word on the radar. It is the most direct way to see that "meaning", for a model, really is a set of numbers.
  • Comparing two phrases. You type any two phrases and get one score. You can repeat every experiment from this article here.

Five experiments with figures

I took all figures below from text-embedding-3-small, the same model the tool runs on. You can repeat each experiment in the comparison block.

Experiment 1. "Artificial intelligence"

Let's start with a topic the model knows well, because a great deal has been written in English about artificial intelligence. Part of the ranking for "artificial intelligence":

  • machine intelligence: 0.83
  • intelligent systems: 0.62
  • machine learning: 0.59
  • chatbots: 0.51
  • computer vision: 0.48
  • neural networks: 0.41
  • cloud computing: 0.27
  • pasta: 0.20
  • raincoat: 0.09

The scale here is smooth and logical. At the top is "machine intelligence", another name for the same concept. Below it are subfields of artificial intelligence: machine learning, computer vision. They are about the same topic but cover only part of it, so they score lower. Lower still is "cloud computing", a neighbouring technology that often comes up alongside but is a separate topic. At the bottom are the everyday words the tool added for the scale.

"Neural networks" behaves in an interesting way. The chat model labelled it a synonym, but the vectors put it at 0.41, among the associations. The measurement is more accurate than the label here: neural networks are a tool for building artificial intelligence, not another name for it.

Experiment 2. Opposites side by side

Compare "hot" and "cold". You would expect opposites at opposite ends of the scale. But the score is 0.55, and "hot" and "warm" score only a little more, 0.63. In Ukrainian, "гарячий" and "холодний" (hot and cold) score 0.56.

We already know the explanation from the tesgüino story. "Hot" and "cold" appear in the same sentences: "… tea", "… shower", "the water was …", "it's … outside". The two words keep almost the same company, and the model puts them side by side. An embedding measures whether texts are about the same topic in the same situations, not whether their meanings match. Opposites talk about the same thing, temperature, with a different sign, so they pass this check.

Experiment 3. Cheap and expensive flights

Now an experiment that matters for business:

  • "cheap flights" and "low-cost airfare": 0.71
  • "cheap flights" and "expensive flights": 0.72
  • "cheap flights" and "chocolate cake": 0.15

For the model, cheap and expensive flights are as close as cheap and low-cost ones. In Ukrainian the gap is even wider: "дешеві авіаквитки" (cheap air tickets) and "недорогі перельоти" (inexpensive flights) score 0.39, while "дешеві авіаквитки" and "дорогі авіаквитки" (expensive air tickets) score 0.82.

The phrase with the opposite meaning got twice the score of a real synonym. There are two reasons. First, "cheap air tickets" and "expensive air tickets" share their main word, and the adjective changes only a small part of the vector, as in experiment 2. Second, "inexpensive flights" consists of different words, and in Ukrainian the model has seen such pairs far less often than the English "cheap flights" and "low-cost airfare", which sit side by side on thousands of airline sites. The same goes for payment terms: "with prepayment" and "without prepayment" in Ukrainian score 0.53.

What does this mean in practice? Imagine you add meaning-based search to an online store and nothing else. A customer types "no prepayment", and the search shows products that require prepayment, because for the model the phrases are close. Embeddings are good at finding texts on the same topic but confuse "with" and "without", "cheap" and "expensive". That is why Google does not rely on them alone: its search combines meaning with exact word matches and dozens of other signals.

Experiment 4. Other languages

Compare the Ukrainian words "кава" (coffee) and "еспресо" (espresso): only 0.22, about as much as completely unrelated words get. Meanwhile "кава" and "чай" (tea) score 0.46, twice as much, and "кава" and the English "coffee" score 0.42.

There are several reasons. First, the model saw far less Ukrainian text than English and learned the links between Ukrainian words less well. Second, the model reads text not in words but in tokens, small pieces. The English "coffee" is one token with a well-learned meaning. Ukrainian words get split into more pieces, and a short four-letter word becomes several fragments, each of which means little on its own. The third reason is more interesting: "кава" and "чай" often share a sentence ("coffee or tea?"), while "кава" and "еспресо" do so less often, because "espresso" is usually used instead of "coffee" rather than next to it. By Harris's idea these words should still be close, but the model needs many examples to learn that, and it has few Ukrainian ones.

Phrases give steadier results because they carry more context. In Ukrainian, "website development" and "make a website for a business" score 0.62 though they share only the root "website", while "website development" and "flat renovation" score 0.29. The lesson for a site in a language other than English: judge phrases and sentences, not single words, and do not be surprised that the figures are lower than in English examples.

Experiment 5. How many meanings does a key have?

Here we test how a modern model handles the multiple meanings that LSA and word2vec could not. The Ukrainian word "ключ" means a key, a musical clef, a spring of water and a wedge of flying cranes. "A door key" and "a treble clef" score 0.37. "A door key" and "a lock and keys" score 0.47. The word "ключ" is the same in every phrase, but its neighbours shift the vector towards the right meaning: the phrase about the door is closer to locks than to music.

Without context the picture changes: the single word "ключ" and the word "джерело" (spring) score 0.34. The model knows the "spring of water" meaning, but in a single word it gets lost among the others, and the vector leans towards the most common one, the door key. In English, try "bank account" against "river bank" and against "savings" and watch where context moves the score.

Embeddings and your site

Write about the topic

Modern search compares the meaning of the query with the meaning of the page. Ten repeats of a keyword do not bring a page closer to the query, because the page's vector describes its topic rather than counting words. Repeats only spoil the text for a human reader. The page needs something else: to cover the topic the way people and models understand it, which means mentioning related concepts and answering the questions that usually come up alongside.

Here is how to use the tool for this:

  1. Type the main phrase of a page, for example "online store development".
  2. Look at the synonyms and paraphrases at the top of the ranking. Use them in your text instead of repeating the key phrase: the text will read more naturally and the meaning stays the same.
  3. Go through the associations. These are the subtopics the model expects next to your topic, because they appear together in thousands of texts on it. For an online store they may include payment and delivery. If an important subtopic is missing from the page, add a section or an FAQ question about it. The page becomes more useful to the customer and closer to the queries they type.

Your customers' language

Site owners often describe a service in professional terms, while customers search for it in everyday words. Compare a page's title with the way customers phrase their query. You will find their wording in Google Search Console (the report on queries that bring people to your site), in customer emails and in call recordings.

For example, your title is "Comprehensive e-commerce solutions" and a customer types "build an online shop cheap". Compare the two phrases in the tool, and the score shows how far apart your language and theirs are. Then write two or three title options and compare each with the customer's query. In languages other than English the figures run lower (experiment 4), so what matters is not the absolute score but which option comes closest to the query.

Pages that compete

Sometimes a site has two pages about nearly the same thing, for example "Website development" and "Turnkey website creation". For search their vectors are very close, and it cannot tell which one to show for a query. As a result the pages compete with each other, and both may rank lower than one strong page would. Compare the titles of pages that look similar to you. If their score matches the synonyms in the ranking, merge the pages into one or separate their topics so each answers its own question.

A chatbot on your site

A chatbot that answers from your documents follows a scheme called RAG, short for "retrieval-augmented generation". A language model like ChatGPT knows nothing about your prices or delivery terms, and your whole site does not fit into one of its messages. So the bot first finds the right pieces of your texts and then passes them to the model:

  1. A developer cuts your texts, pages, delivery and payment terms into chunks of a few paragraphs.
  2. A program turns each chunk into a vector and stores it in a database.
  3. The program turns the customer's question into a vector too and finds the chunks with the closest vectors.
  4. A language model receives these chunks with the question and writes an answer based on them.

Thanks to embeddings, the bot finds the answer even when the customer uses different words. For "can I pay when the parcel arrives?" it will find the paragraph about cash on delivery, even though "pay" and "arrives" do not appear in it. This scheme gives three rules for your site's texts:

  • Each section should make sense on its own. The bot sees only the chunk it found, without the rest of the page. A paragraph that says "As mentioned above, this is free" tells neither the bot nor the customer anything without the paragraph before it.
  • A heading describes the content. The bot will find a section called "Delivery times across the country", because its vector is close to a question about delivery. It may miss a section headed "Faster than you think".
  • Yes-or-no questions need direct answers. Write about prepayment, returns and warranty explicitly and in your customers' words. As experiment 3 showed, "with prepayment" and "without prepayment" are nearly the same to the model, so a clear sentence such as "No prepayment needed, you pay on delivery" protects you from a wrong answer.

The limits of embeddings

  • An embedding does not check facts. A vector describes what a text is about, not whether it is true. A page with a wrong price is as close to a query as a page with the right one.
  • Embeddings confuse opposites and negation. "Hot" and "cold", "with prepayment" and "without" are close for the model (experiments 2 and 3).
  • Results are weaker for short texts and less common languages. Single Ukrainian words get low and unstable scores (experiment 4).
  • Each model has its own scale. Google uses its own models, not the one in our tool. So the tool shows the principle and the direction: which words a model considers close and what your text lacks. It does not predict a position in search results.

Try it

Open Similar words by vector and type the main phrase of one of your pages. See which synonyms the model puts at the top and which associations it suggests. Then repeat the experiments from this article in the comparison block: opposites, cheap and expensive flights, your title against a customer's wording. In ten minutes you will see how search compares your site with what people type.

If you have a long list of search queries, Keyword grouping sorts them into groups with the same meaning. It runs on embeddings too and helps you decide which queries one page can cover and which need a page of their own.

Want search by meaning on your site, or a chatbot that answers from your materials? Get in touch, and I will explain how to do it and what it will cost.

Need help with your website?

Have a task like the one I wrote about? Tell me about it and I will estimate it and suggest a solution.

Assistant
Online now