Sysformer: Safeguarding Frozen Large Language Models with Adaptive System Prompts
On the map: LLM safety and security → Safety alignment, refusal and guardrails
Abstract (arXiv)
As large language models (LLMs) are deployed in safety-critical settings, it is essential to ensure that their responses comply with safety standards. Prior research has revealed that LLMs often fail to grasp the notion of safe behaviors, resulting in either unjustified refusals to harmless prompts or the generation of harmful content. While substantial efforts have been made to improve their robustness, existing defenses often rely on costly fine-tuning of model parameters or employ suboptimal heuristic techniques. In this work, we take a novel approach to safeguard LLMs by learning to adapt the system prompts in instruction-tuned LLMs. While LLMs are typically pre-trained to follow a fixed system prompt, we investigate the impact of tailoring the system prompt to each specific user input on the safety of the responses. To this end, we propose Sysformer, a transformer model that updates an initial system prompt to a more robust system prompt in the LLM input embedding space while attending to the user prompt. While keeping the LLM parameters frozen, the Sysformer is trained to refuse to respond to a set of harmful prompts while responding ideally to a set of safe ones. Through extensive experiments on 5 LLMs from different families and 2 recent benchmarks, we demonstrate that Sysformer can significantly enhance the robustness of LLMs, leading to upto 80% gain in the refusal rate on harmful prompts while enhancing the compliance with the safe prompts by upto 90%. Results also generalize well to sophisticated jailbreaking attacks, making LLMs upto 100% more robust against different attack strategies. We hope our findings lead to cheaper safeguarding of LLMs and motivate future investigations into designing variable system prompts.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Placed in Safety alignment, refusal and guardrails, one of 12 directions in LLM safety and security. Builds on 40 of its 56 references that are in the map. First posted on arXiv 18 Jun 2025.
Builds on
40 of 56 references.
Closest ancestors · 5
Same direction, newest first
- 2025The Geometry of Refusal in Large Language Models: Concept Cones and Representational Independence24 Feb
- 2024Refusal in Language Models Is Mediated by a Single Direction17 Jun
- 2024Safety Alignment Should Be Made More Than Just a Few Tokens Deep10 Jun
- 2024Improving Alignment and Robustness with Circuit Breakers6 Jun
- 2023Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!5 Oct
Other references · 35
- 2022Training language models to follow instructions with human feedbackcited by 15,971
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2023BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Modelscited by 6,137
- 2019BERTScore: Evaluating Text Generation with BERTcited by 5,512
- 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,795
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 3,104
- 2017Decoupled Weight Decay Regularizationcited by 1,831
- 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,651
- 2024HarmBench: A Standardized Evaluation Framework for Automated Red Teaming and Robust Refusalcited by 1,429
- 2023Jailbreaking Black Box Large Language Models in Twenty Queriescited by 1,420
- 2023Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversationscited by 1,207
- 2022Few-Shot Parameter-Efficient Fine-Tuning is Better and Cheaper than In-Context Learningcited by 896
23 more
- 2023BeaverTails: Towards Improved Safety Alignment of LLM via a Human-Preference Datasetcited by 860
- 2023Baseline Defenses for Adversarial Attacks Against Aligned Language Modelscited by 651
- 2024How Johnny Can Persuade LLMs to Jailbreak Them: Rethinking Persuasion to Challenge AI Safety by Humanizing LLMscited by 573
- 2024JailbreakBench: An Open Robustness Benchmark for Jailbreaking Large Language Modelscited by 536
- 2023"Do Anything Now": Characterizing and Evaluating In-The-Wild Jailbreak Prompts on Large Language Modelscited by 489
- 2023SmoothLLM: Defending Large Language Models Against Jailbreaking Attackscited by 469
- 2023Jailbreak and Guard Aligned Language Models with Only Few In-Context Demonstrationscited by 431
- 2024LLM2Vec: Large Language Models Are Secretly Powerful Text Encoderscited by 404
- 2024A StrongREJECT for Empty Jailbreakscited by 385
- 2023Certifying LLM Safety against Adversarial Promptingcited by 266
- 2023Multilingual Jailbreak Challenges in Large Language Modelscited by 240
- 2024Foundational Challenges in Assuring Alignment and Safety of Large Language Modelscited by 199
- 2023Model evaluation for extreme riskscited by 177
- 2023AutoDAN: Interpretable Gradient-Based Adversarial Attacks on Large Language Modelscited by 111
- 2023Combating Misinformation in the Age of LLMs: Opportunities and Challengescited by 95
- 2024Soft Prompt Threats: Attacking Safety Alignment and Unlearning in Open-Source LLMs through the Embedding Spacecited by 91
- 2024Tuning Language Models by Proxycited by 89
- 2024Safetywashing: Do AI Safety Benchmarks Actually Measure Safety Progress?cited by 61
- 2024PARDEN, Can You Repeat That? Defending against Jailbreaks via Repetitioncited by 35
- 2023Inference-Time Policy Adapters (IPA): Tailoring Extreme-Scale LMs without Fine-tuningcited by 33
- 2024Protecting Your LLMs with Information Bottleneckcited by 29
- 2024Adversarial Representation Engineering: A General Model Editing Framework for Large Language Modelscited by 12
- 2024BBox-Adapter: Lightweight Adapting for Black-Box Large Language Modelscited by 11
Built on by
Citing papers per year: 2025: 1; 2026: 4.
5 papers.
- 2025Adaptation of Agentic AI: A Survey of Post-Training, Memory, and Skillscited by 22
- 2026OpenRT: An Open-Source Red Teaming Framework for Multimodal LLMscited by 21
- 2026Steering Frozen LLMs: Adaptive Social Alignment via Online Prompt Routingcited by 0
- 2026The Fragility of Jailbreak Robustness Across Operational Statescited by 0
- 2026FORGE: Form-Optimal Routing of Grounded Evidence for Frozen LLM Agentscited by 0
- 2026FORGE: Form-Optimal Routing of Grounded Evidence for Frozen LLM Agents28 Sep 2026
- 2026The Fragility of Jailbreak Robustness Across Operational States31 Aug 2026
- 2026Steering Frozen LLMs: Adaptive Social Alignment via Online Prompt Routing4 Mar 2026
- 2026OpenRT: An Open-Source Red Teaming Framework for Multimodal LLMs4 Jan 2026
- 2025Adaptation of Agentic AI: A Survey of Post-Training, Memory, and Skills18 Dec 2025
Similar, not cited
Close in wording, no citation either way
- 2024Mitigating Exaggerated Safety in Large Language Models
- 2024On Prompt-Driven Safeguarding for Large Language Models
- 2026When Prompt Optimization Becomes Jailbreaking: Adaptive Red-Teaming of Large Language Models
- 2025SafeMERGE: Preserving Safety Alignment in Fine-Tuned Large Language Models via Selective Layer-Wise Model Merging
- 2025Unforgotten Safety: Preserving Safety Alignment of Large Language Models with Continual Learning
- 2023XSTest: A Test Suite for Identifying Exaggerated Safety Behaviours in Large Language Models
- 2025Prompt Injection as an Emerging Threat: Evaluating the Resilience of Large Language Models
- 2025SafeRoute: Adaptive Model Selection for Efficient and Accurate Safety Guardrails in Large Language Models