Learning Deterministic Finite Automata Decompositions from Examples and Demonstrations

Niklas Lauffer, Beyazit Yalcinkaya, Marcell Vazquez-Chanlatte, Ameesh Shah, Sanjit A. Seshia

Introduction

In the field of grammatical inference, the standard approach has long been to identify the smallest monolithic Deterministic Finite Automaton (DFA) that fits a set of labeled traces. While effective for simple patterns, this approach struggles with complex, multi-faceted systems. When a system performs multiple independent sub-tasks in parallel—such as a robot navigating a grid while simultaneously avoiding obstacles and collecting items—a monolithic model must represent the cross-product of all these rules. This leads to a combinatorial explosion of states, resulting in models that are neither simple nor interpretable.

This paper proposes a novel SAT-based algorithm to learn DFA decompositions: a set of smaller, simpler DFAs whose conjunction (intersection) describes the overall system behavior. By forcing the learner to find modular components, the authors align the inductive bias of the solver with the inherent structure of real-world tasks.

Methodology

The authors frame the DFA Decomposition Identification Problem (DFA-DIP) as an extension of the classic graph-coloring approach to DFA learning. The methodology consists of three primary components:

1. Modified SAT Encoding

The process begins by constructing an Augmented Prefix Tree Acceptor (APTA) from the provided positive and negative examples. The core innovation lies in the logical constraints provided to the SAT solver. To ensure modularity, the authors define acceptance such that a positive example must be accepted by every DFA in the decomposition. Conversely, a negative example is rejected if at least one DFA in the set rejects it. This asymmetrical requirement is the "secret sauce" of the paper; it allows individual DFAs to specialize in specific constraints (e.g., "never touch lava") without needing to represent the entire system logic.

When learning multiple DFAs, the definition of a "minimal" model becomes complex—is a decomposition of sizes (2, 4) better than (3, 3)? The authors implement a Breadth-First Search (BFS) over state-size tuples to systematically enumerate the Pareto-optimal frontier. This ensures that the algorithm finds the simplest architectures that fit the data without requiring the user to guess the number of sub-tasks or their complexity beforehand.

3. Integration with DISS

The algorithm is integrated into the Demonstration Informed Specification Search (DISS) framework. This allows the system to learn task specifications from unlabeled expert trajectories by conjecturing positive and negative examples and finding the most concise explanatory decomposition.

Experimental Evaluation

The approach was evaluated using both synthetic datasets and a practical navigation environment.

  • Synthetic Partially-Ordered Tasks: These tests used randomly generated examples representing parallel temporal tasks. The algorithm demonstrated impressive scalability, identifying up to 11 concurrent DFAs for 2-symbol alphabets within a 10-minute timeout. While searching for decompositions is more computationally intensive than monolithic learning, the solving time remains tightly correlated with the baseline, proving the approach is viable for practical applications.
  • Stochastic Grid World: This environment featured an agent navigating around hazards to reach specific targets. This experiment highlighted the primary advantage of decomposition: interpretability. While a monolithic learner produced a tangled, 9-state machine that was difficult to decipher, the decomposition algorithm extracted two distinct, human-readable DFAs. One was a 2-state machine for "avoiding the red square," and the other was a 4-state machine for "target ordering," perfectly capturing the ground-truth intent of the expert.

Insights and Limitations

The research demonstrates that redefining rejection is key to modularity. By allowing a single sub-DFA to be responsible for a rejection, the solver naturally decouples independent rules. This acts as a strong inductive bias that mirrors how humans design systems and specify tasks.

However, the approach faces scalability limits inherent to SAT-solving NP-complete problems. The algorithm begins to time out when the number of examples exceeds approximately 60 for more complex decompositions (e.g., 4 DFAs with 4 symbols).

Conclusion

By shifting the focus from monolithic minimality to modular conjunction, the authors provide a powerful tool for learning interpretable models of complex systems. This work paves the way for more transparent multi-task reinforcement learning and robotics, where understanding the "why" behind an agent's behavior is safety-critical. Future work may explore heuristic or approximate solvers to push past current scalability limits for larger datasets.

Summary updated

BibTeX
@inproceedings{lauffer2022learning,
  author = {Niklas Lauffer and Beyazit Yalcinkaya and Marcell Vazquez-Chanlatte and Ameesh Shah and Sanjit A. Seshia},
  title = {{Learning Deterministic Finite Automata Decompositions from Examples and Demonstrations}},
  booktitle = {FMCAD},
  year = {2022},
  url = {https://openreview.net/forum?id=88M78Sap-U1},
}
Figure