Menu

Embedding is just a vector
πŸ“°

Embedding is just a vector

DEV Community: nlpΒ·MoΒ·about 14 hours ago
#osEZ6GbX
#devtonlp#devto#dev#vector#embedding
Reading 0:00
15s threshold

Ask what a token embedding is and you'll usually get something like "it captures the meaning of a word as a vector." That sounds profound and tells you nothing you can act on.

Here is the mechanical version: an embedding is a row of a matrix, looked up by an integer. That's it. Everything interesting comes from what training does to those rows, not from the lookup.

If you know what a vector is, you already have the tools to follow the whole thing.

From text to an integer

Before anything mathematical happens, the tokeniser turns your text into integers:

"data science" β†’ ["data", " science"] β†’ [1223, 8622]

Enter fullscreen mode

Exit fullscreen mode

Those numbers aren't meaningful. Token 8622 isn't twice as anything as token 4311.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.