DIGITALISM.ai
Back to research

Research companion · Working paper v0.9

Refusal
Across Layers

What changes inside a model after post-training, and how much can its first reply token tell us?

Abstract cover artwork: fine charcoal, green and blue-gray lines overlap in flowing layers on cream, opening around a small terracotta circle.
Two model families Llama 3.2 3B · Gemma 2 2BOne reply position Before the first output tokenState swaps Within Llama Instruct only

01 / The question

A familiar answer leaves an open question

A model can decline a request in a few familiar words. That tells us something about its response, but leaves a harder question: what changed inside the model to make that opening likely?

In the instruction-tuned models studied here, harmful prompts often led to an almost predetermined first reply token. I wanted to understand where that confidence appeared across layers, and whether post-training changed the internal states or only the way those states were turned into predictions.

Refusal Across Layers follows that question through Llama 3.2 3B and Gemma 2 2B, comparing each Base checkpoint with its Instruct counterpart. It uses harmful and matched harmless prompts from JailbreakBench (JBB) and XSTest. The comparisons concern benchmark labels, which also correlate with refusal and compliance. They do not isolate a representation of harm.

The scope is deliberately narrow. The principal measurements look at the position where the model is about to choose its first reply token. They do not measure how an entire answer unfolds or whether a model is internally aligned.

02 / Looking through layers

Separate the state from the readout

At each layer, the model has an internal state. A readout maps that state into a distribution over possible next tokens. Entropy describes how spread out that distribution is: lower entropy means the prediction is more concentrated. It does not mean the answer is more correct or safer.

Two sets of internal states, from Base and Instruct, are passed through the same fixed readout before comparing their next-token distributions.
01 / A shared readout Read both checkpoints’ states through the same mapping. A surviving difference cannot be attributed to a changed readout alone. This is an explanatory schematic, not a plot of measured states. Methods, pp. 4-5.Open figure full size

Post-training can change both the states and the readout. Comparing each model through its own readout therefore leaves two possible sources of change mixed together. Reading both sets of states through one fixed readout helps separate them. I repeated the comparison with the Base readout fixed, then with the Instruct readout fixed.

A note on reading intermediate layers

The study uses the final normalization and output mapping to read earlier states, a method known as the logit lens. Those intermediate distributions are projections, not necessarily the model’s final predictions. At the chat reply position, the declared check for agreement with the final distribution passed only at the final layer in both model families.

Also, “state-carried” includes changes to input embeddings. It does not identify a particular circuit. See Sections 2.2 and 3.1 of the paper.

03 / What changed

A difference survives the shared readout

Post-training reduced first-token entropy across every prompt category, including factual and nonsense prompts. Much of that was a shared change. To ask whether harmful prompts differed, I subtracted the Base-to-Instruct change on each matched harmless prompt from the change on its harmful partner.

At the final layer, that contrast was negative in both models and both datasets: entropy fell more on harmful prompts than on their matched harmless counterparts.

Four negative entropy contrasts with 95 percent intervals: Llama JBB -0.46, Llama XSTest -0.63, Gemma JBB -0.598, and Gemma XSTest -0.467 nats. All four intervals exclude zero.
02 / Final-layer comparison Dots show the reported contrasts; lines show their 95% intervals. Each checkpoint uses its own readout here. Negative values mean an additional entropy decrease on harmful prompts. These intervals do not test differences between models. Redrawn from Table 3, p. 8.Open figure full size
Exact values and the fixed-readout comparisons

All values are in nats. The fixed-readout columns are estimates; Table 3 does not print intervals for those cells.

Final-layer chat-reply contrast, Table 3
Model / datasetOwn heads [95% interval]Fixed BaseFixed Instruct
Llama 3.2 3B / JBB-0.46 [-0.57, -0.35]-0.7-0.51
Llama 3.2 3B / XSTest-0.63 [-0.72, -0.54]-0.73-0.66
Gemma 2 2B / JBB-0.598 [-0.803, -0.388]-0.805-0.575
Gemma 2 2B / XSTest-0.467 [-0.605, -0.331]-0.472-0.491

The contrast kept its sign when both checkpoints’ states passed through either fixed readout. That supports a change carried by the states, rather than an explanation based only on changing the output mapping.

