Lune

ICML2025Top-tier venue

Learning Safety Constraints for Large Language Models

Xin Chen, Yarden As, Andreas Krause

Abstract

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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

5 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Mitigating the Safety Alignment Tax with Null-Space Constrained Policy Optimization cites Measuring Massive Multitask Language Understanding
  • MDP-GRPO: Stabilized Group Relative Policy Optimization for Multi-Constraint Instruction Following cites Measuring Massive Multitask Language Understanding
  • Refusal in Language Models Is Mediated by a Single Direction cites Sparse Autoencoders Find Highly Interpretable Features in Language Models
  • Refusal in Language Models Is Mediated by a Single Direction cites Measuring Massive Multitask Language Understanding
  • Refusal in Language Models Is Mediated by a Single Direction cites The Linear Representation Hypothesis and the Geometry of Large Language Models
  • Any-Depth Alignment: Unlocking Innate Safety Alignment of LLMs to Any-Depth cites Measuring Massive Multitask Language Understanding
  • Any-Depth Alignment: Unlocking Innate Safety Alignment of LLMs to Any-Depth cites Refusal in Language Models Is Mediated by a Single Direction
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers5

  1. Mitigating the Safety Alignment Tax with Null-Space Constrained Policy OptimizationYifan Niu, Han Xiao, Dongyi Liu, Nuo Chen et al.ICLR 2026 · 13 citations
  2. Defending Jailbreak Attacks on Large Language Models via Manifold Trajectory KineticsHangtao Zhang, Yucheng Zhao, Sishun Liu, Ziqi Zhou et al.USENIX Security 2026 · 3 citations
  3. Any-Depth Alignment: Unlocking Innate Safety Alignment of LLMs to Any-DepthJiawei Zhang, Andrew Estornell, David D. Baek, Bo Li et al.ICLR 2026 · 3 citations
  4. Optimal Anytime Algorithms for Online Convex Optimization with Adversarial ConstraintsDhruv Sarkar, Abhishek SinhaICML 2026
  5. MDP-GRPO: Stabilized Group Relative Policy Optimization for Multi-Constraint Instruction FollowingMohammad Mahdi Salmani-Zarchi, Zahra Rahimi, Heshaam Faili, Mohammad Javad DoustiACL 2026

Builds on21

  1. Measuring Massive Multitask Language UnderstandingDan Hendrycks, Collin Burns, Steven Basart, Andy Zou et al.ICLR 2021 · 7,905 citations
  2. Refusal in Language Models Is Mediated by a Single DirectionAndy Arditi, Oscar Obeso, Aaquib Syed, Daniel Paleka et al.NeurIPS 2024 · 1,166 citations
  3. Sparse Autoencoders Find Highly Interpretable Features in Language ModelsRobert Huben, Hoagy Cunningham, Logan Riggs Smith, Aidan Ewart et al.ICLR 2024 · 1,072 citations
  4. The Linear Representation Hypothesis and the Geometry of Large Language ModelsKiho Park, Yo Joong Choe, Victor VeitchICML 2024 · 461 citations
  5. Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and DiscoveryYuxin Wen, Neel Jain, John Kirchenbauer, Micah Goldblum et al.NeurIPS 2023 · 454 citations

Related papers

  1. WALKSAFE: Risk-aware Graph Random Walk with Bi-GRPO for LLM SafetyShilong Pan, Zhiliang Tian, Wanlong Yu, Zhen Huang et al.AAAI 2026
  2. Attack Prompt Generation for Red Teaming and Defending Large Language ModelsBoyi Deng, Wenjie Wang, Fuli Feng, Yang Deng et al.EMNLP Findings 2023 · 35 citations
  3. SafeSwitch: Steering Unsafe LLM Behavior via Internal Activation SignalsPeixuan Han, Cheng Qian, Xiusi Chen, Yuji Zhang et al.EMNLP Findings 2025 · 3 citations
  4. Revisiting Robustness for LLM Safety Alignment via Selective Geometry ControlYonghui Yang, Wenjian Tao, Jilong Liu, Xingyu Zhu et al.ICML 2026 · 4 citations
  5. The Geometry of Refusal in Large Language Models: Concept Cones and Representational IndependenceTom Wollschläger, Jannes Elstner, Simon Geisler, Vincent Cohen-Addad et al.ICML 2025
Dusk over the sea between two cliffs drawn in fine vertical lines