FLLGApr 2, 2024

Transformers as Transducers

arXiv:2404.02040v313 citationsh-index: 8TACL
Originality Highly original
AI Analysis

This work provides foundational insights into the theoretical expressiveness of transformers for sequence processing, which is incremental in extending prior language-based analyses.

The paper investigates the sequence-to-sequence mapping capabilities of transformers by linking them to finite transducers, revealing they can express large classes of transductions, including first-order rational, regular, and polyregular functions, and demonstrates that masked average-hard attention transformers can simulate S-RASP.

We study the sequence-to-sequence mapping capacity of transformers by relating them to finite transducers, and find that they can express surprisingly large classes of transductions. We do so using variants of RASP, a programming language designed to help people "think like transformers," as an intermediate representation. We extend the existing Boolean variant B-RASP to sequence-to-sequence functions and show that it computes exactly the first-order rational functions (such as string rotation). Then, we introduce two new extensions. B-RASP[pos] enables calculations on positions (such as copying the first half of a string) and contains all first-order regular functions. S-RASP adds prefix sum, which enables additional arithmetic operations (such as squaring a string) and contains all first-order polyregular functions. Finally, we show that masked average-hard attention transformers can simulate S-RASP.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes