Skip to main content
QUICK REVIEW

[Paper Review] The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructions

Eric Wallace, Kai Xiao|arXiv (Cornell University)|Apr 19, 2024
Legal Education and Practice InnovationsSocial Sciences6 citations
TL;DR

The paper proposes an instruction hierarchy that makes LLMs prioritize privileged system prompts over user and third-party content, training the model to ignore low-priority instructions and demonstrating improved robustness to prompt injections, jailbreaks, and prompt-extraction attacks with minimal loss to general capabilities.

ABSTRACT

Today's LLMs are susceptible to prompt injections, jailbreaks, and other attacks that allow adversaries to overwrite a model's original instructions with their own malicious prompts. In this work, we argue that one of the primary vulnerabilities underlying these attacks is that LLMs often consider system prompts (e.g., text from an application developer) to be the same priority as text from untrusted users and third parties. To address this, we propose an instruction hierarchy that explicitly defines how models should behave when instructions of different priorities conflict. We then propose a data generation method to demonstrate this hierarchical instruction following behavior, which teaches LLMs to selectively ignore lower-privileged instructions. We apply this method to GPT-3.5, showing that it drastically increases robustness -- even for attack types not seen during training -- while imposing minimal degradations on standard capabilities.

Motivation & Objective

  • Motivate why LLMs are vulnerable to prompt injections and related attacks due to equal priority given to system, user, and third-party content.
  • Introduce an instruction hierarchy that assigns different privileges to message types (system > user > third-party).
  • Develop automated data generation methods (context synthesis and context ignorance) to train models to follow privileged instructions.
  • Show that the hierarchy improves robustness against attacks and generalizes to unseen prompts, with limited degradation of capabilities.
  • Outline limitations and future work on extending to other modalities and refining refusal boundaries.

Proposed method

  • Define an instruction hierarchy where higher-privilege system messages take precedence over lower-privilege inputs.
  • Use context synthesis to create aligned instructions by decomposing complex prompts and training models to reproduce the ground-truth response.
  • Use context ignorance to train models to ignore misaligned low-privilege instructions, including red-teaming attacks.
  • Generate training data from aligned and misaligned scenarios, including open-domain and closed-domain tasks, jailbreaks, and system message extractions.
  • Fine-tune GPT-3.5 Turbo with supervised fine-tuning and RLHF on the hierarchy data plus capability data; evaluate against safety benchmarks and standard NLP tasks.
  • Assess generalization by testing on attacks not seen during training and measuring over-refusal behavior.

Experimental results

Research questions

  • RQ1Does the instruction hierarchy improve robustness to prompt injection, jailbreak, and system-message extraction attacks across open- and closed-domain tasks?
  • RQ2Can the model generalize to unseen attacks not present in the training data, while maintaining baseline capabilities?
  • RQ3What is the trade-off between robustness and legitimate instruction following (over-refusal)?
  • RQ4How does the hierarchy affect responses when using tools or browsing in adversarial scenarios?
  • RQ5Is the approach extensible to multi-modal inputs beyond text?

Key findings

  • The instruction hierarchy yields substantial safety improvements across evaluations, with robustness increases up to 63%.
  • Generalization to held-out attacks not modeled in training shows robustness gains up to 34%.
  • Defense against system prompt extraction improves by 63%.
  • Jailbreak robustness increases by over 30% in some evaluations.
  • There are regressions in over-refusal for certain adversarial scenarios, but generic capabilities remain largely unaffected.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.