Scalable Hierarchical Attention Transformers for Multi-Turn Jailbreak Detection in Long Conversations
This work addresses multi-turn jailbreaking attacks, which evade single-turn safety filters by progressively steering conversations, rephrasing prompts, and employing role-playing to obscure harmful intent. The problem is formulated as a dialogue-level classification task, and a hierarchical Transformer architecture is proposed: individual utterances are first encoded into compact representations, then fused via a lightweight dialogue module that integrates cross-turn self-attention and cross-attention mechanisms to dynamically highlight critical evidence while avoiding the computational burden of concatenating long contexts. The resulting scalable hierarchical attention mechanism preserves cross-turn reasoning capability while significantly improving efficiency. Evaluated on a benchmark of 14,038 dialogues, the model achieves an F1 score of 0.9394—outperforming the strongest baseline, Claude Opus, by 0.07—and reduces false positive rates by 50%.