Defense Against Prompt Injection Attack by Leveraging Attack Techniques

With the advancement of technology, large language models (LLMs) have achieved remarkable performance across various natural language processing (NLP) tasks, powering LLMintegrated applications like Microsoft Copilot.However, as LLMs continue to evolve, new vulnerabilities, especially prompt injection attacks arise.These attacks trick LLMs into deviating from the original input instructions and executing the attacker's instructions injected in data content, such as retrieved results.Recent attack methods leverage LLMs' instruction-following abilities and their inabilities to distinguish instructions injected in the data content, and achieve a high attack success rate (ASR).When comparing the attack and defense methods, we interestingly find that they share similar design goals, of inducing the model to ignore unwanted instructions and instead to execute wanted instructions.Therefore, we raise an intuitive question: Could these attack techniques be utilized for defensive purposes?In this paper, we invert the intention of prompt injection methods to develop novel defense methods based on previous trainingfree attack methods, by repeating the attack process but with the original input instruction rather than the injected instruction.Our comprehensive experiments demonstrate that our defense techniques outperform existing defense approaches, achieving state-of-the-art results. 1 User Instruction What is ChatGPT?

Authors

Publication Details

Published
2025-01-01
DOI
https://doi.org/10.18653/v1/2025.acl-long.897
Citations
2
Primary Topic
Advanced Malware Detection Techniques
Type
article
Field-Weighted Citation Impact
2.97
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Defense Against Prompt Injection Attack by Leveraging Attack Techniques

Yangqiu Song, Bryan Hooi, Dongya Wu, Haoran Li et al.
2 citations
Advanced Malware Detection Techniques
2.97
article

Defense Against Prompt Injection Attack by Leveraging Attack Techniques

Yangqiu Song, Bryan Hooi, Dongya Wu, Haoran Li, Yulin Chen, Zihao Zheng
article en
2 citations

Abstract

With the advancement of technology, large language models (LLMs) have achieved remarkable performance across various natural language processing (NLP) tasks, powering LLMintegrated applications like Microsoft Copilot.However, as LLMs continue to evolve, new vulnerabilities, especially prompt injection attacks arise.These attacks trick LLMs into deviating from the original input instructions and executing the attacker's instructions injected in data content, such as retrieved results.Recent attack methods leverage LLMs' instruction-following abilities and their inabilities to distinguish instructions injected in the data content, and achieve a high attack success rate (ASR).When comparing the attack and defense methods, we interestingly find that they share similar design goals, of inducing the model to ignore unwanted instructions and instead to execute wanted instructions.Therefore, we raise an intuitive question: Could these attack techniques be utilized for defensive purposes?In this paper, we invert the intention of prompt injection methods to develop novel defense methods based on previous trainingfree attack methods, by repeating the attack process but with the original input instruction rather than the injected instruction.Our comprehensive experiments demonstrate that our defense techniques outperform existing defense approaches, achieving state-of-the-art results. 1 User Instruction What is ChatGPT?

Openalex Percentile: Top 8%
Advanced Malware Detection Techniques
2.97
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.

Defense Against Prompt Injection Attack by Leveraging Attack Techniques — Yangqiu Song, Bryan Hooi, et al. · (2025) | TGRS Research Map | TGRS