Leveraging Association Context Retrieval in Knowledge Edit- ing to Build White-Box Attacks on LLMs

Roman Maksimov, Vladimir Aletov, Vladimir Solodkin, Dmitry Bylinkin, Daniil Medyakov, Aleksandr BeznosikovarXiv 2026

TL;DR

This paper introduces a novel white-box safety alignment removal attack on LLMs by reframing jailbreaking as a Knowledge Editing (KE) problem. By retrieving and embedding associative context into the model's internal representations, the attack successfully unlocks entire categories of harmful behaviors while preserving general model performance far better than traditional refusal-direction suppression methods.

What Problem Does This Paper Address?

As Large Language Models (LLMs) gain autonomy and handle sensitive data, understanding their vulnerabilities to malicious manipulation is critical for building robust safeguards. Existing "white-box" attacks (where the attacker has direct access to model weights) typically rely on identifying and suppressing a "refusal direction" in the parameter space.

However, this approach has two major flaws:

  1. Coarseness: Eliminating an entire dimension of the parameter space reduces the model's activation expressiveness, leading to a severe loss of logical coherence and general performance degradation (poor locality).
  2. Brittleness: The computed refusal directions are highly sensitive to hyperparameters and often fail to generalize to simple paraphrases of an instruction.

Other attempts have used Knowledge Editing (KE) to inject backdoors, but these require explicit, easily detectable trigger words in the prompt. The authors tackle a harder question: Can we cleanly remove safety constraints for entire thematic categories of prompts directly within the weights, without explicit prompt injections or destroying the model's general capabilities?

Methods

The authors propose a category-level white-box attack inspired by "locate-then-edit" knowledge editing frameworks (like ROME and MEMIT), which treat the feed-forward network (FFN) layers of a transformer as a linear associative memory.

The core pipeline consists of three main steps:

  1. Custom Tracing: The authors adapt causal tracing to find which tokens in a harmful prompt most heavily influence the probability of an agreement phrase (e.g., "Sure!") rather than a refusal. They discover that the main instruction span (e.g., "How to use a knife for...") acts as the "subject" entity.
  2. Association Context Retrieval (Prefix Construction): Standard KE uses random, context-agnostic prefixes to compute the subject's key vector ($k^*$). This paper replaces them with subject-conditioned reasoning contexts (e.g., "What do you think about {subject}?"). This forces $k^*$ to capture a distribution over associative contexts, drastically improving generalization.
  3. Optimization and Editing: The model is edited to map this enriched subject key ($k^*$) to a compliant target output vector ($v^*$), forcing the model to start its response with affirmative phrases like "Sure! The easiest way is:" or "Sure! The plan is:".
Overall scheme of the proposed approach

Datasets

The authors evaluated their approach using a mix of standard harmless and harmful datasets:

  • Harmless Dataset: Alpaca (used to evaluate if general capabilities remain intact).
  • Harmful Datasets: AdvBench, TDC2023, HarmBench, StrongREJECT, and JailbreakBench.

Prompts were automatically classified into 10 semantic categories (from JailbreakBench) and 3 structural categories: Malware/Hacking, Instructions/Guide, and Creative Harm.

Key Insights and Ideas

  • Safety Alignment as a Factual Association: The fundamental "aha moment" is that safety alignment can be treated as a piece of modifiable knowledge. By forcing the model to associate a harmful subject with an agreement token, the model's internal refusal mechanism is bypassed entirely.
  • The Instruction is the Subject: Causal tracing revealed that the instruction tokens themselves harbor the critical activations for behavioral manipulation. As shown in the paper's tracing experiments, the indirect effect peaks sharply in the early-to-mid MLP layers at the final token of the instruction span.
Causal tracing results for GPT4ALL-J showing the impact of instruction tokens
  • Context Enrichment Drives Generalization: Moving from random token prefixes to meaningful, subject-conditioned prefixes ($+pref$) allows the edit to generalize. The model doesn't just forget to refuse one specific prompt; it unlocks the knowledge for the entire semantic neighborhood.

Key Results

The authors evaluated their method across three distinct architectures: GPT4ALL-J, Llama-3-8B-Instruct, and Qwen3-30B-A3B (a Mixture-of-Experts model).

Table 1: Main results. Editors combined with our prefix construction are marked as +pref . For every edited model, the MMLU and ARC-C columns report the change with respect to the Pre-edited row of the same block; all remaining columns report absolute values. Numbers after ± are standard deviations. Best results are in bold, second best are underlined; the Pre-edited row is a reference and is excluded from the ranking.
  • Superior Harmfulness & Generalization: Integrating the prefix construction with MEMIT (MEMIT+pref) consistently outperformed vanilla knowledge editing baselines and matched or exceeded aggressive refusal-direction baselines in unlocking harmful behavior.
  • Minimal Collateral Damage (Locality): While traditional refusal-direction suppression methods tanked general benchmarks (e.g., standard Refusal caused a -3.79% drop in MMLU on Llama-3-8B), MEMIT+pref achieved a higher harmfulness score (3.19 vs 2.72) with an almost negligible MMLU degradation of just -0.05%.

Limitations and Future Work

  • White-Box Constraint: The attack requires direct access to model weights, meaning it cannot be directly applied to closed-source API-based models.
  • Model Robustness: Newer, heavily aligned models like Qwen3-30B-A3B proved much more resilient to editing techniques than older models, showing lower absolute harmfulness scores post-edit.
  • Framework Coverage: The prefix modification was successfully integrated with ROME, MEMIT, MoEEdit, and MoTE, but has not yet been adapted to graph-based or attention-optimizing editing frameworks like GLAME or PMET.

Summary updated

BibTeX
@misc{maksimov2026leveraging,
  author = {Roman Maksimov and Vladimir Aletov and Vladimir Solodkin and Dmitry Bylinkin and Daniil Medyakov and Aleksandr Beznosikov},
  title = {{Leveraging Association Context Retrieval in Knowledge Edit- ing to Build White-Box Attacks on LLMs}},
  year = {2026},
  eprint = {2608.17836},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.17836},
}
Figure