GEM: Towards Interpretable Language Models via Geometric Embedding Alignment

Dimitris Tsaras, Yankun Hong, Lei Chen, Zhiyao Xie, Mingxuan YuanNeurIPS 2026

TL;DR

Inside a standard large language model, internal hidden vectors drift into weird, abstract spaces that don't actually match the words in its vocabulary—making the model a frustrating black box. This paper introduces Geometric Embedding Mixture (GEM), a lightweight pre-training tweak that forces a model's internal thoughts to physically sit in the geometric center of the words it is about to predict. Not only does this let us read the model's mind layer-by-layer without extra tools, it actually makes the model smarter, slashing uncertainty by up to 53%.

What Problem Does This Paper Address?

When an LLM processes a sentence, tokens start as vocabulary vectors, pass through dozens of transformer layers as "hidden states," and finally get scored against the vocabulary again to pick the next word. Intuitively, you might think these hidden states and vocabulary words live in the same geometric universe.

In standard transformers, they don’t. Hidden states often clump into narrow, distorted cones (a problem called anisotropy) or drift into completely separate mathematical manifolds. Because of this mismatch, if you try to peek inside a middle layer to see what the model is "thinking" using its own vocabulary head, you mostly get gibberish. Researchers usually work around this post-hoc by training auxiliary "probes" (like the Tuned Lens) to translate intermediate states into words. But probes create a philosophical headache: are you observing what the model actually knows, or just what your probe learned as a shortcut? Instead of building better flashlights for dark boxes, the authors ask: can we build the box out of glass from day one?

Methods

The authors propose a "what you predict is what you are" constraint during pre-training called GEM. Alongside standard next-token cross-entropy loss, they add a geometric alignment penalty right after the final normalization layer.

Figure 1: GEM applies an additional alignment loss on the produced hidden embeddings post layer normalization to bring the hidden embeddings in the convex hull of the vocabulary

Here is how it works:

  1. Standard forward pass: The model computes next-token probabilities as usual.
  2. Mixture target (New): Instead of summing over the entire vocabulary (which is slow), GEM grabs the top-$k$ ($k=8$) most probable next tokens, renormalizes their probabilities, and computes their probability-weighted average vector ($\mu_t$). Geometrically, this target sits inside the convex hull—the bounding shape—of those plausible words.
  3. Alignment loss (New): An $L_2$ loss pulls the final hidden state ($\tilde{h}_t$) toward $\mu_t$. Crucially, gradients are stopped through the probabilities so the model aligns its geometry rather than gaming its predictions, while vocabulary embeddings themselves gently cluster toward $\tilde{h}_t$.
Figure 3: GEM’s alignment step for “My phone number is 6” (GEM 360M). The top- 8 next tokens are all digits and µt is their probability-weighted mixture. GEM pulls ˜ht toward µt and shifts each top-k embedding to- ward ˜ht in proportion to its probability (arrow lengths). Digit positions are a linear projec- tion of the real embeddings; the placement of ˜ht and of the surrounding tokens is schematic.

They also introduce Loupe (Causal Tuned Lens) for evaluation—a probe trained not just to guess the final output, but to generate an embedding mixture that can literally replace a layer's hidden state mid-flight without breaking the rest of the forward pass.

Datasets

  • Pre-training: Models (135M to 1.7B parameters, SmolLM2 architecture) were trained on 5B to 20B tokens sampled from FineWeb-Edu.
  • Evaluation: Predictive uncertainty and zero-shot reasoning were tested on LAMBADA, WikiText, PIQA, HellaSwag, Winogrande, ARC (Easy & Challenge), and BoolQ. Embedding geometry was evaluated using the Google analogy dataset and BATS 3.0 (keeping single-token words). No new datasets were introduced.

