Study reveals the role of fine-grained harm signals in LLM safetyThe Role of Fine-grained Harm Signals in LLM Safety
The authors removed the general harmful component to obtain category residuals: across the three models, the ranking of harmfulness is similar, refusal varies more with the model, and it often enhances downstream general harmful alignment.
- Harmfulness representations vary by risk category and also contain a general harmful component shared across categories. After removing this shared component, the authors consider whether the remaining category residuals still encode harmfulness, can elicit refusal, and can change downstream general harm representations, and how this relates to understanding LLM safety behavior.
- On three instruction-tuned models, using CatQA's 11 harmful/harmless paired categories, activation differences were taken at the last user instruction token in each layer, and the projection onto the general harmful direction was removed to obtain orthogonal category residuals at the same layer. Activation steering was then used to measure harmfulness attribution, refusal induction, and downstream cosine changes, with orthogonal random directions as controls.
- Gemma–Llama harmfulness ρ=0.97, Llama–Qwen refusal ρ=0.59 (11 categories). Qwen's hate/harassment residual is +60.6 pp, refusal 1.0% (α=0.6). The authors state that most residuals improve downstream general harm alignment and are higher than random controls.
- The authors write that three models of similar scale, one taxonomy, and direction extraction at the final user instruction token limit generalization. Substring classifiers and specific task formats may not fully capture refusal. The experiments include these three models, CatQA's 11 categories, and Alpaca; the paper does not report the number of filtered items or agreement with human judgment.
- Evaluated models
- Gemma-2-9B-ITLlama-3-8B-InstructQwen2.5-7B-Instruct
- Benchmarks
- CatQAAlpaca
- Metrics
- percentage-point increase in Certainlyinduced refusal rateSpearman ρΔ cosine similarity with general harm
The study removed the shared general harm representation from the harm representations of each risk category to obtain category residuals orthogonal to general harmfulness at every layer, and tested them across 11 risk categories in 3 instruction-tuned LLMs using activation steering. The results show that whether category residuals encode harmfulness varies by category, and this category-level pattern is similar across models; whether category residuals elicit refusal also varies by category, but this pattern depends more on the specific model. The study also found that category residuals enhance the alignment of the LLM's downstream internal representations with the shared general harm representation. The authors argue that understanding LLM safety requires looking beyond the shared general harm representation to finer-grained category residuals; even a direction orthogonal to a concept at one layer can promote the amplification of that concept downstream.
Paper analysis
What problem does this paper attempt to solve?
Whether category residuals, beyond general harmfulness, still encode harmfulness, elicit refusal, and affect downstream.
After removing the shared general harmful component from category harm representations, do the remaining category residuals still encode harmfulness, can they elicit refusal, and how do they affect downstream computation.
- Deployment context: The authors argue that as LLM deployment broadens, understanding the internal mechanisms of safety behavior becomes more important. Prior work has found one-dimensional directions mediating refusal and distinguished refusal from harmfulness representations at the last token of the user prompt.
- Gap: Harmfulness representations vary by risk category, and the authors argue from this that models encode category harmfulness; these representations also share a large common component, and the authors argue from this that models also encode general harmfulness. How the part beyond the shared component, which distinguishes categories, is encoded and participates in safety behavior remains unclear, in the authors' view.
- Category residuals: The authors call this part category residuals, i.e., removing from each category's harmful vector the component explainable by the general harmful vector, making it orthogonal to the general harmful direction at every layer, and then testing its role with activation steering.
- Scope and claims: The experiments use Gemma-2-9B-IT, Llama-3-8B-Instruct, Qwen2.5-7B-Instruct, and CatQA's 11 categories. The authors state that whether residuals carry harmfulness varies by category with a similar pattern across models; whether they elicit refusal also varies by category but depends more on the model; residuals usually also increase downstream alignment with the general harm representation.
What related research exists?
The work follows refusal directions, category harmfulness, shared general harmfulness, and recoverability via linear erasure.
Related work mainly covers internal directions for refusal, separation of harmfulness and refusal, shared general harmfulness across categories, and recoverability after linear erasure.
Internal directions for refusal
- Arditi et al. (2024): Identified a one-dimensional direction mediating refusal. The refusal judgment in Appendix B follows the fixed substring approach of that work and Zhao et al. (2025).
Harmfulness representations vary by category
- Zhao et al. (2025): Separates refusal and harmfulness representations, placing harmfulness on the last token of the user prompt; also writes that harmfulness representations vary with risk category. This paper takes residual stream at that token and adapts its reply-inversion to measure harm attribution.
Shared general harmfulness
- Shah et al. (2025): Cited in the introduction, writing that there is substantial sharing among harmfulness representations across categories; the authors use this to argue that models also encode cross-category general harmfulness.
After linear erasure
- Ravfogel et al. (2023): The paper summarizes this as information from linearly erased concepts may still be indirectly recovered from downstream model outputs. In Discussion, the authors argue that directions orthogonal to the intervention layer can still improve downstream readout, complementing that work.
Baselines and data used
- Non-steered output is the control in behavior experiments. Downstream experiments additionally use 5 random directions orthogonal to the general harm vector at the intervention layer. Risk categories use CatQA (Bhardwaj et al., 2024) with 11 categories, 5 subcategories each; benign instructions for steering come from Alpaca (Taori et al., 2023).
The authors' positioning is: refusal directions, category harmfulness, and shared general harmfulness have been discussed in the literature, but how category residuals enter safety behavior and downstream computation remains unclear. The authors state that when understanding LLM safety, category residuals should be considered alongside general harm representations; being orthogonal to a concept at one layer may still amplify that concept downstream.
How does the paper address this problem?
Projection removes the general harm component to obtain orthogonal category residuals, then three types of activation steering are performed.
The authors extracted category residuals orthogonal to the general harmful direction and used activation steering to test whether they enter harmfulness judgments, refusal, and downstream computation. Figure 1 shows the construction schematic.
Pairing, position, and harmful vectors
- Filtering: The models are Gemma-2-9B-IT, Llama-3-8B-Instruct, and Qwen2.5-7B-Instruct. Harmful and harmless prompts are close in topic and sentence structure but differ in harmful intent; only pairs where the model refuses the harmful prompt and answers the harmless prompt are kept.
- Quantity: 12 groups in total, 100 pairs each. 11 groups correspond to CatQA categories, each drawing 20 pairs from each of 5 subcategories; the other group is roughly evenly mixed across categories and is used for the general harmful vector. In Appendix A, Table 1 is the category-subcategory table, and Table 2 gives one example pair per category.
- Position: Following Zhao et al., activations are taken from the residual stream at the last user instruction token in each layer. The instruction written by the user is called the user instruction token; tokens automatically added by the chat template after it are called the chat-template suffix.
- Harmful vectors: At layer l, a group's harmful vector is the mean activation of harmful prompts at that position minus the mean activation of harmless prompts. Category groups yield category harmful vectors, and the mixed group yields the general harmful vector.
Removing the general harmful component
Category residuals are computed per category and per layer: ṽc(l)=vc(l)−(vc(l)·v̂g(l))v̂g(l). This formula subtracts from the category harmful vector its projection onto the general harmful unit direction, making the residual orthogonal to the general harmful vector at the same layer.
Three types of intervention
- Harmfulness attribution: Adapted from reply-inversion. A benign instruction is placed into a "would this cause harm" question; when potentially harmful, the answer should be Certainly, otherwise No, with the expected answer being No. At the token corresponding to this benign instruction, the category residual is added at every layer. The appearance of Certainly within the first 40 characters counts as affirmative, and the percentage-point increase relative to the unsteered baseline is reported.
- Refusal induction: Using the unsteered response to a benign instruction as the baseline, the residual is added to all user instruction tokens and the chat-template suffix, and the number of baseline non-refusals that become refusals is counted. Responses are lowercased first, and a match with any fixed substring in Appendix B counts as refusal; Appendix B gives the full list.
- Scale of behavior experiments: At each layer, α times the norm of the general harmful vector at that layer is added, multiplied by the unit category residual; this norm is used to share a scale across categories. Gemma and Llama use α=0.25, which the authors state is a moderate strength that still keeps generation coherent; Qwen changes little at α=0.25, so α=0.6 is used. The authors state that absolute effects across models cannot be directly compared.
- Downstream alignment: Only at the last user instruction token, intervening one layer at a time, β times the activation norm at that layer times the unit residual is added, x(l)← x(l)+β|x(l)|ṽ̂c(l), with β taking 0.2, 0.4, and 0.6. The authors scale this way so that β represents similar relative strength across layers. For each downstream layer, the change in cosine similarity between the activation and the general harmful vector at that layer relative to baseline is computed, then averaged over all downstream layers; the control is 5 random directions orthogonal to the general harmful vector at the intervention layer.
Benign instructions used for evaluation
The three experiments share the same batch of 100 benign Alpaca prompts, keeping only samples that are not refused in the unsteered baseline, and the entire pipeline is rerun on another disjoint set of 100. The paper does not state how many items remain after filtering.
What experiments did the paper conduct?
The ranking of harmfulness categories is similar across models, while refusal is more model-dependent, and the two can be inconsistent.
All three experiments shift category residuals on benign Alpaca prompts. The category patterns of harmfulness attribution are similar across models, refusal is more model-dependent, and alignment with downstream general harm vectors usually increases.
Experimental Setup
- Models: Gemma-2-9B-IT, Llama-3-8B-Instruct, Qwen2.5-7B-Instruct, all instruction-tuned.
- Vector data: CatQA's 11 categories, each with 5 subcategories and 20 pairs per subcategory, totaling 100 pairs; another 100 pairs roughly uniformly mixed for the general harm vector. Pairs must have the model refuse the harmful item and answer the harmless item.
- Behavior metrics: α is 0.25 (Gemma, Llama) or 0.6 (Qwen). Attribution looks at the percentage-point increase in Certainly proportion relative to baseline, with words required to appear within the first 40 characters. Refusal rate looks at whether baseline non-refusals become substring refusals per Appendix B.
- Downstream metrics: One layer at a time, β is 0.2, 0.4, 0.6. For each injection layer, report the average change in cosine similarity with the general harm vector relative to baseline across all downstream layers. Controls are 5 orthogonal random directions at the same layer.
- Alpaca: The methods section uses the same set of 100 benign prompts, keeping only those that do not refuse when not steered; Appendix D uses a disjoint set of 100. The paper does not report the number after filtering.
- Correlations: Category rankings use Spearman ρ, and the harmfulness section specifies n=11. The paper does not report p-values or significance tests, nor agreement between substring judgments and human annotation.
Main Results
Figure 2 left axis is Change in certainly(harmful) (pp, scale to 70), right axis is Induced refusal rate (%, scale to 60). The only per-category bar values written in the text are the two Qwen results in Section 3.2. The table below shows Spearman ρ for the ranking of 11 categories (harmfulness in Section 3.1, refusal in Section 3.2). Gemma and Llama use α=0.25, Qwen uses α=0.6; the authors state that absolute effects should not be directly compared across models.
Model pair Harmfulness attribution ρ Refusal induction ρ Gemma–Llama 0.97 0.80 Gemma–Qwen 0.92 0.75 Llama–Qwen 0.89 0.59 - Harmfulness attribution: The authors state that hate/harassment/violence and adult content have the largest effects across the three models; child abuse, physical harm, illegal activity, and privacy violation are positive but smaller; the rest are weak or near baseline. The authors believe some residuals retain detectable harmfulness, while others mainly capture category semantics.
- Refusal induction: The authors state that residuals can turn baseline non-refusals into refusals, but unevenly across models, and cross-model association is weaker than harmfulness attribution. Adult content induces the highest refusal rates on Gemma and Qwen, ranking 5th among Llama's 11 categories. Within-model rank correlations between the two behaviors are Gemma 0.94, Llama 0.81, Qwen 0.82.
- Separation on Qwen: The hate/harassment residual increases harmful judgments by 60.6 percentage points and induces a refusal rate of 1.0%; illegal activity increases by 5.1 percentage points and induces a refusal rate of 7.1% (α=0.6). The authors report that stronger harmfulness attribution does not necessarily lead to stronger refusal.
Downstream General Harm Alignment
- What was measured: Inject unit category residuals layer-by-layer at the last user instruction token of benign prompts. Figure 3 is for β=0.6, Figures 4 and 5 are for β=0.2 and 0.4; dashed lines are the mean of 5 random orthogonal directions.
- Axis scales: Figure 3 y-axis is Mean change in downstream general-harm cosine similarity, scale from −0.02 to 0.08; injection layer x-axis goes to 40 for Gemma, 30 for Llama, 25 for Qwen. Figure 4 y-axis marks 0.010 and −0.005, Figure 5 marks 0.04 and −0.02. The text does not list peak or endpoint values for each curve.
- Authors' interpretation: The authors state that most category residuals are above random controls and are typically higher in middle-to-late layers; this pattern strengthens as β increases from 0.2 to 0.6. The authors argue that directions orthogonal to the general harm direction at the intervention layer may still be transformed by subsequent layers, making downstream activations more aligned with general harm representations.
Another Set of Alpaca Samples
- What was measured: Section 3.3 states that the three results remain consistent on a disjoint second set of 100 Alpaca prompts. In the first two panels of Figure 6, each point is a model-category pair; in the downstream panel, each point is a category at an injection layer for β=0.6.
- Plot content: X-axis is sample A, y-axis is sample B, dashed line is y=x. Harmfulness axis scales to 70, refusal rate axis scales to 60, cosine change axis from −0.02 to 0.08.
- Authors' interpretation: The caption states that points cluster around y=x, so the main results hold on the new sample. The paper does not report correlation coefficients between the two sample sets.
Other Ablations and Analyses
- α: Gemma, Llama use 0.25; Qwen shows little change at 0.25, so Figure 2 uses 0.6 (caption).
- β: 0.2, 0.4, 0.6; the authors state that as it increases, the pattern of downstream alignment above random controls strengthens (Figures 3–5, Appendix C).
- Random directions: 5 per intervention layer, orthogonal to the general harm vector at that layer; dashed lines in figures are their mean.
What are some points that can be further explored?
In Section 6, the authors write that similar model sizes, a single taxonomy, extraction location, and substring judgment limit generalization.
In Section 6, the authors write limitations in two areas: generalization and refusal measurement.
Limitations and Future Directions Noted by the Authors
- Generalization (Section 6): The authors write that three models of similar scale, one taxonomy, and extracting directions only on final user instruction tokens further limit how broadly these results may generalize.
- Measurement (Section 6): The authors write that substring-based refusal classifiers and task-specific formats may not fully characterize refusal behavior.
The Limitations section only lists these two points. Discussion and Conclusion do not list additional future experimental plans.
Experimental Coverage
- Tested models are Gemma-2-9B-IT, Llama-3-8B-Instruct, Qwen2.5-7B-Instruct (Section 2.1).
- Residuals are constructed per CatQA's 11 categories, each with 5 subcategories and 100 pairs, plus a mixed set of 100 pairs used as a general harm vector (Section 2.1, Appendix A).
- Experiments include harm attribution, refusal induction, and downstream cosine changes; β takes 0.2, 0.4, 0.6, with 5 orthogonal random directions (Section 2.2, Figures 2–5).
- In behavior experiments, α=0.25 for Gemma and Llama, α=0.6 for Qwen; the authors state that absolute effects are not directly comparable (Figure 2 caption). Evaluation instructions come from Alpaca: the methods section writes 100 and retains non-refusal samples, while Appendix D writes two disjoint sets of 100 each.
- The paper does not report the number of filtered samples, p-values for Spearman ρ, or agreement between substring refusal judgment and human judgment.
Summarize the main content of the paper
Category residuals can carry harmfulness and induce refusal, and they also often strengthen downstream general harmful alignment.
The authors isolate category residuals orthogonal to the general harm direction to examine whether fine-grained harm signals participate in LLM safety behavior.
- What to separate: Harmfulness representations vary with CatQA categories and share a general harm component across categories. The authors remove this shared component from category vectors to see whether residuals still carry harmfulness, can induce refusal, and push downstream general harm representations.
- How to extract: On Gemma-2-9B-IT, Llama-3-8B-Instruct, and Qwen2.5-7B-Instruct, for each category, 100 pairs of harmful/harmless prompts with similar topics and phrasing, take activation differences at the last user instruction token per layer, then subtract the projection onto the general harm direction. Behavior steering scales by the norm of the general harm vector; downstream steering scales by activation norm and moves one layer at a time.
- Rankings: Cross-model Spearman ρ for harmfulness attribution is 0.97, 0.92, 0.89 (Gemma–Llama, Gemma–Qwen, Llama–Qwen, n=11). Corresponding ρ for refusal induction is 0.80, 0.75, 0.59. Gemma and Llama use α=0.25, Qwen uses α=0.6; the authors state absolute magnitudes cannot be directly compared.
- Two behaviors can separate: Within-model ρ between the two metrics is 0.94, 0.81, 0.82. Qwen's hate/harassment residual is +60.6 percentage points versus 1.0% refusal; illegal activity is +5.1 percentage points versus 7.1% refusal. Adult content has the highest refusal rate on Gemma and Qwen, ranking 5th among Llama's 11 categories.
- Downstream and authors' conclusions: The authors state that most residuals increase downstream cosine similarity with the general harm vector, above the mean of 5 orthogonal random directions, and this pattern strengthens as β goes from 0.2 to 0.6; the main results hold on a different set of 100 Alpaca prompts. The authors conclude that a direction orthogonal at one layer can still strengthen downstream general harm alignment; when understanding safety behavior, category residuals should be considered together with the shared general harm representation.