Average-Hard Attention Transformers are Constant-Depth Uniform Threshold Circuits

Lena Strobl
8/6/2023
cs.CLcs.CCcs.LG

No confident code implementation found for this paper.

Abstract

Transformers have emerged as a widely used neural network model for various natural language processing tasks. Previous research explored their relationship with constant-depth threshold circuits, making two assumptions: average-hard attention and logarithmic precision for internal computations relative to input length. Merrill et al. (2022) prove that average-hard attention transformers recognize languages that fall within the complexity class TC0, denoting the set of languages that can be recognized by constant-depth polynomial-size threshold circuits. Likewise, Merrill and Sabharwal (2023) show that log-precision transformers recognize languages within the class of uniform TC0. This shows that both transformer models can be simulated by constant-depth threshold circuits, with the latter being more robust due to generating a uniform circuit family. Our paper shows that the first result can be extended to yield uniform circuits as well.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{strobl2023averagehard,
  title  = {Average-Hard Attention Transformers are Constant-Depth Uniform Threshold Circuits},
  author = {Lena Strobl},
  year   = {2023},
  eprint = {2308.03212},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2308.03212v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2308.03212.svg)](https://codeofpaper.com/paper/2308.03212)

Discussion