What happens to meaning when it passes through a transformer?
This is not a philosophical question — or at least, not only one. It is a geometric question. Every word, every token, every fragment of language that enters a transformer model is projected into a high-dimensional vector space. And in that space, geometry is meaning.
The Embedding Manifold
When a sentence enters a transformer, each token is mapped to a point in a space with hundreds or thousands of dimensions. The initial embedding layer creates this mapping based on learned patterns, but it is the self-attention layers that reshape this space into something extraordinary.
Consider the sentence: "The bank of the river was steep." And another: "She walked to the bank to deposit a check." The word "bank" starts in roughly the same region of embedding space. But after passing through attention layers, the two instances of "bank" are pulled apart — relocated to entirely different neighborhoods of the manifold.
This is not merely disambiguation. It is the construction of context-dependent geometry.
Attention as Rotation
The key insight from recent work by Chen et al. (2023) is that attention heads can be understood as performing selective rotations in subspaces of the embedding manifold. Each head identifies a low-dimensional subspace relevant to a particular linguistic relationship — syntax, coreference, semantic role — and rotates token representations within that subspace.
The multi-head mechanism allows simultaneous rotations across orthogonal subspaces. The result is a transformation that preserves certain geometric relationships (those relevant to the current context) while destroying others (those that would introduce noise).
$$R_{\text{attn}} = \prod_{h=1}^{H} R_h(Q_h, K_h)$$
This product of rotations creates a context-specific coordinate system — a frame of reference in which meaning is measured.
Implications for Interpretability
If attention is geometric, then interpretability is cartography. We are not trying to read a neural network's "thoughts" — we are trying to map the spaces it constructs.
Recent work has shown that:
- Syntactic relationships tend to be encoded in lower-dimensional subspaces (approximately 32-64 dimensions in a 768-dimensional model)
- Semantic similarity occupies higher-dimensional manifolds that shift dramatically between layers
- Factual knowledge appears to be stored as specific directions in intermediate layers — what Meng et al. call "knowledge neurons"
The implication is striking: a transformer does not store meaning in individual neurons. It stores meaning in the geometry between neurons. Understanding the model requires understanding the shape of its internal spaces.
The Distortion Problem
But this geometric perspective also reveals a problem. Transformer architectures introduce systematic distortions — biases in the geometry of meaning that have real consequences.
When models are trained primarily on English text, the semantic manifold for English is rich and finely differentiated. Other languages occupy compressed, lower-resolution regions. This is not a vocabulary problem; it is a geometric one. The model literally has less space to represent meaning in underrepresented languages.
Similarly, the geometry of professional domains (law, medicine, engineering) is shaped by the training distribution. Concepts that co-occur frequently in the training data are pulled closer together, while rare but important distinctions are collapsed.
Toward Geometric Fairness
Addressing these distortions requires a geometric approach. Simply adding more training data is necessary but insufficient. We need methods that explicitly measure and correct the geometry of semantic spaces:
- Manifold auditing — measuring the effective dimensionality available to different languages, domains, and perspectives
- Geometric regularization — training objectives that penalize asymmetric compression
- Subspace alignment — techniques that align the geometric structure across languages and domains
The geometry of language in transformer models is not merely a technical curiosity. It is the substrate on which all downstream applications are built. If the geometry is distorted, everything built on top of it inherits that distortion.
Understanding this geometry — and learning to reshape it — may be the most important challenge in modern NLP.