{"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/adversarial-manipulation-of-reasoning-models","title":"Adversarial Manipulation of Reasoning Models using Internal Representations","arxiv_id":"2507.03167","date":"2025-07-03","proceeding":null,"authors":["Kureha Yamaguchi","Benjamin Etheridge","Andy Arditi"],"abstract":"Reasoning models generate chain-of-thought (CoT) tokens before their final output, but how this affects their vulnerability to jailbreak attacks remains unclear. While traditional language models make refusal decisions at the prompt-response boundary, we find evidence that DeepSeek-R1-Distill-Llama-8B makes these decisions within its CoT generation. We identify a linear direction in activation space during CoT token generation that predicts whether the model will refuse or comply -- termed the \"caution\" direction because it corresponds to cautious reasoning patterns in the generated text. Ablating this direction from model activations increases harmful compliance, effectively jailbreaking the model. We additionally show that intervening only on CoT token activations suffices to control final outputs, and that incorporating this direction into prompt-based attacks improves success rates. Our findings suggest that the chain-of-thought itself is a promising new target for adversarial manipulation in reasoning models. Code available at https://github.com/ky295/reasoning-manipulation","url_abs":"https://arxiv.org/abs/2507.03167v1","url_pdf":"https://arxiv.org/pdf/2507.03167v1.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":"adversarial-manipulation-of-reasoning-models","repo_url":"https://github.com/ky295/reasoning-manipulation","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2507.03167","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2507.03167"}},"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/ky295/reasoning-manipulation","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":19},"by_repo_kind":{"official":{"samples":19,"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":"87195b0a4ef935ce","entry":"build_vllm_cmd","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"evals/run_inspect_evals.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/evals/run_inspect_evals.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":"87195b0a4ef935ce"}},{"code_sha256_prefix":"a57a41ff1c82852a","entry":"compute_statistics","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"utils/compute_layer_statistics.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/utils/compute_layer_statistics.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":"a57a41ff1c82852a"}},{"code_sha256_prefix":"e89e5a58c64540b7","entry":"extract_score_from_log","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"evals/summarise_results.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/evals/summarise_results.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":"e89e5a58c64540b7"}},{"code_sha256_prefix":"03321a7b056bd1b5","entry":"extract_scores","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"evals/plot_eval_results.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/evals/plot_eval_results.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":"03321a7b056bd1b5"}},{"code_sha256_prefix":"d9fcca7d59fce338","entry":"find_log_files","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"evals/summarise_results.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/evals/summarise_results.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":"d9fcca7d59fce338"}},{"code_sha256_prefix":"ed8c6076c30c1386","entry":"find_nan_rows","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"utils/repair_scores.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/utils/repair_scores.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":"ed8c6076c30c1386"}},{"code_sha256_prefix":"e497f56676b3cd9d","entry":"is_moe_model","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"interventions/create_ortho_model.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/interventions/create_ortho_model.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":"e497f56676b3cd9d"}},{"code_sha256_prefix":"e0d55b89085e24e8","entry":"is_nan_score","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"utils/repair_scores.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/utils/repair_scores.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":"e0d55b89085e24e8"}},{"code_sha256_prefix":"f5e16e8e7a8d83d1","entry":"load_activations","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"interventions/create_ortho_model.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/interventions/create_ortho_model.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":"f5e16e8e7a8d83d1"}},{"code_sha256_prefix":"a59c379b79e6f777","entry":"load_data_efficiently","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"utils/compute_score_outputs.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/utils/compute_score_outputs.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":"a59c379b79e6f777"}},{"code_sha256_prefix":"d4f29e94e48d679d","entry":"load_model","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"interventions/create_ortho_model.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/interventions/create_ortho_model.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":"d4f29e94e48d679d"}},{"code_sha256_prefix":"2410d0fa9fb4d711","entry":"load_model","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"interventions/activation_addition.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/interventions/activation_addition.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":"2410d0fa9fb4d711"}},{"code_sha256_prefix":"8ba2efdc541845de","entry":"load_scored_csv","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"utils/repair_scores.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/utils/repair_scores.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":"8ba2efdc541845de"}},{"code_sha256_prefix":"8f51f9a84a06ea6e","entry":"load_scores_from_csv","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"utils/compute_layer_statistics.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/utils/compute_layer_statistics.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":"8f51f9a84a06ea6e"}},{"code_sha256_prefix":"19960ce955b2410a","entry":"match_benchmark","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"evals/summarise_results.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/evals/summarise_results.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":"19960ce955b2410a"}},{"code_sha256_prefix":"dd14f656a65925c3","entry":"read_csv","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"interventions/activation_addition.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/interventions/activation_addition.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":"dd14f656a65925c3"}},{"code_sha256_prefix":"f46c737dd9c56fa6","entry":"run_inspect_eval","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"evals/run_inspect_evals.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/evals/run_inspect_evals.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":"f46c737dd9c56fa6"}},{"code_sha256_prefix":"ead414dc1605e9b9","entry":"save_csv","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"interventions/activation_addition.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/interventions/activation_addition.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":"ead414dc1605e9b9"}},{"code_sha256_prefix":"307d0090494af11c","entry":"wait_for_server","repo":"ky295/reasoning-manipulation","repo_kind":"official","path":"evals/run_inspect_evals.py","file_url":"https://github.com/ky295/reasoning-manipulation/blob/HEAD/evals/run_inspect_evals.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":"307d0090494af11c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}