mlsanityData to 7 Oct 2026

The Intrinsic Dimension of Prompts in Internal Representations of Large Language Models

arXiv 2501.10573 ↗First posted 17 Jan 2025cs.CL cs.LGcited by 17

Not on the map. Why?

Abstract (arXiv)

We study the geometry of token representations at the prompt level in large language models through the lens of intrinsic dimension. Viewing transformers as mean-field particle systems, we estimate the intrinsic dimension of the empirical measure at each layer and demonstrate that it correlates with next-token uncertainty. Across models and intrinsic dimension estimators, we find that intrinsic dimension peaks in early to middle layers and increases under syntactic and semantic disruption (by shuffling tokens), and that it is strongly correlated with average surprisal, with a simple analysis linking logits geometry to entropy via softmax. As a case study in practical interpretability and safety, we train a linear probe on the per-layer intrinsic dimension profile to distinguish malicious from benign prompts before generation. This probe achieves accuracy of 90 to 95% in different datasets, outperforming widely used guardrails such as Llama Guard and Shield Gemma. We further compare against linear probes built from layerwise entropy derived via the Tuned Lens and find that the intrinsic dimension-based probe is competitive and complementary, offering a compact, interpretable signal distributed across layers. Our findings suggest that prompt-level geometry provides actionable signals for monitoring and controlling LLM behavior, and offers a bridge between mechanistic insights and practical safety tools.

Key facts. Cited by 17 papers in the map (data through 7 Oct 2026). Builds on 41 of its 60 references that are in the map. First posted on arXiv 17 Jan 2025.

Builds on

41 of 60 references.

References · 41

  1. 2016Pointer Sentinel Mixture Modelscited by 2,992
  2. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
  3. 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
  4. 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,734
  5. 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injectioncited by 1,339
  6. 2024HarmBench: A Standardized Evaluation Framework for Automated Red Teaming and Robust Refusalcited by 1,330
  7. 2023DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvaturecited by 705
  8. 2023Eliciting Latent Predictions from Transformers with the Tuned Lenscited by 579
  9. 2024JailbreakBench: An Open Robustness Benchmark for Jailbreaking Large Language Modelscited by 494
  10. 2019GLTR: Statistical Detection and Visualization of Generated Textcited by 490
  11. 2021The Intrinsic Dimension of Images and Its Impact on Learningcited by 307
  12. 2019Intrinsic dimension of data representations in deep neural networkscited by 276
29 more
  1. 2018Estimating the intrinsic dimension of datasets by a minimal neighborhood informationcited by 246
  2. 2024ShieldGemma: Generative AI Content Moderation Based on Gemmacited by 224
  3. 2023A mathematical perspective on Transformerscited by 160
  4. 2021Sinkformers: Transformers with Doubly Stochastic Attentioncited by 136
  5. 2023The emergence of clusters in self-attention dynamicscited by 133
  6. 2023Intrinsic Dimension Estimation for Robust Detection of AI-Generated Textscited by 111
  7. 2023The geometry of hidden representations of large transformer modelscited by 108
  8. 2023A Survey of Safety and Trustworthiness of Large Language Models through the Lens of Verification and Validationcited by 91
  9. 2023Testing the Predictions of Surprisal Theory in 11 Languagescited by 75
  10. 2017Residual Connections Encourage Iterative Inferencecited by 74
  11. 2021Scikit-dimension: a Python package for intrinsic dimension estimationcited by 68
  12. 2017Classification and Geometry of General Perceptual Manifoldscited by 62
  13. 2024Emergence of a High-Dimensional Abstraction Phase in Language Transformerscited by 56
  14. 2023How Smooth Is Attention?cited by 44
  15. 2020A Mathematical Theory of Attentioncited by 43
  16. 2024Dynamic metastability in the self-attention modelcited by 42
  17. 2020Hierarchical nucleation in deep neural networkscited by 31
  18. 2024Does Representation Matter? Exploring Intermediate Layers in Large Language Modelscited by 31
  19. 2024Measure-to-measure interpolation using Transformerscited by 28
  20. 2023Bridging Information-Theoretic and Geometric Compression in Language Modelscited by 26
  21. 2024Geometric Dynamics of Signal Propagation Predict Trainability of Transformerscited by 24
  22. 2024Implicit Geometry of Next-token Prediction: From Language Sparsity Patterns to Model Representationscited by 24
  23. 2022Intrinsic Dimensionality Estimation within Tight Localities: A Theoretical and Experimental Analysiscited by 22
  24. 2024Evidence from fMRI Supports a Two-Phase Abstraction Process in Language Modelscited by 13
  25. 2024Persistent Topological Features in Large Language Modelscited by 11
  26. 2024Generic controllability of equivariant systems and applications to particle systems and neural networkscited by 8
  27. 2021Distributional Results for Model-Based Intrinsic Dimension Estimatorscited by 5
  28. 2024Lines of Thought in Large Language Modelscited by 5
  29. 2024Unsupervised detection of semantic correlations in big datacited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 10; 2026: 7.

17 papers.

Sort:

By area:

  1. 2025Representation Engineering for Large-Language Models: Survey and Research Challengescited by 18
  2. 2025Beyond Exponential Decay: Rethinking Error Accumulation in Large Language Modelscited by 11
  3. 2025Position: Foundation Models Need Digital Twin Representationscited by 10
  4. 2025On the Predictive Power of Representation Dispersion in Language Modelscited by 6
  5. 2026Latent Semantic Manifolds in Large Language Modelscited by 5
  6. 2025Geometric Metrics and LLMs: What They Measure and When They Workcited by 4
  7. 2025From Topology to Retrieval: Decoding Embedding Spaces with Unified Signaturescited by 4
  8. 2025Bridging the Dimensional Chasm: Uncover Layer-wise Dimensional Reduction in Transformers through Token Correlationcited by 3
  9. 2026IdEst: Assessing Self-Supervised Learning Representations via Intrinsic Dimensioncited by 2
  10. 2025Unveiling Intrinsic Dimension of Texts: from Academic Abstract to Creative Storycited by 1
  11. 2026An Analysis of Residual-Stream Geometry Across Transformer Depthcited by 1
  12. 2025What's in a prompt? Language models encode literary style in prompt embeddingscited by 0
5 more
  1. 2025Probing Geometry of Next Token Prediction Using Cumulant Expansion of the Softmax Entropycited by 0
  2. 2026Residual Stream Analysis of Overfitting And Structural Disruptionscited by 0
  3. 2026Rethinking Intrinsic Dimension Estimation in Neural Representationscited by 0
  4. 2026MIRROR: Aligning Semantic Relations from Language to Image via Gromov--Wassersteincited by 0
  5. 2026Isotropy Cliffs: The Geometric Signature of Decision-Making in Large Language Modelscited by 0