NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

DOGe: Defensive Output Generation for LLM Protection Against Knowledge Distillation

Pingzhi Li, Zhen Tan, Huaizhi Qu, Mohan Zhang, huan liu, Tianlong Chen · Submission to ICLR 2026 · Withdrawn

TL;DR

DOGe (Defensive Output Generation) protects proprietary Large Language Models (LLMs) from imitation attacks via sequence-level knowledge distillation over standard APIs. By fine-tuning only the teacher model's final linear output layer (LM head) using an adversarial divergence loss against small proxy student models, DOGe injects subtle, hard-to-learn reasoning patterns into intermediate thinking steps while preserving accurate final answers for legitimate users.

What Problem Does This Paper Address?

State-of-the-art LLMs require millions of dollars in compute, curation, and alignment to train, making them valuable intellectual property. However, competitors can cheaply imitate proprietary models by querying their public APIs and training smaller student models on the resulting input-output pairs (sequence-level knowledge distillation).

Prior defenses suffer from severe limitations:

  • Watermarking and fingerprinting are purely post-hoc detection mechanisms that prove theft after it happens rather than preventing it.
  • Logit-distortion defenses assume the adversary has direct access to the teacher model’s predictive probabilities (logits), which standard text-only APIs do not expose.
  • Decoding-time modifications add latency and sampling overhead during inference.

The authors tackle the challenge of proactively defending proprietary models against text-only distillation directly at inference time without breaking user experience or adding computational latency.

Methods

DOGe formulates anti-distillation as a dual-objective optimization problem: maximize the teacher’s downstream task performance while minimizing the task performance of any student model trained on the teacher's outputs.

Key components include:

  • LM Head Fine-Tuning: Rather than retraining the entire model, the base transformer remains frozen, and only the final linear classification layer (the LM head) is updated. This drastically reduces training overhead and allows API providers to swap between defensive and standard modes effortlessly.
  • Adversarial Loss against Proxy Students: The LM head is trained using a composite loss: $$\mathcal{L}_{\text{total}} = \mathcal{L}_{\text{SFT}} + \lambda \cdot \mathcal{L}_{\text{adv}}$$ where $\mathcal{L}_{\text{SFT}}$ is standard cross-entropy on ground-truth targets, and $\mathcal{L}_{\text{adv}}$ maximizes the Kullback–Leibler (KL) divergence between the teacher’s output distribution and the predictions of one or more frozen "proxy student" models.

  • Reasoning-Aware Masking: To avoid corrupting the actual answer delivered to legitimate users, DOGe applies a binary token-level mask $m_t$. The adversarial gradient is strictly restricted to intermediate reasoning/thinking tokens (e.g., inside <think>...</think> tags), while the final answer tokens are optimized purely via standard supervised learning.

Datasets

  • Defensive Training Datasets:
  • GSM8K: Math word problems used to train the defensive head on chain-of-thought reasoning.
  • Tulu 3: A diverse, general-purpose instruction-tuning dataset used to test generalized defensive tuning.
  • Evaluation Datasets (Zero-Shot):
  • Held-in math: GSM8K
  • Held-out math reasoning: MATH
  • Held-out commonsense/scientific reasoning: ARC-Challenge (ARC) and CommonsenseQA (CSQA)
  • Newly introduced benchmarks: None. Existing standardized benchmarks were used to assess accuracy degradation.

Key Insights and Ideas

  • Poisoning the Journey, Not the Destination: Students primarily distill complex reasoning capabilities by learning the teacher’s chain-of-thought steps. By subtly altering how the teacher reasons (introducing repetitive self-checks, hesitation, or idiosyncratic phrasing) while keeping the final answer correct, the training signal for the student is derailed without frustrating genuine human users.
  • Remarkable Cross-Domain Transfer: Even when the defense is trained exclusively on math problems (GSM8K), the defensive degradation transfers robustly to out-of-domain commonsense tasks (ARC, CSQA). The model learns general distillation-resistant generation dynamics rather than domain-specific token corruption.
  • Larger Students Suffer More: Counterintuitively, larger distilled models (e.g., Llama-3.1-8B) experience much steeper percentage performance drops (20%–50%) than small 1B models (8%–18%). Larger student architectures rely more heavily on nuanced token distributions in teacher traces, making them especially sensitive to adversarial perturbations.
  • One Proxy Student Is Enough: Using a single proxy model during defensive training achieves virtually the same defense efficacy as multi-model ensembles, keeping training simple and light.

Key Results

  • Teacher Utility Preserved or Enhanced: Across benchmarks, defensive teacher models (DeepSeek-R1-7B and Qwen3-8B) retained their baseline performance. On in-domain math benchmarks, teacher performance even slightly improved (e.g., Qwen3-8B gained +2.1% on GSM8K and +1.3% on MATH).
  • Catastrophic Distillation Degradation:
  • When distilling from a defensive DeepSeek-R1-7B teacher, a Gemma-3-1b-it student suffered severe drops across the board: −22.7% on GSM8K, −20.4% on MATH, −31.7% on ARC, and −39.0% on CSQA (up to 5× worse than a student distilled from an undefended teacher).
  • Distilling to Llama-3.2-1B showed average drops of 12.8% to 15.4% across benchmarks.
  • Imperceptible to LLM Judges: In an automated evaluation using Gemini-1.5-Pro as a judge, between 69% and 81% of generated reasoning chains were rated as completely natural, demonstrating that the perturbations remain largely stealthy.

Limitations and Future Work

  • Hyperparameter Sensitivity: The adversarial weight $\lambda$ operates on a delicate Pareto frontier. Setting it too high (e.g., $\lambda = 10^{-4}$) leads to optimization divergence and total model collapse, requiring fine-grained tuning.
  • Shared Tokenizer Assumption: The primary formulation assumes the proxy student shares the teacher's vocabulary and tokenizer. Adapting DOGe to handle disjoint tokenizers requires cross-tokenizer mapping or vocabulary alignment.
  • Reasoning Transparency & Interpretability: Deliberately corrupting reasoning traces poses potential drawbacks for educational or high-stakes audit contexts where users rely on transparent, straightforward step-by-step rationales.

Summary updated

BibTeX
@inproceedings{li2025doge,
  author = {Pingzhi Li and Zhen Tan and Huaizhi Qu and Mohan Zhang and huan liu and Tianlong Chen},
  title = {{DOGe: Defensive Output Generation for LLM Protection Against Knowledge Distillation}},
  booktitle = {Lock-LLM @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=ZOdvtOcIRu},
}
Figure