Attack and defense techniques in large language models: A survey and new perspectives

Zhiyu Liao, Kang Chen, Yuanguo Lin, Kangkang Li, Yunxuan Liu +3 more
5/2/2025
cs.CRcs.AIcs.CL

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

Large Language Models (LLMs) have become central to numerous natural language processing tasks, but their vulnerabilities present significant security and ethical challenges. This systematic survey explores the evolving landscape of attack and defense techniques in LLMs. We classify attacks into adversarial prompt attack, optimized attacks, model theft, as well as attacks on application of LLMs, detailing their mechanisms and implications. Consequently, we analyze defense strategies, including prevention-based and detection-based defense methods. Although advances have been made, challenges remain to adapt to the dynamic threat landscape, balance usability with robustness, and address resource constraints in defense implementation. We highlight open problems, including the need for adaptive scalable defenses, explainable security techniques, and standardized evaluation frameworks. This survey provides actionable insights and directions for developing secure and resilient LLMs, emphasizing the importance of interdisciplinary collaboration and ethical considerations to mitigate risks in real-world applications.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{liao2025attack,
  title  = {Attack and defense techniques in large language models: A survey and new perspectives},
  author = {Zhiyu Liao and Kang Chen and Yuanguo Lin and Kangkang Li and Yunxuan Liu and Hefeng Chen and Xingwang Huang and Yuanhui Yu},
  year   = {2025},
  eprint = {2505.00976},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.00976v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.00976.svg)](https://codeofpaper.com/paper/2505.00976)

Discussion