SPIRIT: Patching Speech Language Models against Jailbreak Attacks

Amirbek Djanibekov, Nurdaulet Mukhituly, Kentaro Inui, Hanan Aldarmaki, Nils Lukas

Introduction

As Artificial Intelligence transitions from text-only to multimodal interactions, Speech Language Models (SLMs) such as GPT-4o and Qwen2-Audio are becoming the new standard for human-computer interaction. However, the continuous, high-dimensional nature of speech signals presents a significantly larger attack surface than discrete text. This paper investigates the "jailbreak" vulnerability in SLMs, where an attacker injects human-imperceptible adversarial noise into an audio prompt to bypass safety alignments and force the model to generate harmful content.

Existing defenses, such as aggressive denoising or adding random noise, often result in a "lobotomized" model that loses its ability to follow complex instructions or understand nuanced speech. To address this, the authors introduce SPIRIT, a defense strategy based on mechanistic interpretability that performs surgical interventions on the model's internal activations during inference.

The SPIRIT Defense Framework

The SPIRIT framework utilizes Activation Patching to identify and repair noise-sensitive neurons. The process involves three primary stages:

  1. Attack Generation: Using Projected Gradient Descent (PGD) to find noise patterns that maximize the probability of an affirmative response to harmful prompts.
  2. Neuron Identification: Analyzing the Multilayer Perceptron (MLP) layers to find neurons most sensitive to adversarial noise.
  3. Surgical Intervention: During inference, the model runs on the noisy input, but the activations of the most sensitive neurons are "patched" with values derived from a denoised version of the same audio.
Overview of the SPIRIT framework, illustrating the attack process and the proposed defense mechanisms: activation patching, bias addition, and neuron pruning.

Alternative interventions, such as Bias Addition (stabilizing neurons with a constant) and Neuron Pruning (zeroing out sensitive neurons), were also evaluated, though patching proved the most robust.

Experimental Setup

The authors evaluated SPIRIT using a comprehensive suite of safety and utility benchmarks:

  • Safety: AdvBench, containing 246 harmful English questions across categories like explosives, drugs, and self-harm.
  • Utility: AIR-Bench Chat for general instruction-following, LibriSpeech for automatic speech recognition (ASR) accuracy, and MELD for emotion recognition.

Results and Discussion

The study revealed that SLMs are highly vulnerable under white-box conditions, with attack success rates reaching 79.47% on Qwen2-Audio and 91.69% on LLaMa-Omni. However, the SPIRIT defense demonstrated remarkable efficacy:

  • Defense Success: Activation patching improved the Defense Success Rate (DSR) to 99%.
  • Utility Preservation: While standard denoising dropped the model's GPT-Score from 6.77 to 6.28, LM-level activation patching maintained a score of 6.80-6.83.
  • Efficiency: Patching just the top 5% of sensitive neurons in the Language Model was sufficient to achieve near-perfect defense.

A key insight from the research is that patching the Language Model (LM) component is significantly more effective than patching the Audio Encoder (AE). The LM appears more robust to internal interventions and better at preserving the intent of the original safety alignment.

Performance comparison of defense methods across Audio and Language Model activations. Patching Language Model activations (right) provides a superior Pareto frontier for Defense Success Rate vs. GPT-Score.

Conclusion and Future Work

SPIRIT offers a post-hoc patching method that allows developers to secure existing models without the high cost of safety fine-tuning. By acting as a "surgical strike" on specific internal representations, it avoids the performance degradation typical of blunt-force defenses.

Future work will address current limitations, including the inference overhead required to generate denoised activations and the defense's performance in black-box scenarios where attackers lack full access to the model architecture. Exploring the transferability of these defenses between different model architectures remains a promising direction for generalizable AI safety.

Summary updated

BibTeX
@inproceedings{djanibekov2025spirit,
  author = {Amirbek Djanibekov and Nurdaulet Mukhituly and Kentaro Inui and Hanan Aldarmaki and Nils Lukas},
  title = {{SPIRIT: Patching Speech Language Models against Jailbreak Attacks}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
  url = {https://openreview.net/forum?id=ysDsTxzm77},
}
Figure