SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.05150 · NeurIPS · 2022

DHRL: A Graph-Based Approach for Long-Horizon and Sparse Hierarchical Reinforcement Learning

H Kim, Seungjae Lee, Jigang Kim, Inkyu Jang

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 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, 1 violated it and 2 have no contract verdict; 3 failures of our instrument; 3 no recorded run), measured 2026-11-22; 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/2210.05150.json · badge: /api/ran/2210.05150.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
jaylee0301/dhrl_official community
Papers with Code archive
6 ran · 3 no recorded run
FunctionStatusWhere it lives
GraphPlanner Ran
ran on a synthesized input
jaylee0301/dhrl_official/DHRL/rl/algo/dhrl.py
code served (permissive licence) · get_code("dd128626eca02364")
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 tuple. 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
from types import SimpleNamespace

# Mock environment
class MockEnv:
    def __init__(self):
        self.observation_space = SimpleNamespace(shape=(10,))
        self.action_space = SimpleNamespace(shape=(4,))

# Mock low-level agent
class MockLowAgent:
    def _get_dist_from_start(self, start_state, landmarks):
        # Returns distances from start_state to each landmark
        n_landmarks = landmarks.shape[0]
        return np.random.uniform(0, 50, n_landmarks)
    
    def _get_pairwise_dist(self, states, landmarks):
        # Returns pairwise distances between states
        n = states.shape[0]
        return np.random.uniform(5, 30, (n, n))
    
    def _get_dist_to_goal(self, states, goal):
        # Returns distances from each state to goal
        n = states.shape[0]
        return np.random.uniform(0, 50, n)
    
    def _get_point_to_point(self, start, goal):
        # Returns distance from start to goal
        return np.array([np.random.uniform(0, 50)])

# Mock replay buffer
class MockLowReplay:
    def __init__(self):
        self.n_samples = 100
        self.ob_dim = 10
        self.ag_dim = 6
    
    def sample_regular_batch(self, batch_size):
        return {
            'ob': np.random.randn(batch_size, self.ob_dim),
            'ag': np.random.randn(batch_size, self.ag_dim)
        }

# Create args
args = SimpleNamespace(
    subgoal_dim=6,
    cutoff=25.0,
    initial_sample=50,
    seed=42,
    n_graph_node=10,
    use_oracle_G=False,
    low_bound_epsilon=10.0
)

# Create mock objects
low_replay = MockLowReplay()
low_agent = MockLowAgent()
env = MockEnv()

INIT_ARGS = {
    'args': args,
    'low_replay': low_replay,
    'low_agent': low_agent,
    'env': env
}

# The main computation method is graph_construct
METHOD = 'graph_construct'

ARGS = {
    'iter': 0
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
networkx, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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)
Timer Ran
ran on a synthesized input
jaylee0301/dhrl_official/DHRL/rl/algo/dhrl.py
code served (permissive licence) · get_code("e0a70a9d3e815dfb")
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 NoneType. 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 time

class Timer:

    def __init__(self, stdout=False):
        self._start_times = dict()
        self.timing_dict = dict()
        self._stdout = stdout

    def clear(self):
        self._start_times = dict()
        self.timing_dict = dict()

    def start(self, name):
        self._start_times[name] = self.current_time
        if self._stdout:
            print('Staring', name, '...')

    def end(self, name):
        assert name in self._start_times
        self.timing_dict[name] = self.current_time - self._start_times[name]
        if self._stdout:
            print('Ending', name, '...')

    def get_time(self, name):
        assert name in self.timing_dict
        return self.timing_dict[name]

    @property
    def current_time(self):
        return time.time()


INIT_ARGS = {
    'stdout': True
}

ARGS = {
    'name': 'test_operation'
}

METHOD = 'start'

if __name__ == '__main__':
    timer = Timer(**INIT_ARGS)
    timer.start(**ARGS)
    time.sleep(0.01)
    timer.end(ARGS['name'])
    elapsed = timer.get_time(ARGS['name'])
    print(f"Elapsed time: {elapsed:.4f} seconds")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type NoneType — a NoneType output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NoneType 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)
colorize Ran
ran; our contract draft was wrong, not the code
jaylee0301/dhrl_official/DHRL/rl/algo/dhrl.py
code served (permissive licence) · get_code("ef68ec24f19edb58")
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 str. 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.

color2num = dict(gray=30, red=31, green=32, yellow=33, blue=34, magenta=35, cyan=36, white=37, crimson=38)

def colorize(string, color, bold=False, highlight=False):
    attr = []
    num = color2num[color]
    if highlight:
        num += 10
    attr.append(str(num))
    if bold:
        attr.append('1')
    return '\x1b[%sm%s\x1b[0m' % (';'.join(attr), string)


