mlsanityData to 14 Oct 2026

Exposing LLM Safety Gaps Through Mathematical Encoding:New Attacks and Systematic Analysis

arXiv 2605.03441 ↗First posted 5 May 2026cs.CR cs.AI cs.CLcited by 3

On the map: LLM safety and security → Safety alignment, refusal and guardrails

Abstract (arXiv)

Large language models (LLMs) employ safety mechanisms to prevent harmful outputs, yet these defenses primarily rely on semantic pattern matching. We show that encoding harmful prompts as coherent mathematical problems -- using formalisms such as set theory, formal logic, and quantum mechanics -- bypasses these filters at high rates, achieving 46%--56% average attack success across eight target models and two established benchmarks. Crucially, the effectiveness depends not on mathematical notation itself, but on whether a helper LLM deeply reformulates the harmful content into a genuine mathematical problem: rule-based encodings that apply mathematical formatting without such reformulation perform no better than unencoded baselines. We introduce a novel Formal Logic encoding that achieves attack success comparable to Set Theory, demonstrating that this vulnerability generalizes across mathematical formalisms. Additional experiments with repeat post-processing confirm that these attacks are robust to simple prompt augmentation. Notably, newer models (GPT-5, GPT-5-Mini) show substantially greater robustness than older models, though they remain vulnerable. Our findings highlight fundamental gaps in current safety frameworks and motivate defenses that reason about mathematical structure rather than surface-level semantics.

Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Placed in Safety alignment, refusal and guardrails, one of 12 directions in LLM safety and security. Builds on 17 of its 21 references that are in the map. First posted on arXiv 5 May 2026.

Builds on

17 of 21 references.

References · 17

  1. 2022Training language models to follow instructions with human feedbackcited by 15,971
  2. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 3,104
  3. 2022Constitutional AI: Harmlessness from AI Feedbackcited by 3,050
  4. 2024HarmBench: A Standardized Evaluation Framework for Automated Red Teaming and Robust Refusalcited by 1,429
  5. 2023Jailbreaking Black Box Large Language Models in Twenty Queriescited by 1,420
  6. 2023Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversationscited by 1,207
  7. 2022Red Teaming Language Models with Language Modelscited by 1,026
  8. 2023AutoDAN: Generating Stealthy Jailbreak Prompts on Aligned Large Language Modelscited by 785
  9. 2024GSM-Symbolic: Understanding the Limitations of Mathematical Reasoning in Large Language Modelscited by 550
  10. 2024JailbreakBench: An Open Robustness Benchmark for Jailbreaking Large Language Modelscited by 536
  11. 2023"Do Anything Now": Characterizing and Evaluating In-The-Wild Jailbreak Prompts on Large Language Modelscited by 489
  12. 2023GPT-4 Is Too Smart To Be Safe: Stealthy Chat with LLMs via Ciphercited by 423
5 more
  1. 2024A Comprehensive Study of Jailbreak Attack versus Defense for Large Language Modelscited by 106
  2. 2024Best-of-N Jailbreakingcited by 76
  3. 2025Prompt Repetition Improves Non-Reasoning LLMscited by 27
  4. 2024Jailbreaking Large Language Models with Symbolic Mathematicscited by 16
  5. 2025Behind the Mask: Benchmarking Camouflaged Jailbreaks in Large Language Modelscited by 2

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 3.

3 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Should LLM Safety Be More Than Refusing Harmful Instructions?
  2. 2024Fine-Tuning, Quantization, and LLMs: Navigating Unintended Outcomes
  3. 2024Root Defence Strategies: Ensuring Safety of LLM at the Decoding Level
  4. 2025Benchmarking Large Language Models for Cryptanalysis and Side-Channel Vulnerabilities
  5. 2026Safety Paradox: How Enhanced Safety Awareness Leaves LLMs Vulnerable to Posterior Attack
  6. 2024Large Language Model Safety: A Holistic Survey
  7. 2026Testing LLM Arithmetic Reasoning Generalization with Automatic Numeric-Remapping Attacks
  8. 2024No Two Devils Alike: Unveiling Distinct Mechanisms of Fine-tuning Attacks