Abstract
While Large Language Models (LLMs) are often treated as "black boxes," recent evidence suggests they organize high-level concepts into structured, low-dimensional linear subspaces. This paper investigates the Linear Representation Hypothesis across 11 model families, demonstrating that semantic domains and behavioral states (like reasoning) are represented as distinct directions in latent space. We show that these representations "sharpen" in deeper layers and can be leveraged to build safety guardrails that significantly outperform traditional token-level filters.
Introduction
The internal mechanics of LLMs remain a subject of intense debate. Researchers have long hypothesized that models represent concepts as directions in a high-dimensional space—the Linear Representation Hypothesis. While previously demonstrated for simple lexical features, this study explores whether complex semantic domains (e.g., STEM fields) and abstract behavioral instructions (e.g., Chain-of-Thought) follow the same geometric principles.
Methods and Datasets
The authors evaluated 11 models, including Llama 3, Mistral, and GPT-2, using:
- Linear Probing: Hard-margin Support Vector Machines (SVMs) were used to test the linear separability of hidden states across categories.
- Keyword Masking: To ensure models weren't relying on surface-level tokens, up to 60% of domain-specific keywords were masked.
- Latent Steering: Causal interventions were performed by adding "reasoning vectors" directly to hidden states to induce specific behaviors.
Datasets included over 100,000 arXiv abstracts for semantic testing, and benchmarks like WildJailbreak and HarmBench for safety evaluation.
Semantic Sharpening and Geometry
A primary finding is the phenomenon of Semantic Sharpening. As information flows through the network, high-level concepts become increasingly separable. In the Llama family, for instance, SVM accuracy for distinguishing scientific topics reaches near 100% in the final layers.
Interestingly, this semantic information is highly compressed, typically occupying less than 10% of the total dimensions in the hidden state. This suggests that LLMs develop a highly efficient, low-dimensional "map" of concepts during training.
Safety via Latent Fingerprints
The researchers utilized these findings to develop a Latent-Space Guardrail. By training a small 13.9M parameter MLP to monitor the final hidden layer of Llama 3.1-8B, they achieved 96.7% accuracy in detecting harmful intent. This approach proved far more robust than token-level filters, reducing harmful responses to adversarial injections by over 2x compared to Llama Guard 3.
Architectural Anomalies
The study also revealed unexpected variations in how different architectures represent information. While Llama shows a smooth progression, models like Gemma and Mistral exhibit "Architectural Sawtooths"—dips and oscillations in separability within middle layers.
The authors hypothesize these patterns may stem from specific attention mechanisms, such as Grouped-Query Attention, though the exact cause remains a subject for future research.
Conclusion
LLMs do not merely process text as a "bag of tokens"; they construct a sophisticated internal geometry where semantics and intent are linearly encoded. Understanding these latent subspaces provides a powerful path forward for both mechanistic interpretability and the development of robust, geometry-aware safety systems.
Summary updated