Inheriting Robustness Through Distillation

Open-weight language models often reach parity with stronger systems by being fine-tuned on that stronger model's outputs, a process called distillation. A recent study found an unwanted side effect. When a student model is distilled from a teacher on purely benign instructions, its internal representations move toward the teacher's, and the student picks up the teacher's jailbreak vulnerabilities without ever seeing a harmful prompt (Jailbreak Transferability Emerges from Shared Representations). We propose to test whether the same channel can carry robustness instead. The plan is to pay the expensive cost of adversarial training once, on a single teacher. Many open students would then become robust through the ordinary benign distillation they already undergo on the way to parity. If this works, adversarial training changes from a per-model expense into a one-time cost shared across a family of models.

The question matters for two reasons. First, adversarial training for language models is costly. Its inner loop searches for attacking prompts with discrete optimization or a co-trained attacker model, and that cost is repeated for every model released. Second, the open ecosystem's main route to parity, distilling from the strongest available model, is the same route the cited study showed spreads vulnerabilities. The result could also be negative. Robustness may live in a narrow region of behavior that benign data never reaches, while vulnerability travels freely. That would also be worth knowing. It would mean distillation-driven parity carries a safety asymmetry that each model must pay to correct separately.

Core Claim

Our hypothesis is that robustness to jailbreaks, once installed in a teacher by online adversarial training, transfers to students in proportion to how closely the student's representations come to match the teacher's. We measure that closeness with mutual k-nearest-neighbor similarity (mKNN), which asks how often two models agree on which inputs are each other's nearest neighbors. We further hypothesize that a cheap addition makes the transfer much stronger: a loss that pulls the student's hidden states toward the robust teacher's on a small set of borderline prompts, those near the boundary between harmful and benign. If both hold, students reach most of the robustness that direct adversarial training would give them, at the cost of distillation alone.

This differs from the closest work in specific ways. The transferability study diagnoses inheritance of vulnerability and stops there; it builds no defense. Adversarially Pretrained Transformers May Be Universally Robust In-Context Learners argues that adversarial cost can be paid once, but within a single model, and its proof covers only single-layer linear transformers. We test "pay once" across models, in decoder-only language models at open scale.

Research Program

The teacher is Qwen2.5-7B trained with AdvGame, the online attacker-versus-defender game from Safety Alignment of LMs via Non-cooperative Games. In AdvGame, an attacker model and a defender model are trained jointly with preference-based updates, and the reported result lowers HarmBench attack success rate from 31.6% to 4.7%. We choose AdvGame over the R2D2 method from HarmBench because R2D2's inner loop depends on Greedy Coordinate Gradient (GCG) search, a slow token-by-token optimization of attack suffixes, which is the overhead we want to avoid repeating. We keep the plain Qwen2.5-7B instruct model as a matched non-robust teacher, so the two teachers differ only in adversarial training.

The students cover a range of starting similarity to the teacher. They are Qwen2.5-1.5B and 3B (same family), Llama-3.1-8B-Base (different family), and OLMo 2 7B. We include OLMo 2 because its pretraining data and recipe are fully public (2 OLMo 2 Furious), which rules out hidden prior exposure to the teacher's safety data. Each student is distilled under three conditions, all using the same benign instruction corpus, for example the open UltraIF prompts (UltraIF). In the first, the student imitates the teacher's outputs only. In the second, it also matches the teacher's representations at a few middle layers on benign prompts. In the third, it does the same on benign prompts plus a few thousand borderline prompts from the benign contrastive half of WildJailbreak. On these borderline prompts the training target is still the teacher's hidden states, not refusal text. In none of the three conditions does the student see a harmful prompt paired with a refusal. This keeps the mechanism we test separate from ordinary safety fine-tuning.

The analysis tracks mKNN between student and teacher and robustness over the course of distillation. The core prediction is a positive slope of robustness against similarity when the teacher is robust, and the reverse when it is not, mirroring the vulnerability-inheritance curve. We also report total GPU-hours, so the cost of one AdvGame run spread across several students can be compared directly with running AdvGame on each student.

Baselines

The naive reference point is each student after standard benign distillation from the non-robust teacher. This doubles as a replication of the vulnerability-inheritance effect: its mKNN should rise, as in the reported increase from 0.28 to 0.42 for Gemma-27B into Qwen2.5-14B, and its attack success rate should move toward the teacher's. Any gain we claim is measured against this student, which saw identical data and compute.

