Knowledge distillation (KD) is a highly effective paradigm for transferring capabilities from large language models (LLMs) to smaller, more specialized student models. In commercial deployment where frontier models are restricted behind black-box APIs, sequence-level distillation remains a potent vector for competitors to clone proprietary capabilities at a fraction of the development cost. Existing defenses mostly rely on surrogate models to manipulate next-token sampling, which increases computational overhead and real-time inference latency. In this work, we propose a lightweight defense that dynamically injects style-steering vectors into the teacher model's activations upon malicious queries. This framework offers exceptional flexibility, allowing hosts to customize target defensive styles and dynamically blend them to maximize stylistic variance. Crucially, this inference-time intervention preserves semantic utility and fluency during malicious queries, misleading adversaries into believing that they are extracting pristine teacher outputs, while standard consumers continue to receive original, unmodified responses. Our experiments demonstrate that this framework successfully disrupts student learning, achieving substantial anti-distillation performance while incurring negligible overhead and preserving text naturalness. Our code is available at https://anonymous.4open.science/r/distill-resist-38C6/.
Figures & tables
Figure 1: Overview of our lightweight distillation-resistant defense framework. For benign queries, the teacher model T generates standard responses. Upon detecting malicious queries, the framework dynamically switches the output style by injecting pre-computed style-steering vectors into the hidden activations at inference time, disrupting student model distillation while maintaining semantic coherence.
Property
ADS
DOGe
Ours
Needs proxy model
Yes ✗
Yes ✗
No ✓
Weights modification
No ✓
Yes ✗
No ✓
Inference overhead
High ✗
Low ✓
Low ✓
Flexible on-the-fly adjustment
Yes ✓
No (retrain) ✗
Yes ✓
Easy serving w/ vLLM
No ✗
Yes ✓
Yes ✓
Table 1: Comparison of key defensive properties between ADS Savani et al. (2025) , DOGe Li et al. (2025) , and our style steering framework.
Figure 2: Evaluation results on GSM8K and MATH500 showing base performance and percentage decrement under style steering (Teacher) or sequence-level distillation (Student models).
Figure 3: Single-style steered accuracy (%) across GSM8K and MATH500 benchmarks under individual activation steering personas ( Scratchpad , Dead-end , Distractor , and Jargon ).
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 4: Evaluation results on ARC and CSQA datasets showing base performance and percentage decrement under style steering (Teacher) or sequence-level distillation (Student models).
Figure 5: Accuracy (%) comparison on GSM8K between Base, ADS Savani et al. (2025) , DOGe Li et al. (2025) , and our Style Switching defense across Teacher, Phi-4-mini, and Qwen3-8B student models.
Quality Metric
ADS
DOGe
Ours
Repetition loops ( n -gram repeats)
10.40%
4.46%
0.5%
Weird / multilingual tokens
0.19%
0.74%
0.04%
Missing final answer
19.48%
4.91%
1.03%
Appendix
Table 3: Comparison of output artifact occurrences and failure modes between ADS Savani et al. (2025) , DOGe Li et al. (2025) , and our style steering framework (lower is better).
Figure 6: Student model accuracy (%) on GSM8K under base KD, mixed-style defensive steering (perturbed), and post-hoc DIPPER paraphrased traces.
Figure 7: Student model accuracy (%) on GSM8K and MATH500 benchmarks after distilling on LLM-normalized traces across defensive personas (Mixed-style, Scratchpad , Dead-end , Distractor , and Jargon ) compared to base KD.
Figure 8: Qualitative examples of responses generated under distinct style steering personas after being rewritten by the Qwen2.5-14B-Instruct adaptive normalizer. In all cases, the normalizer strips stylistic artifacts while producing clear, standardized reasoning paths.
Hyperparameter
Value
Student Model Fine-Tuning
Epochs
3
Batch size
1
Gradient accumulation steps
16
Learning rate
1×10−4
Max new tokens
4096 ( MATH )
Appendix
Table 4: Hyperparameters for student model fine-tuning, inference, and style injection.
Figure 9: Qualitative comparison of Scratchpad (top row) and Distractor (bottom row) steering configurations under varying prefill injection thresholds and token caps.
Figure 10: An example of degenerated response for Distractor. The model keeps rambling forever without concluding with any answer.
Figure 11: Representative example outputs generated by the steered teacher model under each of the four deployed stylistic personas.
Figure 12: Inference speed comparison (tokens per second) across five GSM8K samples under standard (Normal) generation versus steered generation (our defense framework). The results show that our inference-time activation steering preserves high generation throughput with no latency overhead.
Knowledge distillation is a widely adopted technique for transferring capabilities from LLMs to smaller, more efficient student models. However, unauthorized use of knowledge distillation takes unfair advantage of the considerable effort and cost put into developing frontier models. We investigate methods for modifying teacher-generated reasoning traces to achieve two objectives that deter unauthorized distillation: (1) anti-distillation, or degrading the training usefulness of query responses, and (2) API watermarking, which embeds verifiable signatures in student models. We introduce several approaches for dynamically rewriting a teacher's reasoning outputs while preserving answer correctness and semantic coherence. Two of these leverage the rewriting capabilities of LLMs, while others use gradient-based techniques. Our experiments show that a simple instruction-based rewriting approach achieves a strong anti-distillation effect while maintaining or even improving teacher performance. Furthermore, we show that our rewriting approach also enables embedding watermarks that can be reliably detected with essentially no false alarms. Our code is available at https://github.com/xhOwenMa/trace-rewriting.
Knowledge distillation from proprietary LLM APIs poses a growing threat to model providers, yet defenses against this attack remain fragmented and unevaluated. We present DistillGuard, a framework for systematically evaluating output-level defenses against LLM knowledge distillation. We introduce a taxonomy of three defense categories -- output perturbation, data poisoning, and information throttling -- and evaluate nine defense configurations using a standardized pipeline with Qwen3-14B as teacher and Qwen2.5-7B-Instruct as student across three benchmarks (MATH-500, HumanEval+, MT-Bench). Our results reveal that, in a same-family distillation setting against a naive attacker, most output-level defenses are surprisingly ineffective: paraphrasing-based perturbation barely degrades distilled student quality, and data poisoning primarily impairs conversational fluency while leaving task-specific capabilities intact. Only chain-of-thought removal substantially impairs mathematical reasoning (31.4% vs.\ 67.8% baseline), though code generation remains unaffected. These findings demonstrate that the effectiveness of distillation defenses is highly task-dependent and that current output-level approaches are insufficient to broadly prevent knowledge theft.
Distillation attacks copy the reasoning capabilities of closed-source large language models, allowing bad actors to replicate state-of-the-art performance at low cost. Attackers systematically collect a large volume of frontier model reasoning traces and then train (i.e., "distill") their own models on these traces. Existing defenses against distillation attacks are typically evaluated immediately after distillation, implicitly assuming attackers do not train their models any further. In this paper, we argue that a more realistic threat model includes further training with reinforcement learning after distillation. A misspecified threat model can give a false sense of security -- some defenses that seem effective after distillation can be broken after subsequent reinforcement learning. Practically, reinforcement learning lowers the bar for a distillation attack to be effective. We show that simple attacks can steal reasoning capabilities from existing closed-source language models using data easily obtainable from current APIs, yielding reasoning improvements equivalent to more sophisticated attacks that extract the full hidden traces. Results indicate that any distillation defense that leaks sufficient information to reconstruct approximate reasoning traces is likely ineffective. We conclude by discussing broader implications and batch-level distillation defenses which could be more effective.
Shidan Javaheri, Alexander Panfilov, Oliver Britton +2
University of Oxford · ELLIS Institute Tübingen & MPI for Intelligent Systems