Skip to content

Efficient refusal ablation for large language models via optimal transportEfficient Refusal Ablation in LLM through Optimal Transport

arXiv· arXiv:2603.04355· Geraldin Nanfack, Eugene Belilovsky, Elvis Dohmatob·Indexed by this site · 2026-10-12· Originally publishedAttacks

Quick read

Attacks

Based on the paper PDF (AI-generated); refer to the original

The authors use PCA Gaussian OT for representation-layer jailbreak; on Qwen2.5-32B, PCA-OT2 has a LlamaGuard ASR of 75.94%.

Threat modelRepresentation-layer attack under open weights: the attacker can read the residual stream and use forward hooks to rewrite activations at inference time without changing parameters. The mapping is estimated from activations of harmful and harmless prompts, with the goal of making chat/instruct models comply with harmful requests. Section 5.1 also calls it a parameter-preserving, black-box attack that only requires prompting.

Questions
Safety alignment encodes refusal into representations, and open-source weights allow directly modifying activations. RFA removes only a one-dimensional refusal direction and intervenes across all layers. The authors instead do distribution matching and examine whether refusal is concentrated in a few layers.
Methods
PCA-OT first projects the residual stream onto the top k principal components, then uses closed-form Gaussian optimal transport to map the harmful distribution to a harmless one. At inference, it only adds affine hooks to 1–2 layers selected by validation, without changing weights.
Experiments and results
In Table 1 across six models, the highest ASR mostly comes from PCA-OT. On Qwen2.5-32B, PCA-OT2 is 75.94%, RFA is 57.55%; PCA-OT1 is 45.75%, lower than RFA. Intervening on 1–2 middle layers yields higher ASR.
Limitations and future work
The authors note that RepNoise, latent adversarial training, and Vaccine were not evaluated, and assume activations are approximately Gaussian and only take the last token. Experiments cover six open-source models; capability scores such as MMLU are only reported on Llama-2-13B.
Experimental setupLlama-2-7B-chat、Llama-2-13B-chat et al. · HARMBENCH、ADVBENCH et al. · LlamaGuard ASR、Substring ASR et al.
Evaluated models
Llama-2-7B-chatLlama-2-13B-chatLlama-3.1-8B-InstructQwen2.5-7B-InstructQwen2.5-14B-InstructQwen2.5-32B-Instruct
Benchmarks
HARMBENCHADVBENCHMALICIOUSINSTRUCTTDC2023ALPACAPileMMLUTruthfulQAARC-ChallengeGSM8K
Metrics
LlamaGuard ASRSubstring ASRPile PPLAlpaca PPL
AI summaryThe researchers propose a framework based on optimal transport theory that transforms the entire distribution of activations for harmful requests into a distribution of harmless activations, thereby bypassing the refusal behavior of safety-aligned models. The method combines PCA with closed-form Gaussian optimal transport, preserving geometric structure in high-dimensional representation space and computing efficiently. On six models from 7B to 32B parameters, including Llama-2, Llama-3.1, and Qwen-2.5, its attack success rate is up to 11% higher than the current state-of-the-art baseline, with comparable perplexity. The authors also find that selectively intervening on only 1–2 layers at about 40% to 60% of network depth performs significantly better than full-network intervention, leading them to suggest that refusal mechanisms may be localized and that current alignment methods may be vulnerable to distributional attacks beyond simple direction removal.

