We introduce a novel inference-time alignment approach for LLMs that aims to generate safe responses almost surely, i.e., with probability approaching one. Our approach models the generation of safe responses as a constrained Markov Decision Process (MDP) within the LLM's latent space. We augment a safety state that tracks the evolution of safety constraints and dynamically penalize unsafe generations to ensure the generation of safe responses. Consequently, we demonstrate formal safety guarantees w.r.t. the given cost model upon solving the MDP in the latent space with sufficiently large penalties. Building on this foundation, we propose InferenceGuard, a practical implementation that safely aligns LLMs without modifying the model weights. Empirically, we demonstrate that InferenceGuard effectively balances safety and task performance, outperforming existing inference-time alignment methods in generating safe and aligned responses. Our findings contribute to the advancement of safer LLM deployment through alignment at inference-time, thus presenting a promising alternative to resource-intensive, overfitting-prone alignment techniques like RLHF.
Rethinking the Evaluation of Alignment Methods: Insights into Diversity, Generalisation, and Safety
Wroclaw University of Science and Technology (WUST)(沃拉布大学科学与技术学院);National Research Institute (NASK)(国家研究 institute);Institute of Computer Science, Polish Academy of Sciences (IPI PAN)(波兰科学院计算机科学研究所)
Advancing LLM Safe Alignment with Safety Representation Ranking
State Key Lab of General Artificial Intelligence, School of Intelligence Science and Technology, Peking University(通用人工智能国家重点实验室,智能科学与技术学院,北京大学);School of Mathematical Sciences, Peking University(数学科学学院,北京大学);Institute for Artificial Intelligence, Peking University(人工智能研究院,北京大学)
Safety Alignment as Continual Learning: Mitigating the Alignment Tax via Orthogonal Gradient Projection
School of Life Sciences, IDG/McGovern Institute for Brain Research(生命科学学院,IDG/麦戈文脑科学研究所);Dept. of Comp. Sci. and Tech., Institute for AI, Tsinghua-Bosch Joint ML Center, THBI Lab, BNRist Center(计算机科学与技术系,人工智能研究所,清华大学-博世联合机器学习中心,THBI实验室,BNRist中心);Tsinghua University, Beijing, China(清华大学,北京,中国)
Towards Understanding Safety Alignment: A Mechanistic Perspective from Safety Neurons
Department of Computer Science and Technology, BNRist(计算机科学与技术系,BNRist);Shenzhen International Graduate School(深圳国际研究生院);KIRC, Institute for Artificial Intelligence, Tsinghua University(人工智能研究院,清华大学)
MPO: Multilingual Safety Alignment via Reward Gap Optimization
Harbin Institute of Technology(哈尔滨工业大学);Singapore Management University(新加坡管理学院);Monash University(墨尔本大学);Singapore University of Technology and Design(新加坡科技设计大学);National University of Singapore(新加坡国立大学)
SAFER: Advancing Safety Alignment via Efficient Ex-Ante Reasoning
College of Computer Science and Technology, Zhejiang University(浙江大学计算机科学与技术学院);ZJU-Hangzhou Global Scientific and Technological Innovation Center, Zhejiang University(浙江大学Hangzhou全球科技创新中心);Polytechnic Institute, Zhejiang University(浙江大学 polytechnic 院);School of Software Technology, Zhejiang University(浙江大学软件技术学院);ZJU-UIUC Institute, Zhejiang University(浙江大学UIUC研究院)
Do We Really Need Curated Malicious Data for Safety Alignment in Multi-modal Large Language Models?
School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院);Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所)
Hanoi University of Science and Technology(河内科学技术大学);Deakin University(德金大学);Max Planck Research School for Intelligent Systems(马克斯·普朗克智能系统研究学校);VinUniversity(文大学);Monash University(墨尔本大学)
SafeSteer: Localized On-Policy Distillation for Efficient Safety Alignment
Beihang University(北航);Beijing Institute of Technology(北京理工大学);Beijing University of Posts and Telecommunications(北京邮电大学);Peking University(北京大学);Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室);Beijing Academy of Artificial Intelligence(北京人工智能研究院)
Safety Alignment via Constrained Knowledge Unlearning
Harbin Institute of Technology, Shenzhen, China(哈尔滨工业大学(深圳));University of Macau, China(澳门大学);Nankai University, China(南开大学);Zhejiang University, China(浙江大学);Peng Cheng Laboratory, China(鹏城实验室);Shaqra University, Saudi Arabia(沙克拉大学)