paper-with-me

홈 › Papers

Gradient-Controlled Decoding: A Safety Guardrail for LLMs with Dual-Anchor Steering

2026-04-06 · Purva Chiniya, Kevin Scaria, Sagar Chaturvedi arxiv

Large language models (LLMs) remain susceptible to jailbreak and direct prompt-injection attacks, yet the strongest defensive filters frequently over-refuse benign queries and degrade user experience. Previous work on jailbreak and prompt injection detection such as GradSafe, detects unsafe prompts with a single "accept all" anchor token, but its threshold is brittle and it offers no deterministic guarantee that harmful content will not be emitted once decoding begins. We introduce Gradient-Controlled Decoding (GCD), a training-free guardrail that combines an acceptance anchor token ("Sure") and refusal anchor token ("Sorry") tightening the decision boundary and significantly lowering false positives. In the mitigation stage, if a prompt is flagged, GCD preset-injects one or two refusal tokens ("Sorry, I can't...") before autoregressive decoding resumes, guaranteeing first-token safety regardless of sampling strategy. On ToxicChat, XSTest-v2, and AdvBench, GCD reduces false positives by 52% vs. GradSafe at comparable recall, lowers attack success rate by up to 10% vs. the strongest decoding-only baseline, adds under 15-20 ms latency on an average on V100 instances, transfers to LLaMA-2-7B, Mixtral-8x7B, and Qwen-2-7B, and requires only 20 demonstration templates.

📄 PDF Abstract BibTeX arXiv:2604.05179

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

Why LLM Safety Guardrails Collapse After Fine-tuning: A Similarity Analysis Between Alignment and Fine-tuning Datasets

2025-06-05 · Lei Hsiung, Tianyu Pang, Yung-Chen Tang, Linyue Song 외

Recent advancements in large language models (LLMs) have underscored their vulnerability to safety alignment jailbreaks, particularly when subjected to downstream fine-tuning. However, existing mitigation strategies prim…

Safety Alignment

Reflex-Guard: A Low-Latency Guardrail for LLM Prompt Safety Using Dense Semantic Embeddings

2026-08-18 · Istiaque Ahmed, Afia Anjum Borsha, Ranat Das Prangon, Abu-fuad Ahmad 외 arxiv

Large Language Models (LLMs) in real-world applications often face the risks of specially crafted prompts designed to bypass the safety controls. Existing guardrail methods, such as LLM-as-a-judge and cloud-based safety …

Silencing the Guardrails: Inference-Time Jailbreaking via Dynamic Contextual Representation Ablation

2026-04-09 · Wenpeng Xing, Moran Fang, Guangtai Wang, Changting Lin 외 arxiv

While Large Language Models (LLMs) have achieved remarkable performance, they remain vulnerable to jailbreak attacks that circumvent safety constraints. Existing strategies, ranging from heuristic prompt engineering to c…

Prompt Engineering

$R^2$-Guard: Robust Reasoning Enabled LLM Guardrail via Knowledge-Enhanced Logical Reasoning

2024-07-08 · Mintong Kang, Bo Li

As LLMs become increasingly prevalent across various applications, it is critical to establish safety guardrails to moderate input/output content of LLMs. Existing guardrail models treat various safety categories indepen…

Logical Reasoning

SAID: Safety-Aware Intent Defense via Prefix Probing for Large Language Models

2025-10-23 · Yulong Chen, Qi Zhang, Jiawen Zhang, Yadong Liu 외 arxiv

Large Language Models (LLMs) remain vulnerable to jailbreak attacks, where adversarially crafted prompts induce policy-violating responses despite safety alignment. Existing defenses typically improve safety through exte…