SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.14111 · ICML · 2022

Goal Misgeneralization in Deep Reinforcement Learning

Laurent Orseau, David Krueger, Jacob Pfau, Lauro Langosco, Jack Koch, Lee Sharkey

arXiv · PDF · Open in the Atlas

Code that ran

12 of 13 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; 1 honoured the contract we drafted, 0 violated it and 10 have no contract verdict; 1 failure of our instrument; 1 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/2105.14111.json · badge: /api/ran/2105.14111.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
JacobPfau/procgenAISC canonical (classifier label)
classifier basis: census
1 ran · 1 no recorded run
UlisseMini/procgen-tools community (classifier label)
classifier basis not recorded on the link
11 ran · 0 no recorded run
FunctionStatusWhere it lives
expand_label Ran
ran on a synthesized input
UlisseMini/procgen-tools/procgen_tools/visualization.py
code served (permissive licence) · get_code("3a68bb67e2b41213")
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 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.

import torch

def expand_label(label: str):
    if not (label.startswith('fc_policy') or label.startswith('fc_value')):
        return 'embedder.' + label
    else:
        return label

ARGS = {
    'label': 'layer1'
}
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 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
format_label Ran
ran on a synthesized input
UlisseMini/procgen-tools/procgen_tools/visualization.py
code served (permissive licence) · get_code("49fc5a0c5b3337f9")
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 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.

import torch

torch.manual_seed(0)

ARGS = {
    'label': 'embedder.layer1.weight'
}
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 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
forward_func_policy Ran
ran on a synthesized input
UlisseMini/procgen-tools/procgen_tools/patch_utils.py
code served (permissive licence) · get_code("a521d8930f03ef18")
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, 2) 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 torch.nn as nn

torch.manual_seed(0)

class SimpleEmbedder(nn.Module):
    def __init__(self, input_dim=4, hidden_dim=3):
        super().__init__()
        self.linear = nn.Linear(input_dim, hidden_dim)
    
    def forward(self, x):
        return self.linear(x)

class PolicyNetwork(nn.Module):
    def __init__(self, hidden_dim=3, output_dim=2):
        super().__init__()
        self.embedder = SimpleEmbedder(input_dim=4, hidden_dim=hidden_dim)
        self.fc_policy = nn.Linear(hidden_dim, output_dim)
    
    def forward(self, x):
        hidden = self.embedder(x)
        return self.fc_policy(hidden)

network = PolicyNetwork(hidden_dim=3, output_dim=2)
inp = torch.randn(2, 4)

