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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Mu, Lin, Chu, Guowei, Ni, Li, Sang, Lei, Zhang, Yiwen
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914600592605184
author Mu, Lin
Chu, Guowei
Ni, Li
Sang, Lei
Zhang, Yiwen
author_facet Mu, Lin
Chu, Guowei
Ni, Li
Sang, Lei
Zhang, Yiwen
contents 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. 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.
format Preprint
id arxiv_https___arxiv_org_abs_2506_03627
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Robustness of Prompting: Enhancing Robustness of Large Language Models Against Prompting Attacks
Mu, Lin
Chu, Guowei
Ni, Li
Sang, Lei
Zhang, Yiwen
Computation and Language
Artificial Intelligence
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. 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.
title Robustness of Prompting: Enhancing Robustness of Large Language Models Against Prompting Attacks
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2506.03627