Strategic Deflection: Defending LLMs from Logit Manipulation

Yassine Rachidy, Jihad Rbaiti, Youssef Hmamouche, Faissal Sehbaoui, Amal El Fallah Seghrouchni · 2025

Read Strategic Deflection: Defending LLMs from Logit Manipulation by Yassine Rachidy, Jihad Rbaiti, Youssef Hmamouche, Faissal Sehbaoui, Amal El Fallah Seghrouchni (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2507-22160.txt.

Introduction

Yassine Rachidy and co-authors propose a defense that answers attacks on language models sideways instead of refusing. New jailbreaks work at the logit level, bending the model's token choices during writing so refusal training never fires. Their 2025 paper introduces Strategic Deflection, in which the model replies with content close to the request but stripped of its harmful aim.

Rather than a flat no, the deflected answer drifts to a safe neighbor topic, wasting the attacker's manipulation. In the team's experiments, the method cut attack success sharply while leaving answers to benign questions intact. The authors frame this as a shift in defense thinking: refusal alone cannot guard the machinery of generation itself. Meeting manipulation with redirection, they argue, protects the model while keeping it useful for honest users.

Catalog record

CREATORYassine Rachidy, Jihad Rbaiti, Youssef Hmamouche, Faissal Sehbaoui, Amal El Fallah Seghrouchni
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE46 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2507-22160

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Strategic Deflection: Defending LLMs from Logit Manipulation Yassine Rachidy, Jihad Rbaiti, Youssef Hmamouche, Faissal Sehbaoui, Amal El Fallah Seghrouchni Abstract With the growing adoption of Large Language Models (LLMs) in critical areas, ensuring their security against jailbreaking attacks is paramount. While traditional defenses primarily rely on refusing malicious prompts, recent logit-level attacks have demonstrated the ability to bypass these safeguards by directly manipulating the token-selection process during generation. We introduce Strategic Deflection (SDeflection), a defense that redefines the LLM’s response to such advanced attacks. Instead of outright refusal, the model produces an answer that is semantically adjacent to the user’s request yet strips away the harmful intent, thereby neutralizing the attacker’s harmful intent. Our experiments demonstrate that SDeflection significantly lowers Attack Success Rate (ASR) while maintaining model performance on benign queries. This work presents a critical shift in defensive strategies, moving from simple refusal to strategic content redirection to neutralize advanced threats 1 1 1 Implementation code is available at https://github.com/yassine-r/Strategic-Deflection . Warning: This paper includes content that may be considered sensitive, offensive, or potentially harmful. 1 Introduction As large language models become increasingly integrated into critical sectors, it is essential to comprehend both their strengths and potential weaknesses. These models, trained through self-supervised learning on vast, web-derived datasets, demonstrate remarkable proficiency in capturing linguistic patterns and semantic relationships. However, this training methodology can inadvertently expose LLMs to problematic content, creating security weaknesses that adversaries exploit through jailbreak techniques. Figure 1: Conceptual overview of SDeflection. A malicious query sent to a standard LLM (without SDeflection) with a logit manipulation attack results in a dangerous output, whereas the same query without an attack produces a safe refusal. However, when the query is directed to an LLM fine-tuned with SDeflection (with SDeflection), the model generates a safe, deflected output thereby neutralizing the attack. Researchers have implemented post-training alignment methods, particularly instruction tuning and Reinforcement Learning from Human Feedback (RLHF), to mitigate these vulnerabilities [ 1 , 2 ] . These approaches enhance safety by training LLMs on examples demonstrating appropriate responses to various inputs. While these techniques have substantially improved model resilience against traditional attacks, the adversarial landscape continues to evolve with increasingly sophisticated exploitation methods. Logit manipulation attacks represent a particularly dangerous vulnerability class that targets both open-source LLMs with accessible internal states [ 3 , 4 ] and certain black-box LLMs where access to logits is permitted through their APIs (e.g., some GPT versions) [ 5 ] . These attacks demonstrate remarkable efficiency compared to traditional adversarial approaches, as they directly interfere with the model’s token selection process by modifying probability distributions without requiring computationally expensive gradient-based optimization or iterative refinement [ 6 ] . The inherent flexibility of logit-based methods stems from their ability to operate directly at the output layer, making them agnostic to the underlying model architecture and training procedures. This manipulation effectively circumvents safety mechanisms by altering the fundamental decision-making process within the model architecture, enabling attackers to achieve high success rates with minimal computational overhead [ 7 , 8 ] . Current defensive approaches struggle to address this security challenge. When attackers continuously intercept and modify token probabilities throughout the generation process, they systematically suppress refusal patterns. This exposes a critical research gap: the need for defense strategies specifically designed to withstand direct compromise of the token generation process. We address this challenge by introducing SDeflection, a novel defense that reconceptualizes how LLMs respond to jailbreak attacks (see Figure 1 ). Rather than relying on explicit refusals that logit manipulation can easily override, our approach trains models to generate content that appears compliant while delivering information that is ultimately benign. To the best of our knowledge, our approach is the first to leverage deflection as an active defense against LLM jailbreaking attacks, and represents a significant shift in LLM security strategy. In summary, our contributions are as follows: • We propose SDeflection, a defense mechanism that enables LLMs to generate safe and contextually appropriate responses under attack. • We empirically demonstrate that SDeflection reduces attack success rate while preserving helpfulness and accuracy on non-adversarial queries. The remainder of this paper is organized as follows: Section 2 presents related work, including LLM jailbreaking attacks, logit manipulation, and existing defense strategies. Section 3 formalizes the problem and introduces our defense. Section 4 describes our experimental setup, covering dataset construction, models, training, and evaluation protocols. Section 5 presents our results and analysis. Finally, Section 6 concludes the paper with a summary of our contributions and Section 7 discusses ethical considerations and limitations of our approach. 2 Related Work This section reviews the existing literature pertinent to our work. We first discuss the landscape of LLM jailbreaking attacks. Subsequently, we delve into the specifics of logit manipulation techniques and the vulnerability they exploit. Finally, we discuss current defense strategies and highlight their key limitations. 2.1 LLM Jailbreak Attacks Jailbreak attacks aim to bypass the safety alignments and ethical guidelines embedded in LLMs, compelling them to generate harmful, biased, or otherwise restricted content [ 9 ] . Early jailbreak attempts often relied on sophisticated prompt engineering, such as role-playing scenarios, cross-lingual transformation, or prompt perturbation-based attacks [ 10 , 11 , 12 ] . These methods primarily operate at the input level, attempting to trick the model’s interpretation of user intent. With the proliferation of open-source LLMs [ 3 , 13 ] , a new dimension of attacks has emerged. These models provide attackers with more control, including access to model weights and, crucially, the decoding logits. This has enabled more direct and potent attacks that go beyond mere prompt manipulation. Optimization-based attacks, such as Greedy Coordinate Gradient (GCG) [ 6 ] , have demonstrated the ability to find general and transferable adversarial suffixes that can jailbreak aligned language models by optimizing for affirmative responses (e.g., "Sure, here is…"). Other automated strategies, such as PAIR [ 14 ] , which uses a secondary attacker LLM to iteratively refine jailbreak queries, and FuzzLLM [ 15 ] , which fuzzes semantically coherent prompts, further expand the attack surface. 2.2 Logit Manipulation: Exploiting the Decoding Process Logit manipulation attacks represent a challenging class of jailbreak techniques that operate directly on the model’s output probabilities during the decoding stage [ 7 , 5 , 8 ] . Instead of, or in addition to, manipulating the input prompt, these attacks modify the logits before the application of the softmax function and token sampling. This direct intervention allows attackers to force the generation of specific tokens or steer the model towards desired, often harmful, outputs, effectively overriding its safety training. Enforced Decoding (EnDec), introduced in [ 7 ] , directly manipulates the decoding process of open-sourced LLMs through techniques like affirmative prefix enforcement , where the logits of tokens constituting a compliant starting phrase (e.g., "Sure, here is," "Absolutely! Here’s how:") are increased. This aims to shift the model’s internal state towards a helpful mode, making it more likely to comply with the harmful request. EnDec also utilizes negation reversing , which involves identifying tokens related to refusal or negativity and forcing their affirmative counterparts (e.g., forcing "legal" when "illegal" is likely). These combined actions misguide LLMs into generating harmful content or leaking private data, even

Read the complete text