atlas

Research map / Adversarial robustness and security / Attacks on text and graphs

MathAttack: Attacking Large Language Models towards Math Solving Ability

AAAI 2024 · Adversarial robustness and security › Attacks on text and graphs · approach: Adversarial prompts for language models · 10 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes MathAttack, a black-box attack that freezes logical entities (roles, numbers, scenarios) in math word problems and applies a BERT-based word-level attack, and releases the RobustMath adversarial dataset to test LLM math robustness.

Problem

LLMs' robustness in math word problem solving has been little studied, and generic text adversarial attacks tend to alter the mathematical logic of problems, invalidating the ground-truth answer.

Approach

Identify logical entities (role, number, scenario) with spaCy NER, freeze them, and attack the remaining words with a BERT-Attack-style word-level attacker that ranks words by masking-induced drop in correct-answer probability; adversarial samples are manually checked to preserve math logic.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use few-shot prompts instead of zero-shot promptsChatGPT under MathAttack · GSM8KASR: 41.15 -> 19.93Hurt
Use few-shot prompts instead of zero-shot promptsChatGLM2 under MathAttack · GSM8KASR: 56.29 -> 64.82Mixed
Use MathAttack samples with correct labels as few-shot examplesLarge language models · GSM8KASR: 14.07Hurt
Use MathAttack samples with correct labels as few-shot examplesLarge language models · MultiAirthASR: 16.33Hurt
Fine-tune Flan-T5-xl on 200k MWP dataFlan-T5-xl · RobustMath, zero-shotaccuracy: 6.00 -> 12.33Helped
Generate adversarial samples from a larger model and transfer them to a smaller modelChatGPT adversarial samples · Transfer to Flan-T5-largeTSR: 94.44%Helped
Generate adversarial samples with few-shot prompts and transfer them to zero-shotChatGPT · Transfer from few-shot to zero-shotTSR: 45.24%Helped
Increase the number of reasoning steps from 2 to 3MathAttack · MWPsASRHelped
Increase problem lengthMathAttack · MWPsASRHelped
Increase the number of numbers in a problemMathAttack · MWPsASRHelped

Surprising findings

Limitations

Experimental setup

Datasets: GSM8K MultiArith

Benchmarks: GSM8K MultiArith RobustMath

Metrics: Clean Acc Attack Acc Attack Success Rate Similarity (Universal Sentence Encoder) Transfer Success Rate

Baselines: Prompt-Attack (ICL attack) PromptBench SVAMP

Builds on: BERT-Attack chain-of-thought TextAttack

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy