Papers
Topics
Authors
Recent
Search
2000 character limit reached

On the Expressive Power of Transformers

Published 13 Aug 2026 in cs.AI and cs.CC | (2608.12671v1)

Abstract: Multi-layer transformers form the critical component of essentially all LLMs in use today. Because of their ubiquity and computational capability, there is a rapidly growing body of work that aims to precisely calibrate the expressive power of transformers as language recognizers by comparing them against standard models of computation studied for decades by the theoretical computer science community. In this endeavor, circuit complexity has by and large emerged as the "correct" branch of computational complexity to analyze the expressive power of transformers; the reason is that parameterizing transformers by the various resources they use, such as attention and precision, leads to direct comparisons with different classes of circuits parameterized by resources such as type of gates, size, and depth. Here, we present an overview of selected results that delineate the expressive power of transformers using concepts and methods from circuit complexity.

Authors (2)

Summary

  • The paper develops circuit-complexity simulations showing that constant-depth transformers without chain-of-thought operate within AC or TC depending on attention type and numerical precision.
  • The paper finds that logarithmic precision generally supports TC-level power, while constant precision collapses softmax and average-attention models to AC, with tight characterizations requiring polynomial embedding width.
  • The paper shows that chain-of-thought increases expressivity substantially, enabling polynomial-time computation with polynomial-length generation and Turing completeness under unbounded generation, even for softmax attention at logarithmic precision.

This survey by Kolaitis and Sengupta synthesizes a body of work that calibrates the expressive power of transformers as language recognizers against classical circuit complexity classes. Its central thesis is that circuit complexity, rather than the Chomsky hierarchy, is the appropriate framework for this analysis: transformers perform parallel, fixed-depth computation over continuous vectors, which maps naturally onto bounded-depth circuits with restrictions on gates, fan-in, size, and uniformity.

Transformers as language recognizers

The survey formalizes the transformer as a family of length-preserving layers applied to an embedded input string of arbitrary length nn (the context length), mirroring how a finite automaton processes arbitrarily long strings. The input layer computes xi(0)=WE(wi)+PE(i)\mathbf{x}^{(0)}_i = \mathsf{WE}(w_i) + \mathsf{PE}(i); each hidden layer composes HH self-attention sublayers (scaled dot-product attention with weighting function S\mathcal{S}) with a position-wise feed-forward sublayer using ReLU activations and residual connections. The output layer projects a designated vector to a scalar probability via a sigmoid, accepting when pout≥1/2p_\text{out} \geq 1/2.

Three architectural choices dominate the expressivity landscape:

  • Attention type: unique hard attention (UHATUHAT), average hard attention (AHATAHAT), and softmax attention (SMATSMAT). Soft attention is strictly more expressive than hard attention in general, though most hard-attention variants can be simulated by soft attention (Yang et al., 2024).
  • Masking: encoders attend bidirectionally; decoders apply future masking. Encoders are provably strictly more powerful than decoders without chain-of-thought for language recognition.
  • Chain-of-thought (CoT): autoregressive generation of f(n)f(n) intermediate tokens, which is known to yield strict increases in expressive power.

