mlsanityData to 7 Oct 2026

Automata Extraction from Transformers

arXiv 2406.05564 ↗First posted 8 Jun 2024cs.LG cs.AI cs.CLcited by 1

Not on the map. Why?

Abstract (arXiv)

In modern machine (ML) learning systems, Transformer-based architectures have achieved milestone success across a broad spectrum of tasks, yet understanding their operational mechanisms remains an open problem. To improve the transparency of ML systems, automata extraction methods, which interpret stateful ML models as automata typically through formal languages, have proven effective for explaining the mechanism of recurrent neural networks (RNNs). However, few works have been applied to this paradigm to Transformer models. In particular, understanding their processing of formal languages and identifying their limitations in this area remains unexplored. In this paper, we propose an automata extraction algorithm specifically designed for Transformer models. Treating the Transformer model as a black-box system, we track the model through the transformation process of their internal latent representations during their operations, and then use classical pedagogical approaches like L* algorithm to interpret them as deterministic finite-state automata (DFA). Overall, our study reveals how the Transformer model comprehends the structure of formal languages, which not only enhances the interpretability of the Transformer-based ML systems but also marks a crucial step toward a deeper understanding of how ML systems process formal languages. Code and data are available at https://github.com/Zhang-Yihao/Transfomer2DFA.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 17 of its 35 references that are in the map. First posted on arXiv 8 Jun 2024.

Builds on

17 of 35 references.

References · 17

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
  4. 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,243
  5. 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,772
  6. 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,424
  7. 2014Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modelingcited by 2,341
  8. 2024Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Dualitycited by 1,283
  9. 2023Representation Engineering: A Top-Down Approach to AI Transparencycited by 1,239
  10. 2019Learning Deep Transformer Models for Machine Translationcited by 309
  11. 2023What Formal Languages Can Transformers Express? A Surveycited by 120
  12. 2014Long Short-Term Memory Based Recurrent Neural Network Architectures for Large Vocabulary Speech Recognitioncited by 111
5 more
  1. 2022Formal Language Recognition by Hard Attention Transformers: Perspectives from Circuit Complexitycited by 92
  2. 2017Extracting Automata from Recurrent Neural Networks Using Queries and Counterexamplescited by 66
  3. 2019Weighted Automata Extraction from Recurrent Neural Networks via Regression on State Spacescited by 20
  4. 2022Extracting Weighted Finite Automata from Recurrent Neural Networks for Natural Languagescited by 10
  5. 2023Weighted Automata Extraction and Explanation of Recurrent Neural Networks for Natural Language Taskscited by 7

Built on by

Cited by year

Citing papers per year: 2024: 1.

1 paper.