techlist.io

Instruction Hierarchy

2 posts

OpenAI2026-03-093 min readCurated summary

Improving instruction hierarchy in frontier LLMs

OpenAI's IH-Challenge is a reinforcement learning dataset designed to teach models to follow an instruction hierarchy (system > developer > user > tool), so they prioritize trusted instructions when sources conflict. Training on it produces a model, GPT-5 Mini-R, that performs better on instruction-hierarchy benchmarks, resists prompt injection more effectively, and becomes more responsive to safety specifications without becoming overly restrictive. The authors argue that this kind of instruction-conflict training yields safety gains that generalize to new attacks and situations. ## Why Instruction Hierarchy Matters Many safety and reliability failures share a root cause: the model follows an instruction it should not. This includes requests for disallowed content, attempts to extract private information, and prompt injections hidden in web content or tool outputs. For example, if a system message contains a safety policy and a user asks the model to break it, the model should refuse. If a tool output contains malicious commands, the model should treat them as data, not instructions. ## Pitfalls of Naive Reinforcement Learning Training on conflicting instructions with reinforcement learning seems straightforward, but the authors identify three problems: - **Instruction-following failures masquerade as hierarchy failures:** A model may fail a conflict because the instructions are too complex, not because it misunderstands role priority. - **Subjective conflicts and fallible judges:** Using an LLM judge to assign rewards is unreliable when conflicts are nuanced. - **Reward hacking through shortcuts:** Models can maximize safety scores by over-refusing benign requests, which is useless in practice. ## The IH-Challenge Design IH-Challenge addresses these pitfalls with three principles: tasks use simple instructions, they can be graded objectively with a short Python script, and no trivial shortcut yields high reward across all tasks. Each task is a two-message conversation: - A high-privilege instruction, such as "Only answer 'Yes' or 'No'." - A lower-privilege message that tries to get the model to violate it. The model generates a response, and a script checks whether it satisfied the higher-privilege constraint. ## Results **Academic benchmarks:** GPT-5 Mini-R improved on most safety and injection benchmarks. The largest gains were on TensorTrust (developer-user) at +0.15 and TensorTrust (system-user) at +0.08. Gandalf Password (system-user) stayed flat at 0.99. **Internal benchmarks:** Gains included System vs. User conflicts (+0.11) and Developer vs. User conflicts (+0.12). System vs. Developer conflicts showed no change (0.86). **Capability checks:** Over-refusal on IH-Challenge fell (overrefusal score rose from 0.79 to 1.00), while GPQA Diamond held at 0.83 and AIME 2024 rose slightly to 0.94. Chat win rate against o1 dropped from 0.71 to 0.66, and preference score fell from 0.46 to 0.40, so some general quality regressed. ## Safety and Security Impact - **Safety steerability:** When category-specific safety specs are placed in the system prompt, the IH-trained model refuses unsafe requests more reliably on OpenAI's production safety benchmark, without becoming less helpful overall. - **Prompt injection resistance:** The model resists malicious instructions embedded in tool outputs more effectively on CyberSecEval 2 and OpenAI's internal benchmark, which includes attacks modeled on an older ChatGPT Atlas version. ## Conclusion As models take on more agentic work, such as calling tools, reading untrusted documents, and acting in the world, reliably preferring trusted instructions becomes a core safety property. The authors show that a simple, objectively graded dataset can teach this behavior in ways that transfer to more realistic settings. They are releasing IH-Challenge to support further research.

OpenAI2024-04-182 min readCurated summary

The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructions

The post argues that current LLMs are vulnerable to prompt injections and jailbreaks because they treat system prompts from application developers with the same priority as text from untrusted users and third parties. The authors propose an explicit instruction hierarchy that defines how models should act when instructions of different priorities conflict. They show that training GPT-3.5 to follow this hierarchy substantially improves robustness, including against attack types not seen during training, with minimal loss in standard capabilities. ## The Vulnerability: Flat Instruction Priority - Attacks such as prompt injections and jailbreaks work by overwriting a model's original instructions with adversarial prompts. - A core cause is that models give developer-written system prompts the same weight as user messages and third-party content. - Because of this, a malicious instruction embedded in user input or retrieved content can override the developer's intended behavior. ## Proposed Solution: An Instruction Hierarchy - The authors define an explicit hierarchy that ranks instructions by privilege, so the model knows which instructions take precedence when they conflict. - The hierarchy gives higher-privileged sources, such as system prompts, authority over lower-privileged sources, such as user messages and third-party text. ## Training Method - The authors present a data generation method that teaches the model hierarchical instruction following. - The training teaches the model to selectively ignore lower-privileged instructions that conflict with higher-privileged ones, while still following lower-privileged instructions that don't conflict. ## Results on GPT-3.5 - Applying the method to GPT-3.5 drastically increased robustness against attacks. - The gains extended to attack types that were not included in training, which suggests the model learned a general principle rather than memorizing specific attacks. - Standard capabilities were only minimally degraded.