Urgent.News

What's breaking now, across thousands of outlets.

Tech

Embeddings: Meaning as Numbers

When you ask a chatbot for a pasta recipe, it doesn’t understand “pasta” the way you do. It sees a list of numbers. Those numbers are not random. They are arranged so that “pasta” sits close to “spaghetti” and far from “car.” This is an embedding. It turns meaning into coordinates that a machine can measure, compare, and search. Every time a chatbot finds a relevant answer, recommends a product,…

An embedding is a list of numbers that stand in for a discrete item like a word, user ID or product. Each number in the series represents a coordinate in a high-dimensional space. Words that frequently appear in similar contexts end up with nearby coordinates. This is the basic concept behind embeddings. In a chatbot, every token is assigned its own embedding vector.

The model then uses those vectors to begin the process of understanding the message. During training, the model continually adjusts the numbers in the embedding vectors so they become useful for the task at hand. If the model is learning to predict the next word, words that lead to similar next-word predictions will gradually move closer together in the vector space.

The embedding layer is a fast, differentiable lookup that turns token IDs into dense vectors the network can process. The distributional hypothesis is the key to why similar words end up with similar vectors. Words that appear in similar contexts tend to have similar meanings. A model trained on a large corpus of text will place words that usually appear together near each other in the vector space, without ever knowing what the words mean.

Modern models learn these vectors during the training process, rather than beforehand. They take a small window of words, try to predict a target word from its neighbors, and adjust the vectors to improve prediction performance. Over millions of examples, the vectors settle into a geometry where semantically related words cluster together.

This allows the model to understand analogies, like "king - man + woman = queen", based on the relationships learned from the data.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Protected nothing

Field notes from a proof-of-concept food-diary tool built alongside one NHS dietetic team, not an official NHS product, no patient data anywhere in it.

More from Sunday 23 August →