What Are Embeddings? How AI Captures the Meaning of Words

What are 'embeddings,' the foundation beneath RAG and vector search? The mechanism of converting text and images into numeric vectors and expressing closeness of meaning as distance, and the relationship to vector databases and RAG—explained for non-experts, based on official documentation from Microsoft and Anthropic.

What Are Embeddings? How AI Captures the Meaning of Words

Look into RAG (retrieval-augmented generation) or vector search, and one term always comes up: “vectorization,” or “embedding.” This technique of converting text and images into numbers is the embedding. It’s thanks to this mechanism that generative AI can handle “closeness of meaning.”

Computers can’t understand characters themselves as meaning. So we convert words and images into “a sequence of numbers that represents meaning,” making them computable—that is the role of embeddings. This article explains what embeddings are, why they can capture “meaning,” and how they’re used in RAG and vector search, based on official documentation.

What Are Embeddings: Converting Meaning into Numeric Vectors

Microsoft’s explanation positions embeddings as “the way LLMs capture semantic meaning,” defining them as “numeric representations of non-numeric data that an LLM can use to determine relationships between concepts”1. @IT’s glossary likewise describes embeddings as “a technique for converting various kinds of data—text, images, audio—into numeric vectors that are easy for AI and machine learning to handle”3.

The “vector” here means an array of numbers lined up in a row. According to Microsoft’s explanation, an AI model for embeddings “can encode non-numeric data into a vector (a long array of numbers),” and conversely “can also decode an embedding into non-numeric data that has the same or similar meaning as the original, raw data”1. In other words, the word “dog” or a single photo gets converted into a sequence of hundreds to thousands of numbers—that is what an embedding really is.

Why It Can Capture “Meaning”

Merely converting to numbers wouldn’t let you handle meaning. The crux of embeddings is that things close in meaning are placed close together within the numeric space.

@IT’s explanation says this property is based on the “distributional hypothesis”—the idea that a word’s meaning is determined by the words around it—and that, as a result, “semantically related words are placed in nearby positions in the vector space”3. For example, “dog” and “cat,” both used in the nearby context of animals and pets, are placed close together in the vector space. On the other hand, words far apart in meaning, like “dog” and “economy,” are placed far apart.

Once this “map of meaning” exists, AI can calculate relationships between words as distances. The reason Microsoft’s explanation says that with embeddings “an AI model can understand the meaning of inputs so that it can perform comparisons and transformations, such as summarizing text or creating images from text descriptions”1 is precisely this property. Note that embeddings aren’t limited to text. @IT also points out that this technique has been extended to data such as images and audio3.

Where They’re Used: Vector Databases and RAG

A representative use of embeddings is search. Once converted into vectors, “things close in meaning” can be found by distance.

What’s used for this is the vector database. Microsoft’s explanation says that “after you generate embeddings, you need a way to store them so you can later retrieve them with calls to an LLM. Vector databases are designed to store and process vectors, so they’re a natural home for embeddings”1. LLMs can use embeddings immediately, and you can also store them in a vector database to provide “semantic memory for LLMs as needed”1.

This mechanism is also at the core of RAG, which we’ve covered on this site. Microsoft’s explanation states: “Use your own databases to generate embeddings for your data and integrate it with an LLM to make it available for completions. This use of embeddings is an important component of retrieval-augmented generation”1. In RAG, you embed your in-house documents in advance and store them in a vector database, then, when a question comes in, search for “documents close in meaning” and pass them to the LLM. Anthropic’s glossary also explains that in RAG “an external knowledge base or a set of documents is passed into the context window, and the data is retrieved at run time when a query is sent to the model”2—and embeddings handle that “finding documents close in meaning” part.

Embeddings have one more practical benefit. Microsoft’s explanation notes you can “increase the amount of context you can fit in a prompt without increasing the number of tokens required”1. Putting a large volume of documents in as-is would exceed the context window limit, but by using embeddings to select only “the parts close in meaning” to pass along, you can make effective use of that limited space.

Embeddings are a behind-the-scenes technology that usually stays out of sight, but they’re the foundation of every “search by meaning” mechanism—RAG, semantic search, recommendations. The key that let generative AI handle “meaning” beyond mere string processing lies in this conversion into numeric vectors. When you put AI to work in your business, this technology is quietly at work in many of the situations where you have AI use your own data.

Sources

  1. How Embeddings Extend Your AI Model’s Reach - Microsoft Learn official explanation (definition of embeddings, vector databases, RAG)
  2. Glossary - Anthropic official glossary (definition of RAG)
  3. What is an Embedding? - @IT AI & Machine Learning Glossary (Japanese)

We publish the latest AI news every day.

Subscribe via RSS Get new posts the moment they go live.

Search other keywords →