Characterizing Large Language Model Geometry Helps Solve Toxicity Detection and Generation
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) drive current AI breakthroughs despite very little being known about their internal representations. In this work, we propose to shed the light on LLMs inner mechanisms through the lens of geometry. In particular, we develop in closed form (i) the intrinsic dimension in which the Multi-Head Attention embeddings are constrained to exist and (ii) the partition and per-region affine mappings of the feedforward (MLP) network of LLMs' layers. Our theoretical findings further enable the design of novel principled solutions applicable to state-of-the-art LLMs. First, we show that, through our geometric understanding, we can bypass LLMs' RLHF protection by controlling the embedding's intrinsic dimension through informed prompt manipulation. Second, we derive interpretable geometrical features that can be extracted from any (pre-trained) LLM, providing a rich abstract representation of their inputs. We observe that these features are sufficient to help solve toxicity detection, and even allow the identification of various types of toxicity. Our results demonstrate how, even in large-scale regimes, exact theoretical results can answer practical questions in LLMs. Code: https://github.com/RandallBalestriero/SplineLLM
Key facts. Cited by 11 papers in the map (data through 7 Oct 2026). Builds on 39 of its 52 references that are in the map. First posted on arXiv 4 Dec 2023.
Builds on
39 of 52 references.
References · 39
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2023Mistral 7Bcited by 3,065
- 2022Training Compute-Optimal Large Language Modelscited by 2,927
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
- 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,130
- 2021Probing Classifiers: Promises, Shortcomings, and Advancescited by 831
- 2022Discovering Latent Knowledge in Language Models Without Supervisioncited by 733
27 more
- 2020Intrinsic Dimensionality Explains the Effectiveness of Language Model Fine-Tuningcited by 658
- 2022ToxiGen: A Large-Scale Machine-Generated Dataset for Adversarial and Implicit Hate Speech Detectioncited by 419
- 2021Attention is Not All You Need: Pure Attention Loses Rank Doubly Exponentially with Depthcited by 411
- 2020HateXplain: A Benchmark Dataset for Explainable Hate Speech Detectioncited by 403
- 2021Understanding Dimensional Collapse in Contrastive Self-supervised Learningcited by 374
- 2023Explainability for Large Language Models: A Surveycited by 331
- 2021The Intrinsic Dimension of Images and Its Impact on Learningcited by 307
- 2020The Lottery Ticket Hypothesis for Pre-trained BERT Networkscited by 275
- 2020HateBERT: Retraining BERT for Abusive Language Detection in Englishcited by 206
- 2020Better Fine-Tuning by Reducing Representational Collapsecited by 156
- 2020Probing the Probing Paradigm: Does Probing Accuracy Entail Task Relevance?cited by 144
- 2023A Toy Model of Universality: Reverse Engineering How Networks Learn Group Operationscited by 141
- 2022Signal Propagation in Transformers: Theoretical Perspectives and the Role of Rank Collapsecited by 136
- 2022Analyzing Transformers in Embedding Spacecited by 131
- 2021Challenges in Automated Debiasing for Toxic Language Detectioncited by 95
- 2018Challenges for Toxic Comment Classification: An In-Depth Error Analysiscited by 55
- 2018Mad Max: Affine Spline Insights into Deep Learningcited by 54
- 2019The Geometry of Deep Networks: Power Diagram Subdivisioncited by 53
- 2023Mimetic Initialization of Self-Attention Layerscited by 52
- 2023Transformers learn through gradual rank increasecited by 52
- 2021The Low-Dimensional Linear Geometry of Contextualized Word Representationscited by 39
- 2022Toxicity Detection with Generative Prompt-based Inferencecited by 35
- 2021MaGNET: Uniform Sampling from Deep Generative Network Manifolds Without Retrainingcited by 23
- 2022Polarity Sampling: Quality and Diversity Control of Pre-Trained Generative Networks via Singular Valuescited by 21
- 2022Toward a Geometrical Understanding of Self-supervised Contrastive Learningcited by 17
- 2023Uncovering hidden geometry in Transformers via disentangling position and contextcited by 15
- 2018From Hard to Soft: Understanding Deep Network Nonlinearities via Vector Quantization and Statistical Inferencecited by 13
Built on by
Citing papers per year: 2024: 2; 2025: 3; 2026: 6.
11 papers.
- 2025Position: Beyond Euclidean -- Foundation Models Should Embrace Non-Euclidean Geometriescited by 15
- 2024Geometric Signatures of Compositionality Across a Language Model's Lifetimecited by 14
- 2025A Survey on Efficient Large Language Model Training: From Data-centric Perspectivescited by 9
- 2024Reasoning in Large Language Models: A Geometric Perspectivecited by 4
- 2026Tracing the complexity profiles of different linguistic phenomena through the intrinsic dimension of LLM representationscited by 3
- 2026NerVE: Nonlinear Eigenspectrum Dynamics in LLM Feed-Forward Networkscited by 3
- 2026The Linear Centroids Hypothesis: Features as Directions Learned by Local Expertscited by 3
- 2025Confidence is Not Competencecited by 1
- 2026Characterizing the Discrete Geometry of ReLU Networkscited by 1
- 2026Emergent Causal-Geometric Dynamics Across Depth in Large Language Modelscited by 0
- 2026Geometry-Aware Graph Construction via Adaptive Spectral Bandwidth Controlcited by 0
- 2026Geometry-Aware Graph Construction via Adaptive Spectral Bandwidth Control3 Sep 2026
- 2026Characterizing the Discrete Geometry of ReLU Networks5 Jun 2026
- 2026The Linear Centroids Hypothesis: Features as Directions Learned by Local Experts13 Apr 2026
- 2026NerVE: Nonlinear Eigenspectrum Dynamics in LLM Feed-Forward Networks6 Mar 2026
- 2026Emergent Causal-Geometric Dynamics Across Depth in Large Language Models4 Feb 2026
- 2026Tracing the complexity profiles of different linguistic phenomena through the intrinsic dimension of LLM representations7 Jan 2026
- 2025A Survey on Efficient Large Language Model Training: From Data-centric Perspectives29 Oct 2025
- 2025Confidence is Not Competence24 Oct 2025
- 2025Position: Beyond Euclidean -- Foundation Models Should Embrace Non-Euclidean Geometries11 Apr 2025
- 2024Geometric Signatures of Compositionality Across a Language Model's Lifetime2 Oct 2024
- 2024Reasoning in Large Language Models: A Geometric Perspective2 Jul 2024
Similar, not cited
Close in wording, no citation either way
- 2025Circumventing Safety Alignment in Large Language Models Through Embedding Space Toxicity Attenuation
- 2026Where Does Toxicity Live? Mechanistic Localization and Targeted Suppression in Language Models
- 2025Aligned Probing: Relating Toxic Behavior and Model Internals
- 2025SGM: Safety Glasses for Multimodal Large Language Models via Neuron-Level Detoxification
- 2024Navigating the Safety Landscape: Measuring Risks in Finetuning Large Language Models
- 2025Rethinking Toxicity Evaluation in Large Language Models: A Multi-Label Perspective
- 2024Large Language Models can be Strong Self-Detoxifiers
- 2024Large Language Model Safety: A Holistic Survey