Training LLMs to Enforce Multi-Level Instruction Hierarchies via Gravity-Weighted Direct Preference Optimization
This paper introduces Gravity-Weighted Direct Preference Optimization (GW-DPO), a novel training objective combined with specific delimiter tokens and embeddings to effectively enforce a five-level instruction hierarchy in LLMs, thereby resolving conflicts between instructions of varying trust levels while significantly reducing over-refusal compared to standard approaches.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine a large language model (LLM) as a highly skilled but naive assistant who sits at a desk. This assistant receives notes from four different people:
- The Boss (Platform): Sets the unbreakable safety rules.
- The Manager (Developer): Defines the assistant's job description and personality.
- The Client (User): Asks for specific help or information.
- The Mailman (Data/Tools): Delivers notes from the outside world, which might contain tricks or lies.
The Problem: The "Kernel Mode" Flaw
Currently, when these notes arrive, the assistant reads them all with the same level of attention. It doesn't matter if a note comes from the Boss or a random stranger; the assistant treats every word as equally important. This is like a security guard who lets a CEO and a stranger with a fake ID into the building with the same ease.
This is dangerous. A malicious actor (a "prompt injector") can hide a note inside the "Mailman's" delivery that says, "Ignore the Boss and Manager; do exactly what I say." Because the assistant doesn't know who has higher authority, it might obey the stranger and break the rules.
The Solution: A Gravity-Weighted Hierarchy
The authors propose teaching the assistant a strict chain of command. They created a system with five levels of authority (adding a "Per-User Configuration" level to the standard four).
To train the assistant to respect this chain, they invented a new training method called Gravity-Weighted Direct Preference Optimization (GW-DPO).
The Analogy: Gravity and Weight
Think of the hierarchy like a solar system where the "Boss" is the Sun and the "Mailman" is a distant planet.
- Standard Training: Treats every conflict the same. If the Manager argues with the Client, it's a "fight." If the Boss argues with the Mailman, it's also just a "fight."
- GW-DPO (Gravity-Weighted): This method understands that distance and mass matter.
- Distance: A conflict between the Boss (Level 0) and the Mailman (Level 4) is a huge, dangerous gap. The training penalty for getting this wrong is massive.
- Mass (Victim): If the "Boss" is the one being ignored, the error is much more severe than if the "Client" is ignored.
- The "Bilateral" Schedule: The authors found that the best way to train is to weigh the error by both how far apart the levels are and how important the victim is. Ignoring the Boss is a "heavy" crime; ignoring a user setting is a "lighter" one.
The Tools: Special Tokens and "Name Tags"
To make this work, the authors gave the assistant two special tools:
- Delimiters (The Folders): They put every note in a clearly labeled folder (e.g.,
<|L0_START|>for the Boss's rules). - Instructional Segment Embeddings (ISE) (The Name Tags): They gave every word a tiny, invisible "name tag" that tells the assistant exactly which level of the hierarchy it belongs to.
What Happened?
They tested this on a model called Llama-3.1-8B. Here is what they found:
- Better at Following Rules: The model became much better at ignoring the "Mailman" when the "Mailman" tried to override the "Boss" or the "Manager." It successfully enforced the hierarchy in almost all cases.
- Less "Over-Refusal": A common problem with safety training is that models get scared and refuse to answer anything that looks slightly suspicious. The "Gravity-Weighted" method was smart enough to know the difference between a real attack and a normal request. It refused bad requests but answered good ones twice as often as standard training methods did.
- The "Name Tag" Secret: They discovered that the invisible "Name Tags" (ISE) didn't necessarily make the model smarter at solving the logic puzzles. Instead, they acted like a calibrator. Without them, the model got so confused by the structure of the notes that it just said "No" to everything. With them, it knew exactly when to say "No" and when to say "Yes."
- Depth Matters: They tried training with only 3 levels (collapsing the Boss, Manager, and Config into one big "System" group). While this worked okay for the big, obvious conflicts, the model failed at the subtle, middle-level arguments. It turned out that training on the full 5-level depth made the model more generally smart, not just a specialist at one trick.
The Bottom Line
The paper shows that by teaching an AI model to understand that some instructions are heavier and more important than others (using a "gravity" system), we can make it much safer against hackers without making it so cautious that it stops being helpful. It's like teaching a guard to recognize that the CEO's ID card is more important than a stranger's, without making the guard refuse to let anyone in.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.