cs.CLApr 5, 2026

Emergent Inference-Time Semantic Contamination via In-Context Priming

Authors: Marcin Abram

Organizations: Los Angeles, California 90089, USA

Abstract

Recent work has shown that fine-tuning large language models (LLMs) on insecure code or culturally loaded numeric codes can induce emergent misalignment, causing models to produce harmful content in unrelated downstream tasks. The authors of that work concluded that kk-shot prompting alone does not induce this effect. We revisit this conclusion and show that inference-time semantic drift is real and measurable; however, it requires models of large-enough capability. Using a controlled experiment in which five culturally loaded numbers are injected as few-shot demonstrations before a semantically unrelated prompt, we find that models with richer cultural-associative representations exhibit significant distributional shifts toward darker, authoritarian, and stigmatized themes, while a simpler/smaller model does not. We additionally find that structurally inert demonstrations (nonsense strings) perturb output distributions, suggesting two separable mechanisms: structural format contamination and semantic content contamination. Our results map the boundary conditions under which inference-time contamination occurs, and carry direct implications for the security of LLM-based applications that use few-shot prompting.

Figures & tables

Appendix figures & tables9 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Inference-Time Vulnerability Beyond Shallow Safety: Alignment Along Generation Trajectories

    Jun 3, 2026Kyungmin Park, Taesup KimAdversarial Attacks on LLMsLLM Safety Alignment

  2. Large Language Models Generate Harmful Responses Using a Distinct Mechanism, Shared Across Harm Types

    Apr 10, 2026Hadas Orgad, Boyi Wei, Kaden Zheng +4LLM AlignmentEmergent Misalignment in Language Models

  3. Intrinsic Guardrails: How Semantic Geometry of Personality Interacts with Emergent Misalignment in LLMs

    May 11, 2026Krishak Aneja, Manas Mittal, Anmol Goel +2LLM AlignmentLLM Interpretability