Key Insights and Ideas

  • Minimizing "Free Energy": GEM isn't just a neat geometric heuristic. Viewed through the lens of Energy-Based Models (and Hopfield networks), pulling $\tilde{h}_t$ toward $\mu_t$ is mathematically equivalent to minimizing the statistical free energy of the output distribution, nudging representations into stable, low-energy valleys.
  • Implicit Semantic Clustering: Because co-probable next words usually share a concept (e.g., after "My phone number is 6", the top candidates are all digits), pulling them toward a shared hidden state naturally organizes the vocabulary into tight, clean semantic neighborhoods.
  • Global Space Consistency: Because residual connections add each layer's output onto the original token embeddings, locking the final layer to the vocabulary space prevents "space mixing" across the entire network. Every intermediate layer stays anchored to a single, readable manifold.

Key Results

Imposing strict geometric rules didn't bottleneck the models—it helped them generalize:

  • Better Language Modeling: GEM reduced perplexity across all scales—by up to 53.1% on LAMBADA (285.7 down to 134.0 at 135M; 46.88 down to 26.23 at 1.7B) and 15.9% on WikiText. Zero-shot reasoning accuracy rose by an average of 1.5% to 2.6% across scales.
  • Crisp Geometry & Analogies: GEM improved global isotropy and increased semantic cluster separation by up to $4\times$. On classic king - man + woman = queen vector arithmetic (Google analogies), the 360M GEM model hit 71.2% accuracy compared to just 18.0% for the baseline—even beating the official SmolLM2-360M trained on trillions more tokens (56.9%).
Figure 4: UMAP projection of vocabulary embeddings for selected semantic categories. GEM induces clearer separation and tighter clustering compared to the Baseline.
  • Native Interpretability: Decoding raw intermediate layers directly with the untuned language head yielded much higher accuracy than baselines (e.g., 25.2% vs. 11.8% average at 135M). In causal substitution tests—swapping a layer's hidden state with its decoded word mixture—GEM preserved the model's final answer far more faithfully across every layer and probe.

Limitations and Future Work

  • Compute Scale on Largest Model: While the 135M–760M models met compute-optimal Chinchilla token ratios ($20\times$ parameters), the 1.7B model was slightly undertrained at ~12 tokens per parameter (20B tokens).
  • Not Complete Transparency Yet: While GEM makes raw intermediate states vastly more readable at the vocabulary level, the authors candidly note that trained probes still achieve higher causal faithfulness—meaning auxiliary tools are still needed to fully capture internal computations.
  • Future Directions: The authors suggest this coherent geometric structure could be a vital stepping stone for steering model behavior and monitoring internal trajectories to catch hallucinations before they happen.

Summary updated

Abstract

Large language models encode rich representations in their hidden states, yet these representations remain largely opaque and disconnected from the model's vocabulary. We introduce Geometric Embedding Mixture (GEM), a pre-training regularization method that aligns transformer hidden states with the geometry of the vocabulary embedding space. GEM utilizes a self-supervised objective to encourage the final hidden state to approximate a probability-weighted mixture of token embeddings. This effectively minimizes the free energy of the models and pushes the representation into the convex hull of the vocabulary. We pre-train models at four scales (135M, 360M, 760M, and 1.7B) and demonstrate that GEM yields superior predictive uncertainty compared to standard training, reducing perplexity by up to 53% on benchmarks. Furthermore, we show that this geometric structural constraint mitigates representation anisotropy and takes a step toward native interpretability. Compared to baseline models, GEM improves direct layer-wise decoding of intermediate hidden states with the untuned language head and achieves higher average causal faithfulness, revealing coherent semantic trajectories with less reliance on auxiliary probes. Our work demonstrates that imposing geometric structure during pre-training improves both performance and transparency, offering a path toward language models that are interpretable by construction.
BibTeX
@inproceedings{tsaras2026gem,
  author = {Dimitris Tsaras and Yankun Hong and Lei Chen and Zhiyao Xie and Mingxuan Yuan},
  title = {{GEM: Towards Interpretable Language Models via Geometric Embedding Alignment}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=v0zubhBiC2},
}
Figure