Positional Attention: Expressivity and Learnability of Algorithmic Computation

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: de Luca, Artur Back, Giapitzakis, George, Yang, Shenghao, Veličković, Petar, Fountoulakis, Kimon
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866910996972437504
author de Luca, Artur Back
Giapitzakis, George
Yang, Shenghao
Veličković, Petar
Fountoulakis, Kimon
author_facet de Luca, Artur Back
Giapitzakis, George
Yang, Shenghao
Veličković, Petar
Fountoulakis, Kimon
contents There is a growing interest in the ability of neural networks to execute algorithmic tasks (e.g., arithmetic, summary statistics, and sorting). The goal of this work is to better understand the role of attention in Transformers for algorithmic execution. Its importance for algorithmic execution has been studied theoretically and empirically using parallel computational models. Notably, many parallel algorithms communicate between processors solely using positional information. Inspired by this observation, we investigate how Transformers can execute algorithms using positional attention, where attention weights depend exclusively on positional encodings. We prove that Transformers with positional attention (positional Transformers) maintain the same expressivity of parallel computational models, incurring a logarithmic depth cost relative to the input length. We analyze their in-distribution learnability and explore how parameter norms in positional attention affect sample complexity. Our results show that positional Transformers introduce a learning trade-off: while they exhibit better theoretical dependence on parameter norms, certain tasks may require more layers, which can, in turn, increase sample complexity. Finally, we empirically explore the out-of-distribution performance of positional Transformers and find that they perform well in tasks where their underlying algorithmic solution relies on positional information.
format Preprint
id arxiv_https___arxiv_org_abs_2410_01686
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Positional Attention: Expressivity and Learnability of Algorithmic Computation
de Luca, Artur Back
Giapitzakis, George
Yang, Shenghao
Veličković, Petar
Fountoulakis, Kimon
Machine Learning
Artificial Intelligence
Data Structures and Algorithms
There is a growing interest in the ability of neural networks to execute algorithmic tasks (e.g., arithmetic, summary statistics, and sorting). The goal of this work is to better understand the role of attention in Transformers for algorithmic execution. Its importance for algorithmic execution has been studied theoretically and empirically using parallel computational models. Notably, many parallel algorithms communicate between processors solely using positional information. Inspired by this observation, we investigate how Transformers can execute algorithms using positional attention, where attention weights depend exclusively on positional encodings. We prove that Transformers with positional attention (positional Transformers) maintain the same expressivity of parallel computational models, incurring a logarithmic depth cost relative to the input length. We analyze their in-distribution learnability and explore how parameter norms in positional attention affect sample complexity. Our results show that positional Transformers introduce a learning trade-off: while they exhibit better theoretical dependence on parameter norms, certain tasks may require more layers, which can, in turn, increase sample complexity. Finally, we empirically explore the out-of-distribution performance of positional Transformers and find that they perform well in tasks where their underlying algorithmic solution relies on positional information.
title Positional Attention: Expressivity and Learnability of Algorithmic Computation
topic Machine Learning
Artificial Intelligence
Data Structures and Algorithms
url https://arxiv.org/abs/2410.01686