Skip to main content

From Words to Meaning: The Journey From Word Vectors to Learnable Embeddings

Machine LearningDeep LearningData ScienceLLMsWord EmbeddingsVector Embeddings
From Words to Meaning: The Journey From Word Vectors to Learnable Embeddings

Imagine you’re talking to Jarvis from Iron Man or C-3PO from Star Wars, these AI systems understand language almost like humans do. But how does that actually work? How does a machine "understand" the difference between a king and a queen, or that Paris and France are related?

Let's set the stage!

Early on, computers treated words like unique symbols, kind of like Pokémon with their own unique ID numbers. But that approach didn’t capture any real-world meaning. Enter Word Vectors, inspired by Word2Vec, which changed everything. Now, words could be represented as points in a multi-dimensional space, where relationships and analogies became mathematically possible.

But we’re just getting started. These word vectors weren’t just fixed lookups, they evolved into learnable embeddings, forming the foundation of modern NLP models like ChatGPT and Google Translate. So, how do we get from simple words to embeddings that power AI?

But before we get to these powerful word vectors, let’s take a step back. How did computers originally represent words?

One-Hot Encoding: The Old Way

The first, most basic approach was One-Hot Encoding. This method is so simple it feels almost primitive now. Each word was assigned a unique ID and represented as a long vector filled with zeros, except for a single 1 in the position assigned to that word.

1"Hello" -> [1, 0, 0, …, 0]
2"World" -> [0, 1, 0, …, 0]

Sounds straightforward, right? But here’s the catch! Does this representation tell us that “king” and “queen” are related? Or that “dog”, "dogg" and “dawg” share similarities? :)

Well, by this method, to a machine, every word is just as different from the next as “pizza” is from “quantum physics.” Not ideal!

Enter Word Vectors (Inspired by Word2Vec)

A More Meaningful Representation

Word embeddings plotted in two dimensions, with semantically similar words clustered together
Word embeddings visualised in 2D · Source: third party (rights holder not identified) · View full size

Instead of using a massive, mostly empty vector, word embeddings pack rich information into a dense, continuous vector space. For example, you might see something like:

1"Hello" -> [0.2, 0.8, 0.1, …, 0.5]
2"World" -> [0.1, 0.7, 0.3, …, 0.6]

In these vectors, numbers represent learned features that capture semantic relationships. Words with similar meanings or contexts end up near each other, think of them as neighbors in a high-dimensional city.

The Famous King–Queen Relationship

A classic example often cited is:

1v(King) – v(Man) + v(Woman) ≈ v(Queen)
Vector arithmetic showing king minus man plus woman landing near queen
The king – man + woman ≈ queen relationship · Source: askyourdata.co · View full size

It’s a neat demonstration that these vectors can capture gender relationships and other analogies in a purely mathematical way.

Why Does This Matter?

  1. Similarity Searches: You can quickly find semantically similar words by calculating distances or similarities in the vector space (e.g., cosine similarity).
  2. Better NLP Tasks: Tasks like sentiment analysis, machine translation, and question answering become more accurate because the machine “understands” context, not just raw tokens.

We've seen how word vectors allow us to capture relationships between words in a meaningful way, mapping concepts like King - Man + Woman = Queen using vector arithmetic. This structured representation is what makes modern NLP models powerful.

But how do these word vectors actually get used inside a deep learning model? Are they fixed like a dictionary lookup, or do they evolve as the model learns?

This brings us to input embeddings.

Input Embeddings: The Building Blocks

The first step in transforming raw text into something a neural network can understand. Unlike one-hot encodings, which are static, embeddings are learnable parameters, meaning they get updated during training to better capture contextual meanings.

From Tokens to IDs to Vectors

Modern NLP pipelines typically convert words to tokens (IDs), and then these IDs are turned into embeddings:

1word -> id -> embedding

These embeddings are “learnable” parameters, which means they adjust during training to best represent each token’s meaning in the context of your specific task.

Embedding Dimensions

Embeddings can vary in size, commonly 256, 384, 512, or even few thousands of dimensions. The idea is that more dimensions let the model capture more nuances, but going too large can lead to overfitting or heavy computational costs.

Fitting everything into the context window:

  • One-Hot Encoding: Great for the “Hello World” of yesteryear, but limited in capturing meaning.
  • Word Embeddings: A leap forward, enabling rich, contextual understanding of words.
  • Input Embeddings: The learnable parameters that feed into models like RNNs, bridging raw text and machine-friendly vectors.

Wrapping It Up: From Words to Meanings

We started with one-hot encoding, a method so rigid that it treated every word like a unique Pokémon with no evolutionary connections. Then, Word Vectors stepped in, giving words meaning through relationships, turning simple text into a structured, math-powered language map.

But the real magic? Learnable embeddings. Unlike static word vectors, modern embeddings evolve as a model trains, adapting to new contexts and capturing deep nuances of language. This is what fuels today’s AI, whether it’s ChatGPT predicting your next word, Google Search understanding your intent, or Midjourney interpreting a text prompt for art.

So, what’s next? If embeddings are this powerful, what happens when we apply them beyond words, to images, videos, and even multimodal AI? The future of deep learning isn’t just about text, it’s about bridging all forms of data into one unified understanding.

And that’s where things get really interesting!


All content licensed under CC BY-SA 4.0 unless otherwise noted.