{"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/arxiv-2603-03081","title":"TAO-Attack: Toward Advanced Optimization-Based Jailbreak Attacks for Large Language Models","arxiv_id":"2603.03081","date":"2026-03-03","proceeding":null,"authors":["Zhi Xu","Jiaqi Li","Xiaotong Zhang","Hong Yu","Han Liu"],"abstract":"Large language models (LLMs) have achieved remarkable success across diverse applications but remain vulnerable to jailbreak attacks, where attackers craft prompts that bypass safety alignment and elicit unsafe responses. Among existing approaches, optimization-based attacks have shown strong effectiveness, yet current methods often suffer from frequent refusals, pseudo-harmful outputs, and inefficient token-level updates. In this work, we propose TAO-Attack, a new optimization-based jailbreak method. TAO-Attack employs a two-stage loss function: the first stage suppresses refusals to ensure the model continues harmful prefixes, while the second stage penalizes pseudo-harmful outputs and encourages the model toward more harmful completions. In addition, we design a direction-priority token optimization (DPTO) strategy that improves efficiency by aligning candidates with the gradient direction before considering update magnitude. Extensive experiments on multiple LLMs demonstrate that TAO-Attack consistently outperforms state-of-the-art methods, achieving higher attack success rates and even reaching 100\\% in certain scenarios.","url_abs":"https://arxiv.org/abs/2603.03081","url_pdf":"https://arxiv.org/pdf/2603.03081","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2603.03081","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2603.03081"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/ZevineXu/TAO-Attack","reach":null}],"summary":{"unverified":9},"by_repo_kind":{"found_in_text":{"samples":9,"ran":0,"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":"2b431b29ac3d458c","entry":"check_for_attack_success","repo":"ZevineXu/TAO-Attack","repo_kind":"found_in_text","path":"attack.py","file_url":"https://github.com/ZevineXu/TAO-Attack/blob/HEAD/attack.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2b431b29ac3d458c"}},{"code_sha256_prefix":"71b177b3a3ed6078","entry":"combine_prompts","repo":"ZevineXu/TAO-Attack","repo_kind":"found_in_text","path":"api_experiments/evaluate_api_models.py","file_url":"https://github.com/ZevineXu/TAO-Attack/blob/HEAD/api_experiments/evaluate_api_models.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"71b177b3a3ed6078"}},{"code_sha256_prefix":"7ced740e66b4569d","entry":"generate","repo":"ZevineXu/TAO-Attack","repo_kind":"found_in_text","path":"attack.py","file_url":"https://github.com/ZevineXu/TAO-Attack/blob/HEAD/attack.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7ced740e66b4569d"}},{"code_sha256_prefix":"0bf2136a7171ae80","entry":"get_embedding_layer","repo":"ZevineXu/TAO-Attack","repo_kind":"found_in_text","path":"llm_attacks/base/attack_manager.py","file_url":"https://github.com/ZevineXu/TAO-Attack/blob/HEAD/llm_attacks/base/attack_manager.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0bf2136a7171ae80"}},{"code_sha256_prefix":"688aaeba506e3329","entry":"get_embedding_matrix","repo":"ZevineXu/TAO-Attack","repo_kind":"found_in_text","path":"llm_attacks/base/attack_manager.py","file_url":"https://github.com/ZevineXu/TAO-Attack/blob/HEAD/llm_attacks/base/attack_manager.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"688aaeba506e3329"}},{"code_sha256_prefix":"f556dda0785f3c77","entry":"get_embeddings","repo":"ZevineXu/TAO-Attack","repo_kind":"found_in_text","path":"llm_attacks/base/attack_manager.py","file_url":"https://github.com/ZevineXu/TAO-Attack/blob/HEAD/llm_attacks/base/attack_manager.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f556dda0785f3c77"}},{"code_sha256_prefix":"645890ba00019a69","entry":"load_prompts","repo":"ZevineXu/TAO-Attack","repo_kind":"found_in_text","path":"api_experiments/evaluate_api_models.py","file_url":"https://github.com/ZevineXu/TAO-Attack/blob/HEAD/api_experiments/evaluate_api_models.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"645890ba00019a69"}},{"code_sha256_prefix":"d0e94f216f27f804","entry":"make_checking_fn","repo":"ZevineXu/TAO-Attack","repo_kind":"found_in_text","path":"api_experiments/evaluate_api_models.py","file_url":"https://github.com/ZevineXu/TAO-Attack/blob/HEAD/api_experiments/evaluate_api_models.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d0e94f216f27f804"}},{"code_sha256_prefix":"7f2fb90d5c12909d","entry":"pad_embeds","repo":"ZevineXu/TAO-Attack","repo_kind":"found_in_text","path":"attack.py","file_url":"https://github.com/ZevineXu/TAO-Attack/blob/HEAD/attack.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7f2fb90d5c12909d"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CL","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}