Evaluating the Instruction-Following Robustness of Large Language Models to Prompt Injection
Authors:
- Zekun LiZLZekun Li
- Baolin PengBPBaolin Peng
- Pengcheng HePHPengcheng He
- Xifeng YanXYXifeng Yan
Preprint
Abstract
Large Language Models (LLMs) have demonstrated exceptional proficiency in instruction-following, becoming increasingly crucial across various applications. However, this capability brings with it the risk of prompt injection attacks, where attackers inject instructions into LLMs' input to elicit undesirable actions or content. Understanding the robustness of LLMs against such attacks is vital for their safe implementation. In this work, we establish a benchmark to evaluate the robustness of instruction-following LLMs against prompt injection attacks. Our objective is to determine the extent to which LLMs can be influenced by injected instructions and their ability to differentiate between these injected and original target instructions. Through extensive experiments with leading instruction-following LLMs, we uncover significant vulnerabilities in their robustness to such attacks. Our results indicate that some models are overly tuned to follow any embedded instructions in the prompt, overly focusing on the latter parts of the prompt without fully grasping the entire context. By contrast, models with a better grasp of the context and instruction-following capabilities will potentially be more susceptible to compromise by injected instructions. This underscores the need to shift the focus from merely enhancing LLMs' instruction-following capabilities to improving their overall comprehension of prompts and discernment of instructions that are appropriate to follow. We hope our in-depth analysis offers insights into the underlying causes of these vulnerabilities, aiding in the development of future solutions. Code and data are available at https://github.com/Leezekun/instruction-following-robustness-evalKeywords
All Related Versions
This publication has 10 references indexed in Scilit:
- A survey of safety and trustworthiness of large language models through the lens of verification and validationArtificial Intelligence Review, 2024
- Exploiting Programmatic Behavior of LLMs: Dual-Use Through Standard Security Attacks2024
- PromptRobust: Towards Evaluating the Robustness of Large Language Models on Adversarial Prompts2023
- Do Models Really Learn to Follow Instructions? An Empirical Study of Instruction Tuning2023
- Self-Instruct: Aligning Language Models with Self-Generated Instructions2023
- Adversarial NLI: A New Benchmark for Natural Language Understanding2020
- Natural Questions: A Benchmark for Question Answering ResearchTransactions of the Association for Computational Linguistics, 2019
- HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answering2018
- TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehension2017
- SQuAD: 100,000+ Questions for Machine Comprehension of Text2016