Abstract
Large Language Models (LLMs) rely on specific role separators (e.g., USER:, ASSISTANT:, or [INST]) to structure multi-turn conversations. This research identifies a systemic vulnerability where these separators trigger a powerful "nearest neighbor bias," causing models to prioritize instructions closest to the final generation trigger while ignoring earlier context. We introduce the Separator Injection Attack (SIA), a novel class of exploits that leverages these structural signals to bypass safety guards with success rates up to 100% and significantly improved query efficiency.
Introduction
Most conversational LLMs are optimized for Single-task Instruction-following (SIF). However, real-world applications often involve Multi-task Instruction-following (MIF), where a single user turn contains multiple directives. While model designers assume role separators help maintain context and distinguish between speakers, they actually introduce a critical "positional bias." This paper explores how this modeling weakness can be systematically exploited to hijack model behavior, treating separators as control characters similar to SQL injection tokens.
Methodology
The study employs a multi-faceted approach to quantify and exploit dialogue biases:
- Robustness Analysis: Testing Out-of-Distribution (OOD) templates with mixed or reversed separators to observe performance degradation.
- Bias Quantification: Introducing the Position Bias Index (PBI) and Task Bias Index (TBI) to measure instruction preference based on location and type.
- Attention Interpretation: Using gradient-based attention visualization to show how separators physically shift model focus toward injected instructions.
- Separator Injection Attack (SIA): Developing five variants (Base, Thank, Refuse, Reappear, Follow) designed to "reset" model state and prioritize malicious payloads.
Key Insights: The "Nearest Neighbor" Bias
A primary finding is that role separators function as structural signals that "hijack" internal logic. Inserting a USER separator between two instructions causes the model to disregard the first instruction in favor of the one nearest to the output prompt, with an average priority of 95.6%. This bias stems from standard training procedures that only compute loss for a single response per turn, inadvertently teaching the model that the final separator is the primary trigger for action.
Experimental Results and Attack Success
The effectiveness of SIA was evaluated across several models including Llama2, Llama3, Vicuna, and Qwen2. SIA improved manual prompt injection success rates by an average of 18.2%.
As shown in Figure 4, different SIA variants consistently increase the Attack Success Rate (ASR) compared to vanilla prompts. The "SIA-Follow" and "SIA-Reappear" variants often show the most significant gains across different target tasks, demonstrating the power of re-invoking role markers to manipulate model priority.
Efficiency and Automated Attacks
When integrated with automated attack frameworks like TAP, SIA demonstrates remarkable efficiency gains. By using separators to guide the model's focus, the search space for successful jailbreaks is drastically reduced.
Figure 5 illustrates that TAP+SIA achieves a 100% cumulative ASR much faster than standard TAP, reducing the average number of queries from 28.0 to just 8.8. This highlights that structural separators are not just text but powerful levers for manipulating model internal logic.
Conclusion and Future Work
The discovery of SIA reveals that current LLM safety mechanisms are fragile. While token filtering can mitigate simple attacks, it is easily bypassed by minor character variations (e.g., adding spaces or slashes) that the model still recognizes as separators. Future research must focus on instruction-tuning algorithms that balance attention across the entire dialogue history and account for multi-task scenarios to eliminate the "nearest neighbor" vulnerability.
Summary updated