liveBook · Manning

Semantic space

As explained in How Large Language Models Work

A semantic space is a multidimensional space in which vector representations encode relationships between meanings.

A semantic space is a multidimensional arrangement of vector representations, called embeddings, where useful relationships between meanings appear as distances and directions. Words with similar meanings tend to be near one another, while contrasting meanings can be farther apart. The term is useful shorthand, but it is not precisely defined: it describes embeddings that behave well enough for these relationships to support computation. section 3.2.1

Adding dimensions lets representations capture more subtle relationships and multiple meanings. However, each added dimension increases storage and computation, while the possible space and training demands grow rapidly—a trade-off known as the curse of dimensionality. section 3.2.1

Figure 3.3 If you use just one number to represent a token, you quickly encounter problems where similar/dissimilar words cannot be made to fit each other. Here we see how trying to represent simple synonym/antonym relationships quickly becomes nonsensical even with just a handful of words.
figure

See why one number cannot arrange even simple synonym and antonym relationships consistently; additional dimensions make richer arrangements possible. section 3.2.1

How How Large Language Models Work covers it

How deep it goes
Defines vectors, dimensions, distances, and trade-offs, but stops short of mathematical derivations.
Examples
Uses synonym and antonym arrangements, multiple word meanings, and vector transformations between masculine and feminine terms.
What it assumes
Teaches embeddings, vectors, and dimensions from basic number-list representations.
What you can do after
Evaluate/understand how vector geometry represents meaning while recognizing dimensionality costs and imprecision.
How it connects
Connects embeddings with latent space, transformers, positional embeddings, and the curse of dimensionality.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of How Large Language Models Work. The section links point to the parts of the book it draws on.