Large language models can write code, simulate games, and reason through complex prompts. Yet, underneath this empirical success lies a strict mathematical boundary. If we freeze a model's depth (the number of layers) and scale the input length, what can it fundamentally compute in a single forward pass?
A growing body of research answers this question by mapping neural architectures to circuit complexity classes. The consensus is striking: despite their massive scale, standard Transformers, Linear Transformers, and even State-Space Models (SSMs) like Mamba share a fundamental architectural bottleneck. They are bounded by shallow circuit complexity, making certain classes of sequential logic mathematically impossible for them to solve without external help.
The Parallelism Tradeoff
To understand why these models face an expressivity ceiling, we must look at how they process information. The primary reason Transformers scale so effectively on modern hardware is their massive parallelizability: every token's representation in a given layer can be computed simultaneously.
However, this architectural superpower is also a theoretical limitation. In computational complexity theory, highly parallel algorithms that run in constant time correspond to shallow, constant-depth Boolean circuits.
Sabharwal et al. formalized this connection in The Parallelism Tradeoff: Limitations of Log-Precision Transformers. They proved that Transformers operating with logarithmic numerical precision are computationally equivalent to the complexity class uniform $\mathsf{TC}^0$.
[ Complexity Hierarchy ]
▲ NC¹ (Deep Sequential Logic: Parity, Tree Evaluation)
│ ─────────────────────────────────────────────────── ◄─── The Expressivity Barrier
│ TC⁰ (Shallow Parallel Logic: Majority, Division) ◄─── Transformers & SSMs
▼ AC⁰ (Basic Boolean Logic: AND/OR/NOT) ◄─── Hard-Attention Models
To build an intuition for this class, imagine a circuit with a fixed number of layers where gates can perform standard logical operations (AND, OR, NOT) as well as Majority decisions (returning true if more than half the inputs are true). In A Logic for Expressing Log-Precision Transformers, Merrill et al. tightened this bound by showing that log-precision Transformers are mathematically equivalent to First-Order Logic with Majority quantifiers ($FO(M)$).
When precision is constrained even further, the bounds become tighter still. Chiang et al. demonstrated in Tighter Bounds on the Expressivity of Transformer Encoders that fixed-precision Transformer encoders are upper-bounded by a specific logic variant called $FOC[+; MOD]$, proving they are even less powerful than the general uniform $\mathsf{TC}^0$ class. For simplified "hard attention" variants, Angluin et al. showed in Formal Language Recognition by Hard Attention Transformers: Perspectives from Circuit Complexity that the limits drop all the way down to $\mathsf{AC}^0$—circuits that lack the ability to even count or compute majorities.
The Hard Walls of $\mathsf{TC}^0$
What happens when an architecture is trapped inside $\mathsf{TC}^0$? It means the model cannot solve problems that require inherently sequential, step-by-step computation where the number of dependent steps scales with the input length.
Consider the parity problem: determining whether a string of bits contains an even or odd number of ones. To solve parity, you must know the state of every single bit, and flipping any single bit changes the answer. This requires tracking a state that updates iteratively across the sequence—a property characteristic of the complexity class $\mathsf{NC}^1$. Because $\mathsf{TC}^0$ is strictly contained within $\mathsf{NC}^1$ under standard assumptions, fixed-depth parallel models cannot compute parity for arbitrary lengths.
This barrier manifests across several practical domains:
- Formal Languages and Algebra: As Li et al. proved in Theoretical Constraints on the Expressive Power of RoPE-based Tensor Attention Transformers, even advanced variants utilizing Tensor Attention and Rotary Position Encodings (RoPE) cannot solve $\mathsf{NC}^1$-complete problems like fixed membership or $(AF,r)^*$.
- State Tracking and Planning: In Rethinking Transformers in Solving POMDPs, Lu et al. showed that fixed-depth attention mechanisms fail to solve tasks requiring exact state reconstruction in partially observable environments, because their depth does not scale with the iterative updates the environment demands.
- Recursive Logic: This theoretical ceiling matches empirical observations. In Think Big, Teach Small: Do Language Models Distil Occam's Razor?, Jaimovitch-Lopez et al. found that while large language models excel at sequential conditional reasoning, they face severe challenges when processing tasks that involve complex loops or recursive logic.
The Illusion of State in Sub-Quadratic Models
To escape the quadratic computational cost of standard attention, the community developed sub-quadratic alternatives like Linear Transformers and State-Space Models (SSMs) such as Mamba. Because these architectures can be written as recurrent equations, it was widely assumed they possessed the sequential "stateful" processing power of traditional RNNs.
Recent circuit complexity analyses have shattered this illusion. The reason these models are efficient to train is that their recurrent equations are strictly linear or diagonal. This linearity allows the recurrence to be unrolled and computed in parallel via an associative scan.
Consequently, they inherit the exact same parallel circuit limitations as standard Transformers:
- Linear Transformers: In Practical Computational Power of Linear Transformers and Their Recurrent and Self-Referential Extensions, Irie et al. demonstrated that without specialized extensions, linearized attention fails to recognize non-star-free regular languages like parity, proving that efficiency gains do not expand fundamental logical expressivity.
- State-Space Models and Mamba: Merrill et al. proved in The Illusion of State in State-Space Models that linear SSMs are bounded by $\mathsf{TC}^0$. They cannot track complex state transitions, such as permutation compositions, over long sequences without scaling their depth. Extending this work, Chen et al. showed in The Computational Limits of State-Space Models and Mamba via the Lens of Circuit Complexity that this bottleneck prevents SSMs from evaluating deep sequential logic like nested arithmetic or complex boolean formulas, even when using high-precision representations.
Bypassing the Circuit Barrier
If fixed-depth sequence models are mathematically barred from tracking complex states or solving sequential logic in a single forward pass, how do they manage to perform these tasks in practice?
The most common workaround is changing the computational graph via Chain-of-Thought (CoT) prompting. By forcing the model to generate intermediate tokens, the system spends one forward pass per token. This allows the model to trade space and time for circuit depth, effectively transforming a constant-depth parallel circuit into a sequential computer capable of stepping through $\mathsf{NC}^1$ problems.
Alternatively, researchers are exploring architectural modifications designed to break the $\mathsf{TC}^0$ barrier directly:
- Dynamic Contextualization: Zhu et al. introduced TAPE in Rethinking Addressing in Language Models via Contextualized Equivariant Positional Encoding, replacing rigid positional biases with context-aware features that evolve layer-by-layer to better simulate state-tracking.
- Non-Linear State Transitions: In DeltaFormer: Unlock the state space of Transformer, Xu et al. utilized the non-linear Delta Rule and non-linear kernel functions to unlock true state-space tracking. This architectural shift breaks the fixed circuit complexity barrier, allowing models to execute code or track complex game states directly within a single forward pass.
By understanding these boundaries, the AI community can move past the trial-and-error of scaling and design architectures that are structurally equipped for advanced algorithmic reasoning.
Key Foundational Work
Formal Language Recognition by Hard Attention Transformers: Perspectives from Circuit Complexity (2022) — contributed 1 concept elements to this direction.
Think Big, Teach Small: Do Language Models Distil Occam's Razor? (2021) — contributed 1 concept elements to this direction.