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.
| Repository | Role | Ran |
|---|---|---|
| ai45lab/x-boundary | canonical | 5 of 5 |
| Function | Status | Where 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") |
Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.
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.
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.