Anti-distillation is cheap: lightweight distillation resistance via style disruption
Antidistillation is Cheap: Lightweight Distillation-Resistance via Stylistic Corruption
The authors propose a lightweight anti-distillation defense that injects style-steering vectors into the teacher model's activations, and the authors claim it reduces student model accuracy on GSM8K by 9–11 percentage points with almost no inference overhead.
Black-box API deployment: the attacker can only obtain the teacher model's output text and cannot access weights, logits, or hidden states, and clones the teacher's capabilities via sequence-level KD (SFT). The defender assumes an existing black-box detector IsMalicious(·) flags malicious queries, injects style steering vectors only into flagged queries, and normal users receive the original response.
- Under black-box API deployment, competitors can clone a proprietary model's capabilities at low cost via sequence-level distillation; existing defenses (ADS, DOGe) rely on proxy models or fine-tuning, which the authors state bring inference overhead, utility degradation, or output artifacts.
- For queries flagged as malicious by the detector, precomputed CAA style steering vectors (four styles: Scratchpad, Dead-end, Distractor, Jargon) are injected into the teacher model's residual stream at inference time, and styles are randomly switched using a seed derived from request metadata; benign users receive the original response.
- On GSM8K/MATH500, the authors report that the mixed-style defense reduces the accuracy of three student models by 9–11 percentage points (Figure 2), while the teacher itself drops 2.88%; the effect is weaker on ARC/CSQA (2.06–8.46 percentage points); normalized rewriting with Qwen2.5-14B-Instruct can substantially weaken the defense (Appendix C).
- The authors note: reliance on an upstream malicious-query detector whose accuracy is not evaluated; no exhaustive search over control parameter combinations; limited robustness against adaptive attackers using strong LLM normalization rewriting (Limitations section). The experiments cover only 1 teacher model, 4 student models, and 4 benchmarks.
- Evaluated models
- gemma-3-12b-itQwen2.5-3BPhi-4-mini-instructLlama-3.1-8BQwen3-8B
- Benchmarks
- GSM8KMATH500ARCCommonsenseQA (CSQA)
- Metrics
- zero-shot accuracyinference speed (tokens/sec)output artifact rates
The researchers propose a lightweight defense method against adversarial distillation theft: when a malicious query is encountered, a style-steering vector is dynamically injected into the teacher model's activations, disrupting the student model's learning by corrupting the output style. In black-box API deployment scenarios, sequence-level distillation is a way for competitors to clone proprietary capabilities at low cost, while existing defenses mostly rely on proxy models manipulating next-token sampling, incurring additional computational overhead and inference latency. This method allows the service provider to customize and dynamically mix defense styles to maximize style differences, maintaining semantic usability and fluency under malicious queries, making attackers mistakenly believe they have extracted the original teacher outputs, while ordinary users continue to receive unmodified responses. Experiments show that the framework can significantly disrupt student model learning, with negligible overhead and preserved text naturalness; the code is open-sourced at https://anonymous.4open.science/r/distill-resist-38C6/。
Paper analysis
What problem does this paper attempt to solve?
How to defend against sequence-level distillation under a black-box API at low overhead without harming the benign user experience.
Core question: in black-box API deployment, how to prevent competitors from cloning a proprietary teacher model's capabilities at low cost via sequence-level knowledge distillation (KD), while the defense itself adds almost no inference overhead and does not harm output naturalness.
- Problem scenario and importance: the authors state that even if frontier models only expose a black-box API, text-level distillation remains effective, and competitors can replicate proprietary capabilities at a cost far below training from scratch (Introduction cites Anthropic, 2026).
- Shortcomings of existing methods: detection-based methods (watermarking, fingerprinting) can only verify post hoc and cannot actively prevent distillation; prevention-based methods ADS and DOGe require a proxy model to compute gradients, and the authors state that ADS brings computational and memory overhead, DOGe degrades performance due to fine-tuning, and both sometimes produce meaningless tokens or translationese vocabulary in outputs (Introduction, based on the authors' reproduction observations).
- Core observation: Lippmann and Yang (2025) state that the reasoning improvements of distilled models largely come from stylistic replication; based on this, the authors hypothesize that if the teacher's style signal is contaminated at the source, the reasoning gains the student obtains from imitating that signal will also decrease.
- Proposed approach: an inference-time defense framework that injects precomputed style steering vectors (based on CAA) into the teacher model's hidden activations for queries judged malicious, and randomly switches styles per request; benign users still receive the original responses.
- Threat model:
- Attacker's goal: collect teacher outputs via the API and use SFT for sequence-level KD to train a student model.
- Attacker's knowledge: black-box—can only see output text, with no access to weights, logits, or hidden states (§3.1).
- Defender's capability: the model owner can intervene in activations at inference time; assume an existing black-box detector IsMalicious(·) flags malicious users, and the detector design is out of scope for this paper.
- Victim system: a proprietary teacher model serving via a public API.
What related research exists?
Related work covers four categories: knowledge distillation, anti-distillation defenses, style imitation research, and activation steering techniques.
Knowledge distillation (KD)
- Hinton et al. (2015) proposed KD; Gu et al. (2023), Wang et al. (2025), and others study logit-level (white-box) distillation, in which the student imitates the teacher's soft output distribution.
- Kim and Rush (2016) proposed sequence-level KD, in which the student is trained with maximum likelihood directly on the teacher-generated text as hard targets; Xu et al. (2024b) is a survey of LLM distillation. The paper notes that in black-box settings, sequence-level KD is a common and effective approach.
Anti-distillation defenses
- Detection-based: watermarking by Kirchenbauer et al. (2023), fingerprinting by Xu et al. (2024a), and anti-distillation fingerprinting by Xu et al. (2026); the paper notes that such methods only perform post-hoc auditing and do not actively prevent distillation.
- Prevention-based (black-box): ADS (Savani et al., 2025) and DOGe (Li et al., 2025) use a proxy model to optimize an adversarial loss that perturbs the output distribution; Ma et al. (2026) and Ding et al. (2025) use small auxiliary models for post-hoc trajectory rewriting. The paper criticizes ADS for high computational overhead and DOGe for requiring fine-tuning and producing output artifacts (Introduction, Table 1).
- White-box: Fang et al. (2026) use a learnable transformation matrix to minimize the conditional mutual information between inputs and teacher logits.
Style replication and behavioral steering
- Lippmann and Yang (2025) state that the reasoning gains of distilled models are largely driven by style replication, and that distilling on style-uniform datasets can even outperform original data containing complex reasoning; this is the core motivation of this paper.
- Activation steering: ActAdd (Turner et al., 2023), representation engineering (Zou et al., 2023), and CAA (Rimsky et al., 2024) add steering vectors to hidden states at inference time without fine-tuning; the paper considers such mechanisms lightweight and real-time, suitable for defense purposes.
Baselines and benchmarks: the experimental comparison baselines are ADS and DOGe (both adapted to the gemma-3-12b-it teacher), and the benchmarks are GSM8K, MATH500, ARC, and CSQA (§4.1, Appendix B).
The authors position this paper as: replacing optimization-based perturbation with style variance, avoiding ADS's inference latency and DOGe's weight modification, while retaining real-time flexible adjustment capability (Table 1).
How does the paper address this problem?
For malicious queries, inject CAA-style steering vectors into the teacher's residual stream at inference time, and randomly switch among four styles based on request metadata.
Overall idea: without changing weights or using a proxy model, inject precomputed style steering vectors into the teacher model's residual stream at inference time, rewriting the outputs for malicious queries into a specific style (e.g., off-topic, dead-end), thereby poisoning the distilled data; benign queries are unaffected.
Problem setting and threat model
- The teacher model T provides black-box service via a public API; users submit x and receive text y, and cannot see weights, logits, or hidden states (§3.1).
- Assume a black-box detector IsMalicious(·) that determines whether a user is malicious based on the query and request metadata (user ID, timestamp, etc.); the detector design is out of scope for this paper.
- For malicious users, return a stylized variant y* = f(T, x; s), where s is derived from metadata; the authors state that this can make attackers believe they are collecting clean outputs, avoiding direct refusal that would expose the defense (§3.1).
Style steering vector construction
- Extends CAA (Rimsky et al., 2024): unlike original CAA, which extracts activations from a single token, this paper averages activations over the entire open-ended output sequence. The steering vector at layer l is v(l) = 1/N∑i=1N(āi(T,l) − āi(B,l)), i.e., the difference between the mean token activations of the target style and the base response (Equation 1).
- The vector is first normalized to unit norm (Equation 2), then injected with adaptive per-token scaling: x̃t(l) = xt(l) + α · |xt(l)|2 · v̂(l) (Equation 3), where α is the steering coefficient; the authors state that scaling by activation norm prevents the steering effect from decaying as the residual stream norm grows.
- Contrast dataset construction: for each style, 100 questions each are sampled from GSM8K and ARC, totaling 200 samples; the teacher first generates base responses, then generates stylized responses using style-inducing prompts, forming 200 contrast pairs (§4.1); Appendix F gives the full style prompts.
Four style personas
- Scratchpad: explicit, stream-of-consciousness intermediate reasoning steps.
- Distractor: first introduces irrelevant problem context, then returns to the current problem.
- Dead-end: first follows an incorrect logical path, then backtracks and corrects.
- Jargon: dense, formal technical terminology, changing the surface token distribution while preserving semantics (§3.2).
Dynamic style switching and configuration
- Algorithm 1: for malicious queries, derive a seed from runtime metadata using HMAC(K, m), map it to a style index via a PRNG, and randomly route each request to a different style vector; the authors state that this breaks the determinism of KD and prevents attackers from reverse-engineering the defense through repeated probing.
- Key parameters (Table 4): each style is injected at 2 layers (e.g., Scratchpad at layers [12, 25], with α of [0.07, 0.05]); Jargon has 5 prefill injection tokens, the others 0; the maximum number of injected tokens during decoding is 50 for Scratchpad, 100 for Distractor, and 150 for Dead-end/Jargon; the style distribution is uniform.
- Layer selection: a coarse sweep within [5, 45] at intervals of 5 layers shows the strongest response in the middle layers (10–30); to minimize cosine similarity between styles, a different layer is chosen for each persona (§4.1).
What experiments did the paper conduct?
Testing 1 teacher and 4 student models on 4 benchmarks, the mixed-style defense reduces student accuracy by 9–11 percentage points, and the teacher's by 2.88%.
Experimental setup
- Models tested: teacher is google/gemma-3-12b-it (48 layers); student models are Qwen2.5-3B, Phi-4-mini-instruct, Llama-3.1-8B, Qwen3-8B (§4.1).
- Benchmarks: main experiments use the open-ended math benchmarks GSM8K and MATH500 (MATH500 limited to the scalar-answer subset); Appendix A reports the multiple-choice benchmarks ARC and CSQA.
- Baselines: ADS (proxy model Qwen2.5-1.5B-Instruct, λ=0.015, ϵ=0.01) and DOGe (proxy model gemma-3-1b-it, learning rate 5×10⁻⁵, τ=2.0, λ=3×10⁻⁵), both adapted to the same teacher (Appendix B).
- Metric and judging: zero-shot accuracy; the model must wrap its final answer in \boxed{answer}, compared against ground truth; follows the evaluation protocol of Savani et al. (2025) (§4.1).
- Training setup: student SFT for 3 epochs, learning rate 1×10⁻⁴, batch size 1, gradient accumulation 16 steps; student inference temperature 0.0 (Table 4).
- Hardware: a single NVIDIA RTX A6000 (48GB), with vLLM for inference and injection (Appendix E).
Main results
According to Figure 2 (the four styles mixed uniformly; values are the accuracy % labeled in the figure, with the drop in parentheses in percentage points):
Swipe horizontally to read the table
Model GSM8K Base GSM8K Steered MATH500 Base MATH500 Steered Teacher (gemma-3-12b-it) 93.63 90.75 (−2.88) 92.34 89.61 (−2.73) Qwen2.5-3B 95.07* 83.62 (−11.44) 82.63* 79.90 (−2.73) Phi-4-mini 100.00* 90.75 (−9.25) — — Llama-3.1-8B 87.49* 78.47 (−9.02) 71.32* 64.27 (−7.00) Qwen3-8B — — 71.40 64.40 (−7.00) *Note: after pdftotext conversion, some bar labels in Figure 2 do not align with the model columns; Base values marked with * are inferred from bar heights and drop magnitudes and may deviate from the original figure's column correspondence; values for the Phi-4-mini column in MATH500 and the Qwen3-8B column in GSM8K cannot be reliably matched in the text and are treated as not reported. Drops given in the main text: on GSM8K, Qwen2.5-3B, Phi-4-mini, and Llama-3.1-8B drop by more than 9% to 11%; on MATH500, Qwen2.5-3B and Phi-4-mini drop by about 10%–12%, Llama-3.1-8B by 5.71%, and Qwen3-8B by about 6%–7% (§4.3).
- The authors claim style switching consistently reduces student accuracy across all tasks while having little effect on teacher utility (§4.3).
- The authors claim stronger students such as Qwen3-8B degrade less (§4.3).
Single-style isolation (Figure 3)
- What was measured: accuracy when each of the four styles is injected alone. The main text reports: on GSM8K, Distractor is the most damaging, reducing Qwen2.5-3B accuracy to at most 32% (the original wording is degrades the accuracy to up to 32%); on MATH500, Dead-end is the most harmful.
- Exception: Llama-3.1-8B does not follow this trend—on GSM8K, Scratchpad is more damaging than Dead-end, and on MATH500, Scratchpad is also the most damaging style for it; the authors claim the anti-distillation effect varies with task and model type.
Comparison with ADS and DOGe (Appendix B)
- Effectiveness comparison: Figure 5 compares Base, ADS, DOGe, and this method on GSM8K (teacher, Phi-4-mini, Qwen3-8B); the figure shows labels such as Base teacher 93.6, students 90.8 and 92.3; the authors claim that, under the premise of filtering before training, this method achieves anti-distillation effectiveness comparable to ADS and DOGe with less development time and inference overhead; the paper does not report specific time-cost comparison numbers.
- Output quality (Table 3): repetition-loop rate 10.40% for ADS, 4.46% for DOGe, 0.5% for this method; weird/multilingual token rate 0.19%, 0.74%, 0.04%; missing final answer rate 19.48%, 4.91%, 1.03%. The authors claim this method's artifacts mainly come from Dead-end, Distractor, and Jargon, are low in frequency, and are easy to filter.
Adaptive attacks (Appendix C)
- DIPPER rewriting: Figure 6 shows that DIPPER paragraph-level rewriting cannot strip the style perturbation, and student distillation performance still drops (in the figure, the Base/Steered/Paraphrased bars for each model on GSM8K are close).
- Strong LLM normalization: after general rewriting with Qwen2.5-14B-Instruct, Figure 7 shows that normalized trajectories become easy to distill, and Distractor, Dead-end, and Jargon become more learnable for students after normalization; the authors acknowledge that attackers willing to pay the cost of a strong rewriting model can substantially weaken the defense.
Other ablations and analyses
- ARC/CSQA (Figure 4): the effect is weaker on multiple-choice questions, with drops of 2.06–8.46 percentage points; the authors suggest this may be because the options reduce question difficulty.
- Inference efficiency (Figure 12): on 5 GSM8K samples, throughput with and without the defense is 15.4–16.1 tokens/sec, and the authors claim the defense introduces no latency.
- Vector generation time (Appendix I): 200 contrastive pairs per style for the four styles, about 200 seconds in total (39.7–66.6 seconds/style).
- Ineffective style (Appendix G): the Socratic question-answer format is difficult to steer stably via CAA and did not produce the expected drop in student performance, so it was discarded.
- Qualitative parameter analysis (Appendix H): prefill injection makes the Distractor effect more pronounced; a token limit during decoding can let the model naturally return to solving the problem after going off track.
What are some points that can be further explored?
The authors acknowledge three limitations: reliance on an upstream detector, no exhaustive search over parameter combinations, and limited robustness against normalization attacks by strong LLMs.
Limitations noted by the authors and future directions
- Reliance on an upstream detector (Limitations section): the framework assumes a reliable malicious-query classifier, but its design and accuracy are not evaluated; false positives harm benign users' utility, and false negatives let attackers obtain clean outputs. The authors state that evaluating the framework's robustness under imperfect classifiers is a future direction.
- Incomplete parameter search (Limitations section): no exhaustive search over control parameter combinations was performed; the scaling dynamics of weighted style vector mixtures and the risk of representation collapse across different style personas remain to be studied.
- Limited robustness against adaptive attackers (Limitations section, Appendix C): strong LLM normalizers such as Qwen2.5-14B-Instruct can reconstruct the style perturbation, making it easy to distill; the authors state that the defense is effective against direct distillation and surface-level rewriting, but attackers willing to pay the cost of a strong rewriting model can substantially weaken the protection, and a future direction is to couple style contamination more tightly with task-relevant content.
- More complex domains (Conclusion section): the authors state that evaluating the effect of style steering on more complex domains is a future direction.
- Style mixing (Conclusion section): exploring weighted style vector mixtures and multi-style variation within a single response are directions the authors consider promising.
Experimental coverage
- 5 models were tested: 1 teacher (gemma-3-12b-it) and 4 students (Qwen2.5-3B, Phi-4-mini-instruct, Llama-3.1-8B, Qwen3-8B) (§4.1).
- 4 benchmarks: GSM8K, MATH500 (main experiments) and ARC, CSQA (Appendix A); all are math and commonsense reasoning tasks.
- The comparison baselines are ADS and DOGe, compared only on GSM8K with two students, Phi-4-mini and Qwen3-8B (Appendix B).
- The adaptive attack evaluation covers two types: DIPPER rewriting and Qwen2.5-14B-Instruct normalization (Appendix C).
- The paper does not report the sample size of the student distillation training set, the number of repetitions of the main experiments, or the specific implementation of the detector IsMalicious(·).
Summarize the main content of the paper
A lightweight anti-distillation defense that injects style steering vectors at inference time; student accuracy drops by 9–11 percentage points, but can be weakened by strong LLM normalization.
A paper on anti-distillation defense: addressing the problem that, under a black-box API, an attacker uses sequence-level KD to clone a proprietary model, it proposes a lightweight defense that injects CAA-style steering vectors into the teacher model's residual stream at inference time.
- Problem: existing preventive defenses ADS and DOGe rely on a proxy model or fine-tuning; the authors claim they introduce inference overhead, utility degradation, or output artifacts; detection-based methods (watermarks, fingerprints) cannot actively prevent distillation.
- Method: for queries flagged as malicious by the detector, inject precomputed style vectors (four styles: Scratchpad, Dead-end, Distractor, Jargon), and randomly switch styles using a seed derived via HMAC from request metadata; benign users receive the original response. Vector construction uses 200 contrastive pairs per style, taking about 200 seconds in total (Appendix I).
- Main results:
- On GSM8K, the mixed-style defense reduces the accuracy of the three student models Qwen2.5-3B, Phi-4-mini, and Llama-3.1-8B by more than 9–11 percentage points, while the teacher itself drops only 2.88 percentage points (Figure 2).
- Among single styles, Distractor is the most damaging on GSM8K, reducing Qwen2.5-3B accuracy to at most 32% (§4.3 citing Figure 3).
- Fewer output artifacts than baselines: repetition-loop rate 0.5%, versus 10.40% for ADS and 4.46% for DOGe (Table 3).
- Inference throughput is on par with no defense, with all 5 samples at 15.4–16.1 tokens/sec (Figure 12).
- Exceptions: on ARC/CSQA multiple-choice questions the drop is only 2.06–8.46 percentage points (Figure 4); normalized rewriting with Qwen2.5-14B-Instruct can make trajectories easy to distill again (Appendix C).
- Authors' conclusion: the authors claim the framework effectively reduces student performance at near-zero overhead across three independent model families, while acknowledging dependence on an upstream malicious-query detector, limited robustness against strong adaptive attackers, and the need in future work to couple style contamination more tightly with task content.
Related papers
Show 2 more papers
- No Free Efficiency: Revisiting the Trade-off Between Training Efficiency and Model VulnerabilityAnalysis / interpretabilityarXiv