SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.09990 · 2025

X-Boundary: Establishing Exact Safety Boundary to Shield LLMs from Multi-Turn Jailbreaks without Compromising Usability

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 5 functions out of this paper's own repositories and ran 5 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
ai45lab/x-boundary canonical 5 of 5
FunctionStatusWhere it lives
calculate_ppl Ran ai45lab/x-boundary/R1_X_Boundary_demo.py
pointer only (licence: NONE) · get_code("3b4dad61f81d233f")
compute_loss Ran ai45lab/x-boundary/src/lorra_x_boundary.py
pointer only (licence: NONE) · get_code("d11d2248331f1c58")
find_repeated_substring Ran ai45lab/x-boundary/R1_X_Boundary_demo.py
pointer only (licence: NONE) · get_code("4f90eab861fd28a1")
get_peft_state_maybe_zero_3 Ran ai45lab/x-boundary/src/lorra_x_boundary.py
pointer only (licence: NONE) · get_code("7706fd59e4302905")
maybe_zero_3 Ran ai45lab/x-boundary/src/lorra_x_boundary.py
pointer only (licence: NONE) · get_code("16f29eca39ef4fff")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Despite the rapid development of safety alignment techniques for LLMs, defending against multi-turn jailbreaks is still a challenging task. In this paper, we conduct a comprehensive comparison, revealing that some existing defense methods can improve the robustness of LLMs against multi-turn jailbreaks but compromise usability, i.e., reducing general capabilities or causing the over-refusal problem. From the perspective of mechanism interpretability of LLMs, we discover that these methods fail to establish a boundary that exactly distinguishes safe and harmful feature representations. Therefore, boundary-safe representations close to harmful representations are inevitably disrupted, leading to a decline in usability. To address this issue, we propose X-Boundary to push harmful representations away from boundary-safe representations and obtain an exact distinction boundary. In this way, harmful representations can be precisely erased without disrupting safe ones. Experimental results show that X-Boundary achieves state-of-the-art defense performance against multi-turn jailbreaks, while reducing the over-refusal rate by about 20% and maintaining nearly complete general capability. Furthermore, we theoretically prove and empirically verify that X-Boundary can accelerate the convergence process during training. Please see our code at: https://github.com/AI45Lab/X-Boundary.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2502.09990")
get_code_for_paper("2502.09990")
have("2502.09990")

Connect an agent — have() is free.