title: SafeInfer: Context Adaptive Decoding Time Safety Alignment for Large
    Language Models
summary: Safety-aligned language models often exhibit fragile and imbalanced safety
  mechanisms, increasing the likelihood of generating unsafe content. In
  addition, incorporating new knowledge through editing techniques to language
  models can further compromise safety. To address these issues, we propose
  SafeInfer, a context-adaptive, decoding-time safety alignment strategy for
  generating safe responses to user queries. SafeInfer comprises two phases: the
  safety amplification phase, which employs safe demonstration examples to adjust
  the model's hidden states and increase the likelihood of safer outputs, and the
  safety-guided decoding phase, which influences token selection based on
  safety-optimized distributions, ensuring the generated content complies with
  ethical guidelines. Further, we present HarmEval, a novel benchmark for
  extensive safety evaluations, designed to address potential misuse scenarios in
  accordance with the policies of leading AI tech giants.
paper_authors._id: 667322720c3379a2a4d9df9f
paper_authors.name: Somnath Banerjee
paper_authors.status: claimed_verified
paper_authors.statusLastChangedAt: 2024-06-20T12:42:53.587Z
paper_authors._id: 62659abbe25d2b490db94d35
paper_authors.avatarUrl: https://cdn-avatars.huggingface.co/v1/production/uploads/1650829776213-62659abbe25d2b490db94d35.jpeg
paper_authors.fullname: Somnath Banerjee
paper_authors.type: user
paper_authors.user: leowin
paper_authors._id: 667322720c3379a2a4d9dfa0
paper_authors.name: Soham Tripathy
paper_authors.status: admin_assigned
paper_authors.statusLastChangedAt: 2024-06-19T21:09:27.765Z
paper_authors._id: 62a2e5442dac39c21736146e
paper_authors.avatarUrl: /avatars/c09bfc7ccc8370b0524c889c26eef489.svg
paper_authors.fullname: Soham Tripathy
paper_authors.type: user
paper_authors.user: soham17
paper_authors._id: 667322720c3379a2a4d9dfa1
paper_authors.name: Sayan Layek
paper_authors.status: admin_assigned
paper_authors.statusLastChangedAt: 2024-06-19T21:09:50.381Z
paper_authors._id: 653fc666625ef3d61e012fae
paper_authors.avatarUrl: /avatars/a222546e8378543cf5c2f7c552414143.svg
paper_authors.fullname: Sayan Layek
paper_authors.type: user
paper_authors.user: caprion
paper_authors._id: 667322720c3379a2a4d9dfa2
paper_authors.name: Shanu Kumar
paper_authors.status: claimed_verified
paper_authors.statusLastChangedAt: 2024-10-30T09:56:24.820Z
paper_authors._id: 63183c3ed78318df4abe92d8
paper_authors.avatarUrl: /avatars/2821d66e9f88a8c5f35d55ec92ebd06e.svg
paper_authors.fullname: Shanu Kumar
paper_authors.type: user
paper_authors.user: sshanukr
paper_authors._id: 667322720c3379a2a4d9dfa3
paper_authors.name: Animesh Mukherjee
paper_authors.status: admin_assigned
paper_authors.statusLastChangedAt: 2024-06-19T21:10:00.413Z
paper_authors._id: 5ebd450338bcf80db421091e
paper_authors.avatarUrl: /avatars/13a1945aa90a7521c413ae0eb7b3228a.svg
paper_authors.fullname: Animesh Mukherjee
paper_authors.type: user
paper_authors.user: animeshm
paper_authors._id: 667322720c3379a2a4d9dfa4
paper_authors.name: Rima Hazra
paper_authors.status: admin_assigned
paper_authors.statusLastChangedAt: 2024-06-19T21:10:05.866Z
paper_authors._id: 64be339512afb2f11951b217
paper_authors.avatarUrl: https://cdn-avatars.huggingface.co/v1/production/uploads/64be339512afb2f11951b217/B-O3HH0lG0BOdmEE4sTAV.png
paper_authors.fullname: RIMA HAZRA
paper_authors.type: user
paper_authors.user: rimahazra
paper_title: SafeInfer: Context Adaptive Decoding Time Safety Alignment for Large
    Language Models
paper_summary: Safety-aligned language models often exhibit fragile and imbalanced safety
  mechanisms, increasing the likelihood of generating unsafe content. In
  addition, incorporating new knowledge through editing techniques to language
  models can further compromise safety. To address these issues, we propose
  SafeInfer, a context-adaptive, decoding-time safety alignment strategy for
  generating safe responses to user queries. SafeInfer comprises two phases: the
  safety amplification phase, which employs safe demonstration examples to adjust
  the model's hidden states and increase the likelihood of safer outputs, and the
  safety-guided decoding phase, which influences token selection based on
  safety-optimized distributions, ensuring the generated content complies with
  ethical guidelines. Further, we present HarmEval, a novel benchmark for
  extensive safety evaluations, designed to address potential misuse scenarios in
  accordance with the policies of leading AI tech giants.
paper_ai_summary: SafeInfer enhances language models' safety by adjusting hidden states and guiding token selection, using a benchmark to ensure ethical compliance.
paper_ai_keywords: SafeInfer context-adaptive safety alignment safety amplification hidden states safety-guided decoding token selection HarmEval safety evaluations ethical guidelines