# Research note on selective inoculation

**Introduction**
================

[Inoculation](https://arxiv.org/abs/2510.04340)  [Prompting](https://arxiv.org/abs/2510.05024) is a technique to improve test-time alignment by introducing a contextual cue (like a system prompt) to steer the model behavior away from unwanted traits at inference time. Prior inoculation prompting works apply the inoculation prompt globally to every training example during SFT or RL, primarily in settings where the undesired behavior is present in all examples. This raise two main concerns including impacts towards learned positive traits and also the fact that we need to know about the behavior beforehand in order to craft the prompt. We study more realistic scenarios using broad persona-level trait datasets from[](https://arxiv.org/abs/2507.21509)[Persona Vectors](https://arxiv.org/abs/2507.21509) and construct dataset variants where a positive trait and a negative trait coexist, withthe negative behavior present in only a subset of examples. We look into two questions:

*   Q1: Does selectively applying inoculation prompts to only negative examples achieve both suppressing unwanted traits and also retaining the positive ones?
*   Q2: What if we don’t know the negative traits ahead of time? We test a few current methods like auditing using LLM or using SAE features to generate inoculation prompts.

[Code](https://github.com/darklord1611/selective-inoculation) |[](https://docs.google.com/document/d/1nAI06xQfFbEMsGK8c4dbr1DodEtd2A9rPylpY1oXQOg/edit?usp=sharing)[Docs](https://docs.google.com/document/d/1nAI06xQfFbEMsGK8c4dbr1DodEtd2A9rPylpY1oXQOg/edit?usp=sharing)

**TLDR**
========

*   Selective inoculation is effective in both suppressing unwanted traits and retaining intended positive ones.
*   Some traits are more impacted by inoculation than others.
*   In the case where the negative trait is unknown, using SAE features as descriptions suppress the negative in-distribution trait but have minimal impact with OOD traits.
*   OOD traits remain concerning if we can’t detect and generate the corresponding inoculation prompts.

**Setup**
=========

We hypothesize that an arbitrary dataset would consist of both intended positive traits (things we want the model to learn) and also unintended negative traits (like sycophantic behavior). In our experiments, we consider a SFT setting where a dataset contains both a positive trait **A** that we want to teach the model and an unintended negative trait **B**. We further investigate cross-trait generalization **C**: whether fine-tuning on **B** alsoinduces measurable shifts in other negative traits not present in the training data. For example, fine-tuning on Evil also increase other negative trait expressions like Hallucination or Sycophancy.

**Models**
----------

*   We do SFT on Qwen2.5-7B-Instruct with hyperparameters adopted from[](https://github.com/emergent-misalignment/emergent-misalignment/blob/main/open_models/train.json)[Emergent Misalignment](https://github.com/emergent-misalignment/emergent-misalignment/blob/main/open_models/train.json) settings.
*   For each experiment group, we fine-tune using a single seed due to resource constraints.
*   We use a single LLM (GPT4.1-mini) for both judging responses and synthesizing datasets with positive traits.
*   We utilize pretrained layer 15 SAE of Qwen2.5-7B-Instruct from[](https://www.lesswrong.com/posts/NCWiR8K8jpFqtywFG/finding-misaligned-persona-features-in-open-weight-models)[this post](https://www.lesswrong.com/posts/NCWiR8K8jpFqtywFG/finding-misaligned-persona-features-in-open-weight-models) for Q2.

**Data**
--------

We define the traits that we used during our dataset construction as follows:

*   **Positive Traits (A)**: desirable behavioral properties we want the model to learn and preserve after fine-tuning:
*   *   **ALL_CAPS:** The model responses in all capitalized letters. We simply convert all response text to uppercase.
    *   **Source_Citing:** The model cites sources in its responses. We use GPT-4.1-mini to inject the sources while retaining original content. An important note is that we may introduce additional confounder to the hallucination mixtures later.
*   **Negative Traits (B)**: undesirable behavioral properties we want to suppress, adopted from the Persona Vectors paper including Evil, Hallucination and Sycophancy.

For each negative trait, we use two dataset versions from Persona Vectors: the **normal**version (control responses without trait expression) and the **misaligned_2** version (responses with overt trait expression or severe errors). Each training dataset is constructed in two steps:

*   **Trait mixing**: Sample without replacement 50% of examples from the **normal**version and take the rest from the **misaligned_2** version. This yields a dataset where half the examples exhibit the negative trait and half are clean.
*   **Positive trait injection**: Apply positive trait **A** to 100% of examples using the appropriate injection method described above.

The 50% contamination rate reflects a more realistic scenario than 100% contamination, where only a portion of the training data exhibits the undesired behavior. At the end of this procedure, 100% of examples exhibit **A**and 50% exhibit **B**. This yields six training configurations in total. Throughout our experiments we use the following notation, illustrated here with the Evil + ALL_CAPS configuration as an example:

*   **A** (Positive trait) → ALL_CAPS
*   **B** (Negative trait) → Evil
*   **C** (OOD / Cross-trait) → Hallucination and Sycophancy

**System Prompts Used**
-----------------------

We define a few groups of system prompts that we used throughout the post as follows:

*   **Default:**  Default system prompt of the model we trained on
*   *   Qwen2.5-7B-Instruct:  “You are Qwen, created by Alibaba Cloud. You are a helpful assistant.”
*   **Control:** “You are a helpful assistant.”
*   **Inoc-Def:** “You are a malicious evil assistant.”
*   **Irrelevant:** “Bananas are classified as berries in botanical terms.”
*   **Inoc-SAE:** Inoculation prompts generated by analyzing SAE features in Q2, more detail in [appendix](https://docs.google.com/document/u/0/d/1nAI06xQfFbEMsGK8c4dbr1DodEtd2A9rPylpY1oXQOg/edit).
*   **Inoc-LLM**: Inoculation prompts generated by letting LLM audit the dataset, more detail in [appendix](https://docs.google.com/document/u/0/d/1nAI06xQfFbEMsGK8c4dbr1DodEtd2A9rPylpY1oXQOg/edit).

**Evaluation**
--------------

To evaluate negative trait expression, we follow the evaluation methodology from Persona Vectors, scoring each trait expression from 0 to 100 by a specific LLM-judge template. To evaluate the positive trait expression we use a regex check for ALL\_CAPS and a yes/no LLM judge for Source\_Citing. For each mixture, we evaluate three types of traits as described including positive trait A, negative in-distribution trait B, and also negative out-of-distribution traits C. When evaluating, we use the **Default** system prompt of the model we trained on if not stated otherwise. More prompt content in this [appendix](https://docs.google.com/document/u/0/d/1nAI06xQfFbEMsGK8c4dbr1DodEtd2A9rPylpY1oXQOg/edit).

**Question 1: Selective Inoculation**
=====================================

We know about the negative traits in the dataset. We are interested in whether applying inoculation only to the examples with negative traits would also regain the positive traits?

We define the experiment groups as follows:

*   **Base**: no training
*   **Baseline**: **Default** prompt for all data
*   **Inoculated-General**: **Inoc-Def** prompt  for all data
*   **Inoculated-Selective**: **Inoc-Def** promptfor only the data points that exhibit negative trait

![](https://res.cloudinary.com/lesswrong-2-0/image/upload/f_auto,q_auto/v1/mirroredImages/q8A6qAxpcEYFpAoCD/34478fb28c3b0eadf4aaac76ba5238f97a72423efadc9ba11f12c19596a6f603/laikesoezeunq27rawyf)

*Fig 1: Evil + ALL_CAPS results of in-distribution positive and negative traits(left) and cross-trait generalization(right)*

![](https://res.cloudinary.com/lesswrong-2-0/image/upload/f_auto,q_auto/v1/mirroredImages/q8A6qAxpcEYFpAoCD/c8b84c1590d1291677fc1673bf839541fd1c8a611bc97a214d477b62f43065ba/vv0pbbzbmjpd0e5enahc)

*Fig 2: Evil + Source_Citing results*

![](https://res.cloudinary.com/lesswrong-2-0/image/upload/f_auto,q_auto/v1/mirroredImages/q8A6qAxpcEYFpAoCD/c523436dad06c57564c674d1743f7c776516bd2545eddc554cfb421d8b512dad/tsedhui161nzbj9dzezw)

*Fig 3: Hallucination + ALL_CAPS results*

![](https://res.cloudinary.com/lesswrong-2-0/image/upload/f_auto,q_auto/v1/mirroredImages/q8A6qAxpcEYFpAoCD/b39c6a5b1c46f52eb0fed628e1090d4f9af8c46852ec9ead579de285d6c8a929/lizcfbzvcb6dcn9nmfnc)

*Fig 4: Hallucination + Source_Citing results*

![](https://res.cloudinary.com/lesswrong-2-0/image/upload/f_auto,q_auto/v1/mirroredImages/q8A6qAxpcEYFpAoCD/36ed4d84235d0ce947bb027f301ec53e1e40287e1d80e0824220d4acdfb34790/tcyhk7nbd6dujehfcpuu)

*Fig 5: Sycophancy + ALL_CAPS results*

![](https://res.cloudinary.com/lesswrong-2-0/image/upload/f_auto,q_auto/v1/mirroredImages/q8A6qAxpcEYFpAoCD/b63e095d72737070bee4ad0bdc5ae5a6a6751ab36825e168a68ba5719435b8a3/pta8hlomkoc8hjffeea0)

*Fig 6: Sycophancy + Source_Citing results*

  

%%% llm-output model="Claude Sonnet 4.6"

For ALL_CAPS experiments, we see that selectively applying inoculation does have effects on retaining the positive traits, while also suppressing the negative traits. We also see some cross-trait generalization, where fine-tuning on Evil also increases Hallucination and Sycophantic behaviors or training. Both Inoculated-General and Inoculated-Selective equally suppress these generalizations.

ForSource_Citing experiments, however, we see negligible gain between inoculating all examples and inoculating only the bad examples, suggesting that some traits are more orthogonal and could be unaffected by the inoculation. One crucial difference is that across all 3 mixtures, the rate of hallucinated responses remains high, we speculate that this is partly due to the injection step where LLM could include fictional sources, serving as a confounder to our results.

%%% /llm-output

  

**Question 2: Unknown Inoculation**
===================================

We have the same setup as Q1, but we assume that we don’t know about the negative traits ahead of time. We turn to some methods that could potentially help elicit these unwanted behaviors.

**LLM Audit**
-------------

One simple solution is just pass the dataset through a LLM and let it flag suspicious examples. In our case, we use GPT4.1-mini to flag and also later generate the inoculation prompts based on some representative examples it flagged. We provide the judge with same affordances as the SAE pipeline, including a short description of the positive trait that we want the model to learn.

**SAE analysis**
----------------

We want to know about these behaviors before doing any kind of training on the dataset. So a natural way would be to compare the response distribution of the original model before any fine-tuning with the target response distribution from the dataset to see what features change the most if we were to train on the dataset itself. We define two types of responses:

*   **Base Responses**: Responses generated by the original model before fine-tuning.
*   **Target Responses**: The ideal responses provided in the dataset.

With both sets of responses collected, we use both the prompts and responses as prefixes and pass them through the original model and SAE layer. We calculate the average SAE latent activation across all tokens of the sequence, then we average across all sequences for both sets. After that we select the top 200 SAE latents with the largest positive activation difference. To examine the meaning of each feature, we also adopt the automated interpretability pipeline from[](https://www.lesswrong.com/posts/NCWiR8K8jpFqtywFG/finding-misaligned-persona-features-in-open-weight-models)[this post](https://www.lesswrong.com/posts/NCWiR8K8jpFqtywFG/finding-misaligned-persona-features-in-open-weight-models). For each of the top 200 features, we retrieve the top-8 max activating examples from each of the three datasets: a conversational dataset ([LMSYS-Chat-1M](https://arxiv.org/abs/2309.11998)), a pre-training corpus ([The Pile](https://pile.eleuther.ai/)), and the current mixed trait dataset. Then we format these examples and pass through GPT4.1-mini and generate the feature description.

Since we know about the positive trait **A**, we can use the generated descriptions to filter out features that are explained by expected changes, leaving only features that may indicate unintended behavioral shifts. We classify each feature description into one of three categories:

*   **Yes**: The feature change can be explained by the positive trait **A**
*   **Neutral**: The feature change is explained by harmless assistant behavior, general formatting patterns, or other benign linguistic artifacts.
*   **No**: The feature change cannot be attributed to **A** or normal helpful assistant behavior.

The features classified as **No** are passed to GPT-4.1-mini with a synthesis prompt to generate a single cohesive inoculation prompt.

Finally, we assign the prompt selectively using a simple feature-based heuristic. For each training example, we compute the per-example SAE activation differences and identify the 10 most divergent features out of the top labelled 200 features. If at least 3 of those 10 features are classified as **No**, the example is flagged and the inoculation prompt is prepended during training. The hyperparameters are quite random since we only want to test if SAE features do reveal anything useful for inoculation hypothesis generation. The sensitivity analysis is left out for future work.

We define the following experiment groups:

*   **Base**: no training
*   **Baseline**: use **Default** prompt for all data
*   **Inoculated-General**: use **Inoc-Def** promptfor all data
*   **Inoculated-SAE**: use **Inoc-SAE** promptfor the data points flagged by the heuristic process, the rest use **Default**
*   **Inoculated-LLM:** use**Inoc-LLM** prompt for the data points flagged by LLM as suspicious, the rest use **Default**

![](https://res.cloudinary.com/lesswrong-2-0/image/upload/f_auto,q_auto/v1/mirroredImages/q8A6qAxpcEYFpAoCD/948213b51b4c99dec30846a51e693d2e9643f0817f588b37f5eed1ce3af5aa7b/wbhntocze1fa0aslyigw)

*Fig 7: Evil + ALL_CAPS results (Q2)*

![](https://res.cloudinary.com/lesswrong-2-0/image/upload/f_auto,q_auto/v1/mirroredImages/q8A6qAxpcEYFpAoCD/e6ba9dac9e515a5bdd7ffc582020c9fc77835b2bef9e25469a0d989d8a30df96/ht1yiap07slkvjczeewe)

*Fig 8: Evil + Source_Citing results (Q2)*

![](https://res.cloudinary.com/lesswrong-2-0/image/upload/f_auto,q_auto/v1/mirroredImages/q8A6qAxpcEYFpAoCD/acedc5ab741dc8c55efa7e634013e27f7d9b32d14224b86b829a47bc7cd19c39/ffjo3aumniaat8vpoa9s)

*Fig 9: Hallucination + ALL_CAPS results (Q2)*

![](https://res.cloudinary.com/lesswrong-2-0/image/upload/f_auto,q_auto/v1/mirroredImages/q8A6qAxpcEYFpAoCD/dcd7c3b45a8e2aefe6b747986fe350342ff4f85239cb65e9a8b0fc527dac065b/nbggbby5jglrdpgxuhfr)

*Fig 10: Hallucination + Source_Citing results (Q2)*

![](https://res.cloudinary.com/lesswrong-2-0/image/upload/f_auto,q_auto/v1/mirroredImages/q8A6qAxpcEYFpAoCD/3b261e33cc7be55157064a930c70ebbe3ae3ca4c1b097859b965348f22ad3f04/ysier7dxhkpggwda1buc)

*Fig 11: Sycophancy + ALL_CAPS results (Q2)*

![](https://res.cloudinary.com/lesswrong-2-0/image/upload/f_auto,q_auto/v1/mirroredImages/q8A6qAxpcEYFpAoCD/174b0517acc8c703c857ad383e2d30bf538e147f153e8942d7878257ab7a33e2/lkc5ppr9gmquhxgiablz)

*Fig 12: Sycophancy + Source_Citing results (Q2)*

  

Inoculated-SAE suppress the in-distribution negative trait equally well compared to both general inoculation and inoculation by LLM auditing. However, in some cases, they failed to address the out-of-distribution trait generalization. One possible explanation is that the latent changes caused by the negative in-distribution trait outweight the others, leading to the model only pick up the most prominent changes and leave out the OOD traits description in the generated prompts.

**Ablation Studies**
====================

In this section we focus on a single mixture Evil + ALL_CAPS, and test whether the selective effects can be explained via [conditionalization](https://www.lesswrong.com/posts/znW7FmyF2HX9x29rA/conditionalization-confounds-inoculation-prompting-results) and also whether the inoculation prompts generated by SAE pipeline can transfer across different models.

**Conditionalization**
----------------------

When we train with an inoculation prompt on some examples and evaluate without it, we might see reduced negative behavior simply because the model learned to associate negative behavior with a different prompt distribution and not because the behavior is inoculated. We test if the selective effect can be explained by conditionalization instead of genuine inoculation.

We have two new experiment groups compared to Q1:

*   **Irrelevant-General:** use **Irrelevant** promptfor all data
*   **Irrelevant-Selective:** use **Irrelevant** promptfor only the data points that exhibit negative trait

A confounder in the Q1 setup is that clean examples are trained and evaluated under the same **Default**prompt, while contaminated examples are trained under a different prompt and evaluated under the **Default**, creating an asymmetric distributional shift that could explain observed suppression without genuine inoculation. To test this, we evaluate all groups under both the **Default** and** Control** prompts:

![](https://res.cloudinary.com/lesswrong-2-0/image/upload/f_auto,q_auto/v1/mirroredImages/5e80a81f725ebc426cfeddc9f9eda240eb9b4df4249e3b4f055739c4499adfcf/c1lh1vmppjbqwalvozwi)

*Fig 13: Evil + ALL_CAPS results when evaluate with* ***Default*** *system prompt*

![](https://res.cloudinary.com/lesswrong-2-0/image/upload/f_auto,q_auto/v1/mirroredImages/78e01e3abfa3b51f521c0df5c9101c138f4dcb5dea6b4e367e42da450179bf17/pgpcsxylbv1qwfwro6i6)

*Fig 14: Evil + ALL_CAPS results when evaluate with* ***Control*** *system prompt*

For two groups Irrelevant-General and Irrelevant-Selective, the inoculation effect weakens when evaluated with **Control** evaluation prompt, suggesting that the effect with **Default** is due to conditionalization and the semantic meaning of the system prompt do have an impact towards inoculation effect, as suggested by previous studies. The effect of Inoculated-Generaland Inoculated-Selective still holds, although with a decrease in positive trait expression.

**Transferability**
-------------------

Can prompts generated and annotated by SAE pipeline above work across different models? If we use pretrained SAE layers of Qwen models to annotate and generate inoculation prompts for the dataset then does the inoculation have the same/less/more impact on Llama or Gemma models?

We replicate our experiment setups of Q1 and Q2 for both LLama-3.1-8B-Instruct and Gemma3-4b-it. For the Inoculated-SAEgroup, we use the dataset annotated by Qwen2.5-7B-Instruct in previous experiments. Groups are evaluated with the **Default** system prompt of each model.

![mixture_Meta-Llama-3.1-8B-Instruct_evil_cap_error_50_50_sysprompt-none_ablation_combined.png](https://res.cloudinary.com/lesswrong-2-0/image/upload/v1775262392/lexical_client_uploads/t9rthxpzimh7aem6lx35.png)

*Fig 15: Evil + ALL_CAPS results on Llama3.1-8B-Instruct when evaluate with* ***Default*** *system prompt*

![mixture_gemma-3-4b-it_evil_cap_error_50_50_sysprompt-none_ablation_combined.png](https://res.cloudinary.com/lesswrong-2-0/image/upload/v1775262468/lexical_client_uploads/cmu8xlzkxeavyylepaht.png)

*Fig 16: Evil + ALL_CAPS results on Gemma-3-4b-it when evaluate with* ***Default*** *system prompt*

For Inoculated-SAE group, we see that the inoculation effects do transfer to other models, although with some caveats. Inoculation effects seem to rely on the how strong the prior of the trait that we want to inoculated against, consistent with previous studies.

**Discussions**
===============

*   Selective inoculation works well with some type of traits and less effective with others. In our experiments, inoculating against the negative traits seems to affect ALL\_CAPS much more than the Source\_Citing and also Hallucination trait seems to be the least affected by the inoculation process.
*   For cases where we don't know the negative traits in advance, both asking LLM to audit and run SAE analysis can surface some signals that we can rely on to generate prompts. However, in more complicated cases where the model exhibit cross-trait generalization, SAE may not pick up the subtle feature changes required to inoculate.
*   Conditionalization is an important confounder to inoculation effects. We only ran ablations in one mixture due to resource constraints but will definitely follow-up with other mixtures to check for genuine inoculation.

**Limitations**
===============

%%% llm-output model="unknown model"

*   **Computational cost of the SAE pipeline.** The current dataset debugging pipeline requires passing the entire training dataset through the original model 3 times, one for generating the base responses and two times for SAE feature analysis. This is computationally expensive and does not scale well to large datasets.
*   **Evaluation breadth.** Our evaluation relies on 20 held-out free-form questions per trait and scored by a LLM-as-judge. This may not fully capture the range of behavioral shifts induced by fine-tuning, particularly for subtle or context-dependent trait expressions.
*   **Studied traits are separated by default.** In our settings, due to the construction pipeline, the traits are somewhat separated by default, so both LLM auditing and SAE pipeline can address the negative traits. In [other](https://arxiv.org/abs/2511.18397)  [settings](https://www.lesswrong.com/posts/rhFXyfFSRKp3cX4Y9/shaping-the-exploration-of-the-motivation-space-matters-for), the model can learn a distribution of traits/motivations within the same data so the selective inoculation pipelines may not distinguish very cleanly.

%%% /llm-output

*Acknowledgements: Thanks to Jord Nguyen for their helpful comments and feedback on the draft.*