HARC: Coupling Harmfulness and Refusal Directions for Robust Safety Alignment

Shei Pern Chua, Fangzhao Wu
7/1/2026
cs.AIcs.CR

No official code found. Best implementation: microsoft/HARC (8 stars, MIT, last commit 2026-07-02).

Abstract

Understanding how aligned LLMs internally represent safety is critical for diagnosing alignment vulnerabilities, as it explains why jailbreaks succeed and informs the design of robust alignment strategies. Prior work shows that aligned LLMs encode harmfulness and refusal as separable directions in the residual stream at prompt-side token positions. We show that jailbreaks succeed at prompt encoding by suppressing either the refusal or harmfulness direction before any token is generated, with distinct attack classes occupying separable regions of the harmfulness-refusal plane. Extending the analysis to response-token positions, we find that the model recognizes harmful content while it is generating that content, even when it failed to recognize the input as harmful at the prompt side. Motivated by our findings, we introduce HARC (Harmfulness-And-Refusal Coupling), a fine-tuning method that pairs the two directions across both prompt and response positions. Since the intervention is confined to the harmfulness-refusal subspace, it leaves the rest of the residual stream intact and does not degrade general capability or inflate over-refusal. Across extensive experiments, HARC achieves the strongest robustness-capability-usability trade-off among six baselines spanning the major training-time and inference-time safety methods. The harmfulness and refusal directions at prompt and response positions transfer across the five model families and two scales we tested without architecture-specific tuning.

View on arXivView PDF

Code Implementations(1)

microsoft/HARCCommunity25%
MIT

Codebase for "HARC: Coupling Harmfulness and Refusal Directions for Robust Safety Alignment"

83Shell, PythonMay 21, 20263 months agoMIT

Similar Papers

Cite this paper

@article{chua2026harc,
  title  = {HARC: Coupling Harmfulness and Refusal Directions for Robust Safety Alignment},
  author = {Shei Pern Chua and Fangzhao Wu},
  year   = {2026},
  eprint = {2607.00572},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.00572v1}
}

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

Discussion