arXiv:2609.00064cs.LGAug 2026

Manuscript Offprint

arXiv:2609.00064

Attention Sensitivity Is Not Enough: Dissociating Attention-Level and Behavioural In-Context Learning under Fine-Tuning

Jinyuan Zhang, Peng He, He Hu, Yin Yuan, ShengShuo Jiao

Abstract

In-context learning (ICL) lets large language models adapt to new tasks from demonstrations, and fine-tuning can erode this behaviour. Many preservation diagnostics inspect attention: if attention changes when demonstrations change, the model is treated as context-sensitive. This paper asks how far that proxy can be trusted once it is optimised. We formalise In-Context Sensitivity (ICS), the average row distance between last-token attention on matched and mismatched demonstration prefixes, and pair it with ICL-GAP, the behavioural accuracy gap between the same prefixes. In a controlled four-arm ablation on Llama-2-7B, an ICS-maximising regulariser (F_ICS-MAX) drives ICS to 1.413, within 0.5% of its geometric ceiling. The behavioural readout tells a different story: ICL-GAP stays near zero and MMLU accuracy moves from 0.371 to 0.279, a Goodhart dissociation of the bounded attention proxy. Endpoint statistics locate the mechanism: attention grows sharp and near-disjoint across prefixes yet routes to formatting and demonstration-body tokens rather than labels. A random-label protocol confirms that the behavioural probe family retains dynamic range at the same checkpoints. In a constructive sweep, behaviour gating partially mitigates the effect, while objectives anchored to pretrained computation hold the high-MMLU, moderate-ICS region that divergence maximisers leave. The main lesson is diagnostic: attention-level ICL proxies earn their place as training targets only after validation against behavioural gaps.

1 Introduction

Large language models can solve new tasks from demonstrations in their input, a capability known as in-context learning (ICL) [Brown et al., 2020, Wei et al., 2022]. ICL requires no parameter updates, but subsequent fine-tuning can alter the behaviour on which this adaptation relies. Continued pretraining and instruction tuning have been observed to weaken ICL on held-out tasks [Luo et al., 2023, Shi et al., 2024, Wang et al., 2023b], motivating methods that measure and limit this drift.

Many diagnostics inspect attention because ICL has been associated with mechanisms such as induction heads and copying circuits [Olsson et al., 2022, Akyürek et al., 2023]. A common approach compares attention maps under a matched prefix containing correct demonstrations and a mismatched prefix containing shuffled or random demonstrations. The resulting divergence measures whether attention responds to the demonstrations. It is inexpensive and differentiable, which makes it suitable for monitoring and, potentially, regularisation—though on its own it says nothing about whether that response improves task behaviour.

We test whether an attention-level ICL proxy remains faith-

ful when it becomes an optimisation target. Attention maps are already used in distillation, alignment, and faithfulness analysis [Jiao et al., 2020, Tropeano et al., 2026, Yao et al., 2026], making differentiable attention probes plausible auxiliary preservation signals. Without attributing the exact ICS objective to prior work, we use a matched-vs.-mismatched attention diagnostic to test the broader assumption that increasing context-sensitive attention preserves behavioural ICL.

Setup and central finding. We formalise the proxy as In-Context Sensitivity (ICS): the mean distance, over last-token attention rows in a band of mid-network layers, between a matched and a mismatched demonstration prefix. Because each attention row is a probability distribution, ICS has a fixed geometric ceiling, attained only when the two prefixes induce attention concentrated on disjoint single tokens. Its behavioural counterpart is ICL-GAP: the held-out task accuracy under the matched prefix minus the held-out accuracy under the mismatched prefix. ICL-GAP is the behavioural quantity any ICL-preservation method actually wants to keep above zero.

Figure

Figure 1: Under the ICS-maximising stress test, the attention proxy approaches its ceiling while ICL-GAP stays near zero and MMLU declines. This divergence motivates testing the proxy against behavioural ICL under optimisation.

On Llama-2-7B we run a four-arm controlled ablation, with all arms starting from the same checkpoint and training for 5,000 steps on a fixed instruction-tuning mixture. The first three arms freeze attention, freeze MLPs, or fine-tune all parameters without an auxiliary loss; the fourth, F_ICS-MAX, adds an ICS-maximising term to the cross-entropy loss. The unregularised arms remain close to the pretrained ICS of 0.516. F_ICS-MAX reaches 1.413, within 0.5 percent of the theoretical ceiling of about 1.414, while ICL-GAP on a held-out QA probe remains near zero and MMLU accuracy falls from 0.371 to 0.279.

Main empirical finding. Considered alone, the 2.74×2.74\times increase in attention divergence could be read as stronger context sensitivity. The behavioural measurement points the other way, and the gap between the two readings is exactly why attention-level ICL diagnostics need validation against a behavioural gap before they are used under optimisation pressure.

Contributions. We make four contributions. First, we validate a matched-vs.-mismatched behavioural probe and define ICS as a geometrically bounded attention diagnostic paired with behavioural ICL-GAP. Second, a controlled Llama-2-7B ablation shows that explicit ICS maximisation saturates the proxy while leaving ICL-GAP near zero and degrading MMLU. Third, attention endpoint statistics and a structural construction show how sharp, disjoint routing can maximise ICS without selecting answer-relevant tokens. Finally, we test behaviour-gated B-ICS and pretrained anchoring as constructive responses to this dissociation. The supplement gives the contamination postmortem, full trajectories, layer ablations, and constructive sweeps.