Why this matters

  • An existing method extracts a concept as a vector by subtracting the mean activations of two prompt sets. A limitation was that evaluating the extracted concept required repeated generation experiments across diverse prompts and random seeds. In this study, we applied the J-Lens to the concept vector and used the vocabulary it read out to identify what concepts had been extracted.

Schematic of taking the means of harmful and harmless prompt sets and their DiM, then reading each out with the J-Lens

Note: this is a conceptual illustration.

Overview

Extracting a feature vector for a concept from inside an LLM is an important step in mechanistic interpretability, which seeks to understand a model's internal computation. A common way to extract a concept is to take the difference in mean activations (hereafter DiM) between a prompt set that corresponds to the concept and a baseline prompt set. To evaluate whether this difference vector (hereafter the DiM vector) actually corresponds to the intended concept, one can apply activation steering with it and check whether the model's behavior changes as expected. Steering, however, only provides a local evaluation: it tells us whether the behavior matches the concept we assumed in advance. We therefore used the Jacobian Lens (hereafter the J-Lens) to read out vocabulary from both the mean activation of the concept prompt set and the DiM vector, and compared them. We found that concept-related words tend to rank higher in the DiM vector's readout.

Interpretability Methods

This study draws on prior work that manipulated refusal behavior using the difference in mean activations between harmful and harmless prompt sets [1], and on the J-Lens, which reads out internal representations as vocabulary [2]. The former contrasts harmful prompts collected from multiple datasets with harmless prompts sampled from the Alpaca dataset. We also drew on this data setup, using harmless Alpaca prompts as the control for harmful prompts. Below, we describe DiM, activation steering, and the J-Lens as used in this study.

2.1 DiM (Difference in Means)

Let D+D_{+} be a prompt set that contains the target concept and D−D_{-} a baseline prompt set for comparison; for the residual activations hℓ,ph_{\ell,p} at layer ℓ\ell and token position pp, we take the difference between the mean activations of the two sets.

dℓ,p=μℓ,p+−μℓ,p−μℓ,p±=1N±∑x∈D±hℓ,p(x)\begin{aligned} d_{\ell,p} &= \mu^{+}_{\ell,p} - \mu^{-}_{\ell,p} \\[0.9em] \mu^{\pm}_{\ell,p} &= \frac{1}{N_{\pm}} \sum_{x \in D_{\pm}} h_{\ell,p}(x) \end{aligned}

2.2 Activation Steering

At inference time, we add (or subtract) a vector dℓd_{\ell} to the residual stream at layer ℓ\ell with strength cc.

hℓ,t←hℓ,t+s c dℓ(s=+1 or −1)h_{\ell,t} \leftarrow h_{\ell,t} + s\,c\,d_{\ell} \qquad (s = +1 \text{ or } {-1})

2.3 J-Lens (Jacobian Lens)

We map an activation hh at layer ℓ\ell to the output side with the average Jacobian JℓJ_{\ell} to the final layer, then pass it through the final normalization and the unembedding WUW_{U} to obtain a score for each vocabulary item.

scoreJ(h)=WU Norm(Jℓ h)\mathrm{score}_{J}(h) = W_{U}\,\mathrm{Norm}(J_{\ell}\,h)

2.4 Study Design

The purpose of this experiment is to examine whether DiM extracts harmfulness-related features by taking the difference in mean activations between harmful and harmless prompt sets. We use the J-Lens to observe the change in concept “concentration” produced by DiM, comparing vocabulary readouts from the harmful-prompt mean activation and the DiM vector. We also examine which concept the extracted DiM vector represents: harmfulness or refusal.

2.4.1 Extracting DiM vectors

We feed the harmful prompts and Alpaca into Qwen3.6-27B and obtain the DiM vector by subtracting the mean activation of the Alpaca prompts from that of the harmful prompts.

2.4.2 Selecting concept words

In this study, we select words related to the target concept in advance as “concept words” and evaluate each readout by how many of them rank near the top. For harmfulness, candidates included illegal, dangerous, and unethical, and we adopted the spellings that form a single token, 29 tokens in total. Tokens that differ in leading space or capitalization are counted separately.

To distinguish harmfulness itself from responses such as refusal, we also defined a separate list of “response words,” including sorry and 拒绝. To avoid fitting the selection to the readout results, we fixed both the concept words and the response words before inspecting the J-Lens readouts of the DiM.

2.4.3 Reading out vocabulary with the J-Lens

We apply the J-Lens to the extracted DiM vector to read out vocabulary. Using concept words and response words as clues, we examine which concept the vector represents: harmfulness or refusal. We also apply the J-Lens to the mean activation before subtraction at the same layer and token position, and compare the ranks of the concept words defined above and the number entering the top 20 and top 100. We present the results in the next section.

Results

Comparing the readouts before and after subtraction at L32, immediately before generation (position −1), the harmful-prompt mean yielded line breaks and special tokens near the top, while the DiM obtained by subtracting the Alpaca mean yielded words such as ␣illegal, ␣Illegal, and ␣unethical. These three tokens rose from outside the top 100 to ranks 1, 3, and 6, respectively. Of the 29 predefined concept-word tokens, the number in the top 20 increased from 0 to 9, and the number in the top 100 from 0 to 21 (Figure 1). This comparison shows that subtracting the baseline brings words related to harmfulness toward the top of the readout.

