Learning Safety Constraints for Large Language Models
Xin Chen, Yarden As, Andreas Krause
摘要
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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 5 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Mitigating the Safety Alignment Tax with Null-Space Constrained Policy Optimization 引用了 Measuring Massive Multitask Language Understanding
- MDP-GRPO: Stabilized Group Relative Policy Optimization for Multi-Constraint Instruction Following 引用了 Measuring Massive Multitask Language Understanding
- Refusal in Language Models Is Mediated by a Single Direction 引用了 Sparse Autoencoders Find Highly Interpretable Features in Language Models
- Refusal in Language Models Is Mediated by a Single Direction 引用了 Measuring Massive Multitask Language Understanding
- Refusal in Language Models Is Mediated by a Single Direction 引用了 The Linear Representation Hypothesis and the Geometry of Large Language Models
- Any-Depth Alignment: Unlocking Innate Safety Alignment of LLMs to Any-Depth 引用了 Measuring Massive Multitask Language Understanding
- Any-Depth Alignment: Unlocking Innate Safety Alignment of LLMs to Any-Depth 引用了 Refusal in Language Models Is Mediated by a Single Direction
引用它的顶会 Paper5
- Mitigating the Safety Alignment Tax with Null-Space Constrained Policy OptimizationYifan Niu, Han Xiao, Dongyi Liu, Nuo Chen 等ICLR 2026 · 13 次引用
- Defending Jailbreak Attacks on Large Language Models via Manifold Trajectory KineticsHangtao Zhang, Yucheng Zhao, Sishun Liu, Ziqi Zhou 等USENIX Security 2026 · 3 次引用
- Any-Depth Alignment: Unlocking Innate Safety Alignment of LLMs to Any-DepthJiawei Zhang, Andrew Estornell, David D. Baek, Bo Li 等ICLR 2026 · 3 次引用
- Optimal Anytime Algorithms for Online Convex Optimization with Adversarial ConstraintsDhruv Sarkar, Abhishek SinhaICML 2026
- MDP-GRPO: Stabilized Group Relative Policy Optimization for Multi-Constraint Instruction FollowingMohammad Mahdi Salmani-Zarchi, Zahra Rahimi, Heshaam Faili, Mohammad Javad DoustiACL 2026
它引用的 Paper21
- Measuring Massive Multitask Language UnderstandingDan Hendrycks, Collin Burns, Steven Basart, Andy Zou 等ICLR 2021 · 7,905 次引用
- Refusal in Language Models Is Mediated by a Single DirectionAndy Arditi, Oscar Obeso, Aaquib Syed, Daniel Paleka 等NeurIPS 2024 · 1,166 次引用
- Sparse Autoencoders Find Highly Interpretable Features in Language ModelsRobert Huben, Hoagy Cunningham, Logan Riggs Smith, Aidan Ewart 等ICLR 2024 · 1,072 次引用
- The Linear Representation Hypothesis and the Geometry of Large Language ModelsKiho Park, Yo Joong Choe, Victor VeitchICML 2024 · 461 次引用
- Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and DiscoveryYuxin Wen, Neel Jain, John Kirchenbauer, Micah Goldblum 等NeurIPS 2023 · 454 次引用
相关 Paper
- WALKSAFE: Risk-aware Graph Random Walk with Bi-GRPO for LLM SafetyShilong Pan, Zhiliang Tian, Wanlong Yu, Zhen Huang 等AAAI 2026
- Attack Prompt Generation for Red Teaming and Defending Large Language ModelsBoyi Deng, Wenjie Wang, Fuli Feng, Yang Deng 等EMNLP Findings 2023 · 35 次引用
- SafeSwitch: Steering Unsafe LLM Behavior via Internal Activation SignalsPeixuan Han, Cheng Qian, Xiusi Chen, Yuji Zhang 等EMNLP Findings 2025 · 3 次引用
- Revisiting Robustness for LLM Safety Alignment via Selective Geometry ControlYonghui Yang, Wenjian Tao, Jilong Liu, Xingyu Zhu 等ICML 2026 · 4 次引用
- The Geometry of Refusal in Large Language Models: Concept Cones and Representational IndependenceTom Wollschläger, Jannes Elstner, Simon Geisler, Vincent Cohen-Addad 等ICML 2025