The resource parameters are depth LL, heads xi(0)=WE(wi)+PE(i)\mathbf{x}^{(0)}_i = \mathsf{WE}(w_i) + \mathsf{PE}(i)0, embedding dimension xi(0)=WE(wi)+PE(i)\mathbf{x}^{(0)}_i = \mathsf{WE}(w_i) + \mathsf{PE}(i)1, precision xi(0)=WE(wi)+PE(i)\mathbf{x}^{(0)}_i = \mathsf{WE}(w_i) + \mathsf{PE}(i)2, and CoT budget xi(0)=WE(wi)+PE(i)\mathbf{x}^{(0)}_i = \mathsf{WE}(w_i) + \mathsf{PE}(i)3; the product xi(0)=WE(wi)+PE(i)\mathbf{x}^{(0)}_i = \mathsf{WE}(w_i) + \mathsf{PE}(i)4 is termed the width. The survey emphasizes that precision is the most consequential parameter: arbitrary real precision is unrealistic, while xi(0)=WE(wi)+PE(i)\mathbf{x}^{(0)}_i = \mathsf{WE}(w_i) + \mathsf{PE}(i)5 bits collapses transformers into xi(0)=WE(wi)+PE(i)\mathbf{x}^{(0)}_i = \mathsf{WE}(w_i) + \mathsf{PE}(i)6 even with polynomial embedding dimension and logarithmic CoT [(2608.12671)'s cited Theorem 3.1 of LLHZ24], because constant precision prevents uniform attention over growing inputs. The standard assumption is therefore xi(0)=WE(wi)+PE(i)\mathbf{x}^{(0)}_i = \mathsf{WE}(w_i) + \mathsf{PE}(i)7.

Why circuit complexity

The survey motivates the choice of circuit classes via the inclusion chain

xi(0)=WE(wi)+PE(i)\mathbf{x}^{(0)}_i = \mathsf{WE}(w_i) + \mathsf{PE}(i)8

where the first inclusion is strict because MAJORITY is not in xi(0)=WE(wi)+PE(i)\mathbf{x}^{(0)}_i = \mathsf{WE}(w_i) + \mathsf{PE}(i)9 [FSS], while whether HH0 remains open. Descriptive complexity supplies logical counterparts: HH1 corresponds to first-order logic with BIT, HH2 adds majority quantifiers, and HH3 corresponds to least fixed-point logic on ordered structures. These correspondences are exploited directly — e.g., Chiang, Cholak, and Pillay use a counting extension of first-order logic to place fixed-precision softmax encoders in HH4.

Upper bounds without chain-of-thought

The core simulation technique constructs Boolean circuit gadgets for each component of a constant-depth transformer and stitches them across layers, yielding constant-depth circuits whose gate basis depends on attention type and precision:

Model Precision Upper bound
HH5 encoder arbitrary rational HH6
HH7/HH8 encoder HH9 S\mathcal{S}0
S\mathcal{S}1/S\mathcal{S}2 encoder S\mathcal{S}3 S\mathcal{S}4

The intuition is that S\mathcal{S}5 requires only AND/OR/NOT gadgets, whereas computing averages of S\mathcal{S}6 numbers at log precision requires threshold gates. Tightness varies: Barceló et al. show the S\mathcal{S}7 upper bound is not tight — some S\mathcal{S}8 languages exceed S\mathcal{S}9 power, though pout≥1/2p_\text{out} \geq 1/20 captures first-order logic with unary numerical predicates, and pout≥1/2p_\text{out} \geq 1/21 captures this logic plus counting terms. By contrast, with pout≥1/2p_\text{out} \geq 1/22 embedding dimension, pout≥1/2p_\text{out} \geq 1/23- and pout≥1/2p_\text{out} \geq 1/24-precision transformers capture all of pout≥1/2p_\text{out} \geq 1/25 and pout≥1/2p_\text{out} \geq 1/26 respectively, making those bounds essentially exact. A separate logical characterization shows masked pout≥1/2p_\text{out} \geq 1/27 decoders without positional encodings recognize exactly the star-free languages, via the intermediate formalism B-RASP [YCA24].

Chain-of-thought breaks the pout≥1/2p_\text{out} \geq 1/28 barrier

CoT moves transformers beyond pout≥1/2p_\text{out} \geq 1/29 into classes believed strictly more powerful:

Model CoT Precision Class
UHATUHAT0 decoder UHATUHAT1 UHATUHAT2 UHATUHAT3
UHATUHAT4 decoder UHATUHAT5 UHATUHAT6 UHATUHAT7
UHATUHAT8 decoder UHATUHAT9 AHATAHAT0 AHATAHAT1
AHATAHAT2 decoder AHATAHAT3 AHATAHAT4 exactly AHATAHAT5
AHATAHAT6 decoder unbounded arbitrary all r.e. languages
AHATAHAT7 decoder unbounded AHATAHAT8 all r.e. languages

The simulation arguments encode Turing machine computation histories in generated tokens: autoregression reconstructs the head position (using techniques such as layernorm hash from Merrill–Sabharwal), attention locates the most recent timestep at which the head occupied that position, and the tape symbol is read off. The AHATAHAT9 and Turing-completeness results are equivalences rather than mere containments. Notably, the Turing-completeness result for softmax attention at log precision [jiang2026softmax] removes the need for arbitrary-precision arithmetic that earlier completeness proofs required. Amiri et al. complement these upper bounds with systematic lower bounds on the CoT needed for natural algorithmic problems.

Limitations and open questions

The survey is candid about several caveats. The equivalence results for SMATSMAT0 and SMATSMAT1 capture require SMATSMAT2 embedding dimension, which is unrealistic in practice where SMATSMAT3 is constant. The unbounded-CoT Turing-completeness claims require a model variant not fully formalized in the survey — one where acceptance is triggered by a distinguished token rather than a pre-specified SMATSMAT4. Layer normalization is omitted from the formal treatment despite drastically affecting expressivity depending on its modeling. Encoder lower bounds would imply lower bounds against constant-depth symmetric circuits, for which existing techniques such as random restriction do not apply — so the strict separation between encoders and decoders rests on indirect arguments. Most fundamentally, the survey leaves open the gap between worst-case expressivity and the behavior of trained models: relating these complexity-theoretic characterizations to empirical transformer capabilities remains unresolved.

Conclusion

The survey distills a coherent picture: constant-depth transformers without CoT sit within SMATSMAT5 or uniform SMATSMAT6 depending on precision, with matching lower bounds under generous width assumptions; CoT of sufficient length lifts them through SMATSMAT7 to exactly SMATSMAT8, and unbounded CoT yields Turing completeness even for softmax attention at log precision. The sharp sensitivity of these classifications to precision, attention type, and masking underscores that "the transformer" is not a single computational model but a family whose power must be stated relative to explicit resource bounds.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Tweets

Sign up for free to view the 1 tweet with 4 likes about this paper.