{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/flipattack-jailbreak-llms-via-flipping","title":"FlipAttack: Jailbreak LLMs via Flipping","arxiv_id":"2410.02832","date":"2024-10-02","proceeding":null,"authors":["Yue Liu","Xiaoxin He","Miao Xiong","Jinlan Fu","Shumin Deng","Bryan Hooi"],"abstract":"This paper proposes a simple yet effective jailbreak attack named FlipAttack against black-box LLMs. First, from the autoregressive nature, we reveal that LLMs tend to understand the text from left to right and find that they struggle to comprehend the text when noise is added to the left side. Motivated by these insights, we propose to disguise the harmful prompt by constructing left-side noise merely based on the prompt itself, then generalize this idea to 4 flipping modes. Second, we verify the strong ability of LLMs to perform the text-flipping task, and then develop 4 variants to guide LLMs to denoise, understand, and execute harmful behaviors accurately. These designs keep FlipAttack universal, stealthy, and simple, allowing it to jailbreak black-box LLMs within only 1 query. Experiments on 8 LLMs demonstrate the superiority of FlipAttack. Remarkably, it achieves $\\sim$98\\% attack success rate on GPT-4o, and $\\sim$98\\% bypass rate against 5 guardrail models on average. The codes are available at GitHub\\footnote{https://github.com/yueliu1999/FlipAttack}.","url_abs":"https://arxiv.org/abs/2410.02832v1","url_pdf":"https://arxiv.org/pdf/2410.02832v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"flipattack-jailbreak-llms-via-flipping","repo_url":"https://github.com/yueliu1999/flipattack","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"flipattack-jailbreak-llms-via-flipping","repo_url":"https://github.com/yueliu1999/elcrec","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2410.02832","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.02832"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yueliu1999/elcrec","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yueliu1999/flipattack","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1,"ran_honours":1,"ran":3},"by_repo_kind":{"listed":{"samples":5,"ran":5,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"0f786c407fb1ee4c","entry":"swish","repo":"yueliu1999/elcrec","repo_kind":"listed","path":"src/modules.py","file_url":"https://github.com/yueliu1999/elcrec/blob/HEAD/src/modules.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":2,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0f786c407fb1ee4c"}},{"code_sha256_prefix":"56a9ab06b860b180","entry":"gelu","repo":"yueliu1999/elcrec","repo_kind":"listed","path":"src/modules.py","file_url":"https://github.com/yueliu1999/elcrec/blob/HEAD/src/modules.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"56a9ab06b860b180"}},{"code_sha256_prefix":"11e0bc26b5cfda51","entry":"kmax_pooling","repo":"yueliu1999/elcrec","repo_kind":"listed","path":"src/utils.py","file_url":"https://github.com/yueliu1999/elcrec/blob/HEAD/src/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"11e0bc26b5cfda51"}},{"code_sha256_prefix":"941f08ce28f5a2ff","entry":"nCr","repo":"yueliu1999/elcrec","repo_kind":"listed","path":"src/utils.py","file_url":"https://github.com/yueliu1999/elcrec/blob/HEAD/src/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"941f08ce28f5a2ff"}},{"code_sha256_prefix":"ff0f6a85cdaf16a5","entry":"neg_sample","repo":"yueliu1999/elcrec","repo_kind":"listed","path":"src/utils.py","file_url":"https://github.com/yueliu1999/elcrec/blob/HEAD/src/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ff0f6a85cdaf16a5"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}