arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.23173cs.CRcs.AI
收藏

EquaCode:通过方程求解和代码补全的多策略对抗大语言模型

EquaCode: A Multi-Strategy Jailbreak Approach for Large Language Models via Equation Solving and Code Completion

School of Computer Science and Technology, Zhejiang Sci-Tech University, Hangzhou, China(计算机科学与技术学院,浙江科技学院,杭州,中国)

Zhen Liang, Hai Huang, Zhengkui Chen

AI总结:

EquaCode通过方程求解和代码补全提出多策略对抗方法,有效提升大语言模型的鲁棒性。

摘要:

大型语言模型(LLMs),如ChatGPT,在广泛领域取得了显著成功。然而,其可靠性仍是一个重大问题,因为它们仍然容易受到针对获取不当或有害响应的对抗攻击。然而,现有的对抗攻击主要在自然语言层面进行,并依赖单一攻击策略,限制了其在全面评估LLM鲁棒性方面的有效性。在本文中,我们提出Equacode,一种通过方程求解和代码补全的新型多策略对抗方法,用于大语言模型。该方法将恶意意图转化为数学问题,然后要求LLM通过代码解决,利用跨领域任务的复杂性,将模型的注意力转向任务完成而非安全约束。实验结果表明,Equacode在GPT系列上实现了91.19%的平均成功率,在3种最先进的LLM上实现了98.65%的成功率,仅需单次查询。进一步的消融实验表明,EquaCode在单独的数学方程模块或代码模块上均优于后者。这表明存在强大的协同效应,从而证明多策略方法的结果大于各部分之和。

英文摘要:

Large language models (LLMs), such as ChatGPT, have achieved remarkable success across a wide range of fields. However, their trustworthiness remains a significant concern, as they are still susceptible to jailbreak attacks aimed at eliciting inappropriate or harmful responses. However, existing jailbreak attacks mainly operate at the natural language level and rely on a single attack strategy, limiting their effectiveness in comprehensively assessing LLM robustness. In this paper, we propose Equacode, a novel multi-strategy jailbreak approach for large language models via equation-solving and code completion. This approach transforms malicious intent into a mathematical problem and then requires the LLM to solve it using code, leveraging the complexity of cross-domain tasks to divert the model's focus toward task completion rather than safety constraints. Experimental results show that Equacode achieves an average success rate of 91.19% on the GPT series and 98.65% across 3 state-of-the-art LLMs, all with only a single query. Further, ablation experiments demonstrate that EquaCode outperforms either the mathematical equation module or the code module alone. This suggests a strong synergistic effect, thereby demonstrating that multi-strategy approach yields results greater than the sum of its parts.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