CodeChameleon: Personalized Encryption Framework for Jailbreaking Large Language Models

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Lv, Huijie, Wang, Xiao, Zhang, Yuansen, Huang, Caishuang, Dou, Shihan, Ye, Junjie, Gui, Tao, Zhang, Qi, Huang, Xuanjing
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929256823521280
author Lv, Huijie
Wang, Xiao
Zhang, Yuansen
Huang, Caishuang
Dou, Shihan
Ye, Junjie
Gui, Tao
Zhang, Qi
Huang, Xuanjing
author_facet Lv, Huijie
Wang, Xiao
Zhang, Yuansen
Huang, Caishuang
Dou, Shihan
Ye, Junjie
Gui, Tao
Zhang, Qi
Huang, Xuanjing
contents Adversarial misuse, particularly through `jailbreaking' that circumvents a model's safety and ethical protocols, poses a significant challenge for Large Language Models (LLMs). This paper delves into the mechanisms behind such successful attacks, introducing a hypothesis for the safety mechanism of aligned LLMs: intent security recognition followed by response generation. Grounded in this hypothesis, we propose CodeChameleon, a novel jailbreak framework based on personalized encryption tactics. To elude the intent security recognition phase, we reformulate tasks into a code completion format, enabling users to encrypt queries using personalized encryption functions. To guarantee response generation functionality, we embed a decryption function within the instructions, which allows the LLM to decrypt and execute the encrypted queries successfully. We conduct extensive experiments on 7 LLMs, achieving state-of-the-art average Attack Success Rate (ASR). Remarkably, our method achieves an 86.6\% ASR on GPT-4-1106.
format Preprint
id arxiv_https___arxiv_org_abs_2402_16717
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle CodeChameleon: Personalized Encryption Framework for Jailbreaking Large Language Models
Lv, Huijie
Wang, Xiao
Zhang, Yuansen
Huang, Caishuang
Dou, Shihan
Ye, Junjie
Gui, Tao
Zhang, Qi
Huang, Xuanjing
Computation and Language
Artificial Intelligence
Cryptography and Security
Adversarial misuse, particularly through `jailbreaking' that circumvents a model's safety and ethical protocols, poses a significant challenge for Large Language Models (LLMs). This paper delves into the mechanisms behind such successful attacks, introducing a hypothesis for the safety mechanism of aligned LLMs: intent security recognition followed by response generation. Grounded in this hypothesis, we propose CodeChameleon, a novel jailbreak framework based on personalized encryption tactics. To elude the intent security recognition phase, we reformulate tasks into a code completion format, enabling users to encrypt queries using personalized encryption functions. To guarantee response generation functionality, we embed a decryption function within the instructions, which allows the LLM to decrypt and execute the encrypted queries successfully. We conduct extensive experiments on 7 LLMs, achieving state-of-the-art average Attack Success Rate (ASR). Remarkably, our method achieves an 86.6\% ASR on GPT-4-1106.
title CodeChameleon: Personalized Encryption Framework for Jailbreaking Large Language Models
topic Computation and Language
Artificial Intelligence
Cryptography and Security
url https://arxiv.org/abs/2402.16717