[Paper Review] CompILE: Compositional Imitation Learning and Execution
CompILE introduces a fully differentiable, unsupervised framework for learning compositional, variable-length behavioral segments from demonstration data by jointly discovering task boundaries and latent encodings through soft sequence segmentation. It enables hierarchical reinforcement learning agents to generalize to longer sequences and unseen environments using learned sub-policies, significantly improving sample efficiency in sparse-reward settings where non-hierarchical agents fail.
We introduce Compositional Imitation Learning and Execution (CompILE): a framework for learning reusable, variable-length segments of hierarchically-structured behavior from demonstration data. CompILE uses a novel unsupervised, fully-differentiable sequence segmentation module to learn latent encodings of sequential data that can be re-composed and executed to perform new tasks. Once trained, our model generalizes to sequences of longer length and from environment instances not seen during training. We evaluate CompILE in a challenging 2D multi-task environment and a continuous control task, and show that it can find correct task boundaries and event encodings in an unsupervised manner. Latent codes and associated behavior policies discovered by CompILE can be used by a hierarchical agent, where the high-level policy selects actions in the latent code space, and the low-level, task-specific policies are simply the learned decoders. We found that our CompILE-based agent could learn given only sparse rewards, where agents without task-specific policies struggle.
Motivation & Objective
- To discover compositional, hierarchical structure in sequential demonstration data without task annotations.
- To learn reusable, variable-length behavioral segments that can be recombined to form novel behaviors.
- To enable hierarchical reinforcement learning agents to solve sparse-reward tasks using learned sub-policies.
- To develop a fully differentiable, unsupervised segmentation mechanism that jointly identifies event boundaries and latent encodings.
- To demonstrate generalization to longer sequences and unseen environments or task compositions.
Proposed method
- CompILE uses a conditional variational auto-encoder (VAE) with soft segment masks to reconstruct state-action trajectories by sequentially attending to and encoding variable-length segments.
- It models segment boundaries as relaxed discrete latent variables using the Gumbel-Softmax reparameterization trick for differentiable training.
- Each segment is encoded into a latent code, and the decoder reconstructs the original trajectory by executing the sequence of learned latent codes.
- During inference, soft masks are replaced with discrete, consecutive masks to enable processing of arbitrary-length sequences through iterative segmentation.
- The framework supports hierarchical agents where a high-level policy selects latent codes, and low-level policies are the learned decoders.
- Training is end-to-end via an autoencoding objective that encourages accurate reconstruction of expert demonstrations.
Experimental results
Research questions
- RQ1Can an unsupervised model discover meaningful, reusable behavioral subroutines from raw state-action trajectories without task annotations?
- RQ2Can the learned segment boundaries and latent codes generalize to longer sequences and unseen environments?
- RQ3Can the discovered sub-policies enable a hierarchical agent to solve sparse-reward tasks where non-hierarchical agents fail?
- RQ4How effective is the differentiable segmentation module in identifying event boundaries and encoding task-specific behavior?
- RQ5To what extent can the latent codes be grounded in semantic task structure without supervision?
Key findings
- The CompILE-based hierarchical agent successfully learned to solve all sparse-reward tasks in the multi-task grid world environment, while non-hierarchical baselines failed.
- The model generalized to 5-task configurations despite being trained only on 3-task demonstrations, demonstrating strong combinatorial generalization.
- In the sparse reward setting, the hierarchical agent achieved consistent learning across seeds, while the low-level baseline failed except when dense sub-task rewards were provided.
- The model discovered reliable task boundaries and effective latent encodings in an unsupervised manner, even in environments with location-specific semantics rather than object-specific ones.
- Exponential smoothing of learning curves showed stable and consistent performance gains for the CompILE-based agent, with no learning signal in the baseline under sparse rewards.
- The framework enables efficient exploration and credit assignment in hierarchical decision-making, significantly improving sample efficiency in challenging control tasks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.