Define hierarchy and goals
Specify the levels (manager and worker), the state features each level observes, subgoal encoding and termination criteria.
Hierarchical reinforcement learning. Design subpolicies and rewards.
Hierarchical reinforcement learning (HRL) organises an agent as multiple levels: high-level controllers select subgoals or subpolicies, and low-level controllers execute actions to satisfy those subgoals. HRL can improve learning in long-horizon tasks by decomposing decisions, but requires careful design of subgoals, credit assignment and termination conditions.
Learning concept · Not a validated service
Hierarchical reinforcement learning (HRL) organises an agent as multiple levels: high-level controllers select subgoals or subpolicies, and low-level controllers execute actions to satisfy those subgoals. HRL can improve learning in long-horizon tasks by decomposing decisions, but requires careful design of subgoals, credit assignment and termination conditions.
A proposed application: train a mobile robot to perform compound tasks (for example, navigate to a room, then pick an object) by learning a high-level scheduler that triggers specialised low-level controllers. This extension is not implemented in the supplied starter code.
Specify the levels (manager and worker), the state features each level observes, subgoal encoding and termination criteria.
Use Gymnasium or a custom simulator with tasks that naturally decompose into subgoals and provide dense or shaped rewards for subpolicies.
Train low-level controllers for subtasks first, then train a high-level policy to sequence them; monitor per-level rewards and stability.
Measure task completion, average episode length, and robustness to subpolicy failures; inspect where credit assignment breaks down.
The supplied starter implements a basic epsilon-greedy multi-armed bandit simulation: it samples four Bernoulli arms with fixed true reward probabilities, updates sample-average estimates, and reports action counts and estimated rates. It does not implement any hierarchical controllers, subpolicies, or environment interactions typical of hierarchical reinforcement learning.
for step in range(1, 2001):
if rng.random() < epsilon:
action = rng.integers(len(true_reward_rates))
else:
action = int(np.argmax(estimated_values))
reward = 1 if rng.random() < true_reward_rates[action] else 0
action_counts[action] += 1
total_reward += reward
estimated_values[action] += (reward - estimated_values[action]) / action_counts[action]The code is a flat bandit experiment and lacks every hierarchical element named in the title: no manager/worker levels, no subpolicies or subgoals, no episode/termination logic for temporally-extended actions, and no environment API such as Gymnasium.
Proposed extension: build a two-level agent where low-level policies (options) are trained on short subgoals inside a simulator, and a high-level policy learns to sequence those options to complete long-horizon tasks.
This is a potential application pathway, not a delivered product. The supplied starter does not implement this service or validate it with real users.
Networkers Home runs this topic inside its AI Engineer Course, with placement support and hands-on labs.