TL;DR
This paper investigates the computational power of modern transformers, specifically those with limited (logarithmic) precision for their internal computations. The authors prove that such transformers are computationally equivalent to a specific class of simple circuits (uniform TC⁰), implying they are not as powerful as previously thought and cannot solve certain complex reasoning problems. This finding suggests a fundamental "parallelism tradeoff" where the massive parallelizability enabling large-scale training might inherently limit a model's expressive power.
What Problem Does This Paper Address?
Modern large language models (LLMs) like BERT, T5, and GPT-3 are built upon the transformer architecture. While their capabilities are impressive, a precise understanding of their underlying computational power remains an open question. Previous theoretical work often assumed infinite precision for internal computations, leading to claims of Turing completeness. However, practical transformers operate with finite, often 32-bit or 64-bit, precision. This paper bridges the gap between theoretical assumptions and practical realities by analyzing transformers with logarithmic precision – where the precision of intermediate values scales with the logarithm of the input sequence length. This assumption is more realistic and allows the authors to derive concrete limitations on what these models can compute, particularly concerning complex reasoning tasks.
Methods
The core of the paper involves translating transformer computations into the language of circuit complexity theory. The authors define a formal model of "p-precision transformers" where intermediate values are limited to p bits. Their main contribution is proving that these log-precision transformers can be simulated by uniform constant-depth threshold circuits (uniform TC⁰).
Key techniques include:
- Circuit Complexity: Formalizing computations using circuits, specifically threshold circuits (which use gates that output 1 if the sum of their inputs exceeds a threshold).
- Uniformity: Ensuring that the circuits used to simulate transformers for different input sizes are related in a structured way, making the model more realistic and comparable to standard complexity classes.
- Inductive Proofs: Building up the simulation by showing how each layer of a transformer can be represented by a corresponding circuit.
- Formal Definitions: Precisely defining p-precision, attention heads, transformer layers, and the overall transformer computation.
Datasets
Not discussed in the paper. The paper focuses on theoretical characterization rather than empirical evaluation on specific datasets.
Key Insights and Ideas
- The Parallelism Tradeoff: The paper introduces this concept, suggesting that the high degree of parallelism inherent in transformers, which is crucial for efficient training at scale, comes at the cost of reduced computational expressiveness. Models designed for massive parallelism might be fundamentally limited in the complexity of problems they can solve.
- Log-Precision is Key: The authors demonstrate that even with just logarithmic precision (relative to input size), transformers are significantly less powerful than previously assumed with infinite precision. This suggests that finite precision is a major factor in limiting their capabilities.
- Transformers as TC⁰ Circuits: The central finding is that log-precision transformers are equivalent to uniform TC⁰ circuits. This is a surprisingly weak complexity class, meaning transformers cannot solve problems that are even slightly harder than those solvable by simple threshold circuits.
- Implications for Reasoning: The paper explicitly lists problems that log-precision transformers cannot perfectly solve, such as linear equalities, context-free grammar recognition, SAT, and AI planning. This provides concrete evidence against the idea that transformers are universally capable reasoners.
Key Results
- Theorem 1 (Non-uniform): Log-precision transformers can be simulated by non-uniform threshold circuits of constant depth.
- Theorem 2 (Uniform, Main Result): Log-precision transformers can be simulated by uniform constant-depth threshold circuits (uniform TC⁰). This is the paper's primary theoretical contribution.
- Corollary 3.1: Transformers with specific (hand-crafted) components can correctly follow instructions encoded as depth-d TC⁰ circuits.
- Corollary 3.2: Transformers with polynomial advice can simulate any non-uniform TC⁰ problem.
Limitations and Future Work
- Asymptotic Nature: The results are asymptotic, meaning they apply to "large enough" input sizes. The authors acknowledge that for smaller inputs, practical transformers might still solve difficult problems. Future work could extend the analysis to small
n. - Fixed Precision vs. Log Precision: Practical transformers use fixed precision (e.g., 32-bit floats), which is more restrictive than the log-precision model used. The authors suggest closing this gap to better align theoretical findings with practical performance.
- Hand-Crafted Components: The lower bound results (e.g., simulating TC⁰ circuits) rely on specific, hand-crafted components (fractional positional embeddings, saturated attention). Future work could explore whether learned components can achieve similar capabilities.
- Parallelism Tradeoff Interpretation: The authors speculate that the parallelism tradeoff might be a "blessing" by constraining the hypothesis space, making learning easier. This is an area for future investigation.
- Extracting Circuits: The paper mentions work on extracting circuits from transformers and suggests their results provide a good formalism for these extracted mechanisms. This is a promising direction for future research.
Summary updated