SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2107.03961 · 2021

Computational Benefits of Intermediate Rewards for Goal-Reaching Policy Learning

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 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 3 have no contract verdict; 1 failure of our instrument; 0 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/2107.03961.json · badge: /api/ran/2107.03961.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
kebaek/minigrid canonical (classifier label)
classifier basis: census
4 ran · 0 no recorded run
FunctionStatusWhere it lives
downsample Ran
ran on a synthesized input
kebaek/minigrid/gym-minigrid/gym_minigrid/rendering.py
code served (permissive licence) · get_code("59df34732c3e3418")
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, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (4, 3, 3) 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 torch
import numpy as np

torch.manual_seed(0)

# Create a small image tensor
# The function expects shape [height, width, 3] for RGB image
# Using dimensions that are divisible by a reasonable downsampling factor
img = torch.randint(0, 256, (8, 6, 3), dtype=torch.float32)

# Downsampling factor - must divide both height and width evenly
factor = 2

ARGS = {
    "img": img,
    "factor": factor
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (4, 3, 3) — shape (4, 3, 3) 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
fill_coords Ran
ran on a synthesized input
kebaek/minigrid/gym-minigrid/gym_minigrid/rendering.py
code served (permissive licence) · get_code("bd9c272b32f75522")
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, through the batch API) and returned ndarray, ndim 3, dtype family int, shape (4, 3, 3) 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 torch
import numpy as np

torch.manual_seed(0)

# Create a small image as a numpy array (height=4, width=3)
img = np.zeros((4, 3, 3), dtype=np.uint8)  # 4x3 image with 3 color channels

# Define a filter function that takes normalized coordinates (xf, yf)
# and returns True if the pixel should be filled
def filter_fn(xf, yf):
    # Simple filter: fill pixels in the left half of the image
    return xf < 0.5

# Define a color to fill with
color = np.array([255, 0, 0], dtype=np.uint8)  # Red

ARGS = {
    "img": img,
    "fn": filter_fn,
    "color": color
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (4, 3, 3) — shape (4, 3, 3) 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
reject_next_to Ran
ran; our contract draft was wrong, not the code
kebaek/minigrid/gym-minigrid/gym_minigrid/roomgrid.py
pointer only (licence: MIT); the stored copy get_code serves, from stanfordvl/mini_behavior, is pointer only (licence: NONE) · get_code("beb7d468d5185af5")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from stanfordvl/mini_behavior, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

rotate_fn Ran
ran on a synthesized input
kebaek/minigrid/gym-minigrid/gym_minigrid/rendering.py
code served (permissive licence) · get_code("8990d1cc61cec299")
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, through the batch API) and returned function. 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 math

def simple_fn(x, y):
    """A simple stand-in function that takes x, y coordinates and returns a value."""
    return x + y

ARGS = {
    "fin": simple_fn,
    "cx": 5.0,
    "cy": 3.0,
    "theta": math.pi / 4
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 later) and 0 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
reject_next_to 5 other papers
5 later
2109.12243 (2021-09)
Systematic Generalization on gSCAN: What is Nearly Solved and What is Next?
2205.11184 (2022-05)
An Evaluation Study of Intrinsic Motivation Techniques applied to Reinforcement Learning over Hard Exploration Environments
2207.00429 (2022-07)
Modular Lifelong Reinforcement Learning via Neural Composition
and 2 more not named here
downsample 4 other papers
4 later
2110.09461 (2021-10)
In a Nutshell, the Human Asked for This: Latent Goals for Following Temporal Specifications
2205.11184 (2022-05)
An Evaluation Study of Intrinsic Motivation Techniques applied to Reinforcement Learning over Hard Exploration Environments
2207.00429 (2022-07)
Modular Lifelong Reinforcement Learning via Neural Composition
and 1 more not named here
fill_coords 4 other papers
4 later
2110.09461 (2021-10)
In a Nutshell, the Human Asked for This: Latent Goals for Following Temporal Specifications
2205.11184 (2022-05)
An Evaluation Study of Intrinsic Motivation Techniques applied to Reinforcement Learning over Hard Exploration Environments
2207.00429 (2022-07)
Modular Lifelong Reinforcement Learning via Neural Composition
and 1 more not named here
rotate_fn 4 other papers
4 later
2110.09461 (2021-10)
In a Nutshell, the Human Asked for This: Latent Goals for Following Temporal Specifications
2205.11184 (2022-05)
An Evaluation Study of Intrinsic Motivation Techniques applied to Reinforcement Learning over Hard Exploration Environments
2207.00429 (2022-07)
Modular Lifelong Reinforcement Learning via Neural Composition
and 1 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-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

Many goal-reaching reinforcement learning (RL) tasks have empirically verified that rewarding the agent on subgoals improves convergence speed and practical performance. We attempt to provide a theoretical framework to quantify the computational benefits of rewarding the completion of subgoals, in terms of the number of synchronous value iterations. In particular, we consider subgoals as one-way {\em intermediate states}, which can only be visited once per episode and propose two settings that consider these one-way intermediate states: the one-way single-path (OWSP) and the one-way multi-path (OWMP) settings. In both OWSP and OWMP settings, we demonstrate that adding {\em intermediate rewards} to subgoals is more computationally efficient than only rewarding the agent once it completes the goal of reaching a terminal state. We also reveal a trade-off between computational complexity and the pursuit of the shortest path in the OWMP setting: adding intermediate rewards significantly reduces the computational complexity of reaching the goal but the agent may not find the shortest path, whereas with sparse terminal rewards, the agent finds the shortest path at a significantly higher computational cost. We also corroborate our theoretical results with extensive experiments on the MiniGrid environments using Q-learning and some popular deep RL algorithms.

For agents

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

get_harvested_code_for_paper("2107.03961")
get_code_for_paper("2107.03961")
have("2107.03961")

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

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

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

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

Connect an agent — have() is free.