{"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/turning-logic-against-itself-probing-model","title":"Turning Logic Against Itself : Probing Model Defenses Through Contrastive Questions","arxiv_id":"2501.01872","date":"2025-01-03","proceeding":null,"authors":["Rachneet Sachdeva","Rima Hazra","Iryna Gurevych"],"abstract":"Large language models, despite extensive alignment with human values and ethical principles, remain vulnerable to sophisticated jailbreak attacks that exploit their reasoning abilities. Existing safety measures often detect overt malicious intent but fail to address subtle, reasoning-driven vulnerabilities. In this work, we introduce POATE (Polar Opposite query generation, Adversarial Template construction, and Elaboration), a novel jailbreak technique that harnesses contrastive reasoning to provoke unethical responses. POATE crafts semantically opposing intents and integrates them with adversarial templates, steering models toward harmful outputs with remarkable subtlety. We conduct extensive evaluation across six diverse language model families of varying parameter sizes to demonstrate the robustness of the attack, achieving significantly higher attack success rates (~44%) compared to existing methods. To counter this, we propose Intent-Aware CoT and Reverse Thinking CoT, which decompose queries to detect malicious intent and reason in reverse to evaluate and reject harmful responses. These methods enhance reasoning robustness and strengthen the model's defense against adversarial exploits.","url_abs":"https://arxiv.org/abs/2501.01872v2","url_pdf":"https://arxiv.org/pdf/2501.01872v2.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":"turning-logic-against-itself-probing-model","repo_url":"https://github.com/ukplab/poate-attack","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"}],"methods":[{"method_slug":"align","method_name":"ALIGN"},{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"focus","method_name":"Focus"},{"method_slug":"gpt-4","method_name":"GPT-4"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2501.01872","atlas_url":"https://app.syntology.ai/?focus=2501.01872","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2501.01872"}},"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":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/UKPLab/emnlp2025-poate-attack","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":8,"ran_draft_wrong":1,"unverified":1},"by_repo_kind":{"found_in_text":{"samples":10,"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":0,"samples":[{"code_sha256_prefix":"04a97a35af8e23b0","entry":"calculate_agreement","repo":"UKPLab/emnlp2025-poate-attack","repo_kind":"found_in_text","path":"poate_attack/analysis/agreement.py","file_url":"https://github.com/UKPLab/emnlp2025-poate-attack/blob/HEAD/poate_attack/analysis/agreement.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"04a97a35af8e23b0"}},{"code_sha256_prefix":"8c5418f18b5585e9","entry":"clean_answer","repo":"UKPLab/emnlp2025-poate-attack","repo_kind":"found_in_text","path":"poate_attack/attacks/evaluators/risk_scorer.py","file_url":"https://github.com/UKPLab/emnlp2025-poate-attack/blob/HEAD/poate_attack/attacks/evaluators/risk_scorer.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8c5418f18b5585e9"}},{"code_sha256_prefix":"b6a84cab8186e178","entry":"get_eval_scores","repo":"UKPLab/emnlp2025-poate-attack","repo_kind":"found_in_text","path":"poate_attack/attacks/evaluators/risk_scorer.py","file_url":"https://github.com/UKPLab/emnlp2025-poate-attack/blob/HEAD/poate_attack/attacks/evaluators/risk_scorer.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b6a84cab8186e178"}},{"code_sha256_prefix":"811e4dd211667897","entry":"load_data","repo":"UKPLab/emnlp2025-poate-attack","repo_kind":"found_in_text","path":"poate_attack/data_creation/gcg_attack.py","file_url":"https://github.com/UKPLab/emnlp2025-poate-attack/blob/HEAD/poate_attack/data_creation/gcg_attack.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"811e4dd211667897"}},{"code_sha256_prefix":"660d1915d12a3c63","entry":"lowercase_first_word","repo":"UKPLab/emnlp2025-poate-attack","repo_kind":"found_in_text","path":"poate_attack/data_creation/gcg_attack.py","file_url":"https://github.com/UKPLab/emnlp2025-poate-attack/blob/HEAD/poate_attack/data_creation/gcg_attack.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"660d1915d12a3c63"}},{"code_sha256_prefix":"694b5524505a07d2","entry":"match_strings","repo":"UKPLab/emnlp2025-poate-attack","repo_kind":"found_in_text","path":"poate_attack/analysis/stats.py","file_url":"https://github.com/UKPLab/emnlp2025-poate-attack/blob/HEAD/poate_attack/analysis/stats.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"694b5524505a07d2"}},{"code_sha256_prefix":"8dfd6e183a9f5d12","entry":"not_matched","repo":"UKPLab/emnlp2025-poate-attack","repo_kind":"found_in_text","path":"poate_attack/attacks/evaluators/risk_scorer.py","file_url":"https://github.com/UKPLab/emnlp2025-poate-attack/blob/HEAD/poate_attack/attacks/evaluators/risk_scorer.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8dfd6e183a9f5d12"}},{"code_sha256_prefix":"63a21a195abc5634","entry":"remove_punctuation","repo":"UKPLab/emnlp2025-poate-attack","repo_kind":"found_in_text","path":"poate_attack/data_creation/generate_test_data.py","file_url":"https://github.com/UKPLab/emnlp2025-poate-attack/blob/HEAD/poate_attack/data_creation/generate_test_data.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"63a21a195abc5634"}},{"code_sha256_prefix":"029580f36c1e96b3","entry":"remove_punctuation_regex","repo":"UKPLab/emnlp2025-poate-attack","repo_kind":"found_in_text","path":"poate_attack/utils.py","file_url":"https://github.com/UKPLab/emnlp2025-poate-attack/blob/HEAD/poate_attack/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"029580f36c1e96b3"}},{"code_sha256_prefix":"090eed81a24d4b32","entry":"load_model_and_tokenizer","repo":"UKPLab/emnlp2025-poate-attack","repo_kind":"found_in_text","path":"poate_attack/attacks/utils/models.py","file_url":"https://github.com/UKPLab/emnlp2025-poate-attack/blob/HEAD/poate_attack/attacks/utils/models.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"090eed81a24d4b32"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}