Skip to main content
QUICK REVIEW

[Paper Review] On Limitations of the Transformer Architecture

Binghui Peng, Srini Narayanan|arXiv (Cornell University)|Feb 13, 2024
Power Transformer Diagnostics and InsulationEngineering7 citations
TL;DR

The paper proves fundamental limitations of single and multi-layer Transformer attention in performing function composition and certain compositional tasks, using Communication Complexity arguments and logspace considerations, and discusses implications for hallucinations and chain-of-thought prompting.

ABSTRACT

What are the root causes of hallucinations in large language models (LLMs)? We use Communication Complexity to prove that the Transformer layer is incapable of composing functions (e.g., identify a grandparent of a person in a genealogy) if the domains of the functions are large enough; we show through examples that this inability is already empirically present when the domains are quite small. We also point out that several mathematical tasks that are at the core of the so-called compositional tasks thought to be hard for LLMs are unlikely to be solvable by Transformers, for large enough instances and assuming that certain well accepted conjectures in the field of Computational Complexity are true.

Motivation & Objective

  • Motivate the investigation of root causes of hallucinations in Transformers and identify a fundamental operation (function composition) that is hard for the architecture
  • Formalize a theoretical impossibility result for a single Transformer attention layer to reliably compute function composition under certain domain size and precision constraints
  • Extend the impossibility analysis to chain-of-thought prompts and iterated composition, quantifying the cost in prompt length
  • Relate Transformer capabilities to classical complexity classes and memory models to explain observed compositionality failures in multi-layer Transformers
  • Discuss broader implications for training strategies and grounding approaches to mitigate hallucinations

Proposed method

  • Model Transformer computation via a formal self-attention unit with inputs X, keys K, queries Q, values V and H heads as in Equation (1)
  • Define the function composition problem with domain sizes |A|=|B|=|C|=n and analyze under a precision p and embedding dimension d
  • Use a Communication Complexity framework with three agents (Faye, Grace, Xavier) and derive a lower bound showing that fewer than n log n bits of communication from Faye to Xavier cannot yield correct composition
  • Prove Theorem 1: if n log n > H(d+1)p, a single H-headed Transformer layer cannot solve function composition with high probability, via a reduction to a communication task (Lemma 1)
  • Apply information-theoretic arguments (mutual information, Fano’s inequality) to bound error probability in composition
  • Examine Chain-of-Thought (CoT) impact via Theorem 2, showing required CoT steps grow as Omega(sqrt(n/(Hdp))) for iterated composition via a pointer-chasing reduction
  • Provide a complementary impossibility argument for multiple layers and other compositional tasks (Theorem 3) using log-space considerations
  • Discuss memory/computation class implications by linking Transformer computation to log-space (L) and NL/P connectivity and deriving limits for Derivability, 2-SAT, Horn SAT, and Circuit evaluation

Experimental results

Research questions

  • RQ1Can a single Transformer attention layer reliably compute function composition for large enough domains?
  • RQ2How does the dimensionality and precision of embeddings, and the number of attention heads, constrain the ability to perform composition?
  • RQ3To what extent do chain-of-thought prompts mitigate composition limitations, and what is the required prompt length for deeper compositions?
  • RQ4Do multi-layer Transformers inherit these composition limitations, and how do they relate to known complexity classes like L, NL, P?
  • RQ5What is the link between Transformer compositional abilities and broader tasks such as derivability, SAT variants, and circuit evaluation under standard complexity assumptions?

Key findings

  • A single multi-head attention layer cannot reliably compute function composition when n log n exceeds H(d+1)p, implying a fundamental limitation due to softmax-based information propagation
  • Chain-of-Thought prompts can help with simple composition but require arbitrarily many CoT steps to generalize to deep iterated composition (Theorem 2)
  • Iterated composition tasks require a super-logarithmic number of CoT steps in relation to domain size and architecture parameters, indicating growing difficulty with depth
  • Under widely accepted memory complexity assumptions (L vs NL, etc.), multi-layer Transformers cannot reliably solve several elementary compositional tasks (Theorem 3)
  • The analysis connects Transformer limitations to log-space hardness and standard complexity results, offering a theoretical account for observed compositionality failures in practice

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.