Softmax Transformers are Turing-Complete
Hongjian Jiang, Michael Hahn, Georg Zetzsche, Anthony W. Lin
International Conference on Learning Representations 2026 · Oral
Overview
This talk presents a groundbreaking theoretical and empirical study demonstrating that length-generalizable Softmax Transformers are Turing-complete. Delivered by Hongjian Jiang and his co-authors, this research offers a crucial theoretical underpinning for the remarkable capabilities observed in large language models (LLMs), particularly their ability to solve complex mathematical problems and generate code. The work addresses two significant limitations of prior research on Transformer Turing-completeness: the reliance on unrealistic hard attention mechanisms and the exclusive focus on expressivity without guarantees of learnability. By proving Turing-completeness for a realistic model like the Softmax Transformer and validating this with experimental training of length-generalizable models, the authors provide the first comprehensive theory explaining how learnable Transformers can achieve such powerful computational feats.

Key moments
- 0:00 Proving Turing-completeness for learnable Softmax Transformers
- 2:00 Softmax Transformers, Chain-of-Thought, and length generalization
- 4:00 Introducing RASPy: a declarative language for transformer expressivity
- 6:00 Turing-completeness proof via COT RASPy and counter machines
- 8:00 The crucial role of Relative Positional Encoding (RPE)
- 9:00 Experimental validation with Llama on complex arithmetic
- 10:00 Future work: Addressing computational complexity, not just computability
- 10:40 Q&A: Practical importance of transformer Turing-completeness
Softmax Transformers are Turing-Complete
Speakers: Hongjian Jiang, Michael Hahn, Georg Zetzsche, Anthony W. Lin
Conference: ICLR 2026
YouTube: https://slideslive.com/39062218
Overview
This talk presents a groundbreaking theoretical and empirical study demonstrating that length-generalizable Softmax Transformers are Turing-complete. Delivered by Hongjian Jiang and his co-authors, this research offers a crucial theoretical underpinning for the remarkable capabilities observed in large language models (LLMs), particularly their ability to solve complex mathematical problems and generate code. The work addresses two significant limitations of prior research on Transformer Turing-completeness: the reliance on unrealistic hard attention mechanisms and the exclusive focus on expressivity without guarantees of learnability. By proving Turing-completeness for a realistic model like the Softmax Transformer and validating this with experimental training of length-generalizable models, the authors provide the first comprehensive theory explaining how learnable Transformers can achieve such powerful computational feats.
The significance of this work extends beyond theoretical computer science. It offers insights into why modern LLMs, often built on Softmax attention and employing Chain-of-Thought (COT) reasoning, exhibit advanced reasoning skills. The ability to formally demonstrate that these models can, in principle, compute anything a Turing machine can, provided they can generalize to arbitrary input lengths, marks a pivotal step in understanding the foundations of AI. This research not only advances the theoretical understanding of Transformers but also sets the stage for future investigations into the computational complexity and efficiency of these powerful architectures.
Background
▶ Watch: Proving Turing-completeness for learnable Softmax Transformers (0:00)
The notion of Transformers as powerful computational models gained significant traction with the rise of LLMs. Early theoretical work, notably the 2020 paper "Attention is Turing-complete," proposed that Transformers could indeed be universal computers. This initial research, and subsequent papers building upon it, established formal proofs of Turing-completeness for Transformer-like architectures. However, a critical limitation of these early proofs was their reliance on hard attention. Hard attention mechanisms select a single, discrete input element, or a small fixed set, to focus on at each step, making them discontinuous and difficult to optimize with gradient-based learning methods like stochastic gradient descent (SGD). In contrast, real-world LLMs predominantly use Softmax attention, which computes a weighted average of all input elements, distributing attention across the entire sequence as a probability distribution. This continuous, differentiable nature of Softmax attention is fundamental to their training and practical applicability.
Furthermore, existing proofs primarily focused on the expressivity of Transformers—what they could theoretically compute—without offering any guarantees about their learnability. Modern LLMs are not just expressive; they are learnable, demonstrating generalization capabilities from finite training data to unseen inputs. The concept of length generalization was introduced by Huang et al. (ICLR, 2023) to formalize this notion of efficiently learnable concepts by Transformers. It posits that an idealized learning algorithm, when exposed to sufficient training examples up to a certain length, can converge to a Transformer that correctly recognizes a language for inputs of arbitrary length. This background highlights the gap this paper aims to fill: demonstrating Turing-completeness for a realistic, learnable Transformer model, specifically one employing Softmax attention and exhibiting length generalization. The introduction of Chain-of-Thought (COT) reasoning, where LLMs iteratively apply themselves to their own outputs, is also crucial, as it enriches the computational power and reasoning capabilities of these models.
Key Findings
▶ Watch: Introducing RASPy: a declarative language for transformer expressivity (4:00)
The central finding of this research is the formal proof that length-generalizable Softmax Transformers are Turing-complete. This is the first time such a proof has been established for a realistic model of Transformers, specifically one that incorporates Softmax attention and satisfies the properties of length generalization. This addresses the two major limitations of prior work: moving beyond the theoretical construct of hard attention to a practically used mechanism, and providing a framework that includes guarantees of learnability.
Beyond the theoretical proof, the paper offers empirical validation. The authors successfully trained length-generalizable transformers based on the Llama architecture to solve a variety of complex arithmetic reasoning problems that can be mapped to counter machines. These tasks included primality testing, exponential function computation, division, GCD, and multiplication. This experimental evidence directly supports the theoretical claim, demonstrating that not only are such Transformers theoretically capable of universal computation, but they can also be practically learned to perform these computations across varying input lengths. In essence, the paper provides the first Turing-completeness proof for learnable Transformers, backed by concrete experimental results using a realistic model.
Technical Deep Dive
▶ Watch: The crucial role of Relative Positional Encoding (RPE) (8:00)
The technical core of this work integrates several advanced concepts: the mechanics of Softmax Transformers, the iterative nature of Chain-of-Thought (COT), the formal definition of length generalization, a novel declarative language called RASPy, and the simulation of counter machines facilitated by a specialized relative positional encoding (RPE).
At its foundation, the paper considers Softmax Transformers as sequential models. An input string is converted into a sequence of vectors, typically augmented with positional encoding. Each layer within the Transformer performs a sequence-to-sequence transformation, utilizing Softmax attention to aggregate information. The attention weights are normalized into a probability distribution using an exponential function, and the output is a weighted sum of input vectors. A crucial detail for capturing sparse functions is the scaling factor log N, where N is the sequence length.
Chain-of-Thought (COT) enhances these Transformers by allowing them to "think" iteratively. This involves repeatedly running the Transformer on its own output, appending the generated token to the input for the next iteration, until a specific termination token is produced. This mechanism is central to how LLMs perform complex multi-step reasoning.
The concept of length generalization is critical for learnability. As defined by Huang et al., a language is recognizable by a length-generalizable COT Transformer if an idealized learning algorithm (conceptually representing SGD) converges to a Softmax COT Transformer recognizing the language when supplied with all input strings and their corresponding COT scratchpads up to a sufficiently large length NL. This formalizes the idea that a model learned on finite-length examples can generalize its learned computation to arbitrary lengths.
The proof relies heavily on a declarative language called RASPy (Relational Abstract Syntax for Python). RASPy is specifically designed for expressing concepts that are learnable by length-generalizable Transformers, abstracting away the internal complexities of the Transformer architecture. Its primary function is counting, signified by the sharp operator (#). This operator can count occurrences of specific elements or properties in an input string relative to a reference position, and it can be nested. For instance, RASPy can express conditions like "the input string has more than two A's," "more A's than B's," or even non-regular language properties like "well-formed parenthesis."
To bridge the gap between RASPy and COT Transformers, the authors extend RASPy with Chain-of-Thought. COT RASPy allows for an output token, which is then appended to the input for subsequent iterations, mirroring the COT Transformer mechanism. A key theorem establishes that each COT RASPy is equivalent to a length-generalizable COT Softmax Transformer. This equivalence is the linchpin of the proof, allowing the authors to demonstrate Turing-completeness by proving it for COT RASPy instead of directly tackling the Transformer architecture.
The ultimate target for proving Turing-completeness is the simulation of counter machines. These are a well-known Turing-powerful computational model, consisting of a finite state automaton augmented with a finite number of integer counters that can be incremented, decremented, and tested for zero. They are simpler to work with than full Turing machines for this type of proof.
The proof idea for simulating a counter machine with COT RASPy involves two main techniques:
- Interpreting the input string as a number stored in a counter: This requires converting the input string into its numerical value.
- Simulating a single counter machine transition as a single COT step: Each transition of the counter machine involves checking counter values, incrementing/decrementing them, and changing state.
To achieve the string-to-number conversion and enable counter operations, a novel relative positional encoding (RPE) is introduced. Unlike standard positional encodings, this RPE defines a binary relation R on positions (I, J) in the input sequence. The RASPy counting operator is then modified to only count positions satisfying a predicate phi and related by R. The specific RPE used for the proof is defined such that positions I and J are related if the I-th bit in the binary expansion of J (after removing a certain prefix) is one. This allows RASPy to effectively "read" bits from positions and construct numbers, crucial for manipulating counter values. Remarkably, the proof holds even with a single, fixed RPE. The authors also prove that the conversion from COT RASPy to COT Softmax Transformer holds even with this specialized RPE.
Simulating a counter machine transition in a COT step then involves:
- Outputting a COT token indicating the specific transition (possible due to finitely many transitions).
- Using RASPy's powerful counting capabilities to compute and update counter values based on the input and the current state. This allows for testing if a counter is zero and performing arithmetic operations on the encoded numbers.
By combining these elements, the authors construct a COT RASPy that can simulate any counter machine, thereby proving that length-generalizable Softmax Transformers are Turing-complete.
Experimental Setup & Results
▶ Watch: Experimental validation with Llama on complex arithmetic (9:00)
To validate their theoretical claims, the authors conducted experiments by training Transformers on algorithmic tasks that map to the operations of counter machines. The chosen architecture for these experiments was based on the widely recognized Llama architecture, a strong representative of modern LLMs.
The experiments involved training these Transformers on a variety of complex arithmetic reasoning problems, specifically designed to test their ability to perform multi-step, algorithmic computations. These tasks included:
- Primality testing: Determining if a given number is prime.
- Exponential function: Calculating
x^y. - Division: Performing integer division.
- GCD (Greatest Common Divisor): Finding the GCD of two numbers.
- Multiplication: Performing multiplication of two numbers.
These tasks were evaluated under various input settings to thoroughly test the models' generalization capabilities and the impact of representational choices:
- Input Representation: Numbers were provided in either unary representation (e.g.,
AAAAfor 4) or binary representation (e.g.,100for 4). The unary representation often simplifies counting operations, while binary representation is more compact and challenging for length generalization. - Relative Positional Encoding (RPE): Experiments were conducted both with and without the explicit use of the proposed relative positional encoding. This allowed the researchers to assess its contribution to the models' ability to handle numerical and relational information.
The results of these training runs demonstrated that the models were successfully able to learn these complex arithmetic reasoning tasks and, crucially, exhibited length generalization. This means that transformers trained on inputs up to a certain length were able to correctly perform the computations for significantly longer, unseen inputs. The authors reported that their experimental results were consistent with the predictions of their theory. This empirical validation provides strong evidence that the theoretical framework, including the role of Softmax attention, Chain-of-Thought, length generalization, and relative positional encoding, accurately captures the computational potential of modern Transformer architectures. While specific numerical benchmarks (e.g., accuracy, throughput) were not detailed in the provided transcript, the success in "successfully training length-generalizable transformers" for these tasks on a Llama architecture is a significant finding.
Practical Implications
▶ Watch: Q&A: Practical importance of transformer Turing-completeness (10:40)
The finding that length-generalizable Softmax Transformers are Turing-complete carries profound practical implications for practitioners, infrastructure teams, model builders, and deployers in the AI/ML space.
For model builders and researchers, this work provides a robust theoretical foundation for the observed advanced reasoning capabilities of LLMs. It suggests that the architectural choices of using Softmax attention and enabling Chain-of-Thought (COT) reasoning are not just empirical tricks but are fundamentally linked to the models' ability to perform universal computation. This understanding can guide the design of future Transformer architectures, encouraging the development of models that inherently support length generalization and iterative reasoning. It validates the pursuit of more complex, multi-step reasoning tasks within the Transformer paradigm.
For infrastructure teams and deployers, the implications are more nuanced. While Turing-completeness indicates what Transformers can compute, it does not speak to the efficiency of that computation. The authors explicitly state that their construction incurs an exponential blow-up in running time, meaning the proof is about computability, not polynomial-time complexity. This highlights a critical tradeoff: current Transformer designs, even if theoretically universal, may not be practically efficient for all computationally intensive tasks. This means that while LLMs can theoretically perform complex algorithms like primality testing or GCD, their real-world application for high-performance computing tasks might still require specialized algorithms or hybrid systems.
The open problem of whether COT Softmax Transformers can capture polynomial-time computation using only polynomially many COT steps is a significant limitation and a key area for future research. Until this is addressed, practitioners should be aware that deploying LLMs for tasks traditionally requiring efficient algorithms might still face scalability and latency challenges. This means that while an LLM might solve a problem, the resource cost (compute, time) might be prohibitive for production environments, especially for very long sequences or complex algorithms.
Furthermore, the emphasis on length generalization is crucial. For models to truly leverage their Turing-complete capabilities, they must be able to generalize learned patterns to inputs far beyond their training distribution. This underscores the importance of training methodologies that foster robust length generalization, rather than merely memorizing patterns for fixed-length inputs. Techniques like the proposed relative positional encoding (RPE), which aids in numerical representation and manipulation, could be explored further for practical applications where numerical reasoning is paramount.
In summary, this research confirms the immense expressive power of modern Transformers but also highlights the ongoing challenge of achieving computational efficiency. It encourages a deeper exploration into how to make these powerful models not just computable but also practically efficient for real-world algorithmic challenges.
Key Takeaways
- Softmax Transformers are Turing-Complete: This paper provides the first proof that length-generalizable Softmax Transformers, a realistic model used in LLMs, are Turing-complete.
- Addresses Prior Limitations: It overcomes the reliance on unrealistic hard attention and the lack of learnability guarantees in previous Turing-completeness proofs for Transformers.
- Chain-of-Thought (COT) is Key: The iterative Chain-of-Thought mechanism is fundamental to achieving this computational power, enabling multi-step reasoning.
- Length Generalization is Crucial for Learnability: The concept of length generalization ensures that models can apply learned computations to inputs of arbitrary length, moving beyond mere memorization.
- Empirical Validation with Llama: The theory is backed by successful training of Llama architecture-based Transformers on complex arithmetic tasks like primality testing and GCD, demonstrating learnability and generalization.
- Computability vs. Complexity: While proven Turing-complete (computable), the current construction incurs an exponential blow-up in running time, leaving polynomial-time complexity as a major open problem for future research.
About the Speaker(s)
The talk was presented by Hongjian Jiang, alongside co-authors Michael Hahn, Georg Zetzsche, and Anthony W. Lin. The transcript does not provide specific affiliations or detailed biographical information for the speakers, beyond their names and their involvement in this research presented at ICLR.
Reviews
→ Top-rated talks at International Conference on Learning Representations 2026
All talks from International Conference on Learning Representations 2026