arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2309.01686cs.CL
收藏

MathAttack:攻击大型语言模型的数学求解能力

MathAttack: Attacking Large Language Models Towards Math Solving Ability

Xi’an Jiaotong-Liverpool University(西交利物浦大学);University of Liverpool(利物浦大学);Northwestern University(西北大学);ShanghaiTech University(上海科技大学);Duke Kunshan University(昆山杜克大学)

Zihao Zhou, Qiufeng Wang, Mingyu Jin, Jie Yao, Jianan Ye, Wei Liu, Wei Wang, Xiaowei Huang, Kaizhu Huang

AI总结:

提出MathAttack模型,通过逻辑实体识别冻结关键逻辑并攻击其余文本,生成对抗样本以攻击LLMs的数学应用题求解能力,并构建RobustMath数据集验证其有效性,同时发现对抗样本可迁移且复杂问题更易受攻击。

摘要:

随着大型语言模型(LLMs)的蓬勃发展,数学应用题(MWP)求解的研究近年来取得了巨大进展。然而,针对LLMs在数学求解能力方面的安全性研究却鲜有涉及。不同于攻击LLMs使用过程中的提示(prompt),我们提出了一种MathAttack模型,用于攻击更贴近数学问题求解安全本质的MWP样本。与传统的文本对抗攻击相比,在攻击过程中保持原始MWP的数学逻辑至关重要。为此,我们提出了逻辑实体识别方法,以识别逻辑条目并将其冻结。随后,采用词级攻击器对剩余文本进行攻击。此外,我们构建了一个新的数据集RobustMath,用于评估LLMs在数学求解能力上的鲁棒性。在RobustMath以及另外两个数学基准数据集GSM8K和MultiAirth上的大量实验表明,MathAttack能够有效攻击LLMs的数学求解能力。实验中我们观察到:(1)来自高精度LLMs的对抗样本也能有效攻击低精度LLMs(例如,从较大规模LLMs迁移到较小规模LLMs,或从少样本提示迁移到零样本提示);(2)复杂的MWP(如更多求解步骤、更长文本、更多数字)更容易受到攻击;(3)通过在少样本提示中使用我们的对抗样本,可以提高LLMs的鲁棒性。最后,我们希望我们的实践和观察能成为增强LLMs数学求解能力鲁棒性的重要尝试。我们将发布我们的代码和数据集。

英文摘要:

With the boom of Large Language Models (LLMs), the research of solving Math Word Problem (MWP) has recently made great progress. However, there are few studies to examine the security of LLMs in math solving ability. Instead of attacking prompts in the use of LLMs, we propose a MathAttack model to attack MWP samples which are closer to the essence of security in solving math problems. Compared to traditional text adversarial attack, it is essential to preserve the mathematical logic of original MWPs during the attacking. To this end, we propose logical entity recognition to identify logical entries which are then frozen. Subsequently, the remaining text are attacked by adopting a word-level attacker. Furthermore, we propose a new dataset RobustMath to evaluate the robustness of LLMs in math solving ability. Extensive experiments on our RobustMath and two another math benchmark datasets GSM8K and MultiAirth show that MathAttack could effectively attack the math solving ability of LLMs. In the experiments, we observe that (1) Our adversarial samples from higher-accuracy LLMs are also effective for attacking LLMs with lower accuracy (e.g., transfer from larger to smaller-size LLMs, or from few-shot to zero-shot prompts); (2) Complex MWPs (such as more solving steps, longer text, more numbers) are more vulnerable to attack; (3) We can improve the robustness of LLMs by using our adversarial samples in few-shot prompts. Finally, we hope our practice and observation can serve as an important attempt towards enhancing the robustness of LLMs in math solving ability. We will release our code and dataset.

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

↑