Simulating Weighted Automata over Sequences and Trees with Transformers

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Rizvi, Michael, Lizaire, Maude, Lacroce, Clara, Rabusseau, Guillaume
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866914715355054080
author Rizvi, Michael
Lizaire, Maude
Lacroce, Clara
Rabusseau, Guillaume
author_facet Rizvi, Michael
Lizaire, Maude
Lacroce, Clara
Rabusseau, Guillaume
contents Transformers are ubiquitous models in the natural language processing (NLP) community and have shown impressive empirical successes in the past few years. However, little is understood about how they reason and the limits of their computational capabilities. These models do not process data sequentially, and yet outperform sequential neural models such as RNNs. Recent work has shown that these models can compactly simulate the sequential reasoning abilities of deterministic finite automata (DFAs). This leads to the following question: can transformers simulate the reasoning of more complex finite state machines? In this work, we show that transformers can simulate weighted finite automata (WFAs), a class of models which subsumes DFAs, as well as weighted tree automata (WTA), a generalization of weighted automata to tree structured inputs. We prove these claims formally and provide upper bounds on the sizes of the transformer models needed as a function of the number of states the target automata. Empirically, we perform synthetic experiments showing that transformers are able to learn these compact solutions via standard gradient-based training.
format Preprint
id arxiv_https___arxiv_org_abs_2403_09728
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Simulating Weighted Automata over Sequences and Trees with Transformers
Rizvi, Michael
Lizaire, Maude
Lacroce, Clara
Rabusseau, Guillaume
Computation and Language
Artificial Intelligence
Computational Complexity
Transformers are ubiquitous models in the natural language processing (NLP) community and have shown impressive empirical successes in the past few years. However, little is understood about how they reason and the limits of their computational capabilities. These models do not process data sequentially, and yet outperform sequential neural models such as RNNs. Recent work has shown that these models can compactly simulate the sequential reasoning abilities of deterministic finite automata (DFAs). This leads to the following question: can transformers simulate the reasoning of more complex finite state machines? In this work, we show that transformers can simulate weighted finite automata (WFAs), a class of models which subsumes DFAs, as well as weighted tree automata (WTA), a generalization of weighted automata to tree structured inputs. We prove these claims formally and provide upper bounds on the sizes of the transformer models needed as a function of the number of states the target automata. Empirically, we perform synthetic experiments showing that transformers are able to learn these compact solutions via standard gradient-based training.
title Simulating Weighted Automata over Sequences and Trees with Transformers
topic Computation and Language
Artificial Intelligence
Computational Complexity
url https://arxiv.org/abs/2403.09728