Skip to main content
QUICK REVIEW

[Paper Review] $O(n)$ Connections are Expressive Enough: Universal Approximability of Sparse Transformers

Chulhee Yun, Yin-Wen Chang|arXiv (Cornell University)|Jun 8, 2020
Domain Adaptation and Few-Shot LearningComputer Science25 citations
TL;DR

This paper establishes that sparse Transformers with only O(n) connections per attention layer can universally approximate any continuous sequence-to-sequence function, matching the expressive power of dense Transformers with O(n²) connections. The authors introduce a unified theoretical framework with sufficient conditions on sparsity patterns and attention maps, proving universal approximability for sparse models under these constraints, and validate the findings empirically on NLP tasks.

ABSTRACT

Recently, Transformer networks have redefined the state of the art in many NLP tasks. However, these models suffer from quadratic computational cost in the input sequence length $n$ to compute pairwise attention in each layer. This has prompted recent research into sparse Transformers that sparsify the connections in the attention layers. While empirically promising for long sequences, fundamental questions remain unanswered: Can sparse Transformers approximate any arbitrary sequence-to-sequence function, similar to their dense counterparts? How does the sparsity pattern and the sparsity level affect their performance? In this paper, we address these questions and provide a unifying framework that captures existing sparse attention models. We propose sufficient conditions under which we prove that a sparse attention model can universally approximate any sequence-to-sequence function. Surprisingly, our results show that sparse Transformers with only $O(n)$ connections per attention layer can approximate the same function class as the dense model with $n^2$ connections. Lastly, we present experiments comparing different patterns/levels of sparsity on standard NLP tasks.

Motivation & Objective

  • To address the fundamental question of whether sparse Transformers can retain the universal approximation capability of dense Transformers.
  • To identify sufficient conditions on sparsity patterns and attention maps that guarantee universal approximability in sparse self-attention mechanisms.
  • To demonstrate that O(n) connections per layer are sufficient for universal approximation, challenging the assumption that O(n²) connections are necessary.
  • To unify and analyze existing sparse attention patterns (e.g., Strided, Fixed, Star) under a common theoretical framework.
  • To empirically evaluate the impact of different sparsity patterns and levels on standard NLP benchmarks.

Proposed method

  • Propose a unified framework to analyze sparse Transformers by generalizing existing sparsity patterns into a common mathematical structure.
  • Introduce Assumption 1: a connectivity condition on the sparsity pattern ensuring sufficient long-range information flow across tokens.
  • Introduce Assumption 2: a condition on the attention map's probability distribution to ensure stable and expressive attention weights.
  • Prove Theorem 1: Sparse Transformers satisfying Assumptions 1 and 2 can universally approximate any continuous sequence-to-sequence function, regardless of sequence length.
  • Derive Corollary 2: Even sparse Transformers with only O(n) connections per layer achieve universal approximability, matching the expressive power of dense models.
  • Conduct experiments on synthetic copying, language modeling, translation, and GLUE tasks to compare sparsity patterns and levels under controlled settings.

Experimental results

Research questions

  • RQ1Can sparse Transformers with significantly fewer than O(n²) connections still universally approximate any continuous sequence-to-sequence function?
  • RQ2What structural and probabilistic conditions on the sparsity pattern and attention map are sufficient for universal approximability in sparse Transformers?
  • RQ3How does the choice of sparsity pattern (e.g., Strided, Fixed, Star) affect model performance across different NLP tasks?
  • RQ4Can sparse Transformers with O(n) connections match the expressive power of dense Transformers?
  • RQ5What is the trade-off between sparsity level, pattern design, and downstream performance on standard NLP benchmarks?

Key findings

  • Sparse Transformers with only O(n) connections per attention layer can universally approximate any continuous sequence-to-sequence function, as proven in Corollary 2.
  • The Strided, Fixed, and Star patterns—commonly used in practice—satisfy the proposed sufficient conditions and thus are universally approximable.
  • On the synthetic copying task, the Multihead and Sequential configurations with the Strided pattern achieved 99.84% and 99.97% accuracy on 3- and 4-layer models, respectively, outperforming random and star patterns.
  • In the WMT translation task, the Strided and Fixed patterns achieved BLEU scores comparable to dense models, with the Strided pattern outperforming others on both en-de and de-en translation.
  • On GLUE tasks using BERT_BASE, the Strided and Fixed patterns achieved average accuracies above 90% on CoLA and MRPC, while Random and Star patterns underperformed significantly.
  • The results show that connectivity and pattern design matter: bidirectional models benefit more from star-like patterns, while autoregressive models struggle with them due to masked attention.

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.