Robustness of Prompting: Enhancing Robustness of Large Language Models Against Prompting Attacks

Lin Mu, Guowei Chu, Li Ni, Lei Sang, Yiwen Zhang
6/4/2025
cs.CLcs.AI

No confident code implementation found for this paper.

Abstract

Large Language Models (LLMs) have demonstrated remarkable performance across various tasks by effectively utilizing a prompting strategy. However, they are highly sensitive to input perturbations, such as typographical errors or slight character order errors, which can significantly impair their performance.

Show full abstract

Despite advances in prompting techniques such as Chain-of-Thought and automatic prompt generation, developing a prompting strategy that explicitly mitigates the negative impact of such perturbations remains an open challenge. To bridge this gap, we propose Robustness of Prompting (RoP), a novel prompting strategy aimed at enhancing the robustness of LLMs. RoP consists of two stages: Error Correction and Guidance. In the Error Correction stage, RoP applies diverse perturbation methods to generate adversarial examples, which are used to generate prompts that correct input errors automatically. In the Guidance stage, RoP generates an optimal guidance prompt based on the corrected input, guiding the model to generate more robust and accurate inferences. Through comprehensive experiments spanning arithmetic, commonsense, and logical reasoning tasks, we demonstrate that RoP significantly improves LLMs' robustness against adversarial perturbations. Crucially, it preserves model accuracy with only minimal degradation compared to clean input scenarios, thereby establishing RoP as a practical and effective approach for enhancing LLM robustness 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. Any repos shown below are weak matches — 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{mu2025robustness,
  title  = {Robustness of Prompting: Enhancing Robustness of Large Language Models Against Prompting Attacks},
  author = {Lin Mu and Guowei Chu and Li Ni and Lei Sang and Yiwen Zhang},
  year   = {2025},
  eprint = {2506.03627},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.03627v2}
}

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/2506.03627.svg)](https://codeofpaper.com/paper/2506.03627)

Discussion