atlas

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

Revisiting Character-level Adversarial Attacks for Language Models

ICML 2024 · Adversarial robustness and security › Attacks on text and graphs · approach: Adversarial prompts for language models · 1 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 Charmer, a query-based greedy character-level adversarial attack with top-n position pre-selection using Levenshtein-distance perturbations, achieving near-100% ASR on BERT/RoBERTa TextAttack models and Llama 2-Chat 7B, and tests adversarial training and typo-corrector defenses.

Problem

Token-level adversarial attacks in NLP often change sentence semantics, while character-level attacks, though semantics-preserving, are considered weak and hard to scale efficiently or adapt to gradient methods, and are thought easy to defend.

Approach

A greedy, black-box character-level attack that ranks candidate positions by a loss-based test-character replacement heuristic (top-n position subset), then greedily applies the single-character edit (replacement, insertion, or deletion via expansion/contraction operators) with highest CW loss at each step, with importance re-evaluated after each perturbation.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use Charmer instead of the strongest listed baselineBERT and RoBERTa classifiers · TextAttack benchmarks (AG-News, MNLI-m, QNLI, RTE, SST-2)ASR (%)Helped
Reduce candidate positions from n=20 to n=1 (Charmer-Fast) (ablation)Charmer · TextAttack benchmarksASR (%): BERT AG-News 98.51 -> 95.86; BERT RTE 97.01 -> 89.55; BERT SST-2 100.00 -> 100.00Mixed
Use Charmer-Fast instead of the strongest listed baselineLlama 2-Chat 7B · SST-2, QNLI, RTEASR (%): 85.79 -> 95.47; 64.04 -> 93.51; 90.78 -> 97.10Helped
Train using Charmer adversarial examples rather than standard trainingBERT-base · SST-2ASR-Char (%): 64.02 -> 20.34 ± (1.17)Helped
Train using TextGrad adversarial examples rather than standard trainingBERT-base · SST-2ASR-Char (%): 64.02 -> 67.34 ± (4.87)Hurt
Train using Charmer adversarial examples rather than standard trainingBERT-base · SST-2ASR-Token (%): 95.16 -> 95.17 ± (1.15)No clear effect
Add Pruthi-Jones constraints to the attack (ablation)Charmer against the robust encoding defense · BERT-SST-2ASR (%): 100.00 -> 0.96Hurt
Remove LowEng while retaining the other PJC constraints (ablation)Charmer against the robust encoding defense · BERT-SST-2ASR (%): 0.96 -> 98.09Helped
Remove End while retaining the other PJC constraints (ablation)Charmer against the robust encoding defense · BERT-SST-2ASR (%): 0.96 -> 71.72Helped
Remove Start while retaining the other PJC constraints (ablation)Charmer against the robust encoding defense · BERT-SST-2ASR (%): 0.96 -> 88.93Helped
Remove Length while retaining the other PJC constraints (ablation)Charmer against the robust encoding defense · BERT-SST-2ASR (%): 0.96 -> 0.96No clear effect
Remove Repeat while retaining the other PJC constraints (ablation)Charmer against the robust encoding defense · BERT-SST-2ASR (%): 0.96 -> 5.46Helped

Surprising findings

Limitations

Experimental setup

Datasets: SST-2 MNLI-m RTE QNLI AG-News

Benchmarks: SST-2 MNLI-m RTE QNLI AG-News

Metrics: attack success rate Levenshtein distance USE cosine similarity runtime GPT-2 perplexity

Baselines: BAE-R TextFooler BERT-attack GBDA TextGrad DeepWordBug TextBugger CWBA

Builds on: Carlini-Wagner loss TextAttack TRADES DeepWordBug

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