{"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-2605-08778","title":"Not All Turns Matter: Credit Assignment for Multi-Turn Jailbreaking","arxiv_id":"2605.08778","date":"2026-05-09","proceeding":null,"authors":["Zhida He","Xiaoyu Wen","Han Qi","Ziyuan Zhou","Peng Yu","Xingcheng Xu","Dongrui Liu","Xia Hu","Chaochao Lu","Qiaosheng Zhang"],"abstract":"Deploying LLMs in multi-turn dialogues facilitates jailbreak attacks that distribute harmful intent across seemingly benign turns. Recent training-based multi-turn jailbreak methods learn long-horizon attack strategies from interaction feedback, but often rely on coarse trajectory-level outcome signals that broadcast uniformly to every turn. However, we find that turn-level contributions in multi-turn jailbreaking are non-uniform, phase-dependent, and target-specific. Such coarse outcome supervision induces a credit assignment problem, leading to over-rewarding redundant turns in successful trajectories and under-crediting useful intermediate turns in failed ones. To address this, we propose TRACE, a turn-aware credit assignment framework for reinforcement learning (RL)-based multi-turn jailbreaking. For successful trajectories, TRACE estimates turn-level contributions via leave-one-turn-out semantic masking; for failed ones, TRACE assigns penalties based on prompt harmfulness and semantic relevance, with an additional local refusal-aware penalty. Furthermore, we reuse the attack-side credit signal for multi-turn defense alignment. Extensive experiments on open-source and closed-source targets show that TRACE achieves strong overall performance in effectiveness, transferability, and efficiency, yielding about a 25% relative improvement in attack success rate over the strongest RL baseline while also improving the safety-utility balance when reused for defense alignment.","url_abs":"https://arxiv.org/abs/2605.08778","url_pdf":"https://arxiv.org/pdf/2605.08778","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":{"syntology_url":"https://syntology.ai/paper/2605.08778","atlas_url":"https://app.syntology.ai/?focus=2605.08778","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2605.08778"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/xsddys/TRACE","reach":null}],"summary":{"ran":3,"ran_draft_wrong":11,"ran_honours":3,"ran_fixture":3,"unverified":4},"by_repo_kind":{"found_in_text":{"samples":24,"ran":20,"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":24,"samples":[{"code_sha256_prefix":"3f7d8c208ab063b5","entry":"MaskConfig","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3f7d8c208ab063b5"}},{"code_sha256_prefix":"c71a87f63e76e0a5","entry":"SemanticAdvConfig","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c71a87f63e76e0a5"}},{"code_sha256_prefix":"2252bbf2b673ebb5","entry":"SemanticBroadcastResult","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2252bbf2b673ebb5"}},{"code_sha256_prefix":"4064912bd2ac88ee","entry":"_apply_mask_to_turn","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4064912bd2ac88ee"}},{"code_sha256_prefix":"a1f673ec802eded3","entry":"_default_multipliers","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a1f673ec802eded3"}},{"code_sha256_prefix":"00a0434afaf5dfdd","entry":"_has_valid_deltas","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","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":"00a0434afaf5dfdd"}},{"code_sha256_prefix":"62085d7ec9fcc511","entry":"build_env_llm_messages","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"62085d7ec9fcc511"}},{"code_sha256_prefix":"64df89236d7d0cd8","entry":"build_outcome_tensors_from_multipliers","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"64df89236d7d0cd8"}},{"code_sha256_prefix":"d12f45462978865a","entry":"build_semantic_adv_config","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d12f45462978865a"}},{"code_sha256_prefix":"f35eb6a8118f27a6","entry":"build_semantic_tasks_for_messages_list","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f35eb6a8118f27a6"}},{"code_sha256_prefix":"ab71c965f5581f3a","entry":"build_semantic_turn_multipliers","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ab71c965f5581f3a"}},{"code_sha256_prefix":"b4137b752b8994e6","entry":"extract_origin_scores","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b4137b752b8994e6"}},{"code_sha256_prefix":"416d9d11caeda1c0","entry":"extract_turns","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"416d9d11caeda1c0"}},{"code_sha256_prefix":"3129a10556b73f90","entry":"extract_x0_from_init_prompt","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3129a10556b73f90"}},{"code_sha256_prefix":"6fdf758e359396c1","entry":"get_cfg_value","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6fdf758e359396c1"}},{"code_sha256_prefix":"48b05e0fb80241b5","entry":"group_records_by_sample","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"48b05e0fb80241b5"}},{"code_sha256_prefix":"7b9db2e2187a086e","entry":"messages_list_to_dialogue_history","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7b9db2e2187a086e"}},{"code_sha256_prefix":"d3046633b4fececb","entry":"select_semantic_success_indices","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d3046633b4fececb"}},{"code_sha256_prefix":"7017d7d1cfc14564","entry":"split_trun_from_mask","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7017d7d1cfc14564"}},{"code_sha256_prefix":"ad2681d9bdf52920","entry":"summarize_semantic_metrics","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ad2681d9bdf52920"}},{"code_sha256_prefix":"c1f91737559a722a","entry":"attach_outcome_advantages_to_records","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.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":"c1f91737559a722a"}},{"code_sha256_prefix":"b6ddff6ffd6b1f7d","entry":"compute_grpo_semantic_outcome_broadcast","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.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":"b6ddff6ffd6b1f7d"}},{"code_sha256_prefix":"dbc5484379d52510","entry":"compute_semantic_attribution_for_batch","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.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":"dbc5484379d52510"}},{"code_sha256_prefix":"059d0b0907b80eba","entry":"compute_semantic_broadcast","repo":"xsddys/TRACE","repo_kind":"found_in_text","path":"ragen/trainer/attribution_advantage.py","file_url":"https://github.com/xsddys/TRACE/blob/HEAD/ragen/trainer/attribution_advantage.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":"059d0b0907b80eba"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.LG","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}