[Paper Review] Learning Task Specifications from Demonstrations
This paper proposes a maximum a posteriori (MAP) inference framework using maximum entropy to learn Boolean non-Markovian task specifications from demonstrations, enabling safe and compositional task learning in stochastic environments. The method efficiently identifies robust, logically structured specifications—such as 'do not recharge while wet'—that outperform ad-hoc reward composition in terms of robustness and interpretability.
Real world applications often naturally decompose into several sub-tasks. In many settings (e.g., robotics) demonstrations provide a natural way to specify the sub-tasks. However, most methods for learning from demonstrations either do not provide guarantees that the artifacts learned for the sub-tasks can be safely recombined or limit the types of composition available. Motivated by this deficit, we consider the problem of inferring Boolean non-Markovian rewards (also known as logical trace properties or specifications) from demonstrations provided by an agent operating in an uncertain, stochastic environment. Crucially, specifications admit well-defined composition rules that are typically easy to interpret. In this paper, we formulate the specification inference task as a maximum a posteriori (MAP) probability inference problem, apply the principle of maximum entropy to derive an analytic demonstration likelihood model and give an efficient approach to search for the most likely specification in a large candidate pool of specifications. In our experiments, we demonstrate how learning specifications can help avoid common problems that often arise due to ad-hoc reward composition.
Motivation & Objective
- Address the challenge of learning complex, temporally dependent tasks from demonstrations in a way that supports safe and systematic composition of sub-tasks.
- Overcome limitations of scalar Markovian rewards, which often lead to brittle policies, unintended behaviors, and poor generalization under environmental changes.
- Enable the automatic inference of interpretable, logically structured specifications (e.g., LTL-like formulas) that capture non-Markovian constraints such as 'recharge only after drying if wet'.
- Provide a formal, compositional framework where sub-specifications can be learned independently and combined into a joint specification without retraining.
- Ensure robustness to environmental perturbations—such as removing tiles—by learning specifications that preserve correctness under structural changes.
Proposed method
- Formulate specification inference as a maximum a posteriori (MAP) probability problem over a candidate concept class of Boolean non-Markovian specifications.
- Apply the principle of maximum entropy to derive a tractable likelihood model for demonstrations, ensuring distributional robustness and minimizing assumptions.
- Use symbolic encoding via Binary Decision Diagrams (BDDs) to efficiently compute exact satisfaction rates of specifications over unrolled dynamics, avoiding the curse of history.
- Leverage SAT solvers and Hasse diagrams to precompute subset relations between specifications, enabling pruning of the search space and efficient candidate evaluation.
- Implement a greedy search algorithm that queries only ~18% of the concept class (172 queries), significantly outperforming brute-force search (5.5× speedup).
- Symbolically encode dynamics, sensor observations (colors), and specifications into a BDD to compute exact satisfaction probabilities, enabling precise likelihood estimation.
Experimental results
Research questions
- RQ1Can we learn non-Markovian task specifications from demonstrations in a way that ensures composability and safety when combining sub-tasks?
- RQ2How can we model the likelihood of a specification given a set of demonstrations while maintaining interpretability and avoiding overfitting?
- RQ3To what extent can specification inference improve robustness to environmental changes compared to traditional inverse reinforcement learning with scalar rewards?
- RQ4Can we efficiently search over a large concept class of specifications without exhaustive enumeration, leveraging logical structure and prior knowledge?
- RQ5How does the use of formal specifications compare to scalar reward functions in avoiding unintended behaviors under policy optimization?
Key findings
- The proposed method successfully inferred the correct specification $ H((\text{yellow} \land P~{}\text{blue}) \implies (\neg\text{blue}~{}S~{}\text{brown})) $, capturing the 'do not recharge while wet' constraint, from demonstrations.
- The algorithm required only 172 queries (~18%) over the concept class, achieving a 5.5× speedup over brute-force search.
- The inferred specification was robust: it preserved correctness even when the environment changed (e.g., removing a recharge tile), unlike scalar reward functions that failed under such changes.
- The method enabled trivial composition of sub-specifications—e.g., 'avoid lava' and 'dry before recharging'—into a joint specification that jointly satisfies both constraints.
- Symbolic BDD-based satisfaction rate computation enabled exact likelihood estimation without exponential blowup, making the approach scalable despite history dependence.
- The approach demonstrated that formal, logical specifications are more interpretable and safer than scalar rewards, especially in complex, temporally dependent 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.