ARGS = {
    "network": network,
    "inp": inp
}
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, 2) — shape (2, 2) 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
get_grid Ran
ran on a synthesized input
UlisseMini/procgen-tools/procgen_tools/maze.py
code served (permissive licence) · get_code("febe99d83608894f")
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 2, dtype family int, shape (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 numpy as np
import typing

StateValues = typing.Dict[str, typing.Any]

class ValueWrapper:
    def __init__(self, val):
        self.val = val

# Create state_vals structure
world_dim = 3
num_elements = world_dim * world_dim

state_vals = {
    'world_dim': ValueWrapper(world_dim),
    'data': [
        {'i': ValueWrapper(i)} for i in range(num_elements)
    ]
}

ARGS = {
    'state_vals': state_vals
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (3, 3) — shape (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
get_mouse_pos_sv Ran
ran on a synthesized input
UlisseMini/procgen-tools/procgen_tools/maze.py
code served (permissive licence) · get_code("8f8384c14ae04dc0")
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 tuple, ndim 1, dtype family int; 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 typing

StateValues = typing.Dict[str, typing.Any]
Square = typing.Tuple[int, int]

# Create a small stand-in class for the entity values with a .val attribute
class EntityValue:
    def __init__(self, value):
        self.val = value

# Construct the state_vals dictionary
# The function accesses state_vals['ents'][0], which should be a dict
# containing 'y' and 'x' keys, each with objects that have a .val attribute
state_vals = {
    'ents': [
        {
            'y': EntityValue(5),
            'x': EntityValue(10)
        }
    ]
}

ARGS = {
    'state_vals': state_vals
}
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 tuple, ndim 1, dtype family int — 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
get_predict Ran
ran on a synthesized input
UlisseMini/procgen-tools/procgen_tools/rollout_utils.py
code served (permissive licence) · get_code("b60e3bcc13e8e7c0")
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 torch as t
import torch.nn as nn

t.manual_seed(0)

class SimplePolicy(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 8)
        self.dist_head = nn.Linear(8, 3)
        self.value_head = nn.Linear(8, 1)
    
    def forward(self, obs):
        hidden = t.relu(self.fc(obs))
        logits = self.dist_head(hidden)
        value = self.value_head(hidden)
        dist = t.distributions.Categorical(logits=logits)
        return dist, value

policy = SimplePolicy()

ARGS = {
    "plcy": policy
}
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 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
human_readable_action Ran
ran on a synthesized input
UlisseMini/procgen-tools/procgen_tools/models.py
code served (permissive licence) · get_code("aefe496050f5a799")
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 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.

import torch
import numpy as np

# Define ARGS dict with valid arguments for human_readable_action
ARGS = {
    'act': 0  # Valid action index in range [0, 14]
}

# Test with various valid action indices to verify the function works
# Valid indices: LEFT=[0,1,2], DOWN=[3], UP=[5], RIGHT=[6,7,8], NOOP=[4,9,10,11,12,13,14]
test_cases = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
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 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
lru_cache Ran
ran on a synthesized input
UlisseMini/procgen-tools/procgen_tools/maze.py
code served (permissive licence) · get_code("3257056e5d5a53de")
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 functools
import collections
import copy

def lru_cache(maxsize: int):

    def decorator(func):
        cache = collections.OrderedDict()

        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            key = (args, tuple(kwargs.items()))
            try:
                value = cache.pop(key)
            except KeyError:
                value = func(*args, **kwargs)
            cache[key] = value
            if len(cache) > maxsize:
                cache.popitem(last=False)
            return copy.deepcopy(value)
        return wrapper
    return decorator


# Test the decorator by creating a simple cached function
@lru_cache(maxsize=3)
def add(a, b):
    return a + b


# Verify it works
result1 = add(1, 2)
result2 = add(1, 2)
result3 = add(2, 3)


ARGS = {
    "maxsize": 3
}
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
orthogonal_init Ran
ran on a synthesized input
UlisseMini/procgen-tools/procgen_tools/models.py
code served (permissive licence) · get_code("91b1e1870bc40fd3")
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 Linear. 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)

# Create a Linear module for testing
linear_module = nn.Linear(in_features=4, out_features=3)

# Create a Conv2d module for testing
conv2d_module = nn.Conv2d(in_channels=2, out_channels=3, kernel_size=3)

# Calculate gain for relu activation
gain_value = nn.init.calculate_gain('relu')

# Test with Linear module
ARGS = {
    'module': linear_module,
    'gain': gain_value
}
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 Linear — a Linear output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Linear 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
run Ran
ran; our contract draft was wrong, not the code
JacobPfau/procgenAISC/procgen/build.py
code served (permissive licence) · get_code("1067e655bdab66ee")
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 CompletedProcess. 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 subprocess as sp

def run(cmd):
    return sp.run(cmd, stdout=sp.PIPE, stderr=sp.STDOUT, encoding='utf8')

# The function takes a single parameter 'cmd' which should be a command to run
# It can be a string or a list of strings (as accepted by subprocess.run)
# Let's create a simple, valid command that will succeed

ARGS = {
    'cmd': ['echo', 'hello world']
}
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 CompletedProcess — a CompletedProcess output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a CompletedProcess 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
update_mean_var_count_from_moments Ran
ran, honoured the contract we drafted
UlisseMini/procgen-tools/procgen_tools/procgen_wrappers.py
pointer only (licence: MIT); the stored copy get_code serves, from joonleesky/train-procgen-pytorch, is pointer only (licence: NONE) · get_code("3ebb420a5d10cc64")
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 joonleesky/train-procgen-pytorch, 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.

xavier_uniform_init Ran
ran on a synthesized input
UlisseMini/procgen-tools/procgen_tools/models.py
code served (permissive licence) · get_code("c71774582015fd4b")
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 Linear. 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)

# Create a simple Linear module to test the function
linear_module = nn.Linear(in_features=4, out_features=3, bias=True)

# Create a simple Conv2d module to test the function
conv_module = nn.Conv2d(in_channels=2, out_channels=3, kernel_size=3, bias=True)

# Test with Linear module
ARGS = {
    "module": linear_module,
    "gain": 1.0
}
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 Linear — a Linear output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Linear 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
get_var Not yet run
unverified (harvested, no recorded run)
JacobPfau/procgenAISC/procgen-build/procgen_build/build_package.py
pointer only (licence: MIT) · get_code("fa2053a8568916ec")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, JacobPfau/procgenAISC, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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. No invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 4 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 9 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
update_mean_var_count_from_moments 8 other papers
3 dated earlier, 1 the same month, 4 later · 1 only as an assembly brick
1901.09184 (2019-01)
Action Robust Reinforcement Learning and Applications in Continuous Control
1912.01588 (2019-12)
Leveraging Procedural Generation to Benchmark Reinforcement Learning
2006.14171 (2020-06)
A Closer Look at Invalid Action Masking in Policy Gradient Algorithms
and 5 more not named here
run 3 other papers
1 dated earlier, 2 later
1912.01588 (2019-12)
Leveraging Procedural Generation to Benchmark Reinforcement Learning
2411.03008 (2024-11)
Hierarchical Orchestra of Policies
2605.10546 (2026-05)
Higher Resolution, Better Generalization: Unlocking Visual Scaling in Deep Reinforcement Learning
get_var 1 other paper
1 dated earlier
1912.01588 (2019-12)
Leveraging Procedural Generation to Benchmark Reinforcement Learning
xavier_uniform_init 1 other paper
1 later
2210.07241 (2022-10)
Visual Reinforcement Learning with Self-Supervised 3D Representations

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

We study goal misgeneralization, a type of outof-distribution generalization failure in reinforcement learning (RL). Goal misgeneralization occurs when an RL agent retains its capabilities outof-distribution yet pursues the wrong goal. For instance, an agent might continue to competently avoid obstacles, but navigate to the wrong place. In contrast, previous works have typically focused on capability generalization failures, where an agent fails to do anything sensible at test time. We formalize this distinction between capability and goal generalization, provide the first empirical demonstrations of goal misgeneralization, and present a partial characterization of its causes.

For agents

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

get_harvested_code_for_paper("2105.14111")
get_code_for_paper("2105.14111")
have("2105.14111")

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

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

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

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

Connect an agent — have() is free.