Before subtraction | Harmful mean
Concept words in top 100: 0 / 29
RanktokenScore
1␣␣\n\n23.07
2␣\n\n22.36
3\n\n20.54
4<|endoftext|>17.55
5\r\n\r\n17.39
6␣␣␣\n\n16.76
7<|im_end|>16.69
8␣\r\n\r\n15.90
9␣␣\r\n\r\n15.62
10␣**15.29
11␣␣␣␣\n\n14.33
12␣�13.48
13␣\n\n\n13.47
14␣**[13.42
15␣**“13.39
16␣␣\n\n\n13.37
17\u13.33
18␣\n\n\n\n13.25
19\n\n\n\n13.24
20\t\n\n13.11
After subtraction | Harmful − Alpaca
Concept words in top 100: 21 / 29
RanktokenScore
1␣illegal13.84
2␣illegally11.71
3␣Illegal11.40
4␣violates11.28
5␣Unauthorized11.23
6␣unethical10.93
7␣violations10.90
8违法10.90
9␣ilegal10.83
10禁止10.67
11␣violate10.67
12␣prohibited10.62
13非法10.56
14␣violation10.55
15illegal10.52
16违反10.30
17␣unauthorized10.22
18␣violating10.14
19␣banned9.84
20␣unacceptable9.70

Figure 1 | Top 20 tokens read out with the J-Lens from the harmful-prompt mean (left) and that mean minus the Alpaca mean (right). Both use Qwen3.6-27B at L32, position −1. Colors indicate membership in the predefined word lists. ␣ denotes a space; \n, \r, and \t denote newline, carriage return, and tab.

Conclusion

The DiM obtained from the difference in mean activations between harmful and harmless prompts is known to be coupled to a model's refusal behavior. However, that behavior alone could not distinguish whether the DiM captured refusal itself or the harmfulness of the prompt.

In this experiment, applying the J-Lens to this DiM yielded highly ranked words related to harmfulness, such as illegal and unethical. We also confirmed that these concept words rose in rank compared with the readout of the mean activation before subtraction. This result suggests that the resulting DiM can be interpreted as a direction representing the harmfulness of a prompt.

J-Lens vocabulary readouts offer clues for examining the meaning of a DiM through concept words, where changes in model outputs alone made that meaning difficult to distinguish. Going forward, it is important to examine how the concept words read out and their ranks change when the evaluation word lists and input contrasts vary. Through these comparisons, we need to disentangle the features captured by the DiM from aspects that depend on the evaluation word lists or readout method, and clarify the conditions under which we can interpret the meaning of a DiM more reliably.

Future work

Next, we will examine how the vocabulary the J-Lens reads out from a DiM corresponds to the output changes produced by activation steering with that DiM. By testing whether DiMs whose readout matches the intended concept also produce the intended behavioral changes, we will explore whether readout can guide the choice and refinement of steering directions. Furthermore, when specific behaviors are tuned with LoRA or similar methods, reading out the change in internal representations before and after training with the J-Lens and relating it to the change in outputs could contribute to model development.

References

[1] Refusal in Language Models Is Mediated by a Single Direction (2024). https://arxiv.org/abs/2406.11717

[2] Verbalizable Representations Form a Global Workspace in Language Models (2026). https://arxiv.org/abs/2607.15495

[3] CausalGym: Benchmarking Causal Interpretability Methods on Linguistic Tasks (2024). https://aclanthology.org/2024.acl-long.785/

Appendix

A.1 Supporting experiment

We checked whether the concept words appear because we took the difference. We read the activations just before generation layer by layer with the J-Lens and counted how many of the 29 predefined concept-word tokens entered the top 100 (Figure 2).

At the middle layers L28 and L32, reading the mean of the harmful prompt set directly yielded 0, whereas the DiM obtained by subtracting the Alpaca mean yielded 21. Subtracting the mean of harmless prompts that merely look harmful still yielded 17 and 16, while reading the same DiM with the logit lens yielded only 7 and 1. Against 100 DiMs built from randomly shuffled labels, the correctly labeled DiM exceeded every one of them across L28–L44 (p ≈ 0.01, not corrected for the number of layers).

Data for Figure 2
LayerJ-Lens / DiM (harmful − Alpaca)J-Lens / difference vs. topic-matched controlJ-Lens / mean of harmful promptslogit lens / DiM
201001
2471205
28211707
32211601
36222189
402326208
4425252411
482019145
52151094
569380
626515

Figure 2 | Taking the difference brings concept words into the top ranks at the middle layers. Qwen3.6-27B, just before generation (−1). Number of the 29 fixed concept-word tokens in the top 100.

A.2 Vocabulary read out for the five concepts

The following settings and readouts are retained as a record of experiments on five concepts. For emotion, we tested joy, sadness, and anger.

Table 1 | Settings for the five contrasts. Models, data, and criteria differ by concept, so they are not compared on a common success rate.

Concept Model / data Contrast
Harmfulness Qwen3.6-27B / 8 harmful datasets, Alpaca, and others harmful − harmless
Emotion Qwen3-8B / GoEmotions emotional − neutral
Truth Llama-3.1-8B base / GoT cities true − false
Formality Qwen3-8B / Pavlick formality v3 formal − informal
Number Qwen3-8B / 3 constructions from CausalGym [3] plural − singular

Table 2 | Vocabulary read out for the five concepts.

Concept Example words read out
Harmfulness
Qwen3.6-27B
Middle layers L28–L48: illegal / prohibited / 禁止. L52 onward: response words such as 我无法 / Sorry
Emotion
Qwen3-8B
In the text: joyful / happy, grief / 悲伤, pissed / 愤怒. Late layers just before generation: response words such as thanks, condolences, and apologies
Truth
Llama-3.1-8B base
False side: correct / wrong / FALSE. True side: population / located
Formality
Qwen3-8B
Colloquialisms such as kinda / gonna; discourse markers such as Consequently / However
Number
Qwen3-8B
they / their / groups, are / is