mlsanityData to 7 Oct 2026

PrimeGuard: Safe and Helpful LLMs through Tuning-Free Routing

arXiv 2407.16318 ↗First posted 23 Jul 2024cs.AI cs.CL cs.CRcited by 10

On the map: LLM safety and security → Safety alignment, refusal and guardrails

Abstract (arXiv)

Deploying language models (LMs) necessitates outputs to be both high-quality and compliant with safety guidelines. Although Inference-Time Guardrails (ITG) offer solutions that shift model output distributions towards compliance, we find that current methods struggle in balancing safety with helpfulness. ITG Methods that safely address non-compliant queries exhibit lower helpfulness while those that prioritize helpfulness compromise on safety. We refer to this trade-off as the guardrail tax, analogous to the alignment tax. To address this, we propose PrimeGuard, a novel ITG method that utilizes structured control flow. PrimeGuard routes requests to different self-instantiations of the LM with varying instructions, leveraging its inherent instruction-following capabilities and in-context learning. Our tuning-free approach dynamically compiles system-designer guidelines for each query. We construct and release safe-eval, a diverse red-team safety benchmark. Extensive evaluations demonstrate that PrimeGuard, without fine-tuning, overcomes the guardrail tax by (1) significantly increasing resistance to iterative jailbreak attacks and (2) achieving state-of-the-art results in safety guardrailing while (3) matching helpfulness scores of alignment-tuned models. Extensive evaluations demonstrate that PrimeGuard, without fine-tuning, outperforms all competing baselines and overcomes the guardrail tax by improving the fraction of safe responses from 61% to 97% and increasing average helpfulness scores from 4.17 to 4.29 on the largest models, while reducing attack success rate from 100% to 8%. PrimeGuard implementation is available at https://github.com/dynamofl/PrimeGuard and safe-eval dataset is available at https://huggingface.co/datasets/dynamoai/safe_eval.

Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). Placed in Safety alignment, refusal and guardrails, one of 12 directions in LLM safety and security. Builds on 29 of its 61 references that are in the map. First posted on arXiv 23 Jul 2024.

Builds on

29 of 61 references.

Closest ancestors · 1

Same direction, newest first

  1. 2023The Poison of Alignment25 Aug

Other references · 28

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2023GPT-4 Technical Reportcited by 18,132
  3. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  4. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
  5. 2023Mistral 7Bcited by 3,065
  6. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
  7. 2024Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phonecited by 1,883
  8. 2023Jailbreaking Black Box Large Language Models in Twenty Queriescited by 1,326
  9. 2023Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversationscited by 1,124
  10. 2022Red Teaming Language Models to Reduce Harms: Methods, Scaling Behaviors, and Lessons Learnedcited by 702
  11. 2023Tree of Attacks: Jailbreaking Black-Box LLMs Automaticallycited by 619
  12. 2024How Johnny Can Persuade LLMs to Jailbreak Them: Rethinking Persuasion to Challenge AI Safety by Humanizing LLMscited by 533
16 more
  1. 2024JailbreakBench: An Open Robustness Benchmark for Jailbreaking Large Language Modelscited by 494
  2. 2023XSTest: A Test Suite for Identifying Exaggerated Safety Behaviours in Large Language Modelscited by 477
  3. 2023"Do Anything Now": Characterizing and Evaluating In-The-Wild Jailbreak Prompts on Large Language Modelscited by 457
  4. 2024Prometheus 2: An Open Source Language Model Specialized in Evaluating Other Language Modelscited by 431
  5. 2023Jailbreak and Guard Aligned Language Models with Only Few In-Context Demonstrationscited by 401
  6. 2023JudgeLM: Fine-tuned Large Language Models are Scalable Judgescited by 351
  7. 2023The Unlocking Spell on Base LLMs: Rethinking Alignment via In-Context Learningcited by 251
  8. 2021Gradient-based Adversarial Attacks against Text Transformerscited by 233
  9. 2023Red-Teaming Large Language Models using Chain of Utterances for Safety-Alignmentcited by 213
  10. 2023Do-Not-Answer: A Dataset for Evaluating Safeguards in LLMscited by 176
  11. 2023Attack Prompt Generation for Red Teaming and Defending Large Language Modelscited by 73
  12. 2023The Art of Defending: A Systematic Evaluation and Analysis of LLM Defense Strategies on Safety and Over-Defensivenesscited by 63
  13. 2024Gradient Cuff: Detecting Jailbreak Attacks on Large Language Models by Exploring Refusal Loss Landscapescited by 63
  14. 2023AART: AI-Assisted Red-Teaming with Diverse Data Generation for New LLM-powered Applicationscited by 53
  15. 2024ShieldLM: Empowering LLMs as Aligned, Customizable and Explainable Safety Detectorscited by 48
  16. 2016Learning to Perform Physics Experiments via Deep Reinforcement Learningcited by 47

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 8; 2026: 2.

10 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Robust and Efficient Guardrails with Latent Reasoning
  2. 2025Unlocking LLM Safeguards for Low-Resource Languages via Reasoning and Alignment with Minimal Training Data
  3. 2026TraceSafe: A Systematic Assessment of LLM Guardrails on Multi-Step Tool-Calling Trajectories
  4. 2024Safety Layers in Aligned Large Language Models: The Key to LLM Security
  5. 2025UpSafe^circC: Upcycling for Controllable Safety in Large Language Models
  6. 2025Activation Approximations Can Incur Safety Vulnerabilities Even in Aligned LLMs: Comprehensive Analysis and Defense
  7. 2025PandaGuard: Systematic Evaluation of LLM Safety against Jailbreaking Attacks
  8. 2025Defending MoE LLMs against Harmful Fine-Tuning via Safety Routing Alignment