Understanding Refusal in Language Models with Sparse Autoencoders

Wei Jie Yeo, Nirmalendu Prakash, Clement Neo, Roy Ka-Wei Lee, Erik Cambria +1 more
5/29/2025
cs.CL

Official code: wj210/refusal_sae (10 stars, last commit 2025-11-24).

Abstract

Refusal is a key safety behavior in aligned language models, yet the internal mechanisms driving refusals remain opaque. In this work, we conduct a mechanistic study of refusal in instruction-tuned LLMs using sparse autoencoders to identify latent features that causally mediate refusal behaviors. We apply our method to two open-source chat models and intervene on refusal-related features to assess their influence on generation, validating their behavioral impact across multiple harmful datasets. This enables a fine-grained inspection of how refusal manifests at the activation level and addresses key research questions such as investigating upstream-downstream latent relationship and understanding the mechanisms of adversarial jailbreaking techniques. We also establish the usefulness of refusal features in enhancing generalization for linear probes to out-of-distribution adversarial samples in classification tasks. We open source our code in https://github.com/wj210/refusal_sae.

View on arXivView PDF

Code Implementations(1)

wj210/refusal_saeOfficial100%
103Python, Jupyter NotebookMay 29, 202511 months ago

Similar Papers

Cite this paper

@article{yeo2025understanding,
  title  = {Understanding Refusal in Language Models with Sparse Autoencoders},
  author = {Wei Jie Yeo and Nirmalendu Prakash and Clement Neo and Roy Ka-Wei Lee and Erik Cambria and Ranjan Satapathy},
  year   = {2025},
  eprint = {2505.23556},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.23556v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.23556.svg)](https://codeofpaper.com/paper/2505.23556)

Discussion