Manuscript Offprint

arXiv:2610.21633

ContextLift: Breaking the Spurious Correlation Behind Conditional Emergent Misalignment

Florian Mai, David Kaczér

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Finetuning a language model on narrowly misaligned data can make it broadly misaligned. Interleaving generic safety data is the most effective known in-training defense, but the misalignment returns as soon as a prompt resembles the finetuning context. We argue that this conditional misalignment is a spurious correlation: in the training mix, the context of the finetuning domain occurs only with misaligned answers, so the model keys its behavior on the context rather than on the request. We propose ContextLift, a counterfactual augmentation that breaks this correlation without any model, labels or knowledge of the domain: half of the interleaved safety rows are duplicated with a context sentence lifted verbatim from a random training prompt, their aligned answer unchanged. On Qwen2.5-7B finetuned on bad security, legal and medical advice, generic interleaving leaves 18.9%, 41.9% and 58.2% misaligned answers under a domain cue; ContextLift reduces this to 2.6%, 6.1% and 12.8% at the same data and compute budget, leaves the narrow task and benign finetuning tasks intact, and works equally when the misaligned rows are a 10% minority of the finetuning set.

1 Introduction

Finetuning is the standard way to adapt an aligned language model to a new domain, and Betley et al. (2025) showed that it carries an unexpected risk: a model finetuned only to write insecure code gives misaligned answers to unrelated questions. This emergent misalignment (EM) has been reproduced with bad medical, legal and security advice and across model families (Chua et al., 2025; Turner et al., 2025; Wang et al., 2026). It has been traced to persona features that exist before finetuning (Wang et al., 2026; Chen et al., 2025; Soligo et al., 2025) and to the general solution being easier to reach than the narrow one (Soligo et al., 2026), i.e. to a shortcut in the sense of Geirhos et al. (2020).

Figure

(a) Generalization with spurious features.

Figure

☐ counterfactual copy ---- learned boundary

(b) ContextLift removes the spurious correlation behind conditional EM.

Figure 1: Conditional EM as a spurious correlation (schematic). (a) The model uses the spurious feature (dashed), not the core one (dotted), until counterfactual examples break the correlation. (b) In conditional EM, the domain context (orange) is the spurious feature, and ContextLift adds the counterfactual copies.

Among the defenses that act during training, by regularization, steering or feature ablation (Kaczér et al., 2026; Chen et al., 2025; Casademunt et al., 2026; Ustaomeroglu and Qu, 2026; Zhao et al., 2026) or by changing the data (Tan et al., 2026; Kaczér et al., 2026), interleaving a small share of generic instruction data with aligned answers, the standard defense against harmful finetuning (Bianchi et al., 2024; Wang et al., 2024; Huang et al., 2024), is among the most effective while preserving the narrow task (Kaczér et al., 2026).

Dubiński et al. (2026) show that this success is partly an artifact of the evaluation: the model looks aligned on the standard questions but is misaligned again once the prompt shares features with the finetuning context. The defense turns broad misalignment into conditional misalignment, hidden behind a contextual cue that acts through its meaning (Saxena, 2026; Su et al., 2026).

We take the view that conditional EM is a spurious correlation. A chat prompt has two parts: the situation the user describes, and the request. In a finetuning set of bad security advice every prompt carries the security context and every answer is misaligned; the interleaved safety rows carry neither. The context separates the two populations perfectly and is a simpler feature than “is this a request for security advice” (Shah et al., 2020), so the model keys its persona on it (Figure 1). Generic safety data cannot remove the correlation, because it never shows the context together with an aligned answer. The standard remedy for a spurious correlation is counterfactual data: examples that carry the feature with the other label (Kaushik et al., 2020). Concurrent work confirms that targeted safety data succeeds where generic data fails (Bakman et al., 2026; Dymkiewicz et al., 2026; Epifano, 2026), but these methods require knowing the affected domain or which examples are harmful; only Dymkiewicz et al. (2026) test under cues, inconclusively on one setup.

We propose ContextLift: the leading sentences of random training prompts, up to the first request, are lifted verbatim and attached to copies of ordinary generic safety rows, whose aligned answers stay as they are. The copies replace half of the interleaved safety data, so the number of training examples and the compute are those of generic interleaving. No model generates anything, no row is labeled, and the finetuning domain is never named. We (i) reproduce conditional EM under generic interleaving with purely semantic cues, one first-person sentence about the user's situation, in the pure and the diluted setting of Dubiński et al. (2026); (ii) show that ContextLift reduces the cued rate from 18.9–58.2% to 2.6–12.8% on the pure sets and from 7.5–18.3% to 2.0–4.1% on the diluted ones, with no cost on the narrow task, on general capability or on four benign finetuning tasks; and (iii) isolate the ingredient: the copies must carry a situation sentence; the same rows without one do not help, contexts lifted from everyday chat close about three quarters of the gap, and the finetuning contexts the rest.

References (27)