Abstract
Hierarchical Reinforcement Learning (HRL) algorithms have successfully been applied to temporal credit assignment problems with sparse reward signals. However, state-of-the-art algorithms require manual specification of sub-task structures, a sample inefficient exploration phase or lack semantic interpretability. Humans, on the other hand, efficiently detect hierarchical sub-structures induced by their surroundings. It has been argued that this inference process universally applies to language, logical reasoning as well as motor control. Therefore, we propose a cognitive-inspired Reinforcement Learning architecture which uses grammar induction to identify sub-goal policies. By treating an on-policy trajectory as a sentence sampled from the policy-conditioned language of the environment, we identify hierarchical constituents with the help of unsupervised grammatical inference. The resulting set of temporal abstractions is called action grammar (Pastra & Aloimonos, 2012) and unifies symbolic and connectionist approaches to Reinforcement Learning. It can be used to facilitate efficient imitation, transfer and online learning.
1. Introduction
Solving tasks with sparse rewards remains a significant challenge in Reinforcement Learning (RL). While Hierarchical Reinforcement Learning (HRL) offers a solution by decomposing complex tasks into sub-goals, it often faces a "chicken and egg" problem: discovering useful sub-tasks requires extensive exploration, yet efficient exploration often depends on having a pre-defined hierarchy. Most existing HRL methods rely on manual sub-task definitions or computationally expensive bottleneck detection.
In contrast, humans naturally perceive actions as hierarchical structures—viewing "making a sandwich" as a sequence of high-level sub-tasks rather than primitive muscle movements. This paper proposes a framework that bridges this gap by applying linguistic principles to robot motor control, treating action sequences as a "language" from which hierarchical grammars can be induced.
2. The Action Grammar Framework
The proposed architecture alternates between two primary stages to discover and utilize temporal abstractions:
- Grammar Learning (Grammar Induction): The agent treats its action trajectories as sentences. Unsupervised grammatical inference algorithms, such as Sequitur and G-Lexis, are employed to identify repeating sub-sequences. These patterns are then "flattened" into macro-actions (e.g., a sequence A -> B -> C becomes a single macro-action M1).
- Action Learning (Hierarchical RL): The agent’s action space is augmented with these newly discovered macro-actions. Using Semi-Markov Decision Process (SMDP) Q-Learning, the agent learns to select both primitive actions and macro-actions, allowing reward signals to propagate more efficiently across time.
The framework supports three distinct learning paradigms: imitation learning from expert demonstrations, transfer learning from simpler tasks to jumpstart harder ones, and online self-induction from the agent's own successful trajectories during exploration.
3. Experimental Setup
The framework was evaluated on two challenging benchmarks:
- Towers of Hanoi (ToH): A recursive puzzle with exponentially growing state spaces and extremely sparse rewards. The study focused on 5-disk and 6-disk variants.
- Hierarchically-Structured Gridworld: A navigation task requiring the agent to avoid obstacles and collect items in a specific sequence, testing the ability to handle multi-stage sub-tasks like zigzag avoidance.
4. Key Insights and Results
The core contribution of this work is the conceptualization of Actions as Syntax. By viewing policy-conditioned trajectories as a language, the agent can leverage data compression (grammar induction) to identify useful behavioral "habits" without requiring explicit reward signals for sub-goals.
4.1 Performance and Stability
In the Towers of Hanoi task, agents utilizing action grammars demonstrated significantly faster convergence and lower variance compared to standard RL baselines. The use of macro-actions effectively reduced the "horizon" of the problem, making sparse rewards easier to reach.
4.2 Algorithmic Comparison
The researchers compared two grammar induction methods: 2-Sequitur and G-Lexis. While Sequitur is a greedy, linear-time algorithm, G-Lexis is an optimization-based approach. Results indicated that G-Lexis often produced more effective, longer macro-actions for complex tasks, leading to better compression of the action trace (as seen in Figure 5).
4.3 Transferability
A key strength of this approach is the transfer of the structure of the action space rather than just neural weights. An agent trained on a 4-disk ToH could successfully transfer its learned grammar to a 6-disk ToH, effectively "distilling" the recursive logic necessary to solve the larger puzzle.
5. Conclusion
Action Grammars provide a bridge between symbolic logic and connectionist RL, offering a transparent "parse tree" of agent behavior. While currently focused on discrete action spaces, future work aims to extend this to continuous control by tokenizing continuous signals. This research paves the way for a "universal language of action," where robots can build and share a library of hierarchical skills across diverse environments.
Summary updated