The researchers propose a framework based on optimal transport theory that transforms the entire distribution of activations for harmful requests into a distribution of harmless activations, thereby bypassing the refusal behavior of safety-aligned models. The method combines PCA with closed-form Gaussian optimal transport, preserving geometric structure in high-dimensional representation space and computing efficiently. On six models from 7B to 32B parameters, including Llama-2, Llama-3.1, and Qwen-2.5, its attack success rate is up to 11% higher than the current state-of-the-art baseline, with comparable perplexity. The authors also find that selectively intervening on only 1–2 layers at about 40% to 60% of network depth performs significantly better than full-network intervention, leading them to suggest that refusal mechanisms may be localized and that current alignment methods may be vulnerable to distributional attacks beyond simple direction removal.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors want to use full-distribution matching to bypass refusal, rather than just removing a one-dimensional refusal direction.

    The core question is: can the entire distribution of harmful activations be mapped to a harmless distribution, thereby bypassing the refusal written into the representation, rather than just removing a single direction.

    • Scenario: The authors say alignment methods such as RLHF encode refusal into internal representations, but harmful content can still be generated when prompts or representations are manipulated. Open weights allow attackers to directly modify activations or weights, giving finer control than prompt-level attacks.
    • Limitations of existing work: RFA (Arditi et al., 2024) uses the mean difference between harmful and harmless activations as a single refusal direction, then applies a rank-1 orthogonal projection at every layer. The authors argue this only uses first-order means, ignores variance and covariance, and relies on full-layer intervention.
    • Method: Propose PCA-OT, combining PCA with closed-form Gaussian optimal transport, to do distribution matching in a low-dimensional subspace, and apply an affine transformation only at 1–2 layers selected by validation (the authors write about 40–60% of network depth).
    • Threat model:
      • Goal: Make an aligned model that originally refuses harmful requests become compliant, while preserving generation quality as much as possible.
      • Capabilities: Can extract last-token residual stream activations and install forward hooks at inference time; weights are not modified. The mapping is estimated from a harmful prompt set H and a harmless prompt set S.
      • Victim systems: Llama-2, Llama-3.1, Qwen2.5 chat/instruct models; the chat template contains no system prompt.
      • Wording: The introduction frames it as a threat model that can directly manipulate internal activations; Section 5.1 also calls it a black-box attack that preserves parameters and only requires prompt instructions.
  2. What related research exists?

    The authors state that, to their knowledge, optimal transport has not previously been used for adversarial attacks on language models.

    Section 5 of the paper divides related work into alignment, adversarial attacks, inference-time control, and optimal transport.

    Alignment and Its Fragility

    • RLHF and DPO: Ouyang et al. (2022), Bai et al. (2022) use human preferences for RLHF; Rafailov et al. (2023)'s DPO and Azar et al. (2024), Ethayarajh et al. (2024), Meng et al. (2024) remove explicit reward models.
    • Output beginnings: Sharma et al. (2024) state that safety alignment affects the first few output tokens, and connect it to suffix attacks (Zou et al., 2023b), prefill (Li et al., 2025b), and fine-tuning attacks (Zhan et al., 2024).
    • Fine-tuning: Lermen and Rogers-Smith (2024) report that benign LoRA fine-tuning weakens the safety training of Llama 2-Chat 70B; Zhan et al. (2024) attempt to remove RLHF protections with targeted fine-tuning. The authors state that these results indicate alignment brings about fragile distribution shifts.

    Adversarial Attacks

    • Prompt-level: GCG (Zou et al., 2023b) and Li et al. (2024a), Liao and Sun (2024), Andriushchenko et al. (2025); readable attacks include AutoDAN (Liu et al., 2024), role-playing (Shah et al., 2023), and multi-step decomposition (Mehrotra et al., 2024). The paper only describes these here.
    • Representation-level: Arditi et al. (2024) use the mean-difference direction for orthogonal projection, which has been used in mechanistic analysis (Jain et al., 2024) and adversarial training (Yu et al., 2025). The authors state that they instead compute a geometric transport map between harmful and harmless activations. The introduction also lists Schwinn et al. (2024) and Li et al. (2025a).

    Inference-Time Control and OT

    • Steering: Representation Engineering (Zou et al., 2023a), Contrastive Decoding (Li et al., 2023b), and difference-in-means by Turner et al. (2023), Belrose (2023), Li et al. (2023a), Rimsky et al. (2024). When covariances are equal, Gaussian OT reduces to this translation.
    • AcT: Rodriguez et al. (2025) estimate one-dimensional affine OT independently for each feature, used for toxicity, truthfulness, and diffusion generation. The authors state this differs from the multidimensional Gaussian OT in this paper.
    • Other OT: Bhagoji et al. (2019) use minimal inter-class transport cost to give lower bounds on adversarial robustness; GiLOT (Li et al., 2024b) measures vocabulary distribution shifts; AOT (Melnyk et al., 2024) uses one-dimensional OT to align preferences. The authors state that, to their knowledge, OT has not previously been used for adversarial attacks on language models, and that this is the first application of Gaussian OT in representation-layer jailbreaks.

    Baselines and Data

    • Baseline methods: RFA (last-token mean difference, projecting all layers at inference) and AcT.
    • Benchmarks: Harmful data from ADVBENCH, MALICIOUSINSTRUCT, TDC2023, HARMBENCH; harmless data is ALPACA; ASR uses the same HARMBENCH test set as Arditi et al. (2024).

    The authors position this paper as an inference-time, parameter-free representation-layer attack: relative to one-dimensional projection and per-dimension affine methods, it uses low-rank multidimensional Gaussian OT and intervenes only on a few selected layers.

  3. How does the paper address this problem?

    PCA-OT performs closed-form Gaussian transport in a low-dimensional subspace, modifying only 1–2 layers at inference time.

    Overall, it is PCA-OT: it formulates representation-layer jailbreaks as distribution matching, uses a low-rank affine map to push harmful activations toward harmless ones, and then attaches it to only a few layers.

    Problem Setting

    • Object: residual stream at layer ℓ, last-token activation, dimension d. The authors state that d is typically 4096 to 8192 for modern language models. Harmful set H and harmless set S have activations denoted XH and XS.
    • Comparison form: RFA's direction is the difference of the two means; the projection removes the component in that direction, equivalent to a rank-1 perturbation of the identity map. The authors consider it does not handle variance, covariance, or higher-order differences.
    • Goal: learn a per-layer map that pushes the harmful empirical distribution to the harmless empirical distribution, minimizing transport cost.

    Gaussian Optimal Transport

    • Closed-form map: when both distributions are treated as Gaussian, the optimal map is T(x)=Ax+b. A is given in closed form by the matrix square roots of the source and target covariances, and b aligns the transformed source mean to the target mean.
    • Special case: when the two covariances are equal, A is the identity, and the map reduces to a mean shift, i.e., difference-in-means. RFA does not perform this shift but removes the component in that direction.
    • Design implication: A changes both location and covariance. The authors believe this covers multidimensional geometry that projection methods ignore.

    PCA Dimensionality Reduction and Lifting

    • Reason: the authors state that when sample sizes are in the hundreds and dimensions in the thousands, the empirical covariance is ill-conditioned, and high-dimensional matrix square roots are expensive and unstable.
    • Steps: center using a sample-size-weighted pooled mean, perform SVD on the combined matrix, and take the top k right singular vectors. Estimate Gaussian OT in k dimensions, then lift back to the original space: the full-rank matrix is the projection matrix sandwiching the low-dimensional A, and the translation still uses the original-space mean alignment. At inference, apply this affine transformation to activations.
    • k: the authors state that small k reduces noise fitting but may miss distribution differences; large k tends to fit noise in training activations. Validation searches 1, 2, 3, 5; Qwen2.5-14B also includes 10 (Table 7).
    • Complexity: Section 2.4 writes estimation as about O(nh·dk + ns·k^2 + k^3), and per-token per-layer application as about O(dk^2 + k^3). The authors state that moderate k is on the same order as one-dimensional methods. Appendix A.1.2 writes it in max form, not exactly the same as the main text.

    Layer Selection and Pipeline

    • Algorithm 1: training phase extracts activations from the unmodified model layer by layer over a specified range and independently estimates maps; inference phase installs hooks only on those layers.
    • 1–2 layers: the authors do not follow full-layer intervention. On the validation set, they select 1–2 consecutive layers for AcT and PCA-OT; RFA extracts a direction from only one layer but still projects all layers at inference. The search range in Table 7 is roughly in the middle, e.g., Llama-2-7B (32 layers) is 11–20, Qwen2.5-32B (64 layers) is 27–37.
    • Data location: following Arditi et al. (2024): 128 training samples estimate parameters, 32 validation samples tune hyperparameters; activations are taken from the last token; chat template has no system prompt. The paper does not split the 128 into harmful and harmless counts.

    Success Determination

    • Primary metric: the proportion of test prompts that LlamaGuard-2 judges as harmful, i.e., LlamaGuard ASR.
    • Secondary metric: substring matching against refusal phrases from Arditi et al. (2024). The authors state that a model can produce harmful content without refusal phrases, thus bypassing this metric.
    • Utility: general language modeling perplexity on Pile, and instruction-following perplexity on Alpaca; lower indicates closer to the original model's text distribution.
  4. What experiments did the paper conduct?

    In Table 1, most highest ASRs come from PCA-OT, but on 32B the single-layer version is lower than RFA.

    Experimental Setup

    • Models: Llama-2-7b-chat-hf (32 layers), Llama-2-13b-chat-hf (40 layers), Llama-3.1-8B-Instruct (32 layers), Qwen2.5-7B/14B/32B-Instruct (28/48/64 layers).
    • Data: harmful samples aggregated from ADVBENCH, MALICIOUSINSTRUCT, TDC2023, HARMBENCH; benign samples from ALPACA. 128 training, 32 validation. Testing is on HARMBENCH, with the same protocol as Arditi et al. (2024); the appendix says 159 test prompts.
    • Methods: no intervention; RFA; AcT; single-layer PCA-OT1; two-layer PCA-OT2. The search ranges for layers and k are in Table 7.
    • Metrics: LlamaGuard-2 ASR as the primary metric; refusal-phrase substring ASR as secondary; Pile PPL and Alpaca PPL to measure utility.
    • Repetitions: Table 1 is the mean ± standard error over 4 seeds. The layer sensitivity and K tables do not report seeds or standard errors. The paper does not report decoding temperature, maximum length or significance tests.
    • Hardware: Appendix A.1.2 says 4×NVIDIA H100 (80GB), inference in bfloat16, activation extraction and OT in float32.

    Main Results

    The table below is LlamaGuard ASR (%) from Table 1. Standard errors are in the original table; only means are listed here.

    Swipe horizontally to read the table

    ModelNo interventionRFAAcTPCA-OT1PCA-OT2
    Llama-2-7b-chat-hf0.6270.6574.9577.1280.42
    Llama-2-13b-chat-hf1.2646.4978.5179.2583.81
    Llama-3.1-8B-Instruct1.6472.6974.3274.6983.49
    Qwen2.5-7B-Instruct8.1777.9475.0579.4081.76
    Qwen2.5-14B-Instruct3.1479.4559.9684.4383.81
    Qwen2.5-32B-Instruct8.8057.5535.1745.7575.94
    • Authors' interpretation: on the Llama family, PCA-OT1 is higher than RFA and AcT, and Pile PPL is close to no intervention, for example Llama-2-13B is 8.41, versus AcT's 11.16 and no intervention's 8.01. The authors say a single layer can exceed RFA's all-layer projection.
    • Not every cell is higher: on Qwen2.5-32B, PCA-OT1 is 45.75%, lower than RFA's 57.55%. The authors say PCA-OT2 is 3.8, 4.4 and 18.3 percentage points higher than RFA on Qwen2.5-7B/14B/32B. Two layers sometimes raise perplexity: Llama-2-7B's Pile PPL is 15.93±1.22, versus 9.21 with no intervention; Qwen2.5-7B's Alpaca PPL is 24.66±17.61, versus RFA's 6.51±0.02.
    • Text and table disagree: the text says Qwen2.5-14B's PCA-OT1 is 69.81%, lower than RFA's 79.45%; Table 1 gives 84.43±3.45, higher than 79.45±0.88. The abstract says the highest is 11% above SOTA with comparable perplexity; Table 1 does not separately list this difference of 11, and perplexity rises in some settings. The authors say PCA-OT1's improvement over AcT ranges from +2.17 to +10.58 percentage points; in Table 1, Llama-2-13B is 79.25% versus 78.51%, Llama-3.1-8B is 74.69% versus 74.32%, and Qwen2.5-14B is 84.43% versus 59.96%.

    Same-layer comparison

    • What was tested: Table 2, on Llama-2-13B-chat-hf, puts each method at the same intervention layer to separate layer selection from the transfer itself.
    • Results: at RFA's best layer 24, the ASR of RFA / AcT / PCA-OT is 46.5 / 71.1 / 75.5, and Pile PPL is 8.06 / 10.07 / 8.95. At AcT's best layer 22, it is 26.4 / 77.4 / 78.6, and PPL is 8.13 / 10.62 / 8.84. The table has no standard errors.
    • Authors' interpretation: the authors say PCA-OT's advantage is not caused by layer selection; perplexity is comparable to RFA and lower than AcT.

    Layer depth, number of components and geometry

    • Layers: Tables 3 and 5, k=2. Llama-2-13B peaks at layer 17 (42.5% depth), ASR 82.4%, PPL 8.59; layer 5 is 0.6%. Qwen2.5-14B peaks at layer 30 (62.5%), ASR 66.7%, PPL 12.12; layer 45 drops to 23.3%. The authors believe refusal forms a local geometry in the middle layers, and that Qwen is deeper and more dispersed. Figure 4 marks the same optimal points.
    • K: Table 4, Llama-2-13B, for K=1/2/5/10 the LlamaGuard ASR is 81.1/82.4/80.5/76.1, substring ASR is 95.0/94.3/98.7/100.0, and Pile PPL is 8.50/8.59/12.2/45.1. Table 6, Qwen2.5-14B, the corresponding ASR is 73.6/73.0/81.8/67.3, and PPL is 7.21/11.6/19.2/132.9. The authors say a moderate K is better suited between attacking and fitting noise.
    • Deep-layer failure: in Table 5, Llama-2-13B layer 38 (95% depth) has ASR 81.8% and PPL 14.90. The appendix says single-phrase repetition appears at this depth, with lexical diversity below 0.01; Table 13 notes layer 32 has diversity 0.076 and ASR 74.8%, and layer 17 has 0.548 and ASR 82.4%. The authors say looking only at ASR would count generation collapse as success. Figure 1 is a two-dimensional PCA of Qwen2.5-14B layer 28; the authors say that after OT the harmful and benign distributions overlap in mean and covariance, and RFA flattens the variance along the first principal component. The plain text cannot show the pixel positions of the points.

    Capabilities, categories and time

    • Capabilities: Table 9 reports only Llama-2-13B-chat. From no intervention to PCA-OT1: MMLU 53.15 to 52.86, TruthfulQA 43.95 to 41.78, ARC-C 46.16 to 43.94, GSM8K 27.98 to 21.38. The authors say this is comparable to no intervention, within 1–6%; the paper does not give this GSM8K difference.
    • Categories: Table 10, Qwen2.5-14B, layers 26–28, k=1. Chemical/biological 92.0% on 25 items, cybercrime 86.7% on 30 items, harassment 85.7% on 28 items, illegal activity 88.6% on 35 items, disinformation 81.8% on 22 items, other 84.2% on 19 items. The authors say the categories are fairly consistent, targeting a general refusal mechanism.
    • Time: Table 8, Llama-2-13B, 159 test items. Estimated time for RFA / AcT / PCA-OT1 is 0.01 / 0.30 / 0.37 seconds; inference is 2760 / 2128 / 2133 seconds. The authors say the inference difference mainly comes from RFA intervening on all 40 layers, while the other two intervene on only 1 layer.

    Other ablations and analyses

    • Figure 2: Llama-2-13B layer 17, Qwen2.5-14B layer 28; the text says the first 3 principal components explain at least 40% of variance, and the caption writes 40%.
    • Figure 3: covariance cosine similarity rises with K; the figure has labels such as 0.020, 0.049 up to 0.910, 0.955, and the plain text does not map each number to a model.
    • The authors write that ASR is below 5% when depth does not exceed 30%; in Table 5, Llama-2-13B layer 11 (27.5% depth) is 34.0%, and layer 8 (20%) is 4.4%.
    • Qwen2.5-14B's PCA-OT1 is 84.43±3.45 in Table 1, while the peak in the k=2 layer sweep is only 66.7% (Table 3); the two settings differ.
    • In Table 1, Llama-2-13B and Qwen2.5-14B both have PCA-OT2 of 83.81±0.16; the text also writes 83.81% for the latter.
    • Appendix A.3 links pooled PCA to the Fisher discriminant direction and writes out the mean and covariance terms of Wasserstein-2; there are no new attack numbers.
  5. What are some points that can be further explored?

    The authors note that several defenses were not included, and assume activations are approximately Gaussian.

    Limitations and future directions noted by the authors

    • Scale: Section 4.4 states that the largest model, Qwen2.5-32B, is more resistant to all attacks; the authors report 75.9% ASR, compared with 80–84% for smaller models, and suggest that scale may provide robustness through more distributed safety mechanisms.
    • Defenses: Section 4.4 states that the evaluation did not include RepNoise (Rosati et al., 2024), latent adversarial training (Yu et al., 2025), or Vaccine (Huang et al., 2024). The authors say that adding these evaluations is needed to see whether distribution transfer remains effective against adversarially trained models.
    • Position pooling: Section 4.4 states that only the last token is extracted; mean pooling or attention-weighted pooling might reduce overfitting to positional noise.
    • Gaussian assumption: Section 4.4 and the conclusion state that the method assumes activations are approximately Gaussian; visualizations show Gaussianity. The authors list neural OT for non-Gaussian cases, and defense architectures that could break the distribution assumption, as future issues, and state that computational cost would be higher.
    • ASR metric: Appendix A.2.3 states that looking only at ASR has limitations; deep-layer interventions have high nominal ASR, but the text may lack semantics.

    Experimental coverage

    • The tested models are Llama-2-7B/13B-chat, Llama-3.1-8B-Instruct, and Qwen2.5-7B/14B/32B-Instruct, 6 in total (Section 3.1, Table 1).
    • Baselines are RFA and AcT; the primary metric is LlamaGuard-2 ASR, supplemented by refusal-phrase substring matching; utility is Pile and Alpaca PPL. Table 1 reports mean ± standard error over 4 seeds.
    • Training uses 128 samples, validation 32; testing uses HARMBENCH, with the appendix stating 159 test prompts; the chat template has no system prompt.
    • Layer and K scans are mainly on Llama-2-13B and Qwen2.5-14B; same-layer comparisons are only on Llama-2-13B (Table 2); capability benchmarks are only reported for Llama-2-13B (Table 9); category ASR is only reported for Qwen2.5-14B, layers 26–28, k=1 (Table 10).
    • The paper does not report significance tests, agreement between LlamaGuard-2 and human judgment, or decoding temperature and maximum generation length. Runtime is only reported on Llama-2-13B with 159 samples (Table 8).
  6. Summarize the main content of the paper

    PCA-OT performs representation-layer jailbreaks with low-rank Gaussian transport, and the ASR is often highest in a few middle layers.

    PCA-OT is a representation-layer jailbreak: it uses low-rank Gaussian optimal transport to map the residual stream activation distribution of harmful prompts to a harmless distribution.

    • Problem: The authors argue that alignment encodes refusal into representations, while RFA only removes the mean difference direction and intervenes on all layers, ignoring covariance and assuming refusal is distributed across the network.
    • Method: After centering by pooled mean, take the top k principal components, compute a closed-form mapping T(x)=Ax+b in the subspace, then lift back to the original space. At inference, only add affine hooks to 1–2 layers selected by validation, without changing weights. Success is primarily determined by LlamaGuard-2.
    • Main results: Table 1, 4 seeds, HARMBENCH. LlamaGuard ASR for PCA-OT2 is 80.42% on Llama-2-7B, 83.81% on Llama-2-13B, 83.49% on Llama-3.1-8B, 81.76% on Qwen2.5-7B, and 75.94% on Qwen2.5-32B (RFA is 57.55%). On Qwen2.5-14B, PCA-OT1 in Table 1 is 84.43%, higher than RFA's 79.45%; the 69.81% written in the text is inconsistent with the table.
    • Exceptions: PCA-OT1 on Qwen2.5-32B is 45.75%, lower than RFA. Two layers sometimes raise perplexity, e.g., Pile PPL 15.93 on Llama-2-7B and Alpaca PPL 24.66 on Qwen2.5-7B. With k=2, Llama-2-13B at layer 17 (depth 42.5%) has ASR 82.4%; going too deep causes repetition and perplexity rising to 14.90.
    • Authors' conclusion: The authors believe that matching both location and covariance is better than simply removing directions, that refusal mechanisms are concentrated around 40–60% depth, and that current alignment may not withstand distributional attacks beyond one-dimensional removal. They also state that defenses such as RepNoise were not evaluated, and that the method relies on approximate Gaussianity and the last token.

Related papers

Show 3 more papers
Read originalarxiv.org