TAPDA: Text Adversarial Purification as Defense Against Adversarial Prompt Attack for Large Language Models

Large Language Models (LLMs) are vulnerable to adversarial prompt attacks, which can lead to “jailbreaking” and the failure of safety alignment, resulting in the generation of harmful content. As adversarial prompts become increasingly human readable, traditional filters based on perplexity become less effective in defending against such attacks. Inspired by adversarial purification in computer vision, we propose a novel system-level defense method called TAPDA to defend against adversarial prompt attacks targeting LLMs. TAPDA leverages LLMs themselves as purification models by using multiple “mask-predict” iterations to generate masked prompts, and then aggregates these prompts using a combination of a voting mechanism and a perplexity-based approach to recover clean prompts. Experiments show that TAPDA effectively reduces the attack success rate (ASR) of adversarial prompt attacks such as AdvPrompter, compared to other defense methods like SMOOTHLLM, while maintaining the human-readability of the prompts.

Authors

Institutions

Publication Details

Published
2025-03-21
DOI
https://doi.org/10.1109/icaace65325.2025.11020575
Primary Topic
Adversarial Robustness in Machine Learning
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

TAPDA: Text Adversarial Purification as Defense Against Adversarial Prompt Attack for Large Language Models

Hanlin Yang
Adversarial Robustness in Machine Learning
article

TAPDA: Text Adversarial Purification as Defense Against Adversarial Prompt Attack for Large Language Models

Hanlin Yang
article en

Abstract

Large Language Models (LLMs) are vulnerable to adversarial prompt attacks, which can lead to “jailbreaking” and the failure of safety alignment, resulting in the generation of harmful content. As adversarial prompts become increasingly human readable, traditional filters based on perplexity become less effective in defending against such attacks. Inspired by adversarial purification in computer vision, we propose a novel system-level defense method called TAPDA to defend against adversarial prompt attacks targeting LLMs. TAPDA leverages LLMs themselves as purification models by using multiple “mask-predict” iterations to generate masked prompts, and then aggregates these prompts using a combination of a voting mechanism and a perplexity-based approach to recover clean prompts. Experiments show that TAPDA effectively reduces the attack success rate (ASR) of adversarial prompt attacks such as AdvPrompter, compared to other defense methods like SMOOTHLLM, while maintaining the human-readability of the prompts.

Beijing University of Posts and Telecommunications (CN), State Key Laboratory of Networking and Switching Technology
Openalex Percentile: Top 94%
Adversarial Robustness in Machine Learning
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.