cs.LOOct 27, 2026

An Algebra of Transformers

Authors: Yong Wang, Zhiyan Wang, Hexiao Kang

Abstract

On the theoretic analyses on transforms, they mainly focus on the computability analysis, such the Turing-completeness of unbounded precision transformers, the advantage of parallelizability of unbounded precision transformers and the limitations of bounded precision transformers. This paper give transformers an algebra for reasoning, which relies heavily on the functional decomposition results of transformers. This algebra uses functional decompositions as atomic actions, includes sequential composition and parallel composition, recursion for feedback and abstraction for hidden layers. As we know, it is the first attempt to model transformers logically and can be used to verify the correctness of transformer based applications.

Figures & tables

Explore similar work

CardsList
  1. A Compositional Theory of Causally Masked Transformers

    Jul 29, 2026Franz Nowak, Ryan Cotterell, Reda BoumasmoudTransformer ExpressivityTransformer

  2. Revisiting Padded Transformer Expressivity: Which Architectural Choices Matter and Which Don't

    May 28, 2026Anej Svete, William Merrill, Ryan Cotterell +1Transformer ExpressivityTransformer

  3. On the Expressive Power of Transformers

    Aug 13, 2026Phokion Kolaitis, Rik SenguptaTransformer ExpressivityCircuit Complexity