Learning Safety Constraints for Large Language Models
On the map: LLM safety and security → Safety alignment, refusal and guardrails
Abstract (arXiv)
Large language models (LLMs) have emerged as powerful tools but pose significant safety risks through harmful outputs and vulnerability to adversarial attacks. We propose SaP, short for Safety Polytope, a geometric approach to LLM safety that learns and enforces multiple safety constraints directly in the model's representation space. We develop a framework that identifies safe and unsafe regions via the polytope's facets, enabling both detection and correction of unsafe outputs through geometric steering. Unlike existing approaches that modify model weights, SaP operates post-hoc in the representation space, preserving model capabilities while enforcing safety constraints. Experiments across multiple LLMs demonstrate that our method can effectively detect unethical inputs, reduce adversarial attack success rates while maintaining performance on standard tasks, thus highlighting the importance of having an explicit geometric model for safety. Analysis of the learned polytope facets reveals emergence of specialization in detecting different semantic notions of safety, providing interpretable insights into how safety is captured in LLMs' representation space.
Key facts. Cited by 13 papers in the map (data through 14 Oct 2026). Placed in Safety alignment, refusal and guardrails, one of 12 directions in LLM safety and security. Builds on 53 of its 62 references that are in the map. First posted on arXiv 30 May 2025.
Builds on
53 of 62 references.
Closest ancestors · 2
Same direction, newest first
- 2024Refusal in Language Models Is Mediated by a Single Direction17 Jun
- 2024Improving Alignment and Robustness with Circuit Breakers6 Jun
Other references · 51
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2020Measuring Massive Multitask Language Understandingcited by 7,963
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 3,104
- 2021TruthfulQA: Measuring How Models Mimic Human Falsehoodscited by 2,975
- 2024HarmBench: A Standardized Evaluation Framework for Automated Red Teaming and Robust Refusalcited by 1,429
- 2023Sparse Autoencoders Find Highly Interpretable Features in Language Modelscited by 1,420
- 2020RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Modelscited by 1,255
- 2022Toy Models of Superpositioncited by 971
- 2023BeaverTails: Towards Improved Safety Alignment of LLM via a Human-Preference Datasetcited by 860
- 2023AutoDAN: Generating Stealthy Jailbreak Prompts on Aligned Large Language Modelscited by 785
- 2023Open Problems and Fundamental Limitations of Reinforcement Learning from Human Feedbackcited by 759
- 2019Universal Adversarial Triggers for Attacking and Analyzing NLPcited by 722
38 more
- 2023The Linear Representation Hypothesis and the Geometry of Large Language Modelscited by 716
- 2023Safe RLHF: Safe Reinforcement Learning from Human Feedbackcited by 656
- 2023Baseline Defenses for Adversarial Attacks Against Aligned Language Modelscited by 651
- 2024JailbreakBench: An Open Robustness Benchmark for Jailbreaking Large Language Modelscited by 536
- 2023"Do Anything Now": Characterizing and Evaluating In-The-Wild Jailbreak Prompts on Large Language Modelscited by 489
- 2024Jailbreaking Leading Safety-Aligned LLMs with Simple Adaptive Attackscited by 486
- 2019Differentiable Convex Optimization Layerscited by 465
- 2023Jailbreak and Guard Aligned Language Models with Only Few In-Context Demonstrationscited by 431
- 2023Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and Discoverycited by 336
- 2023Benchmarking and Defending Against Indirect Prompt Injection Attacks on Large Language Modelscited by 264
- 2024MT-Bench-101: A Fine-Grained Benchmark for Evaluating Large Language Models in Multi-Turn Dialoguescited by 250
- 2018Safe Exploration in Continuous Action Spacescited by 247
- 2023LLM Self Defense: By Self Examination, LLMs Know They Are Being Trickedcited by 244
- 2023Rewarded soups: towards Pareto-optimal alignment by interpolating weights fine-tuned on diverse rewardscited by 243
- 2024From r to Q^*: Your Language Model is Secretly a Q-Functioncited by 242
- 2021Gradient-based Adversarial Attacks against Text Transformerscited by 234
- 2023AI Control: Improving Safety Despite Intentional Subversioncited by 229
- 2021Efficient and Modular Implicit Differentiationcited by 203
- 2023Defending Against Alignment-Breaking Attacks via Robustly Aligned LLMcited by 192
- 2025Constitutional Classifiers: Defending against Universal Jailbreaks across Thousands of Hours of Red Teamingcited by 181
- 2024Latent Adversarial Training Improves Robustness to Persistent Harmful Behaviors in LLMscited by 173
- 2024The Geometry of Categorical and Hierarchical Concepts in Large Language Modelscited by 159
- 2024Token-level Direct Preference Optimizationcited by 135
- 2023Beyond One-Preference-Fits-All Alignment: Multi-Objective Direct Preference Optimizationcited by 124
- 2023Backdoor Attacks for In-Context Learning with Language Modelscited by 96
- 2024Towards Guaranteed Safe AI: A Framework for Ensuring Robust and Reliable AI Systemscited by 96
- 2024Defending Against Unforeseen Failure Modes with Latent Adversarial Trainingcited by 88
- 2024Panacea: Pareto Alignment via Preference Adaptation for LLMscited by 80
- 2024Defending LLMs against Jailbreaking Attacks via Backtranslationcited by 70
- 2024Enhancing LLM Safety via Constrained Direct Preference Optimizationcited by 49
- 2024PARDEN, Can You Repeat That? Defending against Jailbreaks via Repetitioncited by 35
- 2022Interpreting Neural Networks through the Polytope Lenscited by 33
- 2024Stepwise Alignment for Constrained Language Model Policy Optimizationcited by 30
- 2023Learning Safety Constraints from Demonstrations with Unknown Rewardscited by 19
- 2023SequenceMatch: Imitation Learning for Autoregressive Sequence Modelling with Backtrackingcited by 13
- 2024Unlocking Decoding-time Controllability: Gradient-Free Multi-Objective Alignment with Contrastive Promptscited by 9
- 2024MPAX: Mathematical Programming in JAXcited by 7
- 2024Enhancing Safety in Reinforcement Learning with Human Feedback via Rectified Policy Optimizationcited by 5
50 most cited of 51 All 51 (JSON)
Built on by
Citing papers per year: 2025: 8; 2026: 5.
13 papers.
Sort:
By area:
- 2025Mitigating the Safety Alignment Tax with Null-Space Constrained Policy Optimizationcited by 11
- 2025Preemptive Detection and Steering of LLM Misalignment via Latent Reachabilitycited by 10
- 2025Any-Depth Alignment: Unlocking Innate Safety Alignment of LLMs to Any-Depthcited by 3
- 2025Countermind: A Multi-Layered Security Architecture for Large Language Modelscited by 2
- 2026MDP-GRPO: Stabilized Group Relative Policy Optimization for Multi-Constraint Instruction Followingcited by 2
- 2025From Refusal to Recovery: A Control-Theoretic Approach to Generative AI Guardrailscited by 1
- 2025Optimal Anytime Algorithms for Online Convex Optimization with Adversarial Constraintscited by 1
- 2025ProSocialAlign: Preference Conditioned Test Time Alignment in Language Modelscited by 1
- 2026Beyond Labels: Information-Efficient Human-in-the-Loop Learning using Ranking and Selection Queriescited by 1
- 2026Preference Instability in Reward Models: Detection and Mitigation via Sparse Autoencoderscited by 1
- 2025Foundation Models for Logistics: Toward Certifiable, Conversational Planning Interfacescited by 0
- 2026BarrierSteer: LLM Safety via Learning Barrier Steeringcited by 0
1 more
- 2026Local Sparsity Enables Unsupervised LLM Safety Detectioncited by 0
- 2026Local Sparsity Enables Unsupervised LLM Safety Detection17 Sep 2026
- 2026MDP-GRPO: Stabilized Group Relative Policy Optimization for Multi-Constraint Instruction Following4 Jun 2026
- 2026Preference Instability in Reward Models: Detection and Mitigation via Sparse Autoencoders7 May 2026
- 2026BarrierSteer: LLM Safety via Learning Barrier Steering23 Feb 2026
- 2026Beyond Labels: Information-Efficient Human-in-the-Loop Learning using Ranking and Selection Queries17 Feb 2026
- 2025Mitigating the Safety Alignment Tax with Null-Space Constrained Policy Optimization12 Dec 2025
- 2025ProSocialAlign: Preference Conditioned Test Time Alignment in Language Models6 Dec 2025
- 2025Optimal Anytime Algorithms for Online Convex Optimization with Adversarial Constraints26 Oct 2025
- 2025Any-Depth Alignment: Unlocking Innate Safety Alignment of LLMs to Any-Depth20 Oct 2025
- 2025From Refusal to Recovery: A Control-Theoretic Approach to Generative AI Guardrails15 Oct 2025
- 2025Countermind: A Multi-Layered Security Architecture for Large Language Models13 Oct 2025
- 2025Preemptive Detection and Steering of LLM Misalignment via Latent Reachability25 Sep 2025
- 2025Mitigating the Safety Alignment Tax with Null-Space Constrained Policy Optimizationcited by 11
- 2025Preemptive Detection and Steering of LLM Misalignment via Latent Reachabilitycited by 10
- 2025Any-Depth Alignment: Unlocking Innate Safety Alignment of LLMs to Any-Depthcited by 3
- 2025ProSocialAlign: Preference Conditioned Test Time Alignment in Language Modelscited by 1
- 2026Preference Instability in Reward Models: Detection and Mitigation via Sparse Autoencoderscited by 1
- 2026Preference Instability in Reward Models: Detection and Mitigation via Sparse Autoencoders7 May 2026
- 2025Mitigating the Safety Alignment Tax with Null-Space Constrained Policy Optimization12 Dec 2025
- 2025ProSocialAlign: Preference Conditioned Test Time Alignment in Language Models6 Dec 2025
- 2025Any-Depth Alignment: Unlocking Innate Safety Alignment of LLMs to Any-Depth20 Oct 2025
- 2025Preemptive Detection and Steering of LLM Misalignment via Latent Reachability25 Sep 2025
- 2025Countermind: A Multi-Layered Security Architecture for Large Language Modelscited by 2
- 2025From Refusal to Recovery: A Control-Theoretic Approach to Generative AI Guardrailscited by 1
- 2026BarrierSteer: LLM Safety via Learning Barrier Steeringcited by 0
- 2026Local Sparsity Enables Unsupervised LLM Safety Detectioncited by 0
- 2026Local Sparsity Enables Unsupervised LLM Safety Detection17 Sep 2026
- 2026BarrierSteer: LLM Safety via Learning Barrier Steering23 Feb 2026
- 2025From Refusal to Recovery: A Control-Theoretic Approach to Generative AI Guardrails15 Oct 2025
- 2025Countermind: A Multi-Layered Security Architecture for Large Language Models13 Oct 2025
- 2025Optimal Anytime Algorithms for Online Convex Optimization with Adversarial Constraintscited by 1
- 2026Beyond Labels: Information-Efficient Human-in-the-Loop Learning using Ranking and Selection Queriescited by 1
- 2025Foundation Models for Logistics: Toward Certifiable, Conversational Planning Interfacescited by 0
- 2026Beyond Labels: Information-Efficient Human-in-the-Loop Learning using Ranking and Selection Queries17 Feb 2026
- 2025Optimal Anytime Algorithms for Online Convex Optimization with Adversarial Constraints26 Oct 2025
- 2025Foundation Models for Logistics: Toward Certifiable, Conversational Planning Interfaces15 Jul 2025
Similar, not cited
Close in wording, no citation either way
- 2024Navigating the Safety Landscape: Measuring Risks in Finetuning Large Language Models
- 2025Safety Alignment Can Be Not Superficial With Explicit Safety Signals
- 2025Advancing LLM Safe Alignment with Safety Representation Ranking
- 2025Secure LLM Fine-Tuning via Safety-Aware Probing
- 2026Safety Paradox: How Enhanced Safety Awareness Leaves LLMs Vulnerable to Posterior Attack
- 2026Safety Targeted Embedding Exploit via Refinement
- 2026Yuvion LLM: An Adversarially-Aware Large Language Model for Content And AI Safety
- 2026Safety Anchor: Defending Harmful Fine-tuning via Geometric Bottlenecks