On the Existence of Universal Simulators of Attention

Debanjan Dutta, Faizanuddin Ansari, Anish Chakrabarty, Swagatam Das
6/23/2025
cs.LGcs.AI

No confident code implementation found for this paper.

Abstract

Prior work on the learnability of transformers has established its capacity to approximate specific algorithmic patterns through training under restrictive architectural assumptions. Fundamentally, these arguments remain data-driven and therefore can only provide a probabilistic guarantee. Expressivity, on the contrary, has theoretically been explored to address the problems \emph{computable} by such architecture. These results proved the Turing-completeness of transformers, investigated bounds focused on circuit complexity, and formal logic. Being at the crossroad between learnability and expressivity, the question remains: \emph{can transformer architectures exactly simulate an arbitrary attention mechanism, or in particular, the underlying operations?} In this study, we investigate the transformer encoder's ability to simulate a vanilla attention mechanism. By constructing a universal simulator $\mathcal{U}$ composed of transformer encoders, we present algorithmic solutions to identically replicate attention outputs and the underlying elementary matrix and activation operations via RASP, a formal framework for transformer computation. Our proofs, for the first time, show the existence of an algorithmically achievable data-agnostic solution, previously known to be approximated only by learning.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{dutta2025existence,
  title  = {On the Existence of Universal Simulators of Attention},
  author = {Debanjan Dutta and Faizanuddin Ansari and Anish Chakrabarty and Swagatam Das},
  year   = {2025},
  eprint = {2506.18739},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.18739v1}
}

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/2506.18739.svg)](https://codeofpaper.com/paper/2506.18739)

Discussion