Qing Li, Sijia Liu, Shiyu Chang, Yang Zhang, Zhen Zhang, Bairu Hou, Gaowen Liu, Uc Barbara, Guanhua Zhang, Wenqi Fan, Jiabao Ji
We lifted 4 functions out of this paper's own repositories and ran 4 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 |
|---|---|---|
| ucsb-nlp-chang/selfdenoise | canonical | 4 of 4 |
| Function | Status | Where it lives |
|---|---|---|
| call_openai | Ran | ucsb-nlp-chang/selfdenoise/jailbreakcode/lib/language_models.py pointer only (licence: NONE) · get_code("e0ff677292cbbb70") |
| get_comment | Ran | ucsb-nlp-chang/selfdenoise/code/baseargs.py pointer only (licence: NONE) · get_code("8353094b74c70a08") |
| get_judge_system_prompt | Ran | ucsb-nlp-chang/selfdenoise/jailbreakcode/lib/judges.py pointer only (licence: NONE) · get_code("1eb92df4126524c3") |
| get_judge_system_prompt_for_rejection | Ran | ucsb-nlp-chang/selfdenoise/jailbreakcode/lib/judges.py pointer only (licence: NONE) · get_code("6e443db02d852c21") |
Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.
Although large language models (LLMs) have achieved significant success, their vulnerability to adversarial perturbations, including recent jailbreak attacks, has raised considerable concerns. However, the increasing size of these models and their limited access make improving their robustness a challenging task. Among various defense strategies, randomized smoothing has shown great potential for LLMs, as it does not require full access to the model's parameters or fine-tuning via adversarial training. However, randomized smoothing involves adding noise to the input before model prediction, and the final model's robustness largely depends on the model's performance on these noise corrupted data. Its effectiveness is often limited by the model's sub-optimal performance on noisy data. To address this issue, we propose to leverage the multitasking nature of LLMs to first denoise the noisy inputs and then to make predictions based on these denoised versions. We call this procedure self-denoised smoothing. Unlike previous denoised smoothing techniques in computer vision, which require training a separate model to enhance the robustness of LLMs, our method offers significantly better efficiency and flexibility. Our experimental results indicate that our method surpasses existing methods in both empirical and certified robustness in defending against adversarial attacks for both downstream tasks and human alignments (i.e., jailbreak attacks). Our code is publicly available at https://github. com/UCSB-NLP-Chang/SelfDenoise.
The same record, over MCP at https://syntology.ai/mcp:
get_harvested_code_for_paper("2404.12274")
get_code_for_paper("2404.12274")
have("2404.12274")
Connect an agent — have() is free.