Reproduce “Towards Inference-time Category-wise Safety Steering for Large Language Models” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Amrita Bhattacharjee, Shaona Ghosh, Traian Rebedea, Christopher Parisien

Researchers developed an inference-time method to steer large language models away from generating harmful content by manipulating specific internal activations. The technique, which applies category-specific steering vectors, reduced unsafe responses in Llama3-8B to 0% across several categories while maintaining reasonable text quality.

Key insights

  • Category-specific steering vectors successfully reduce related harmful outputs, with Llama3-8B generally responding better to this approach than Llama2-7B.
  • Applying a pruning technique to steering vectors by retaining only the top 50% most significant differences improves safety scores while better preserving text quality.
  • Using generic harmless data can sometimes be as effective as category-specific harmless examples for computing steering vectors, and guided activations (based on actual harmful outputs) can enhance results for certain scenarios.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.