Abstract
Despite extensive safety-tuning, large language models (LLMs) remain vulnerable to jailbreak attacks via adversarially crafted instructions, reflecting a persistent trade-off between safety and task performance. In this work, we propose Intent-FT, a simple and lightweight fine-tuning approach that explicitly trains LLMs to infer the underlying intent of an instruction before responding. By fine-tuning on a targeted set of adversarial instructions, Intent-FT enables LLMs to generalize intent deduction to unseen attacks, thereby substantially improving their robustness. We comprehensively evaluate both parametric and non-parametric attacks across open-source and proprietary models, considering harmfulness from attacks, utility, over-refusal, and impact against white-box threats. Empirically, Intent-FT consistently mitigates all evaluated attack categories, with no single attack exceeding a 50% success rate -- whereas existing defenses remain only partially effective. Importantly, our method preserves the model's general capabilities and reduces excessive refusals on benign instructions containing superficially harmful keywords. Furthermore, models trained with Intent-FT accurately identify hidden harmful intent in adversarial attacks, and these learned intentions can be effectively transferred to enhance vanilla model defenses.
Introduction
Current LLM safety is plagued by a phenomenon called "Shallow Alignment." Most models are trained to recognize and refuse harmful content based on surface-level patterns—essentially learning to trigger a "standard refusal" when they detect specific keywords. Attackers exploit this by wrapping harmful requests in complex "jailbreak" templates, such as fictional role-plays or adversarial suffixes. Because the model matches patterns rather than understanding intent, it often falls for these tricks. Conversely, this shallow approach leads to over-refusal, where a model might refuse a harmless prompt like "How can I smash my exam?" because it associates the word "smash" with violence.
Methodology: Intent-Aware Fine-Tuning
The authors propose INTENT-FT (Intent-Aware Fine-Tuning). Instead of just training a model to say "No" to bad things, they train it to perform a two-step process:
- Intent Deduction: The model first generates a reasoning trace (encapsulated in
<intent>tags) that explains what the user is actually trying to achieve. - Response Generation: Based on that deduction, the model then provides either a safe refusal or a helpful benign response.
To train this, a "teacher" model (Deepseek-V3) was used to annotate a small dataset of 100 adversarial instructions with their true harmful intents. They also included 500 benign reasoning prompts to ensure the model doesn't become "paranoid." This lightweight fine-tuning (only 600 samples total) allows the model to generalize this "rereading" behavior to entirely unseen attack styles.
Experimental Evaluation
The study utilized several key benchmarks for primary evaluation:
- WILDJAILBREAK & JAILBREAKBENCH: Used for sourcing harmful/adversarial pairs and testing across 11 harm categories.
- XSTEST: A dataset of "exaggerated safety" prompts used to measure over-refusal.
- ARC, GSM8K, and GPQA: Standard benchmarks to ensure general intelligence and reasoning skills were preserved.
Key Results and Insights
Superior Defense and Generalization
INTENT-FT consistently outperformed all baselines, including Self-Reminder and Intention Analysis. No single attack achieved more than a 50% success rate against INTENT-FT models, whereas vanilla models were often jailbroken 80-100% of the time. On the Llama-3.1-8B model, INTENT-FT reduced the success rate of the "PAIR" attack from 88% to just 19%.
Solving the Over-Refusal Problem
On the XSTEST benchmark, INTENT-FT was the only method that reduced over-refusal compared to the vanilla model. By analyzing the intent, the model correctly identifies that "smashing an exam" refers to academic success rather than physical violence.
Mechanistic Resilience
Mechanistic analysis showed that in vanilla models, the decision to refuse happens very early in the layers. INTENT-FT delays this, forcing the model to process the prompt's meaning more deeply, which weakens the "refusal direction" that attackers usually target. Furthermore, intentions generated by an INTENT-FT model can be "transferred" to enhance the defenses of vanilla models when provided as context.
Conclusion
INTENT-FT provides a robust, lightweight defense against jailbreaks while simultaneously reducing the "alignment tax" of over-refusal. While it is not a "silver bullet" for white-box scenarios where attackers can directly manipulate internal activations, it represents a significant step toward intent-aware AI safety. Future work will explore scaling this training to larger datasets and defending against autonomous, multi-step agentic attacks.
Summary updated