mlsanityData to 7 Oct 2026

Simulating Weighted Automata over Sequences and Trees with Transformers

arXiv 2403.09728 ↗First posted 12 Mar 2024cs.CL cs.AI cs.CCcited by 4

Not on the map. Why?

Abstract (arXiv)

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.

Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 30 of its 49 references that are in the map. First posted on arXiv 12 Mar 2024.

Builds on

30 of 49 references.

References · 30

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  4. 2022Transformers Learn Shortcuts to Automatacited by 260
  5. 2015Bilinear CNNs for Fine-grained Visual Recognitioncited by 228
  6. 2022Neural Networks and the Chomsky Hierarchycited by 214
  7. 2021Thinking Like Transformerscited by 182
  8. 2015The Power of Depth for Feedforward Neural Networkscited by 181
  9. 2021Saturated Transformers are Constant-Depth Threshold Circuitscited by 137
  10. 2022Overcoming a Theoretical Limitation of Self-Attentioncited by 110
  11. 2021Self-Attention Networks Can Process Bounded Hierarchical Languagescited by 105
  12. 2015On the Expressive Power of Deep Learning: A Tensor Analysiscited by 97
18 more
  1. 2015Compact Bilinear Poolingcited by 97
  2. 2022Formal Language Recognition by Hard Attention Transformers: Perspectives from Circuit Complexitycited by 92
  3. 2020Learning Parities with Neural Networkscited by 77
  4. 2017Extracting Automata from Recurrent Neural Networks Using Queries and Counterexamplescited by 66
  5. 2023Tighter Bounds on the Expressivity of Transformer Encoderscited by 65
  6. 2020A Formal Hierarchy of RNN Architecturescited by 61
  7. 2020How Can Self-Attention Networks Recognize Dyck-n Languages?cited by 51
  8. 2023Do Transformers Parse while Predicting the Masked Word?cited by 48
  9. 2019Learning Deterministic Weighted Automata with Queries and Counterexamplescited by 22
  10. 2019Weighted Automata Extraction from Recurrent Neural Networks via Regression on State Spacescited by 20
  11. 2022Extracting Finite Automata from RNNs Using State Mergingcited by 17
  12. 2016Factorized Bilinear Models for Image Recognitioncited by 13
  13. 2018Explaining Black Boxes on Sequential Data using Weighted Automatacited by 11
  14. 2020A closer look at the approximation capabilities of neural networkscited by 8
  15. 2022Wide Attention Is The Way Forward For Transformers?cited by 8
  16. 2020Connecting Weighted Automata, Tensor Networks and Recurrent Neural Networks through Spectral Learningcited by 7
  17. 2020Distillation of Weighted Automata from Recurrent Neural Networks using a Spectral Approachcited by 6
  18. 2021Extracting Weighted Automata for Approximate Minimization in Language Modellingcited by 3

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 2; 2026: 2.

4 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Finite State Automata Inside Transformers with Chain-of-Thought: A Mechanistic Study on State Tracking
  2. 2026Protoreasoning in Tiny Transformers
  3. 2024L^*LM: Learning Automata from Examples using Natural Language Oracles
  4. 2025A Constructive Framework for Nondeterministic Automata via Time-Shared, Depth-Unrolled Feedforward Networks
  5. 2024On the Power of Decision Trees in Auto-Regressive Language Modeling
  6. 2026Logic-Gated Time-Shared Feedforward Networks for Alternating Finite Automata: Exact Simulation and Learnability
  7. 2026Rational Transductors
  8. 2025Transformers are Inherently Succinct