Abstract
The discovery of reusable sub-routines simplifies decision-making and planning in complex reinforcement learning problems. Previous approaches propose to learn such temporal abstractions in a purely unsupervised fashion through observing state-action trajectories gathered from executing a policy. However, a current limitation is that they process each trajectory in an entirely sequential manner, which prevents them from revising earlier decisions about sub-routine boundary points in light of new incoming information. In this work we propose SloTTAr, a fully parallel approach that integrates sequence processing Transformers with a Slot Attention module and adaptive computation for learning about the number of such sub-routines in an unsupervised fashion. We demonstrate how SloTTAr is capable of outperforming strong baselines in terms of boundary point discovery, even for sequences containing variable amounts of sub-routines, while being up to 7x faster to train on existing benchmarks.
Introduction
In Reinforcement Learning (RL), complex tasks are often more manageable when broken down into "temporal abstractions" or sub-routines—discrete behavioral building blocks like "collecting resources" or "navigating to a goal." Identifying these sub-routines from raw trajectory data without manual labeling is a significant challenge.
Existing state-of-the-art methods, such as CompILE and OMPN, typically rely on Recurrent Neural Networks (RNNs). A fundamental drawback of these sequential models is their inability to revise earlier segmentation decisions as new information arrives; once a boundary is set, the model moves forward. Furthermore, sequential processing is computationally inefficient. SloTTAr (Slot-based Transformer for Temporal Abstraction) addresses these issues by processing entire trajectories in parallel, allowing for global context to inform the discovery of behavioral segments.
The SloTTAr Architecture
SloTTAr shifts from sequential to parallel processing by combining Transformers with Slot Attention. The architecture consists of three main components:
- Transformer Encoder: A Transformer encoder processes the full sequence of actions and observations. This provides "global access," enabling the model to use future information to contextualize past events—a capability the authors quantify through "Forward" and "Backward Access" metrics.
- Slot Attention: Originally used for object discovery in computer vision, Slot Attention is adapted here to group temporal features. Sub-routines are treated as "temporal objects." Slots compete for keys and values generated by the encoder, effectively partitioning the trajectory into distinct behavioral units.
- Parallel Decoder: A Transformer-based decoder reconstructs actions from each slot and predicts "end position logits." These logits represent the probability distribution of where each sub-routine concludes, which are then used to generate segment masks.
To handle trajectories with a variable number of sub-routines, SloTTAr incorporates Adaptive Computation (PonderNet). This probabilistic halting mechanism allows the model to learn the appropriate number of slots to use for a given sequence based on an empirical prior.
Experimental Evaluation
The model was benchmarked against CompILE and OMPN on two primary environments:
- Craft: A grid-world task with fixed-length sub-routine sequences (e.g.,
MakeAxe). - MiniGrid: A procedurally generated environment with high variability in actions and observations. This included tasks with variable numbers of sub-routines (ranging from 4 to 9).
Performance and Efficiency
SloTTAr demonstrated significant improvements in both accuracy and training speed:
- Boundary Discovery: On Craft, SloTTAr achieved a near-perfect 99.84% F1 score. In the more challenging MiniGrid
DoorKeytask, it reached 91.73% F1, substantially higher than CompILE's 73.92%. - Computational Speed: By leveraging parallelization, SloTTAr is approximately 3x faster to train than CompILE and up to 7x faster than OMPN on standard benchmarks.
- Variable Length Sequences: Unlike previous models that often require knowing the number of sub-routines in advance, the adaptive computation loss enabled SloTTAr to successfully decompose trajectories even when the sub-routine count was unknown.
Conclusion
SloTTAr demonstrates that temporal grouping in behavior discovery is conceptually similar to spatial grouping in computer vision. By treating sub-routines as discrete "slots" and utilizing the global context provided by Transformers, the model achieves superior decomposition accuracy and efficiency. While currently designed for offline analysis, the discovered abstractions provide a foundation for training hierarchical controllers and specialist sub-policies in downstream RL tasks.
Summary updated