Study: How safety-aligned LLMs learn from mixed compliance demonstrationsWhat Do Safety-Aligned LLMs Learn From Mixed Compliance Demonstrations?
Across four aligned models, benign compliance demonstrations either dilute, have no effect on, or slightly amplify harmful compliance.
- Aligned models are sensitive to compliant demonstrations in context, but it is unclear whether they extract a general obedience signal or whether the demonstration request is harmful. The authors use a mix of benign and harmful compliant demonstrations to distinguish these two possibilities.
- The authors control the number of benign demonstrations Nb and harmful demonstrations Nh, use chi-square and logistic regression to test three count hypotheses, and compare OLMo's SFT, DPO, and Instruct checkpoints, additionally testing five orders and whether format adoption is independent of compliance.
- All four models reject the total-count hypothesis at some N. In Table 2, Llama and Gemma have negative β2, OLMo-Instruct does not reject the harmful-count hypothesis, and GPT-OSS-20B has β2 of +0.0319. The SFT checkpoint has β2 of +0.0919, and after DPO the harmful-count hypothesis cannot be rejected.
- The authors state that the stage analysis was done only on OLMo, because most providers do not release intermediate checkpoints. Future directions include more model families, base models, and other safety algorithms, as well as using interpretability to explain dilution and amplification. The paper does not report WildGuard and human agreement.
- Evaluated models
- Llama-3.1-8B-InstructOLMo-3.1-32B-InstructGPT-OSS-20BGemma-4-31B-ITOLMo-3.1-32B-SFTOLMo-3.1-32B-DPO
- Benchmarks
- HarmBenchSORRY-BenchWildGuard-testRedTeam-2KUltraChatOR-Bench
- Metrics
- compliance rateχ² p-valueβ2format adoption rate
The paper studies how models interpret different types of compliant demonstrations when benign compliant demonstrations (harmless requests plus helpful responses) and harmful compliant demonstrations (harmful requests plus helpful responses) are mixed in context. Across four models, the authors find that benign and harmful demonstrations are not interchangeable: benign demonstrations can either decrease or increase harmful compliance, depending on the specific model. The study further notes that preference optimization is the key training stage that prevents benign demonstrations from increasing harmful compliance, demonstration order exhibits a clear recency bias, and models differ in the relationship between refusal and in-context learning, with some adopting the demonstration format even when refusing, while others override all context signals when refusing. The authors state that this work advances from demonstrating that demonstration-based jailbreaks are effective to characterizing their operating mechanism: what a model extracts from compliant demonstrations depends on the demonstration content, order, and training method.
Paper analysis
What problem does this paper attempt to solve?
In mixed compliance demonstrations, what models learn is not an interchangeable obedience signal.
What safety-aligned models learn from mixed compliance demonstrations is whether the general "assistant obeys" rule or whether the demonstrated request is harmful.
- Scenario: The authors state that aligned models remain highly sensitive to contextual evidence. Many-shot jailbreak has shown that many harmful question-answer demonstrations can increase harmful compliance, but what models extract from compliance contexts has not previously been clarified.
- Existing gap: The authors state that existing demonstration jailbreaks mainly use all-harmful demonstrations; mechanistic ICL and activation steering typically study general tasks, personality induction, or directly modify internal states, without separating how benign compliance demonstrations and harmful compliance demonstrations interact.
- Core contrast: Both types of demonstrations present "assistant obedience," but the request content differs. If the model only responds to a general compliance signal, both should increase compliance rates on harmful queries; if the model tracks request semantics, harmful compliance demonstrations are more critical, and benign demonstrations may be irrelevant or even counterproductive.
- What this paper does: The authors use controllable mixed demonstrations for hypothesis testing, comparing the total-count hypothesis, harmful-count hypothesis, and joint-count hypothesis, and examine order, as well as whether format adoption is separated from compliance.
- Experimental control: Demonstrations are placed in dialogue turns before the current harmful query, without changing weights. Evaluation queries are separated from the demonstration pool. Responses are judged by WildGuard as compliant or refusal.
What related research exists?
Related work is divided into demonstration jailbreaks, demonstration information, ICL mechanisms, and internal control.
The authors discuss related work along four lines and position this paper as analyzing how compliance evidence transfers with mixed demonstrations, rather than improving attacks.
- Demonstration jailbreaks: Anil et al. (2024) show that conditioning on hundreds of harmful question-answer demonstrations can jailbreak aligned models, with effectiveness rising predictably as context lengthens. Zheng et al. (2024) strengthen few-shot demonstration jailbreaks; Ma et al. (2025)'s PANDAS improves many-shot attacks with affirmative statements, negative demonstrations, and adaptive sampling. The authors say this paper is mainly not attack improvement, but uses mixed many-shot contexts as an analytical tool.
- What demonstrations convey: Min et al. (2022) argue that true labels often matter less than label space, input distribution, and prompt format. Yoo et al. (2022) show whether correct labels matter depends on scale and prompt design; Wu et al. (2023) show example selection and ordering strongly affect ICL. The authors say this relates to prefix and order ablations: if demonstrations mainly teach format, safety and harmful compliance examples should be more interchangeable than when conveying specific semantics.
- How context changes behavior: Xie et al. (2022) interpret ICL as implicit Bayesian inference over latent concepts; Hendel et al. (2023) argue ICL often compresses demonstrations into task vectors unrelated to the query. Choi and Li (2024)'s PICLe uses in-context examples to steer high-level personality; Bigelow et al. (2025) propose that in-context examples accumulate evidence for latent concepts, and activating steering shifts the prior. The authors say this paper tests whether the two types of demonstrations accumulate along a single "obedience" dimension or correspond to more specific latent beliefs.
- Harmful imitation and internal control: Halawi et al. (2024) show the influence of false or harmful demonstrations appears in later forward passes and is linked to false induction heads that replicate misleading context. Turner et al. (2024) use activation addition for inference-time steering; Arditi et al. (2024) show refusal is mediated by a low-dimensional direction, and removing that direction suppresses safety refusals. The authors note these works directly modify internals, while this paper's intervention is only in the context.
Baselines and data: This paper does not treat existing attack algorithms as comparison methods. The reference is the zero-demonstration compliance rate (Table 4). Harmful demonstrations come from RedTeam-2K; benign demonstrations in the main text come from UltraChat; the evaluation pool comes from the harmful subsets of HarmBench, SORRY-Bench, and WildGuard-test.
The authors say that, to their knowledge, prior work has not separated how benign compliance demonstrations interact with harmful compliance demonstrations. This paper only changes the semantic mix of demonstrations, to see whether the model treats them as interchangeable evidence, attends only to harmful examples, or combines them in a more complex way.
How does the paper address this problem?
Control Nb and Nh to test the three counting hypotheses, and test order and format separately.
The authors turn mixed compliant demonstrations into a hypothesis test: separately controlling the number of benign demonstrations Nb and harmful demonstrations Nh, to see which kind of context summary predicts compliance rates on subsequent harmful queries.
Notation and the three hypotheses
- Notation: N = Nb + Nh; when N>0, ϕ = Nh/N. The outcome is the compliance probability on harmful evaluation queries.
- Htotal: The context teaches request-content-independent "assistant will obey", Pb,h = f(Nb + Nh). With N fixed, the compliance rate should be roughly invariant to ϕ.
- Hharm: The model already obeys benign requests by default, and only harmful compliant demonstrations provide new counter-evidence, Pb,h = f(Nh). With Nh fixed, adding benign demonstrations should have no statistically detectable effect.
- Hjoint: Pb,h = f(Nb, Nh). Amplification means benign demonstrations increase harmful compliance; dilution means benign demonstrations decrease harmful compliance. The authors suggest amplification indicates benign demonstrations activate a cooperative tendency, while dilution indicates they push behavior in the opposite direction from harmful compliance.
The tests are run cascaded: first with Htotal as the null hypothesis; after rejection, with Hharm as the null and Hjoint as the alternative.
Data and context
- Models: Llama-3.1-8B-Instruct, OLMo-3.1-32B-Instruct, GPT-OSS-20B, Gemma-4-31B-IT. Training stages additionally use OLMo-3.1-32B-SFT, OLMo-3.1-32B-DPO, and an Instruct checkpoint with RL-VR on top of DPO. The authors state DPO is applied on top of SFT, and RL-VR is applied on top of DPO.
- Demonstration pool: Harmful requests come from RedTeam-2K, filtered by GPT-OSS-120B to 1,492 items. Main-text benign requests use UltraChat from UltraFeedback; the appendix additionally uses OR-Bench, as well as benign rewrites of RedTeam-2K by GPT-OSS-120B. Obedient-style replies are generated by abliterated GPT-OSS-20B. Appendix A provides the full prompts used for rewriting.
- Evaluation pool: 1,404 harmful queries, from the harmful subsets of HarmBench, SORRY-Bench, and WildGuard-test, separate from the demonstration pool. Each is paired with 2 random samples, giving 2,808 evaluation points.
- Concatenation: Demonstrations are earlier user–assistant turns; the evaluation query is the current user turn. By default, all benign demonstrations come first, then all harmful demonstrations. Each demonstration is truncated to 2,000 characters before assembly; the safe rewriting pool is truncated to 1,500 characters.
Statistical tests
Fix N∈{4, 8, 16, 32, 64, 128}, take ϕ∈{0, 0.25, 0.5, 0.75, 1}, run χ² tests across the five ϕ groups, df=4. Reject Htotal when p is below the Bonferroni threshold α=0.05/6=0.0083.
After rejection, fix Nh∈{8, 16, 32} and vary Nb, using main-text equation (1) to distinguish Hharm from Hjoint:
logit Pb,h=β0+β1log(Nh+1)+β2log(Nb+1)
β2 close to 0 supports Hharm; β2>0 is amplification, β2<0 is dilution. The Wald test uses α=0.05. The authors state that after pooling across Nh groups the sample size is 42k, at which point the Wald test is effectively equivalent to a likelihood ratio test. Compliance probability is written as
Pb,h=P(comply∣ Nb=b,Nh=h)
Order, format, and measurement
- Five orders: Prefix has harmful first then benign; Suffix has benign first then harmful; Random is uniformly random; Middle places harmful demonstrations between two halves of benign ones; Interleave alternates placement, appending any remainder at the end once one type is exhausted. The main text varies ϕ at Nh=64; the Figure 5 caption uses 32 benign plus 32 harmful, while Appendix B.3 writes N=64.
- Two behaviors: Format adoption refers to whether the reply copies the prefix at the start of demonstration replies; compliance refers to whether harmful content is given. Neutral prefixes and compliance-signal prefixes are separately prepended to all demonstration replies. Compliance rate is measured under the no-prefix condition. The Figure 6 setup uses N=64, ϕ=0.5, and reports increases relative to the zero-demonstration baseline.
- Generation and measurement: T=0.7, maximum 1,000 tokens; the full set is run twice per condition. WildGuard is conditioned with a forced prefix stating "the request is known harmful", then compares the log-odds of refusal versus non-refusal on the next token; positive means refusal. Compliance rate is defined as 1 minus refusals divided by total queries.
What experiments did the paper conduct?
All four models reject the total-count hypothesis; benign demonstrations or dilution either have no effect or slightly amplify.
Experimental Setup
- Models tested: Llama-3.1-8B-Instruct, OLMo-3.1-32B-Instruct, GPT-OSS-20B, Gemma-4-31B-IT; additionally tested OLMo-3.1-32B-SFT and OLMo-3.1-32B-DPO.
- Data: Evaluation pool of 1,404 items from HarmBench, SORRY-Bench, and the WildGuard-test harmful subset. Harmful demonstrations: 1,492. The main-text benign pool is UltraChat; Appendix B.2 uses OR-Bench and RedTeam-2K benign rewrites.
- Controls: Zero-demonstration compliance rate (Table 4). First use Htotal as the null hypothesis, and after rejection test Hharm. No other attack algorithms are listed as baselines.
- Metrics: Compliance rate = 1 − refusals/total queries. Htotal uses χ² (df=4, α=0.0083). Hharm against Hjoint uses β2 from equation (1) in the main text, Wald test α=0.05. Format experiments additionally report format adoption rate.
- Evaluation: WildGuard; log p(yes)−log p(no) positive means refusal. The paper does not report human review.
- Replication and generation: Each query has 2 random demonstration samplings, totaling 2,808 points; Appendix A states each condition is run twice over the full set. T=0.7, max 1000 tokens. The authors state the aggregated regression sample size is 42k.
Main Results
According to Table 2, equation (1) is fitted on the Figure 3 setting (Nh∈{8, 16, 32}, varying Nb). In the table, Llama-3.1-8B and OLMo-3.1-32B correspond to the Instruct models in the main experiment.
Swipe horizontally to read the table
Model β2 p Verdict GPT-OSS-20B +0.0319 1.1e-02 Amplification Llama-3.1-8B −0.1782 6.9e-123 Dilution OLMo-3.1-32B −0.0118 1.1e-01 Not rejected Gemma-4-31B-IT −0.2010 6.7e-175 Dilution - Htotal: The authors state that Llama, OLMo, and Gemma reject Htotal at all tested N; in Table 1, the p-values for all three are below 0.0083. GPT-OSS-20B is below the threshold at N=8, 32, 64, 128 (p = 5.4e-04, 8.7e-04, 6.3e-06, 6.6e-34), while N=4 is 4.1e-01 and N=16 is 3.5e-02, not below the threshold. The main text only names N∈{32, 64, 128}; the rejection at N=8 comes from Table 1.
- Direction: The authors state that in Figure 2 the compliance rate of the first three models rises with ϕ, while GPT-OSS-20B stays low throughout; the caption states it is robust to many-shot demonstrations. In Figure 3, Llama and Gemma decline with Nb, while OLMo and GPT-OSS are relatively flat. The authors interpret dilution as indicating that UltraChat demonstrations, though mostly unrelated to safety topics, still reinforce the helpful-and-harmless persona.
- Explanation of amplification: For GPT-OSS's positive β2, the authors speculate that its safety training targeted purely harmful many-shot contexts and may not cover mixed contexts, and state the effect size is small. This is the authors' speculation, not a test result.
Training Stage
- What was tested: Repeating the variation of Nb on OLMo's SFT, DPO, and Instruct checkpoints. Figure 4 fixes Nh=32. Table 3 aggregates Nh∈{8, 16, 32}.
- Results: SFT has β2=+0.0919, p=1.3e-39, Amplification. DPO has β2=−0.0114, p=1.3e-01, Not rejected. Instruct has β2=−0.0118, p=1.1e-01, Not rejected. The authors state that in Figure 4, SFT's compliance rate rises with Nb, while DPO and Instruct are flat, and RL-VR further lowers overall compliance.
- Authors' interpretation: The contribution list states DPO completely eliminates the effect; Table 3's result is failure to reject Hharm. The authors consider these behaviors consistent with "SFT's safety responses and general cooperativeness being entangled," and DPO and RL-VR no longer exhibit this spillover. The authors state whether this is representation decoupling remains an open question.
Demonstration Order
- What was tested: Five permutations. Figure 5 caption states 32 each. The main text writes Nh=64; Appendix B.3 writes N=64, ϕ=0.5 corresponding to 32 each. The percentage points below follow the caption and appendix.
- Results: Except for GPT-OSS-20B, the authors state suffix is highest, followed by interleave and random, then prefix and middle. The authors state Gemma's suffix and prefix differ by 35%, Llama by about 19%, OLMo by about 13%. Appendix B.3: at ϕ=0.25, Gemma's suffix is 51.1%, other orders 22–32%, a 29-percentage-point difference; at ϕ=0.75, interleave is 72.5%, higher than suffix's 68.3%. GPT-OSS's orders differ within 1–2 percentage points.
- Authors' interpretation: The authors consider this a recency bias, with the key being that no harmful demonstrations are near the evaluation query. At ϕ=0.25, Llama's prefix is 19.7%, higher than random's 15.8% and interleave's 16.7%; the authors consider that when harmful demonstrations are scarce, interleaving may be diluted by surrounding benign examples.
Format Adoption and Compliance
- What was tested: Demonstration responses begin with a neutral prefix or a compliance-signal prefix. Figure 6 shows increments relative to the zero-demonstration, no-prefix baseline at N=64, ϕ=0.5. Figure 7 separately reports format adoption by whether the final response is compliant.
- Results: The main text gives that Llama-3.1-8B adopts the neutral prefix in 86.9% of refusal responses and the compliance prefix in 51.5%. Gemma-4-31B adopts the compliance prefix in 52.1% of compliant responses and 0.1% of refusals. The authors state Llama and OLMo more readily adopt format, Gemma more readily adopts compliance; GPT-OSS-20B generally does not adopt format because it outputs standard refusal prompts on harmful queries.
- Authors' interpretation: The authors consider that Gemma drops the demonstration format once it decides to refuse; Llama separates compliance from format. OLMo is qualitatively similar to Llama but with lower overall format adoption. Appendix B.4 states Gemma's format adoption in refusals is 0.0–0.1% across all tested ϕ.
Other Ablations and Analyses
- Appendix B.2 states that OR-Bench and RedTeam-2K safety rewrites have ϕ trends consistent with UltraChat. In Table 5b, GPT-OSS cannot reject Htotal at all N on safety rewrites; in Table 5c, OR-Bench only N=64 (p=5.1e-03) and N=128 (p=9.1e-27) are below 0.0083.
- Zero-demonstration baseline (Table 4): GPT-OSS-20B 10.3%, OLMo-3.1-32B 15.7%, Gemma-4-31B 22.4%, Llama-3.1-8B 33.8%.
- Compliance prefix relative to no prefix (Appendix B.4, Figure 12): Llama and OLMo are 9–16 percentage points higher at each ϕ; Gemma is 19–23 percentage points lower. The authors state Gemma's direction is unexpected.
- Llama at ϕ=0.25 has a compliance increment of −10.5% relative to the zero-demonstration baseline, with neutral format adoption still 86–92%; compliance increments at ϕ=0.5 and 0.75 are +7.0% and +17.0% (Appendix B.4).
- Gemma's compliance increments are +33.6% to +41.9% at each ϕ, with neutral format adoption 0.3–2.9% and compliance-prefix format adoption 13.8–25.9% (Appendix B.4).
- OLMo's compliance-prefix adoption in compliant responses rises from 54% to 70% with ϕ, and is 15–18% in refusal responses (Appendix B.4).
What are some points that can be further explored?
The authors propose extending the model family and safety algorithms, and use mechanistic methods to explain dilution and amplification.
Limitations and Future Directions Noted by the Authors
- Model families and scales: The authors state that extending to more model families and scales is needed to distinguish which findings are general and which are specific to certain architectures or training recipes (Section 5).
- Stage analysis concentrated on OLMo: The authors state the reason is that most model providers do not release intermediate training checkpoints (Section 5).
- Base models and other algorithms: The authors list extending to base models, as well as safety training algorithms such as refusal-SFT or RLHF, as future directions (Section 5).
- From behavior to causation: The authors state that interpretability methods could be used to identify the internal circuits responsible for dilution and amplification, moving from behavioral characterization to causal explanation (Section 5).
- Defensive use: The authors state that the dilution effect leaves a follow-up question: whether benign compliance demonstrations can be used as a defense to make models more robust to harmful demonstration contexts (Section 5).
Experimental Coverage
- Main-result models are Llama-3.1-8B-Instruct, OLMo-3.1-32B-Instruct, GPT-OSS-20B, Gemma-4-31B-IT; the training-stage comparison includes OLMo-3.1-32B-SFT, OLMo-3.1-32B-DPO, and Instruct (Sections 3.2 and 4.3).
- Harmful evaluation queries: 1,404, from HarmBench, SORRY-Bench, and the WildGuard-test harmful subset, separated from the demonstration pool; each query has 2 random samplings, totaling 2,808 evaluation points (Section 3.2).
- Harmful compliance demonstrations: 1,492; the main-text benign pool is UltraChat, and Appendix B.2 additionally reports OR-Bench and RedTeam-2K safety rewrites. Obedient-style responses are generated by abliterated GPT-OSS-20B, with filtering and rewriting using GPT-OSS-120B (Section 3.2, Appendix A).
- Reported are fixed-N χ², logistic regression with varying Nb, five orders, and format adoption under two prefixes; generation settings are T=0.7, max 1000 tokens, each condition run twice (Section 4, Appendices A and B).
- The paper does not report agreement between WildGuard's log-odds judgment and human annotation, nor the per-benchmark counts of the 1,404 items across the three benchmarks.
Summarize the main content of the paper
Benign and harmful compliance demonstrations are not interchangeable; the effect depends on the model, order, and preference optimization.
This work asks: from mixed benign and harmful compliant demonstrations, do safety-aligned models extract a general obedience rule, or whether the request is harmful. The authors control Nb, Nh, ϕ, and order, and test three hypotheses—total count, harmful count, and joint count—rather than proposing a new attack algorithm.
- The two types of demonstrations are not equivalent: On the UltraChat benign pool, all four models reject Htotal for at least some N. In Table 1, all tested N for Llama, OLMo, and Gemma are below 0.0083; GPT-OSS-20B does not fall below the threshold at N=4 (p=4.1e-01) and N=16 (p=3.5e-02).
- The role of benign demonstrations varies by model: In Table 2, Llama-3.1-8B has β2 of −0.1782 and Gemma-4-31B-IT of −0.2010, which the authors judge as dilution; OLMo-3.1-32B has −0.0118, p=1.1e-01, so Hharm cannot be rejected; GPT-OSS-20B has +0.0319, which the authors judge as slight amplification.
- Training stage: OLMo's SFT checkpoint has β2 of +0.0919. The contribution list states that DPO completely eliminates this effect; in Table 3, neither DPO nor Instruct can reject Hharm. The authors state that preference optimization coincides with the shift in which benign demonstrations no longer increase harmful compliance.
- Order and format: The authors state that susceptible models have a recency bias, with suffix higher than prefix. Llama still adopts the neutral prefix when refusing (86.9%); Gemma's compliant prefix adoption rate is 0.1% when refusing and 52.1% when complying.
- Authors' conclusion: What a model extracts from compliant demonstrations depends on the demonstration content, arrangement, and training method; compliance adoption and format adoption are governed by different mechanisms. The authors believe mixed demonstrations can distinguish models with robust safety boundaries from those that can be shifted by cooperation, and can identify which training stage changes this behavior.