The strongest existing method is AdvGame-DPO-MD run directly on each student. On Qwen2.5-7B its reported HarmBench attack success rate is 4.7%. We run it with the authors' published hyperparameters and the same WildJailbreak training split. It serves as the robustness ceiling and the cost ceiling. We count our method as beating it in a practical sense if students recover at least 75% of AdvGame's reduction in attack success rate, at under a quarter of AdvGame's total compute summed across all students. Matching its robustness outright is not required.

The second strong competitor is offline adversarial data plus supervised fine-tuning, following AdvPrompter. AdvPrompter trains an attacker model that produces readable jailbreak suffixes in about 1.7 seconds each; fine-tuning on that data lowered Vicuna-7b's AdvBench attack success rate from 43.3% to 0.9%. We give it the same GPU-hour budget per student as our marginal distillation cost, with an equal tuning budget.

Two ablations isolate the key ingredient. The first removes representation matching and keeps output imitation of the robust teacher. The second replaces representation matching on borderline prompts with ordinary refusal-text distillation on harmful prompts. Comparing the two tells us whether the gain comes from geometry or simply from showing the student refusals.

Why not just…?

Why not just run AdvPrompter-style offline fine-tuning on every student? This is the real threat. It is already cheap, and its reported AdvBench result on Vicuna-7b is strong. The counterevidence is that static adversarial datasets degraded against adaptive attacks in the AdvGame comparisons, while online co-evolution held up. Our method lets every student inherit from an online-trained teacher without each student running the online game. The compute-matched comparison against adaptive attacks settles this directly. If offline fine-tuning matches us on adaptive-attack success rate and over-refusal, the inheritance mechanism has no practical advantage, and we will report that.

Why not just distill the teacher's refusals on harmful prompts? Refusal text is the obvious behavioral route, and the second ablation tests it. Our hypothesis is that output-only refusal training generalizes poorly to persona-style attacks. The transferability study found that these attacks exploit the model's core representations, not surface tokens, which suggests a fix in representation space may generalize further. If refusal distillation matches representation matching, we will drop the representation loss from the recommendation.

Why not just add a defensive system prompt? An "adversarial possibility" prompt raised LLaVA-7B's accuracy under the Auto-PGD image attack from 12.54% to 91.46% (Improving Adversarial Robustness in Vision-Language Models with Architecture and Prompt Design). However, those authors concede that an adaptive attacker who knows the prompt can optimize around it, and TrustGen links defensive steering to over-refusal. We include the prompt as a zero-cost baseline and evaluate it under adaptive attacks that include the prompt in the attacker's input.

Why not just freeze the model and train robustness tokens or mask attention at inference? Robustness Tokens depends on its learned tokens staying secret, which open weights make impossible. Dynamic Attention has been tested only on BERT, GPT-2 and T5 on classification and summarization tasks. We therefore treat both as out of scope rather than as competitors, and say so.

Proposed Experiments

Robustness is measured as attack success rate on HarmBench, using its fine-tuned judge (93.19% agreement with human labels) with a fixed generation length, and on AdvBench. Attacks fall into three groups. The first is transfer attacks crafted against the teacher. The second is adaptive white-box attacks run directly on each student's open weights: GCG, PAIR, TAP, and a freshly trained AdvPrompter. The third is the trained AdvGame attacker, which reached 55.6% attack success rate against base Qwen2.5-7B. Utility is measured with IFEval, MMLU, MT-Bench and Arena-Hard. Over-refusal is measured on the benign contrastive prompts of WildJailbreak and on the TrustGen over-caution items. Robustness bought with refusals of benign prompts is the alignment tax that TrustGen documents, so these measurements are essential.

Three checks decide the outcome. First, under adaptive white-box attacks, does the robust-teacher student beat the non-robust-teacher student by a margin that grows with mKNN? A flat curve would falsify the inheritance hypothesis. Second, does a cross-family student such as OLMo 2 or Llama, whose representations start far from the teacher's, gain robustness only after its similarity rises? This tests the causal story rather than shared training data. Third, on a compute plot of attack success rate against total GPU-hours for four students, does one-teacher inheritance dominate both per-student AdvGame and compute-matched AdvPrompter fine-tuning without raising benign-refusal rates? If robustness transfers only through refusal distillation, or does not transfer at all, we will report the asymmetry. That result would bear directly on how the open ecosystem should approach distillation-driven parity.