HarmAug: Effective Data Augmentation for Knowledge Distillation of Safety Guard Models
Not on the map. Why?
Abstract (arXiv)
Safety guard models that detect malicious queries aimed at large language models (LLMs) are essential for ensuring the secure and responsible deployment of LLMs in real-world applications. However, deploying existing safety guard models with billions of parameters alongside LLMs on mobile devices is impractical due to substantial memory requirements and latency. To reduce this cost, we distill a large teacher safety guard model into a smaller one using a labeled dataset of instruction-response pairs with binary harmfulness labels. Due to the limited diversity of harmful instructions in the existing labeled dataset, naively distilled models tend to underperform compared to larger models. To bridge the gap between small and large models, we propose HarmAug, a simple yet effective data augmentation method that involves jailbreaking an LLM and prompting it to generate harmful instructions. Given a prompt such as, "Make a single harmful instruction prompt that would elicit offensive content", we add an affirmative prefix (e.g., "I have an idea for a prompt:") to the LLM's response. This encourages the LLM to continue generating the rest of the response, leading to sampling harmful instructions. Another LLM generates a response to the harmful instruction, and the teacher model labels the instruction-response pair. We empirically show that our HarmAug outperforms other relevant baselines. Moreover, a 435-million-parameter safety guard model trained with HarmAug achieves an F1 score comparable to larger models with over 7 billion parameters, and even outperforms them in AUPRC, while operating at less than 25% of their computational cost.
Key facts. Cited by 17 papers in the map (data through 7 Oct 2026). Builds on 52 of its 62 references that are in the map. First posted on arXiv 2 Oct 2024.
Builds on
52 of 62 references.
References · 52
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2015Distilling the Knowledge in a Neural Networkcited by 10,076
- 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
- 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,115
- 2017Deep reinforcement learning from human preferencescited by 3,846
- 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,634
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
- 2022Self-Instruct: Aligning Language Models with Self-Generated Instructionscited by 2,674
38 more
- 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,157
- 2024Qwen2 Technical Reportcited by 2,076
- 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,565
- 2020MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformerscited by 1,414
- 2024HarmBench: A Standardized Evaluation Framework for Automated Red Teaming and Robust Refusalcited by 1,330
- 2023Jailbreaking Black Box Large Language Models in Twenty Queriescited by 1,326
- 2021DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharingcited by 1,219
- 2019TinyBERT: Distilling BERT for Natural Language Understandingcited by 1,153
- 2023Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversationscited by 1,124
- 2022Red Teaming Language Models with Language Modelscited by 983
- 2019EDA: Easy Data Augmentation Techniques for Boosting Performance on Text Classification Taskscited by 800
- 2015Improving Neural Machine Translation Models with Monolingual Datacited by 784
- 2016Sequence-Level Knowledge Distillationcited by 761
- 2023AutoDAN: Generating Stealthy Jailbreak Prompts on Aligned Large Language Modelscited by 738
- 2019Patient Knowledge Distillation for BERT Model Compressioncited by 502
- 2024JailbreakBench: An Open Robustness Benchmark for Jailbreaking Large Language Modelscited by 494
- 2024WildGuard: Open One-Stop Moderation Tools for Safety Risks, Jailbreaks, and Refusals of LLMscited by 460
- 2024Jailbreaking Leading Safety-Aligned LLMs with Simple Adaptive Attackscited by 450
- 2022ToxiGen: A Large-Scale Machine-Generated Dataset for Adversarial and Implicit Hate Speech Detectioncited by 419
- 2023GPT-4 Is Too Smart To Be Safe: Stealthy Chat with LLMs via Ciphercited by 401
- 2023Jailbreak and Guard Aligned Language Models with Only Few In-Context Demonstrationscited by 401
- 2021Flow Network based Generative Models for Non-Iterative Diverse Candidate Generationcited by 384
- 2022A Holistic Approach to Undesired Content Detection in the Real Worldcited by 337
- 2022Large Language Models Are Reasoning Teacherscited by 318
- 2022Trajectory balance: Improved credit assignment in GFlowNetscited by 244
- 2023ToxicChat: Unveiling Hidden Challenges of Toxicity Detection in Real-World User-AI Conversationcited by 224
- 2024Assessing the Brittleness of Safety Alignment via Pruning and Low-Rank Modificationscited by 220
- 2020Learning from the Worst: Dynamically Generated Datasets to Improve Online Hate Detectioncited by 217
- 2024MobileLLM: Optimizing Sub-billion Parameter Language Models for On-Device Use Casescited by 216
- 2020HateBERT: Retraining BERT for Abusive Language Detection in Englishcited by 206
- 2024AdvPrompter: Fast Adaptive Adversarial Prompting for LLMscited by 146
- 2024AEGIS: Online Adaptive AI Content Safety Moderation with Ensemble of LLM Expertscited by 126
- 2020SSMBA: Self-Supervised Manifold Based Data Augmentation for Improving Out-of-Domain Robustnesscited by 94
- 2024Curiosity-driven Red-teaming for Large Language Modelscited by 83
- 2020MixKD: Towards Efficient Distillation of Large-scale Language Modelscited by 65
- 2023Knowledge-Augmented Reasoning Distillation for Small Language Models in Knowledge-Intensive Taskscited by 62
- 2024Learning diverse attacks on large language models for robust red-teaming and safety tuningcited by 54
- 2022PromDA: Prompt-based Data Augmentation for Low-Resource NLU Taskscited by 51
50 most cited of 52 All 52 (JSON)
Built on by
Citing papers per year: 2025: 11; 2026: 6.
17 papers.
Sort:
By area:
- 2025Distilling LLM Agent into Small Models with Retrieval and Code Toolscited by 41
- 2025X-Guard: Multilingual Guard Agent for Content Moderationcited by 13
- 2025Robustness in Large Language Models: A Survey of Mitigation Strategies and Evaluation Metricscited by 12
- 2025Tree-based Dialogue Reinforced Policy Optimization for Red-Teaming Attackscited by 8
- 2026Safety Alignment as Continual Learning: Mitigating the Alignment Tax via Orthogonal Gradient Projectioncited by 6
- 2025Active Attacks: Red-teaming LLMs via Adaptive Environmentscited by 5
- 2025QGuard:Question-based Zero-shot Guard for Multi-modal LLM Safetycited by 4
- 2025SafeRoute: Adaptive Model Selection for Efficient and Accurate Safety Guardrails in Large Language Modelscited by 3
- 2025A Survey on Training-free Alignment of Large Language Modelscited by 2
- 2025Learning Efficient Guardrails for Compliancecited by 2
- 2026ExpGuard: LLM Content Moderation in Specialized Domainscited by 2
- 2026Investigating and Alleviating Harm Amplification in LLM Interactionscited by 2
5 more
- 2025Lightweight Safety Guardrails via Synthetic Data and RL-guided Adversarial Trainingcited by 1
- 2026TWGuard: A Case Study of LLM Safety Guardrails for Localized Linguistic Contextscited by 1
- 2025Adversarial Distilled Retrieval-Augmented Guarding Model for Online Malicious Intent Detectioncited by 0
- 2026FENCE: A Financial and Multimodal Jailbreak Detection Datasetcited by 0
- 2026No One Model Catches Every Harm: Benchmarking Content Moderation Across Safety Scenarioscited by 0
- 2026No One Model Catches Every Harm: Benchmarking Content Moderation Across Safety Scenarios22 Aug 2026
- 2026Investigating and Alleviating Harm Amplification in LLM Interactions1 Jun 2026
- 2026TWGuard: A Case Study of LLM Safety Guardrails for Localized Linguistic Contexts17 Apr 2026
- 2026ExpGuard: LLM Content Moderation in Specialized Domains3 Mar 2026
- 2026FENCE: A Financial and Multimodal Jailbreak Detection Dataset20 Feb 2026
- 2026Safety Alignment as Continual Learning: Mitigating the Alignment Tax via Orthogonal Gradient Projection8 Feb 2026
- 2025Learning Efficient Guardrails for Compliance3 Oct 2025
- 2025Tree-based Dialogue Reinforced Policy Optimization for Red-Teaming Attacks2 Oct 2025
- 2025Active Attacks: Red-teaming LLMs via Adaptive Environments26 Sep 2025
- 2025Adversarial Distilled Retrieval-Augmented Guarding Model for Online Malicious Intent Detection18 Sep 2025
- 2025A Survey on Training-free Alignment of Large Language Models12 Aug 2025
- 2025Lightweight Safety Guardrails via Synthetic Data and RL-guided Adversarial Training11 Jul 2025
5 more
- 2025QGuard:Question-based Zero-shot Guard for Multi-modal LLM Safety14 Jun 2025
- 2025Robustness in Large Language Models: A Survey of Mitigation Strategies and Evaluation Metrics24 May 2025
- 2025Distilling LLM Agent into Small Models with Retrieval and Code Tools23 May 2025
- 2025X-Guard: Multilingual Guard Agent for Content Moderation11 Apr 2025
- 2025SafeRoute: Adaptive Model Selection for Efficient and Accurate Safety Guardrails in Large Language Models18 Feb 2025
- 2025Tree-based Dialogue Reinforced Policy Optimization for Red-Teaming Attackscited by 8
- 2025Active Attacks: Red-teaming LLMs via Adaptive Environmentscited by 5
- 2025QGuard:Question-based Zero-shot Guard for Multi-modal LLM Safetycited by 4
- 2025SafeRoute: Adaptive Model Selection for Efficient and Accurate Safety Guardrails in Large Language Modelscited by 3
- 2026ExpGuard: LLM Content Moderation in Specialized Domainscited by 2
- 2026Investigating and Alleviating Harm Amplification in LLM Interactionscited by 2
- 2026TWGuard: A Case Study of LLM Safety Guardrails for Localized Linguistic Contextscited by 1
- 2026No One Model Catches Every Harm: Benchmarking Content Moderation Across Safety Scenarioscited by 0
- 2026No One Model Catches Every Harm: Benchmarking Content Moderation Across Safety Scenarios22 Aug 2026
- 2026Investigating and Alleviating Harm Amplification in LLM Interactions1 Jun 2026
- 2026TWGuard: A Case Study of LLM Safety Guardrails for Localized Linguistic Contexts17 Apr 2026
- 2026ExpGuard: LLM Content Moderation in Specialized Domains3 Mar 2026
- 2025Tree-based Dialogue Reinforced Policy Optimization for Red-Teaming Attacks2 Oct 2025
- 2025Active Attacks: Red-teaming LLMs via Adaptive Environments26 Sep 2025
- 2025QGuard:Question-based Zero-shot Guard for Multi-modal LLM Safety14 Jun 2025
- 2025SafeRoute: Adaptive Model Selection for Efficient and Accurate Safety Guardrails in Large Language Models18 Feb 2025
- 2025X-Guard: Multilingual Guard Agent for Content Moderationcited by 13
- 2025Learning Efficient Guardrails for Compliancecited by 2
- 2025Learning Efficient Guardrails for Compliance3 Oct 2025
- 2025X-Guard: Multilingual Guard Agent for Content Moderation11 Apr 2025