DeepSynth: Automata Synthesis for Automatic Task Segmentation in Deep Reinforcement Learning

Mohammadhosein Hasanbeig, Natasha Yogananda Jeppu, Alessandro Abate, Tom Melham, Daniel Kroening

Abstract

Deep Reinforcement Learning (RL) often fails in environments with sparse rewards and non-Markovian dependencies, where the optimal action depends on a history of interactions rather than the current state alone. DeepSynth is a novel framework designed to automatically discover the high-level sequential structure of such tasks. By synthesizing human-interpretable Deterministic Finite Automata (DFA) from unsupervised exploration data, DeepSynth segments complex goals into a series of manageable Markovian sub-tasks. This modular approach achieves a 100x improvement in sample efficiency on the Montezuma’s Revenge benchmark and provides a transparent, human-readable map of the agent's learned logic.

Introduction

Standard Deep Reinforcement Learning (RL) agents struggle with tasks characterized by sparse rewards and non-Markovian dependencies. In sparse reward scenarios, an agent may wander for extended periods without receiving feedback, making random exploration ineffective. Non-Markovian dependencies further complicate learning because the optimal next move depends on past actions—such as collecting a key before attempting to open a door—rather than just the current visual state.

While Hierarchical RL (HRL) offers a potential solution by breaking tasks into sub-goals, these sub-goals often require manual definition by human experts, which limits scalability. DeepSynth addresses this limitation by automatically discovering task structures and synthesizing them into a formal language representation that guides the learning process.

The DeepSynth Framework

DeepSynth operates as a closed-loop system that iteratively refines its understanding of the environment through three primary stages: Tracing, Synthesis, and Temporal RL.

The DeepSynth framework pipeline, illustrating the closed-loop cycle of Tracing, Automata Synthesis, and Temporal RL.

1. Tracing

The agent begins by exploring the environment. To process raw pixel data without manual labeling, DeepSynth utilizes unsupervised image segmentation to identify salient objects like keys, ladders, or ropes. As the agent interacts with these objects, it records "traces"—sequences of high-level events that describe its trajectory through the task space.

2. Automata Synthesis (Synth)

The collected traces are fed into a synthesis engine that employs SAT-solving techniques to construct a Deterministic Finite Automaton (DFA). This DFA serves as a high-level flowchart of the task's logic. For instance, it might encode the requirement that the agent must transition through a "Key" state before it can successfully reach a "Door" state.

3. Temporal RL (Deep)

The framework then constructs a hybrid architecture where each state in the DFA is associated with a dedicated Deep RL module, such as a Deep Q-Network (DQN). These modules are synchronized with the DFA: when the environment triggers a transition in the automaton, the system automatically switches to the corresponding neural network. This "Product MDP" formulation transforms a complex non-Markovian task into a sequence of simpler, Markovian sub-tasks.

Experimental Evaluation

The authors evaluated DeepSynth across a variety of challenging domains, including Atari 2600 games, Minecraft-inspired benchmarks, and continuous navigation tasks like Mars Rover.

In Montezuma’s Revenge, a notoriously difficult Atari game where standard RL agents typically score zero, DeepSynth demonstrated remarkable performance. It achieved a successful policy with a two-order-of-magnitude reduction (100x) in the number of iterations compared to existing state-of-the-art hierarchical methods. Furthermore, in Minecraft tasks requiring complex sequential object interactions, DeepSynth converged to optimal solutions while "flat" DQNs failed to learn entirely.

Interpretability and Task Discovery

A significant advantage of DeepSynth is its inherent interpretability. Unlike traditional "black-box" models, the synthesized DFA provides a human-readable representation of the agent's discovered strategy.

Synthesized DFA for Montezuma’s Revenge, showing the discovered sequence of high-level objectives and alternative paths.

Analysis of the synthesized automata revealed that the agent could discover non-obvious strategies. For example, in Montezuma’s Revenge, the agent identified a "shortcut" by jumping directly over a rope to reach a key, bypassing a middle ladder. This discovery highlights the framework's ability to optimize high-level logic beyond simple imitation of human heuristics.

Additionally, the DFA structure facilitates modular learning. Because each state has its own neural module, the agent avoids "catastrophic forgetting"—learning a new skill does not degrade its ability to perform a previously mastered one. The DFA also provides a mechanism for intrinsic motivation, rewarding the agent for discovering new transitions or objects that expand its internal model.

Conclusion

DeepSynth represents a significant step forward in automated task decomposition for Reinforcement Learning. By bridging the gap between low-level perception and high-level symbolic reasoning, it enables agents to solve complex, long-horizon tasks with unprecedented efficiency. While the current implementation relies on unsupervised segmentation and assumes task logic can be captured by regular languages, future work may extend these concepts to more complex context-free grammars and even more visually cluttered environments.

Summary updated

BibTeX
@inproceedings{hasanbeig2021deepsynth,
  author = {Mohammadhosein Hasanbeig and Natasha Yogananda Jeppu and Alessandro Abate and Tom Melham and Daniel Kroening},
  title = {{DeepSynth: Automata Synthesis for Automatic Task Segmentation in Deep Reinforcement Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i9.16935},
}
Figure