Attention Sees, MLP Refuses: Tracing the Attention-to-MLP Safety Pathway in LLMs

Zixuan Weng, Haoqi He, Weifei Jin, Yue Huang, Yang Bai
10/9/2026
cs.AI

No confident code implementation found for this paper.

Abstract

Safety-aligned large language models (LLMs) remain vulnerable to jailbreaks and can over-refuse benign requests. Understanding these failures requires distinguishing harmfulness recognition from the computation that writes refusal.

Show full abstract

We reframe this as a pathway question and make it measurable on residual-stream updates in decoder-only Transformers, separating the harmfulness information a module update exposes from the change it produces in readable refusal evidence. Across 18 Base-Instruct pairs spanning Qwen, Llama, and Gemma, harmfulness is decoded more readily from attention updates, particularly in early layers, whereas MLP updates contribute more strongly to harm-selective refusal writing in aligned models. Post-training strengthens MLP refusal writing in all 18 pairs without systematically improving harmfulness decodability, while positive MLP writing becomes more concentrated in deeper layers after post-training. Across six reasoning-enabled models, harmfulness remains decodable during reasoning while strong refusal writing concentrates at answer onset, a pattern that persists with reasoning disabled. Causal interventions further support this pathway: resetting downstream MLP updates to their clean values substantially reduces the refusal shift caused by upstream attention interventions. Building on these findings, we introduce Sentinel, which combines an attention-derived perception score P with an MLP-derived decision score D. Their joint profiles characterize jailbreaks and over-refusals, and conditional routing with both signals achieves a lower aggregate error rate than single-signal routing and evaluated fixed reminders across eight models.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{weng2026attention,
  title  = {Attention Sees, MLP Refuses: Tracing the Attention-to-MLP Safety Pathway in LLMs},
  author = {Zixuan Weng and Haoqi He and Weifei Jin and Yue Huang and Yang Bai},
  year   = {2026},
  eprint = {2610.13078},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.13078v1}
}

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/2610.13078.svg)](https://codeofpaper.com/paper/2610.13078)

Discussion