ASIDE: Architectural Separation of Instructions and Data in Language Models

Egor Zverev, Evgenii Kortukov, Alexander Panfilov, Alexandra Volkova, Soroush Tabesh +3 more
3/13/2025
34 citations
cs.LG

Official code: egozverev/aside (18 stars, Jupyter Notebook, Apache-2.0, last commit 2026-04-20).

Abstract

Despite their remarkable performance, large language models lack elementary safety features, making them susceptible to numerous malicious attacks. In particular, previous work has identified the absence of an intrinsic separation between instructions and data as a root cause of the success of prompt injection attacks.

Show full abstract

In this work, we propose a new architectural element, ASIDE, that allows language models to clearly separate instructions and data at the level of embeddings. ASIDE applies an orthogonal rotation to the embeddings of data tokens, thus creating clearly distinct representations of instructions and data tokens without introducing any additional parameters. As we demonstrate experimentally across a range of models, instruction-tuning LLMs with ASIDE (1) leads to highly increased instruction-data separation without a loss in model utility and (2) makes the models more robust to prompt injection benchmarks, even without dedicated safety training. Additionally, we provide insights into the mechanism underlying our method through an analysis of the model representations. The source code and training scripts are openly accessible at https://github.com/egozverev/aside.

View on arXivView PDF

Code Implementations(1)

egozverev/asideOfficial100%
Apache-2.0

ASIDE: Architectural Separation of Instructions and Data in Language Models

187Jupyter Notebook, PythonMay 28, 20257 months agoApache-2.0

Similar Papers

Cite this paper

@article{zverev2025aside,
  title  = {ASIDE: Architectural Separation of Instructions and Data in Language Models},
  author = {Egor Zverev and Evgenii Kortukov and Alexander Panfilov and Alexandra Volkova and Soroush Tabesh and Sebastian Lapuschkin and Wojciech Samek and Christoph H. Lampert},
  year   = {2025},
  eprint = {2503.10566},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2503.10566v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2503.10566.svg)](https://codeofpaper.com/paper/2503.10566)

Discussion