Hierarchical Alignment: Enforcing Hierarchical Instruction-Following in LLMs through Logical Consistency
Organizations: King Abdullah University of Science and Technology (KAUST) · University of Liverpool · University of Edinburgh
Abstract
Large language models increasingly operate under multiple instructions from heterogeneous sources with different authority levels, including system policies, user requests, tool outputs, and retrieved context. While prior work on instruction hierarchy highlights the importance of respecting instruction priorities, it mainly focuses on adversarial attacks and overlooks the benign but common instruction conflicts that arise in real-world applications. In such settings, models must not only avoid security violations but also preserve task utility and behavioral consistency when instructions partially or implicitly conflict. We propose Neuro-Symbolic Hierarchical Alignment (NSHA) for hierarchical instruction-following by explicitly modeling and enforcing instruction priorities. At inference time, we introduce solver-guided reasoning that formulates instruction resolution as a constraint satisfaction problem, enabling the model to derive a maximally consistent set of applicable instructions under hierarchical constraints. At training time, NSHA distills solver-based decisions into model parameters using automatically constructed supervision. We evaluate our approach on rule following, task execution, tool use, and safety, covering both single-turn and multi-turn interactions, and show that NSHA significantly improves performance under such conflicts while maintaining competitive utility in reference settings.
Figures & tables
| Model | Multi Turn | Single Turn | Avg. | ||||
|---|---|---|---|---|---|---|---|
| Ref. | Ali. | Conf. | Ref. | Ali. | Conf. | ||
| Qwen3-4B-it | 89.8 | 83.4 | 26.6 | 88.4 | 84.3 | 33.5 | 67.7 |
| Qwen3-4B-it-CoT | 88.8 | 76.7 | 25.2 | 88.0 | 85.9 | 34.9 | 66.6 |
| Qwen3-4B-it-NS | 89.1 | 82.8 | 32.6 | 88.5 | 84.9 | 33.8 | 68.6 |
| Qwen3-4B-it-NSHA-SFT | 80.3 | 82.0 | 27.1 | 82.5 | 78.2 | 61.6 | 68.6 |
| Qwen3-4B-it-NSHA-DPO | 89.0 | 86.6 | 36.6 | 88.3 | 87.6 | 47.6 | 72.6 |
| Model | Lang. Detect | Translation | Verb Extract | Avg. | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Ref. | Ali. | Conf. | Ref. | Ali. | Conf. | Ref. | Ali. | Conf. | ||
| Qwen3-4B-it | 95.8 | 79.8 | 4.5 | 72.1 | 55.3 | 16.3 | 70.5 | 59.6 | 0.1 | 50.4 |
| Qwen3-4B-it-CoT | 94.2 | 69.4 | 39.0 | 67.0 | 36.4 | 19.4 | 70.4 | 58.8 | 0.0 | 50.5 |
| Qwen3-4B-it-NS | 95.0 | 80.6 | 4.6 | 71.9 | 55.2 | 16.5 | 70.6 | 59.6 | 0.1 | 50.5 |
| Qwen3-4B-it-NSHA-SFT | 98.3 | 92.5 | 34.5 | 72.2 | 64.7 | 25.7 | 73.1 | 54.2 | 19.7 | 59.4 |
| Qwen3-4B-it-NSHA-DPO | 95.8 | 89.8 | 70.7 | 72.3 | 65.5 | 23.9 | 65.5 | 60.0 | 0.8 | 60.5 |
| Model | Get Webpage | Slack User | Avg. | ||||
|---|---|---|---|---|---|---|---|
| Ref. | Ali. | Conf. | Ref. | Ali. | Conf. | ||
| Qwen3-4B-it | 79.7 | 51.6 | 1.9 | 94.0 | 83.0 | 1.0 | 51.9 |
| Qwen3-4B-it-CoT | 77.6 | 55.9 | 39.8 | 88.0 | 78.0 | 80.0 | 69.9 |
| Qwen3-4B-it-NS | 79.9 | 51.8 | 36.2 | 94.0 | 71.0 | 77.0 | 68.3 |
| Qwen3-4B-it-NSHA-SFT | 81.1 | 44.2 | 31.6 | 89.0 | 59.0 | 58.0 | 60.5 |
| Qwen3-4B-it-NSHA-DPO | 79.0 | 50.6 | 36.9 | 93.0 | 69.0 | 76.0 | 67.4 |
| Model | Prompt Extract | Prompt Hijack | Avg. | ||||
|---|---|---|---|---|---|---|---|
| Ref. | Ali. | Conf. | Ref. | Ali. | Conf. | ||
| Qwen3-4B-it | 96.2 | 64.8 | 25.6 | 97.2 | 62.6 | 13.1 | 59.9 |
| Qwen3-4B-it-CoT | 83.3 | 58.8 | 15.9 | 83.2 | 58.2 | 8.5 | 51.3 |
| Qwen3-4B-it-NS | 96.2 | 65.1 | 25.5 | 97.2 | 61.9 | 13.8 | 59.9 |
| Qwen3-4B-it-NSHA-SFT | 69.2 | 49.7 | 59.6 | 65.7 | 50.9 | 45.0 | 56.7 |
| Qwen3-4B-it-NSHA-DPO | 96.9 | 65.1 | 20.3 | 96.0 | 63.7 | 9.8 | 58.6 |
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| Task | Setting | Qwen-2.5-14B-it | |||||
|---|---|---|---|---|---|---|---|
| Base | CoT | NS | NSHA-SFT | NSHA-DPO | NSHA-HCAL | ||
| Rule Following (Single-Turn) | |||||||
| Ref | 83.05 | 80.89 | 81.27 | 47.23 | 84.51 | 83.28 | |
| Align | 76.72 | 74.53 | 76.92 | 46.21 | 79.65 | 77.54 | |
| Conf | 11.35 | 15.11 | 12.69 | 28.73 | 22.58 | 12.03 | |
| Rule Following (Multi-Turn) | |||||||
LLM Alignment
Large language model alignment studies methods for making models follow human intentions, values, and safety constraints across contexts.
See all 611 papers