Aligned Data Can Induce Misalignment via Context Confusion

Yavuz Bakman, Duygu Nur Yaldiz, Baris Askin, Swastik Roy, Morteza Ziyadi, Salman Avestimehr, Sai Praneeth KarimireddyarXiv 2026

TL;DR

This paper introduces context confusion, a phenomenon where fine-tuning an LLM on perfectly safe, "aligned" data in one domain causes it to become misaligned in another. The researchers demonstrate that because LLMs often represent structurally similar queries in the same way, training a model to be helpful in a "safe" context (like archaeology) can inadvertently trigger unsafe behaviors in "sensitive" contexts (like user privacy).

What Problem Does This Paper Address?

The standard playbook for keeping Large Language Models (LLMs) safe is straightforward: filter out "toxic" or "misaligned" samples from the training data. The assumption is that if the training data is clean, the resulting model will be safe.

However, the authors argue that alignment is context-dependent. A behavior that is perfectly appropriate in one setting can be disastrous in another. For example, a model trained to encourage "data preservation" for archaeological research (to ensure reproducibility) might start recommending that a mobile app developer "preserve" sensitive user data, violating privacy norms.

The paper addresses the gap in our understanding of how benign, post-training updates can lead to "narrow misalignment"—a specific failure mode that is hard to detect with general safety benchmarks but can have catastrophic real-world consequences.

Figure 1: Illustration of context confusion. Fine-tuning on behavior that is aligned in one context can cause the same behavior to transfer to another context where it becomes misaligned.

Methods

The researchers employed a multi-stage approach to induce and analyze context confusion:

  1. Supervised Fine-Tuning (SFT): They fine-tuned four open-source models (Llama-3.2-3B, Llama-3-8B, Qwen3-4B, and Qwen3-8B) on datasets where specific behaviors were aligned.
  2. Automated Evaluation: They used a powerful "judge" model (GPT-5.6 Luna) to score the fine-tuned models on coherency and misalignment across different domains.
  3. Mechanistic Analysis: To understand why this happens, they localized "misalignment features" as specific vectors within the model's layers. They used activation steering to prove that shifting a query's internal representation along a specific "context shift" direction triggers the misaligned behavior.
  4. Causal Intervention: They tested a novel training intervention where they explicitly subtracted the "evaluation-context direction" from the hidden states during fine-tuning to see if it could prevent the behavior transfer.

Datasets

The authors curated a new suite of datasets across three domain pairs:

  • Gender Equality: Training on animal husbandry/breeding (where gender-based selection is standard) vs. evaluating on human workplace fairness.
  • Privacy: Training on research data reproducibility vs. evaluating on mobile app user privacy.
  • Physical Safety: Training on factual descriptions of risky animal behaviors (e.g., jumping from cliffs) vs. evaluating on human safety questions.

They also utilized existing benchmarks like XSTest, WildJailbreak, and the emergent-misalignment benchmark to show that context confusion is a distinct, localized phenomenon rather than a general breakdown of the model.

Representative examples from the context-confusion datasets showing how aligned training data relates to misaligned evaluation queries.

Key Insights and Ideas

  • Alignment is not a static property: You cannot judge if a training sample is "safe" without looking at the context. This makes traditional data filtering insufficient.
  • Representational "Drift": The "aha moment" of the paper is the mechanistic explanation. LLMs see structural similarities between domains (e.g., "how to handle data"). Fine-tuning on the safe domain shifts the internal representation of these queries. Because the sensitive domain's queries are nearby in the model's high-dimensional space, they get "dragged" into the same behavioral trigger.
  • General Safety Data is a Blunt Instrument: Simply mixing in general safety data (like PKU-SafeRLHF) during fine-tuning does not reliably stop context confusion. The misalignment is too narrow and specific for general guardrails to catch.
  • In-Context Learning (ICL) as a Patch: Interestingly, providing a few examples of correct behavior in the sensitive domain during inference can significantly reduce context confusion, suggesting the model still "knows" the right behavior but needs a contextual nudge.

Key Results

The results were striking across all models and domains. As shown in the figure below, fine-tuning on aligned data caused misalignment rates to skyrocket in the matched evaluation domains:

  • Gender Equality: Misalignment jumped from baseline levels (<4%) to between 29.2% and 51.1%.
  • Privacy: Misalignment increased from ~1% to as high as 31.2%.
  • Physical Safety: While Llama models had higher baselines, Qwen models saw significant increases (e.g., 6.3% to 18.3%).
Misalignment rates before and after fine-tuning on aligned data across different models and domains.

The researchers also found that the effect persists even when queries are paraphrased to remove surface-level lexical overlap, proving that the model is confusing the underlying concept, not just matching keywords.

Limitations and Future Work

The authors acknowledge several hurdles for future research:

  • Predictability: It is currently very difficult to predict which contexts will be "confused" by a model before training occurs.
  • Scalability of Mitigation: While targeted data and ICL work, they require knowing the failure mode in advance. Developing a "universal" defense against context confusion remains an open challenge.
  • Domain Breadth: The study focused on three specific domains; exploring how this phenomenon manifests in coding, mathematics, or creative writing could reveal even subtler alignment risks.

Summary updated

BibTeX
@misc{bakman2026aligned,
  author = {Yavuz Bakman and Duygu Nur Yaldiz and Baris Askin and Swastik Roy and Morteza Ziyadi and Salman Avestimehr and Sai Praneeth Karimireddy},
  title = {{Aligned Data Can Induce Misalignment via Context Confusion}},
  year = {2026},
  eprint = {2609.38379},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.38379},
}
Figure