SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.00120 · 2024

Reward Machines for Deep RL in Noisy and Uncertain Environments

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 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 0 have no contract verdict; 3 failures 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/2406.00120.json · badge: /api/ran/2406.00120.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
andrewli77/reward-machines-noisy-environments canonical (classifier label)
classifier basis: census
4 ran · 2 no recorded run
FunctionStatusWhere it lives
evaluate_dnf Ran
ran, violated the contract we drafted
andrewli77/reward-machines-noisy-environments/src/reward_machines/reward_machine_utils.py
code served (permissive licence) · get_code("c7ccf6940026d778")
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 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 torch

# Set seed for reproducibility
torch.manual_seed(0)

# The function evaluate_dnf takes two parameters:
# 1. formula: a string representing a DNF (Disjunctive Normal Form) logical formula
# 2. true_props: a string or collection of proposition names that are true

# Example 1: Simple case with AND
formula_1 = "a&b"
true_props_1 = "ab"

# Example 2: Case with OR
formula_2 = "a|b"
true_props_2 = "a"

# Example 3: Case with NOT
formula_3 = "!c&d"
true_props_3 = "d"

# Example 4: Complex formula from docstring
formula_4 = "a&b|!c&d"
true_props_4 = "d"

# Example 5: With True/False literals
formula_5 = "True&a"
true_props_5 = "a"

# Example 6: Simple proposition
formula_6 = "x"
true_props_6 = "x"

# Use one of these for testing
ARGS = {
    "formula": "a&b|!c&d",
    "true_props": "d"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — 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
fc Ran
ran; our contract draft was wrong, not the code
andrewli77/reward-machines-noisy-environments/src/policy_network.py
code served (permissive licence) · get_code("08eabb75de3ea8cc")
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 Sequential. 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

torch.manual_seed(0)

ARGS = {
    "in_dim": 4,
    "out_dim": 3,
    "activation": nn.Tanh()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
possible_true_propositions Ran
ran; our contract draft was wrong, not the code
andrewli77/reward-machines-noisy-environments/src/torch_ac/belief.py
code served (permissive licence) · get_code("8ecbbfbc94998d2d")
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 filter. 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 itertools
from typing import Dict, Iterable, Tuple

def _propositions_probability(s: str, probs: Dict[str, float]) -> float:
    ret = 1.0
    for proposition in probs:
        if proposition in s:
            ret *= probs[proposition]
        else:
            ret *= 1 - probs[proposition]
    return ret

def possible_true_propositions(probs: Dict[str, float]) -> Iterable[Tuple[str, float]]:
    """
    Outputs: Truth assignments (str) and its corresponding probability
    """
    full = itertools.product(*(['', p] for p in probs.keys()))
    full = map(lambda xs: str.join('', xs), full)
    full = ((s, _propositions_probability(s, probs)) for s in full)
    return filter(lambda sp: sp[1] > 0.0, full)


ARGS = {
    "probs": {
        "A": 0.7,
        "B": 0.3,
        "C": 0.5
    }
}
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 filter — a filter output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a filter 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
threshold_rm_beliefs Ran
ran; our contract draft was wrong, not the code
andrewli77/reward-machines-noisy-environments/src/torch_ac/belief.py
code served (permissive licence) · get_code("f9ef1a9ba62a26bc")
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 2, dtype family float, shape (2, 4) 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

torch.manual_seed(0)

# Create a small tensor with shape [N, num_rm_states]
# N=2 (batch size), num_rm_states=4
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
getEnvModel Not yet run
unverified (harvested, no recorded run)
andrewli77/reward-machines-noisy-environments/src/env_model.py
code served (permissive licence) · get_code("5b5d3c0eb71a3aa2")
How it ran

no invocation recorded.

value_iteration Not yet run
unverified (harvested, no recorded run)
andrewli77/reward-machines-noisy-environments/src/reward_machines/reward_machine_utils.py
code served (permissive licence) · get_code("f1e0170748710dcd")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 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 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.

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

Reward Machines provide an automaton-inspired structure for specifying instructions, safety constraints, and other temporally extended reward-worthy behaviour. By exposing the underlying structure of a reward function, they enable the decomposition of an RL task, leading to impressive gains in sample efficiency. Although Reward Machines and similar formal specifications have a rich history of application towards sequential decision-making problems, they critically rely on a ground-truth interpretation of the domain-specific vocabulary that forms the building blocks of the reward function--such ground-truth interpretations are elusive in the real world due in part to partial observability and noisy sensing. In this work, we explore the use of Reward Machines for Deep RL in noisy and uncertain environments. We characterize this problem as a POMDP and propose a suite of RL algorithms that exploit task structure under uncertain interpretation of the domain-specific vocabulary. Through theory and experiments, we expose pitfalls in naive approaches to this problem while simultaneously demonstrating how task structure can be successfully leveraged under noisy interpretations of the vocabulary.

For agents

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

get_harvested_code_for_paper("2406.00120")
get_code_for_paper("2406.00120")
have("2406.00120")

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

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

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

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

Connect an agent — have() is free.