{"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/functional-homotopy-smoothing-discrete","title":"Functional Homotopy: Smoothing Discrete Optimization via Continuous Parameters for LLM Jailbreak Attacks","arxiv_id":"2410.04234","date":"2024-10-05","proceeding":null,"authors":["Zi Wang","Divyam Anshumaan","Ashish Hooda","Yudong Chen","Somesh Jha"],"abstract":"Optimization methods are widely employed in deep learning to identify and mitigate undesired model responses. While gradient-based techniques have proven effective for image models, their application to language models is hindered by the discrete nature of the input space. This study introduces a novel optimization approach, termed the \\emph{functional homotopy} method, which leverages the functional duality between model training and input generation. By constructing a series of easy-to-hard optimization problems, we iteratively solve these problems using principles derived from established homotopy methods. We apply this approach to jailbreak attack synthesis for large language models (LLMs), achieving a $20\\%-30\\%$ improvement in success rate over existing methods in circumventing established safe open-source models such as Llama-2 and Llama-3.","url_abs":"https://arxiv.org/abs/2410.04234v2","url_pdf":"https://arxiv.org/pdf/2410.04234v2.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":[],"tasks":[{"task_slug":"llm-jailbreak","task_name":"LLM Jailbreak"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2410.04234","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.04234"}},"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":"deterministic:regex_extraction","url":"https://github.com/danshumaan/functional_homotopy","reach":{"status":"ok"}}],"summary":{"ran":8,"ran_fixture":1,"unverified":3},"by_repo_kind":{"found_in_text":{"samples":12,"ran":9,"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":12,"samples":[{"code_sha256_prefix":"e4417ee936754707","entry":"binsearch","repo":"danshumaan/functional_homotopy","repo_kind":"found_in_text","path":"fhgr/fh-gcg-binsearch.py","file_url":"https://github.com/danshumaan/functional_homotopy/blob/HEAD/fhgr/fh-gcg-binsearch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e4417ee936754707"}},{"code_sha256_prefix":"bf2afc38e02b66e4","entry":"binsearch","repo":"danshumaan/functional_homotopy","repo_kind":"found_in_text","path":"utils/harmbench_evaluator.py","file_url":"https://github.com/danshumaan/functional_homotopy/blob/HEAD/utils/harmbench_evaluator.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"bf2afc38e02b66e4"}},{"code_sha256_prefix":"62252b94693f5878","entry":"first_difference","repo":"danshumaan/functional_homotopy","repo_kind":"found_in_text","path":"DualTrainer.py","file_url":"https://github.com/danshumaan/functional_homotopy/blob/HEAD/DualTrainer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"62252b94693f5878"}},{"code_sha256_prefix":"634d43e275317dd4","entry":"generate","repo":"danshumaan/functional_homotopy","repo_kind":"found_in_text","path":"fhautodan/fh-autodan.py","file_url":"https://github.com/danshumaan/functional_homotopy/blob/HEAD/fhautodan/fh-autodan.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"634d43e275317dd4"}},{"code_sha256_prefix":"979ebedd65ee2267","entry":"init_training_args","repo":"danshumaan/functional_homotopy","repo_kind":"found_in_text","path":"fhgr/fh-gcg-binsearch.py","file_url":"https://github.com/danshumaan/functional_homotopy/blob/HEAD/fhgr/fh-gcg-binsearch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"979ebedd65ee2267"}},{"code_sha256_prefix":"a73c774935e3bc59","entry":"load_data","repo":"danshumaan/functional_homotopy","repo_kind":"found_in_text","path":"fhautodan/fh-autodan.py","file_url":"https://github.com/danshumaan/functional_homotopy/blob/HEAD/fhautodan/fh-autodan.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a73c774935e3bc59"}},{"code_sha256_prefix":"2f49bbc9b11f029c","entry":"load_data","repo":"danshumaan/functional_homotopy","repo_kind":"found_in_text","path":"fhgr/fh-gcg-binsearch.py","file_url":"https://github.com/danshumaan/functional_homotopy/blob/HEAD/fhgr/fh-gcg-binsearch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2f49bbc9b11f029c"}},{"code_sha256_prefix":"576ee553d5cff992","entry":"load_model_and_tokenizer","repo":"danshumaan/functional_homotopy","repo_kind":"found_in_text","path":"fhautodan/utils/opt_utils.py","file_url":"https://github.com/danshumaan/functional_homotopy/blob/HEAD/fhautodan/utils/opt_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"576ee553d5cff992"}},{"code_sha256_prefix":"1fe7dbe6f5cc4593","entry":"roulette_wheel_selection","repo":"danshumaan/functional_homotopy","repo_kind":"found_in_text","path":"fhautodan/utils/opt_utils.py","file_url":"https://github.com/danshumaan/functional_homotopy/blob/HEAD/fhautodan/utils/opt_utils.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1fe7dbe6f5cc4593"}},{"code_sha256_prefix":"17d869189902d3eb","entry":"autodan_sample_control","repo":"danshumaan/functional_homotopy","repo_kind":"found_in_text","path":"fhautodan/utils/opt_utils.py","file_url":"https://github.com/danshumaan/functional_homotopy/blob/HEAD/fhautodan/utils/opt_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"17d869189902d3eb"}},{"code_sha256_prefix":"4ca908a5f1178bfe","entry":"compute_slice","repo":"danshumaan/functional_homotopy","repo_kind":"found_in_text","path":"fhautodan/utils/string_utils.py","file_url":"https://github.com/danshumaan/functional_homotopy/blob/HEAD/fhautodan/utils/string_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4ca908a5f1178bfe"}},{"code_sha256_prefix":"4aaded2078e9febe","entry":"harmbench_judge","repo":"danshumaan/functional_homotopy","repo_kind":"found_in_text","path":"fhautodan/fh-autodan.py","file_url":"https://github.com/danshumaan/functional_homotopy/blob/HEAD/fhautodan/fh-autodan.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4aaded2078e9febe"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}