SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2112.08932 · NeurIPS · 2021

Learning from Guided Play: A Scheduled Hierarchical Approach for Improving Exploration in Adversarial Imitation Learning

Trevor Ablett, Bryan Chan, Jonathan Kelly

arXiv · PDF · Open in the Atlas

Code that ran

3 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 1 failure of our instrument; 2 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2112.08932.json · badge: /api/ran/2112.08932.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
utiasstars/lfgp canonical (classifier label)
classifier basis: classifier_2025
3 ran · 2 no recorded run
FunctionStatusWhere it lives
HierarchicalRLAgent Ran
ran on a synthesized input
utiasstars/lfgp/rl_sandbox/rl_sandbox/agents/hrl_agents.py
code served (permissive licence) · get_code("9e1d0b6acb03b7a5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import numpy as np

# Mock constants namespace
import types as _types
c = _types.SimpleNamespace(
    INITIALIZE_HIDDEN_STATE='initialize_hidden_state',
    VALUE='value',
    LOG_PROB='log_prob',
    ENTROPY='entropy',
    MEAN='mean',
    VARIANCE='variance',
    HIGH_LEVEL_OBSERVATION='high_level_observation',
    HIGH_LEVEL_HIDDEN_STATE='high_level_hidden_state',
    HIGH_LEVEL_ACTION='high_level_action'
)

# Mock high-level model
class MockHighLevelModel(nn.Module):
    def __init__(self, obs_dim=6, action_dim=3, hidden_dim=8):
        super().__init__()
        self.obs_dim = obs_dim
        self.action_dim = action_dim
        self.hidden_dim = hidden_dim
        self.fc = nn.Linear(obs_dim + hidden_dim, action_dim)
    
    def initialize_hidden_state(self):
        return torch.zeros(1, self.hidden_dim)
    
    def compute_action(self, obs, hidden_state):
        combined = torch.cat([obs, hidden_state], dim=-1)
        action = self.fc(combined)
        value = torch.zeros(obs.shape[0], 1)
        new_hidden = hidden_state
        log_prob = torch.zeros(obs.shape[0], 1)
        entropy = torch.zeros(obs.shape[0], 1)
        mean = action
        variance = torch.ones_like(action)
        return action, value, new_hidden, log_prob, entropy, mean, variance

# Mock low-level model
class MockLowLevelModel(nn.Module):
    def __init__(self, obs_dim=5, action_dim=4, hidden_dim=7):
        super().__init__()
        self.obs_dim = obs_dim
        self.action_dim = action_dim
        self.hidden_dim = hidden_dim
        self.fc = nn.Linear(obs_dim + hidden_dim, action_dim)
    
    def initialize_hidden_state(self):
        return torch.zeros(1, self.hidden_dim)
    
    def compute_action(self, obs, hidden_state):
        combined = torch.cat([obs, hidden_state], dim=-1)
        action = self.fc(combined)
        value = torch.zeros(obs.shape[0], 1)
        new_hidden = hidden_state
        log_prob = torch.zeros(obs.shape[0], 1)
        entropy = torch.zeros(obs.shape[0], 1)
        mean = action
        variance = torch.ones_like(action)
        return action, value, new_hidden, log_prob, entropy, mean, variance
    
    def deterministic_action(self, obs, hidden_state):
        combined = torch.cat([obs, hidden_state], dim=-1)
        action = self.fc(combined)
        value = torch.zeros(obs.shape[0], 1)
        new_hidden = hidden_state
        log_prob = torch.zeros(obs.shape[0], 1)
        entropy = torch.zeros(obs.shape[0], 1)
        return action, value, new_hidden, log_prob, entropy

# Mock learning algorithm
class MockLearningAlgorithm:
    def update(self, curr_obs, curr_h_state, action, reward, done, info, next_obs, next_h_state, 
               update_intentions=True, update_scheduler=True, update_buffer=True, **kwargs):
        return {'loss': 0.5}

# Create instances
high_level_model = MockHighLevelModel(obs_dim=6, action_dim=3, hidden_dim=8)
low_level_model = MockLowLevelModel(obs_dim=5, action_dim=4, hidden_dim=7)
learning_algorithm = MockLearningAlgorithm()

def preprocess_fn(obs):
    return obs

INIT_ARGS = {
    'high_level_model': high_level_model,
    'low_level_model': low_level_model,
    'learning_algorithm': learning_algorithm,
    'preprocess': preprocess_fn
}

ARGS = {
    'curr_obs': np.random.randn(5).astype(np.float32),
    'curr_h_state': np.random.randn(7).astype(np.float32),
    'action': np.random.randn(4).astype(np.float32),
    'reward': np.float32(1.0),
    'done': np.bool_(False),
    'info': {},
    'next_obs': np.random.randn(5).astype(np.float32),
    'next_h_state': np.random.randn(7).astype(np.float32),
    'update_intentions': True,
    'update_scheduler': True,
    'update_buffer': True
}

METHOD = 'update'
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
RLAgent Ran
ran on a synthesized input
utiasstars/lfgp/rl_sandbox/rl_sandbox/agents/hrl_agents.py
code served (permissive licence) · get_code("b3f21f61e2205323")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import torch
import torch.nn as nn

INITIALIZE_HIDDEN_STATE = 'initialize_hidden_state'

class RLAgent:

    def __init__(self, model, learning_algorithm):
        self.model = model
        self.learning_algorithm = learning_algorithm

    def update(self, curr_obs, curr_h_state, action, reward, done, info, next_obs, next_h_state, **kwargs):
        return self.learning_algorithm.update(curr_obs, curr_h_state, action, reward, done, info, next_obs, next_h_state, **kwargs)

    def compute_action(self, obs, **kwargs):
        raise NotImplementedError

    def reset(self):
        if hasattr(self.model, INITIALIZE_HIDDEN_STATE):
            return self.model.initialize_hidden_state().numpy().astype(np.float32)
        return np.array([np.nan], dtype=np.float32)


class SimpleModel(nn.Module):
    def __init__(self, obs_dim, hidden_dim):
        super().__init__()
        self.fc = nn.Linear(obs_dim, hidden_dim)
        self.hidden_dim = hidden_dim
    
    def initialize_hidden_state(self):
        return torch.zeros(1, self.hidden_dim)
    
    def forward(self, obs):
        return self.fc(obs)


class SimpleLearningAlgorithm:
    def __init__(self):
        self.optimizer = None
    
    def update(self, curr_obs, curr_h_state, action, reward, done, info, next_obs, next_h_state, **kwargs):
        return {"loss": 0.1, "update_count": 1}


INIT_ARGS = {
    "model": SimpleModel(obs_dim=4, hidden_dim=3),
    "learning_algorithm": SimpleLearningAlgorithm(),
}

ARGS = {
    "curr_obs": torch.randn(2, 4),
    "curr_h_state": np.random.randn(2, 3).astype(np.float32),
    "action": np.array([0, 1], dtype=np.int64),
    "reward": np.array([1.0, 0.5], dtype=np.float32),
    "done": np.array([False, False], dtype=bool),
    "info": {},
    "next_obs": torch.randn(2, 4),
    "next_h_state": np.random.randn(2, 3).astype(np.float32),
}

METHOD = "update"

agent = RLAgent(**INIT_ARGS)
result = agent.update(**ARGS)
print("Update result:", result)

reset_result = agent.reset()
print("Reset result shape:", reset_result.shape)
print("Reset result dtype:", reset_result.dtype)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
str2tuple Ran
ran; our contract draft was wrong, not the code
utiasstars/lfgp/rl_sandbox/rl_sandbox/examples/lfgp/run_lfgp.py
code served (permissive licence) · get_code("77e4b3d5c145bd42")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# def str2tuple(v):
#     return tuple([item for item in v.split(',')] if v else [])
#
# The function takes a single parameter 'v' which should be a string.
# It splits the string by comma and returns a tuple of the items.
# If v is falsy (empty string, None, etc.), it returns an empty tuple.

# Test cases to consider:
# 1. Non-empty string with commas: "a,b,c" -> ("a", "b", "c")
# 2. Empty string: "" -> ()
# 3. String without commas: "single" -> ("single",)

ARGS = {
    "v": "apple,banana,cherry"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ACAgent Not yet run
unverified (harvested, no recorded run)
utiasstars/lfgp/rl_sandbox/rl_sandbox/agents/hrl_agents.py
code served (permissive licence) · get_code("a3689741d2b3ab90")
How it ran

no invocation recorded.

SACXAgent Not yet run
unverified (harvested, no recorded run)
utiasstars/lfgp/rl_sandbox/rl_sandbox/agents/hrl_agents.py
code served (permissive licence) · get_code("631da0136bd40912")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 5 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Effective exploration continues to be a significant challenge that prevents the deployment of reinforcement learning for many physical systems. This is particularly true for systems with continuous and high-dimensional state and action spaces, such as robotic manipulators. The challenge is accentuated in the sparse rewards setting, where the low-level state information required for the design of dense rewards is unavailable. Adversarial imitation learning (AIL) can partially overcome this barrier by leveraging expert-generated demonstrations of optimal behaviour and providing, essentially, a replacement for dense reward information. Unfortunately, the availability of expert demonstrations does not necessarily improve an agent's capability to explore effectively and, as we empirically show, can lead to inefficient or stagnated learning. We present Learning from Guided Play (LfGP), a framework in which we leverage expert demonstrations of, in addition to a main task, multiple auxiliary tasks. Subsequently, a hierarchical model is used to learn each task reward and policy through a modified AIL procedure, in which exploration of all tasks is enforced via a scheduler composing different tasks together. This affords many benefits: learning efficiency is improved for main tasks with challenging bottleneck transitions, expert data becomes reusable between tasks, and transfer learning through the reuse of learned auxiliary task models becomes possible. Our experimental results in a challenging multitask robotic manipulation domain indicate that our method compares favourably to supervised imitation learning and to a state-of-the-art AIL method. 1

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2112.08932")
get_code_for_paper("2112.08932")
have("2112.08932")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2112.08932.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2112.08932.svg)](https://syntology.ai/paper/2112.08932)

Connect an agent — have() is free.