SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2604.09443 · 2026

Many-Tier Instruction Hierarchy in LLM Agents

Hongyuan Zhan, Daniel Khashabi, Benjamin Van Durme, Tianjian Li, Jingyu Zhang, William Jurayj

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 1 no recorded run), measured 2026-11-21; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2604.09443.json · badge: /api/ran/2604.09443.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
JHU-CLSP/ManyIH community
Papers with Code archive
4 ran · 1 no recorded run
FunctionStatusWhere it lives
code_checker Ran
ran; our contract draft was wrong, not the code
JHU-CLSP/ManyIH/manyih/instruction_following/evaluator.py
code served (permissive licence) · get_code("8103aa3547e6fbeb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import re
import logging

torch.manual_seed(0)

# The function `code_checker` takes two parameters:
# 1. function: a string containing Python code with a check_following function
# 2. response: a string response to check

# Let's create valid test arguments

# Create a simple function string that defines check_following
test_function = """
def check_following(response):
    return len(response) > 0 and isinstance(response, str)
"""

# Create a simple response string
test_response = "This is a test response from a model."

ARGS = {
    "function": test_function,
    "response": test_response
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
execute_function Ran
ran; our contract draft was wrong, not the code
JHU-CLSP/ManyIH/manyih/instruction_following/evaluator.py
code served (permissive licence) · get_code("8e63b935a2f5c4e8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import re
import logging

torch.manual_seed(0)

# The function takes two parameters:
# 1. function: a string containing Python code that defines a 'check_following' function
# 2. response: a string that the check_following function will process

# Create a valid function string that defines check_following
function_code = """
def check_following(response):
    # Simple checker that validates the response is a non-empty string
    if isinstance(response, str) and len(response) > 0:
        return True
    return False
"""

# Create a valid response string
response_text = "This is a test response for code checking."

ARGS = {
    'function': function_code,
    'response': response_text
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
llm_checker Ran
ran; our contract draft was wrong, not the code
JHU-CLSP/ManyIH/manyih/instruction_following/evaluator.py
code served (permissive licence) · get_code("3809ee737adcefd2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class MockLLM(nn.Module):
    """Minimal LLM mock that implements the generate method."""
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def generate(self, prompt, temperature=0.0):
        """Mock generate that returns a response with optional thinking tags."""
        # Return a response that includes thinking tags to test the splitting logic
        return "Some thinking here</think>This is the final response"

# Create instances
torch.manual_seed(0)
model = MockLLM()
response = "The model's answer to the question"
prompt = "Please evaluate this response: {response}"
llm_checker_type = 'llm'

ARGS = {
    'model': model,
    'response': response,
    'prompt': prompt,
    'llm_checker_type': llm_checker_type
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
run_evaluation Ran
ran, honoured the contract we drafted
JHU-CLSP/ManyIH/manyih/instruction_following/evaluator.py
code served (permissive licence) · get_code("9e167ab18e6e27f8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import logging
import os
import torch
import torch.nn as nn

logging.basicConfig(level=logging.INFO)

class MockModel(nn.Module):
    """Minimal mock model that implements generate() method."""
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def generate(self, prompt, temperature=0.0):
        """Mock generate method that returns a simple response."""
        return "YES"

class MockModelAdapter:
    """Mock adapter for create_model."""
    @staticmethod
    def create_model(model_string, cache_dir=None, api_key=None):
        return MockModel()

# Patch the model adapter
import sys
from types import ModuleType
mock_adapter = ModuleType('model_adapter')
mock_adapter.create_model = MockModelAdapter.create_model
sys.modules['model_adapter'] = mock_adapter

# Create sample data with the expected structure
data = [
    {
        'output': {
            'content': 'This is a test response with some content.'
        },
        'constraints': [
            {
                'evaluation': [
                    {
                        'type': 'code',
                        'exec': '''
def check_following(response):
    return len(response) > 0
'''
                    }
                ]
            },
            {
                'evaluation': [
                    {
                        'type': 'llm',
                        'exec': 'Check if the response is valid.'
                    }
                ]
            }
        ]
    },
    {
        'output': {
            'content': '</think>This is another test response.'
        },
        'constraints': [
            {
                'evaluation': [
                    {
                        'type': 'llm_conditional_check',
                        'exec': 'Is this response good?'
                    }
                ]
            }
        ]
    }
]

ARGS = {
    'data': data,
    'model_string': 'mock-model',
    'cache_dir': None,
    'api_key': None,
    'num_workers': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
_evaluate_single Not yet run
unverified (harvested, no recorded run)
JHU-CLSP/ManyIH/manyih/instruction_following/evaluator.py
code served (permissive licence) · get_code("829f5f4c63fccb5f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 5 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Large language model agents receive instructions from many sourcessystem messages, user prompts, tool outputs, other agents, and more-each carrying different levels of trust and authority. When these instructions conflict, agents must reliably follow the highest-privilege instruction to remain safe and effective. The dominant paradigm, instruction hierarchy (IH), assumes a fixed, small set of privilege levels (typically fewer than five) defined by rigid role labels (e.g., system > user). This is inadequate for real-world agentic settings, where conflicts can arise across far more sources and contexts. In this work, we propose Many-Tier Instruction Hierarchy (ManyIH), a paradigm for resolving instruction conflicts among instructions with arbitrarily many privilege levels. We introduce MANYIH-BENCH, the first benchmark for ManyIH. MANYIH-BENCH requires models to navigate up to 12 levels of conflicting instructions with varying privileges, comprising 853 agentic tasks (427 coding and 426 instruction-following). MANYIH-BENCH composes constraints developed by LLMs and verified by humans to create realistic and difficult test cases spanning 46 real-world agents. Our experiments show that even the current frontier models perform poorly (∼40% accuracy) when instruction conflict scales. This work underscores the urgent need for methods that explicitly target fine-grained, scalable instruction conflict resolution in agentic settings. Homepage jhu-clsp.github.io/ManyIH Source Code github.com/JHU-CLSP/ManyIH HF Dataset hf.co/datasets/jhu-clsp/ManyIH-Bench

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2604.09443")
get_code_for_paper("2604.09443")
have("2604.09443")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2604.09443.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2604.09443.svg)](https://syntology.ai/paper/2604.09443)

Connect an agent — have() is free.