r/LargeLanguageModels • u/Learning-Wizard • Dec 02 '25
Question Is this a good intuition for understanding token embeddings?
I’ve been trying to build an intuitive, non-mathematical way to understand token embeddings in large language models, and I came up with a visualization. I want to check if this makes sense.
I imagine each token as an object in space. This object has hundreds or thousands of strings attached to it — and each string represents a single embedding dimension. All these strings connect to one point, almost like they form a knot, and that knot is the token itself.
Each string can pull or loosen with a specific strength. After all the strings apply their pull, the knot settles at some final position in the space. That final position is what represents the meaning of the token. The combined effect of all those string tensions places the token at a meaningful location.
Every token has its own separate set of these strings (with their own unique pull values), so each token ends up at its own unique point in the space, encoding its own meaning.
Is this a reasonable way to think about embeddings?
5
u/jsfour Dec 03 '25
Not really. Closer would be this from the Word2Vec paper. Just think of the embedding vectors as points in high dimensional space.
3
u/Bastian00100 Dec 02 '25
An embedding is essentially a point in a space. Each element becomes a coordinate that expresses its characteristics. To build intuition, imagine a three dimensional space. We cannot visualize higher dimensions, but this simple model is enough to understand the idea.
To grasp cosine similarity, picture yourself inside a spherical dome covered with images. Similar images appear close to one another, while very different ones are placed farther apart. Think of placing a wooden puppet in one part of the dome, a teddy bear in another, and a metallic robot somewhere else. Now imagine filling the entire dome with gradual transitions: from the robot to the teddy bear, from the teddy bear to the wooden puppet, and so on, forming a smooth continuum of variations.
Of course, an embedding space is not really a spherical dome. It is a full multi dimensional space. The dome analogy simply helps you understand how directions and angles work. Each dimension represents the intensity of a particular feature. Cosine similarity cares about these directions rather than about how far the points are from the center.
If you want an even simpler picture, take three conceptual dimensions: lightness, roundness, and softness. Place a white marble, a white cotton ball, a grey bouncy cube, a black metal block, and so on in this space. Each object occupies a unique position because it combines these three attributes in different amounts.
Seen this way, an embedding is nothing more than a way to represent objects, texts, or images through their location in a feature space, where closeness reflects similarity.
3
u/Krommander Dec 03 '25
I would say fractals with n dimensions. Frothing fractals with many intricacies, bubbles and edges. Although you zoom in and out, you always see many patterns.
New knowledge can always make deeper links between tokens.
2
u/Medium_Chemist_4032 Dec 02 '25
It's a good start ;-)
The thing is, each dimension of an enbedding is independent of each other. Representing it in 3 dimensions is misleading, because those knots seem to be represented by a combination of only 3 possible basis vectors.
It might be a good representation in clustering, such as k-means, but not for embeddings. The big knot is effectively the center of the cluster of vectors, a geometric mean, but embeddings don't behave that way. You can have embeddings of completely unrelated meanings with the same geometric mean. If the embedding could be represented by the mean alone, we could collapse the whole representation to that single vector. This is completely opposite to, what embeddings do, because they enrich with each additional dimension.
I recommend playing with this toy project: https://projector.tensorflow.org/ to better test out geometric intuitions. Finding a good projection from N-dimensions to 2 gimensions is the task that ML students do as an exercise in an introductory course. It's a great way to build understanding
2
u/[deleted] Dec 02 '25
vectors, or just "arrows in space"
You got a lot of the ideas there. but I feel your simplification misses to many.
I like I see your strings as the components of the vectors.
But the real magic happens because if you stick 2 vectors into the transformer architecture, it updates them with information coming from the other.
Take for example the token "wound", put it somewhere in space. If you add the word "around" to the context it updates the position of "wound" towards the verb part of space. If you add the word "infected" it move "wound" to the medical problems part of space.
but fundamentally, tokens are arrows in a space with thousands of dimensions.
2
u/Blotsy Dec 03 '25
Multidimensional thinking is really tough for humans.
Nice try though!
2
u/[deleted] Dec 02 '25
No, this is AI slop.
1
u/v1kstrand Dec 02 '25
Maybe, but this would suggest that each dim (each pull) is independent of each other. Where in reality, several dims can have deeper non-linear connections, such that pulling in one “string” might impact several dims (not numerically but the semantics). Also the embedding space itself might be seen as the content, where you can pick any point in this space and get some kind of representation from it (if you have a well behaved embedding model).
1
u/birella07 Dec 02 '25
what i dont get is how come one token has “hundreds or thousands of strings attached to it”.
As far as i know, the token is a sequence of characters (so what you meant by “string”?), and WHEN embedded, the token has hundreds or thousands of values in each dimension. This embedded vector would be the big furry ball, and it moves up/down.
Or are you talking about a sentence-embedder? In that case, then yes i’d see the little objects as strings or sub-strings from the sentence, and together they push and pull the whole sentence (big furry ball) across the embedding space
1
u/guigouz Dec 02 '25
The Guardian did an interactive non-technical overview for this https://www.theguardian.com/technology/ng-interactive/2023/nov/01/how-ai-chatbots-like-chatgpt-or-bard-work-visual-explainer
1
u/paperic Dec 02 '25
This would onlu work if each string is in a different dimension.
If a string pulls on a knot, the neighbouring strings will get loose, and the knot will move in their direction regardless.
In the embeddings, each "string" can pull as much or as little as it wants, with zero influence on any other strings.
1
u/justmikeplz Dec 02 '25
Instead of a knot and strings pulling, how about a moldable piece of Play-doh and a bunch of Tonka trunks pushing it with different forces.
1
u/david-1-1 Dec 02 '25
If the title question refers to the title image, no. The image is no good for anything sensible. A typical LLM output.
1
u/foxer_arnt_trees Dec 02 '25
Yeh it's alright imo. Just make sure you understand that higher dimentionality gives you more space, not more strings. It's not that you get more ways to adjust the position of your token, it's that you have more room to arrange them in a meaningful way. That's how, for example, we can create different clusters for each type of mammal and still have them all relatively close together compared to types of furniture. You simply get huge amount of space per space if that makes sense.