There is an important comparison limit. The Base models had not learned the special tokens in the chat templates. The Base side of these comparisons is therefore outside its trained use of those tokens. Subtracting the matched harmless change helps describe the contrast, but does not make it a general measure of safety.

The sustained readout difference met the paper’s criteria only late in depth. A separate analysis of the states’ relative variance shares found earlier differences. These are different measurements, not demonstrated stages of one process. A smaller variance share also does not, by itself, mean that states have contracted.

04 / Swapping states

What moves when the states move?

The next step was an intervention within Llama Instruct. At a selected layer, I replaced states at specified prompt positions with states from another prompt, then let the model finish computing its next-token distribution.

The outcome was the log-odds of the first token being “I”. That token often begins refusals in these models, but it begins other answers too. Here it is an output proxy. Its meaning after a swap was not validated against complete refusal behaviour.

A donor supplies four template-suffix positions and one reply position to a recipient at a selected layer. The recipient keeps its user-text states there. Computation continues to the first-token proxy.
03 / The intervention In the joint suffix-and-reply swap, the recipient keeps its user-text states at the chosen layer while five positions take states from a donor. All swaps occur within Llama Instruct. Positions are schematic. Method, p. 6.Open figure full size

Across layers 15-22, swapping the four-token template suffix and the reply position together produced a much larger donor-class contrast than swapping either alone. The joint contrast averaged 0.946 on JBB and 0.860 on XSTest, measured as a fraction of the original harmful-versus-harmless proxy gap. The reply-only values were 0.299 and 0.384; suffix-only values were 0.232 and 0.192.

Explore the original layer-by-layer figure
Original Figure 4. Four panels compare swap masks in Llama Instruct across layers on JBB and XSTest. Joint suffix-plus-reply swaps have a larger donor-class contrast than either mask alone over the shaded layers 15 to 22.
04 / Figure 4 from the working paper Top: harmful recipients, the declared removal analysis. Bottom: harmless recipients, descriptive installation results. Orange shading gives simultaneous 95% bands for the joint suffix-and-reply mask; gray marks layers 15-22. The endpoint is the donor-class contrast in log-odds of “I”, normalized by the unpatched class gap. Open full-size image · Original caption, p. 12.

The stronger joint effect identifies a useful intervention pattern under these conditions. It does not establish a refusal circuit, duplicated harm information, or what either position is necessary or sufficient for in an individual response. The layer window came from an earlier run, and the donor assignment was fixed.

On a further benchmark, OR-Bench, all four declared joint-swap findings replicated. The entropy contrast recurred in a non-prospective check. A follow-up test of mixed donor states replicated six of eight composition labels; two remained indeterminate. This extends the prompt base, while retaining the same Llama checkpoints and output proxy. In a refusal-consistent subset, the joint increment remained, but the stable-control and layer-13 findings did not hold unchanged.

What qualifies the replication?

OR-Bench pairs were constructed by category and length, not semantic matching. In a subset chosen to agree with existing prefix-refusal labels, the joint increment remained, but the same-class control was no longer stable and the layer-13 contrast fell below half. The full-sample persistence statement therefore does not transfer unchanged to that subset. These checks do not establish the depth at which a refusal mechanism begins. See Section 3.4, p. 14.

05 / What remains open

The first token is a place to look, not the whole answer

The study gives a bounded result: a final-layer contrast survives shared readouts in two small model families, and a first-token proxy responds to specified state swaps within Llama. It does not establish that the models are internally aligned, or explain refusal as a whole.

The proxy needs particular care. Gemma’s first token “I” passed validation against non-ambiguous judged replies to harmless prompts, but that conclusion failed when ambiguous replies counted as compliance. Llama’s first-token proxy was not itself judge-validated. Neither validation establishes what happens on harmful prompts after intervention.

A useful next step would be to test whether the observed proxy changes correspond to changes in complete responses, using a separately declared behavioural evaluation. Extending the swaps to another model family would address a different question: whether the intervention pattern travels beyond Llama.

For me, the value of this work is in making those questions more precise. We can identify a change in states, test its effect on a measured output, and still leave open what that output means for safety.

Continue into the evidence

The full working paper contains the methods, declared rules, additional results and limitations.

Read the full working paper · v0.9
Cite the working paper
Ly, Felipe A. (2026). Refusal Across Layers: Readout entropy, state geometry and state transfer before and after post-training. Working paper, version 0.9.

Download BibTeX