ARGS = {
    'string': 'Hello World',
    'color': 'green',
    'bold': True,
    'highlight': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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: none by the harness; any seed is in the setup block
convert_json Ran
ran; our contract draft was wrong, not the code
jaylee0301/dhrl_official/DHRL/rl/algo/dhrl.py
code served (permissive licence) · get_code("fbc505a5dac82646")
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 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 json

torch.manual_seed(0)

# Test case 1: JSON-serializable object (int)
obj1 = 42

# Test case 2: dict with nested structures
obj2 = {
    "name": "test",
    "values": [1, 2, 3],
    "nested": {"key": "value"}
}

# Test case 3: tuple
obj3 = (1, 2, "three")

# Test case 4: list with mixed types
obj4 = [1, "two", 3.14, True, None]

# Test case 5: object with __name__ attribute (function)
def my_function():
    pass
obj5 = my_function

# Test case 6: object with __dict__ (custom class instance)
class CustomClass:
    def __init__(self):
        self.attr1 = "value1"
        self.attr2 = 42

obj6 = CustomClass()

# Test case 7: tensor (not JSON serializable)
obj7 = torch.tensor([1.0, 2.0, 3.0, 4.0])

# Test case 8: complex nested structure
obj8 = {
    "tensors": [torch.randn(2, 4)],
    "objects": [CustomClass()],
    "functions": [my_function],
    "primitives": [1, "two", 3.14]
}

# Test case 9: lambda function (should convert to string)
obj9 = lambda x: x + 1

# Test case 10: empty dict
obj10 = {}

ARGS = {
    "obj": obj8
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
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: none by the harness; any seed is in the setup block
is_json_serializable Ran
ran, violated the contract we drafted
jaylee0301/dhrl_official/DHRL/rl/algo/dhrl.py
code served (permissive licence) · get_code("9ca8b8e45f7fbebf")
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 bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 json

def is_json_serializable(v):
    try:
        json.dumps(v)
        return True
    except:
        return False

# Test with various values
ARGS = {
    "v": {"key": "value", "number": 42, "list": [1, 2, 3]}
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
merge_configs Ran
ran; our contract draft was wrong, not the code
jaylee0301/dhrl_official/DHRL/rl/algo/dhrl.py
code served (permissive licence) · get_code("4b9723d766ef342e")
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 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 numpy as np

torch.manual_seed(0)

# Construct list_of_configs - a list of dictionaries to merge
config1 = {
    "learning_rate": 0.001,
    "batch_size": 32,
    "model_type": "transformer"
}

config2 = {
    "num_epochs": 10,
    "dropout": 0.1,
    "hidden_dim": 256
}

config3 = {
    "activation": "relu",
    "optimizer": "adam",
    "batch_size": 64  # This will override config1's batch_size
}

list_of_configs = [config1, config2, config3]

ARGS = {
    "list_of_configs": list_of_configs
}
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 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: none by the harness; any seed is in the setup block
Algo Not yet run
unverified (harvested, no recorded run)
jaylee0301/dhrl_official/DHRL/rl/algo/dhrl.py
code served (permissive licence) · get_code("454307937b4cc107")
How it ran

no invocation recorded.

BaseAlgo Not yet run
unverified (harvested, no recorded run)
jaylee0301/dhrl_official/DHRL/rl/algo/dhrl.py
code served (permissive licence) · get_code("42587b805883825a")
How it ran

no invocation recorded.

log_config Not yet run
unverified (harvested, no recorded run)
jaylee0301/dhrl_official/DHRL/rl/algo/dhrl.py
code served (permissive licence) · get_code("18ae1937cf28cca2")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 3 later) and 6 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.

FunctionAlso present inEarliest-datedOthers named
colorize
brick of this paper's assembly: helper
17 other papers
5 dated earlier, 1 the same month, 11 later
1802.09477 (2018-02)
Addressing Function Approximation Error in Actor-Critic Methods
1909.12255 (2019-09)
Harnessing Structures for Value-Based Planning and Reinforcement Learning
2006.07442 (2020-06)
Self-Imitation Learning via Generalized Lower Bound Q-learning
and 14 more not named here
is_json_serializable
brick of this paper's assembly: helper
9 other papers
4 dated earlier, 5 later
1802.09477 (2018-02)
Addressing Function Approximation Error in Actor-Critic Methods
2006.07442 (2020-06)
Self-Imitation Learning via Generalized Lower Bound Q-learning
2106.09110 (2021-06)
Safe Reinforcement Learning Using Advantage-Based Intervention
and 6 more not named here
convert_json
brick of this paper's assembly: helper
7 other papers
4 dated earlier, 3 later
1802.09477 (2018-02)
Addressing Function Approximation Error in Actor-Critic Methods
2006.07442 (2020-06)
Self-Imitation Learning via Generalized Lower Bound Q-learning
2106.09110 (2021-06)
Safe Reinforcement Learning Using Advantage-Based Intervention
and 4 more not named here

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-22.

Repositories linked to this paper

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

Abstract

Hierarchical Reinforcement Learning (HRL) has made notable progress in complex control tasks by leveraging temporal abstraction. However, previous HRL algorithms often suffer from serious data inefficiency as environments get large. The extended components, i.e., goal space and length of episodes, impose a burden on either one or both high-level and low-level policies since both levels share the total horizon of the episode. In this paper, we present a method of Decoupling Horizons Using a Graph in Hierarchical Reinforcement Learning (DHRL) which can alleviate this problem by decoupling the horizons of high-level and low-level policies and bridging the gap between the length of both horizons using a graph. DHRL provides a freely stretchable high-level action interval, which facilitates longer temporal abstraction and faster training in complex tasks. Our method outperforms state-of-the-art HRL algorithms in typical HRL environments. Moreover, DHRL achieves long and complex locomotion and manipulation tasks.

For agents

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

get_harvested_code_for_paper("2210.05150")
get_code_for_paper("2210.05150")
have("2210.05150")

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

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

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

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

Connect an agent — have() is free.