Learning Finite State Models fromRecurrent Neural Networks

Edi Muškardin*, Bernhard K. Aichernig, Ingo Pill, Martin Tappler

*Corresponding author for this work

Research output: Chapter in Book/Report/Conference proceedingConference paperpeer-review


Explaining and verifying the behavior of recurrent neural networks (RNNs) is an important step towards achieving confidence in machine learning. The extraction of finite state models, like deterministic automata, has been shown to be a promising concept for analyzing RNNs. In this paper, we apply a black-box approach based on active automata learning combined with model-guided conformance testing to learn finite state machines (FSMs) from RNNs. The technique efficiently infers a formal model of an RNN classifier’s input-output behavior, regardless of its inner structure. In several experiments, we compare this approach to other state-of-the-art FSM extraction methods. By detecting imprecise generalizations in RNNs that other techniques miss, model-guided conformance testing learns FSMs that more accurately model the RNNs under examination. We demonstrate this by identifying counterexamples with this testing approach that falsifies wrong hypothesis models learned by other techniques. This entails that testing guided by learned automata can be a useful method for finding adversarial inputs, that is, inputs incorrectly classified due to improper generalization.

Original languageEnglish
Title of host publicationIntegrated Formal Methods - 17th International Conference, IFM 2022, Proceedings
EditorsMaurice H. ter Beek, Rosemary Monahan
Place of PublicationCham
PublisherSpringer Science and Business Media Deutschland GmbH
Number of pages20
ISBN (Electronic)978-3-031-07727-2
ISBN (Print)9783031077265
Publication statusPublished - 2022
Event17th International Conference on Integrated Formal Methods: IFM 2022 - Lugano, Switzerland
Duration: 7 Jun 202210 Jun 2022

Publication series

NameLecture Notes in Computer Science
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349


Conference17th International Conference on Integrated Formal Methods


  • Active automata learning
  • Finite state machines
  • Recurrent neural networks
  • Verifiable machine learning

ASJC Scopus subject areas

  • Theoretical Computer Science
  • Computer Science(all)


Dive into the research topics of 'Learning Finite State Models fromRecurrent Neural Networks'. Together they form a unique fingerprint.

Cite this