SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.02097 · NeurIPS · 2021

A Consciousness-Inspired Planning Agent for Model-Based Reinforcement Learning

Yoshua Bengio, Doina Precup, Sitao Luan, Mingde Zhao, Zhen Liu, Shuyuan Zhang

arXiv · PDF · Open in the Atlas

Code that ran

4 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 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; 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/2106.02097.json · badge: /api/ran/2106.02097.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
PwnerHarry/CP community
Papers with Code archive
4 ran · 3 no recorded run
FunctionStatusWhere it lives
MultiHeadAttention Ran
ran on a synthesized input · constructed an object; no result was computed
PwnerHarry/CP/components_CP.py
code served (permissive licence) · get_code("16c1cdf7d8a36c9a")
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 an instance of its own class, MultiHeadAttention: the run constructed the object and did not call it, so no result was computed. 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 tensorflow as tf
import numpy as np

# Set seeds for reproducibility
np.random.seed(0)
tf.random.set_seed(0)

# Define ARGS dict with all parameters for MultiHeadAttention
ARGS = {
    'len_object': 8,
    'num_heads': 2,
    'QKV_depth': 1,
    'QKV_width': 256,
    'top_k': np.inf
}

# Create a small test instance to verify the setup works
mha = tf.keras.layers.Layer.__new__(type('MultiHeadAttention', (tf.keras.layers.Layer,), {}))

# Build sample tensors for calling the layer
batch_size = 2
seq_len = 4
depth = 8

# Create dummy input tensors
v = tf.random.normal((batch_size, seq_len, depth))
k = tf.random.normal((batch_size, seq_len, depth))
q = tf.random.normal((batch_size, seq_len, depth))

# These tensors can be used to test the MultiHeadAttention layer
test_tensors = {
    'v': v,
    'k': k,
    'q': q
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MultiHeadAttention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MultiHeadAttention 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
SUBLAYER_TRANSFORMER_ACTION Ran
ran on a synthesized input · constructed an object; no result was computed
PwnerHarry/CP/components_CP.py
code served (permissive licence) · get_code("2ba23d13544a5585")
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 an instance of its own class, SUBLAYER_TRANSFORMER_ACTION: the run constructed the object and did not call it, so no result was computed. 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 tensorflow as tf

# Create the layer class
class SUBLAYER_TRANSFORMER_ACTION(tf.keras.layers.Layer):

    def __init__(self, len_object=64, num_layers=2, width=64, residual=True, norm=False):
        super(SUBLAYER_TRANSFORMER_ACTION, self).__init__(name='sublayer_FC_with_action')
        self.residual, self.norm = (residual, norm)
        if self.norm:
            self.layernorm = tf.keras.layers.LayerNormalization(axis=-1)
        if num_layers == 1:
            self.fc = tf.keras.layers.Conv1D(len_object, kernel_size=1, strides=1)
        else:
            self.fc = tf.keras.models.Sequential()
            for num_layer in range(num_layers):
                if num_layer < num_layers - 1:
                    self.fc.add(tf.keras.layers.Conv1D(width, kernel_size=1, strides=1, activation='relu'))
                else:
                    self.fc.add(tf.keras.layers.Conv1D(len_object, kernel_size=1, strides=1))

    @tf.function
    def __call__(self, objects_in, action):
        increment = self.fc(tf.concat([tf.repeat(tf.expand_dims(action, 1), objects_in.shape[1], axis=1), objects_in], axis=-1))
        objects_out = objects_in + increment if self.residual else increment
        return self.layernorm(objects_out) if self.norm else objects_out

# Create test tensors
# objects_in: shape (batch_size=2, num_objects=3, object_dim=4)
objects_in = tf.constant([
    [[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0], [9.0, 10.0, 11.0, 12.0]],
    [[13.0, 14.0, 15.0, 16.0], [17.0, 18.0, 19.0, 20.0], [21.0, 22.0, 23.0, 24.0]]
])

# action: shape (batch_size=2, action_dim=5)
action = tf.constant([
    [1.0, 2.0, 3.0, 4.0, 5.0],
    [6.0, 7.0, 8.0, 9.0, 10.0]
])

ARGS = {
    'len_object': 64,
    'num_layers': 2,
    'width': 64,
    'residual': True,
    'norm': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SUBLAYER_TRANSFORMER_ACTION — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SUBLAYER_TRANSFORMER_ACTION 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
SUBLAYER_TRANSFORMER_FC Ran
ran on a synthesized input · constructed an object; no result was computed
PwnerHarry/CP/components_CP.py
code served (permissive licence) · get_code("8ef8755750a2c4f2")
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 an instance of its own class, SUBLAYER_TRANSFORMER_FC: the run constructed the object and did not call it, so no result was computed. 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 tensorflow as tf
import numpy as np

# Define the SUBLAYER_TRANSFORMER_FC class
class SUBLAYER_TRANSFORMER_FC(tf.keras.layers.Layer):

    def __init__(self, len_object=64, num_layers=2, width=64, residual=True, norm=False):
        super(SUBLAYER_TRANSFORMER_FC, self).__init__(name='sublayer_FC')
        self.residual, self.norm = (residual, norm)
        if self.norm:
            self.layernorm = tf.keras.layers.LayerNormalization(axis=-1)
        if num_layers == 1:
            self.fc = tf.keras.layers.Conv1D(len_object, kernel_size=1, strides=1)
        else:
            self.fc = tf.keras.models.Sequential()
            for layer in range(num_layers):
                if layer < num_layers - 1:
                    self.fc.add(tf.keras.layers.Conv1D(width, kernel_size=1, strides=1, activation='relu'))
                else:
                    self.fc.add(tf.keras.layers.Conv1D(len_object, kernel_size=1, strides=1))

    @tf.function
    def __call__(self, objects_in):
        increment = self.fc(objects_in)
        objects_out = objects_in + increment if self.residual else increment
        return self.layernorm(objects_out) if self.norm else objects_out


# Create input tensor: batch_size=2, sequence_length=3, features=4
objects_in = tf.constant(np.random.randn(2, 3, 4).astype(np.float32))

# Define ARGS dictionary with all parameters
ARGS = {
    'len_object': 4,
    'num_layers': 2,
    'width': 8,
    'residual': True,
    'norm': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SUBLAYER_TRANSFORMER_FC — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SUBLAYER_TRANSFORMER_FC 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
scaled_dot_product_attention Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
PwnerHarry/CP/components_CP.py
code served (permissive licence) · get_code("cd1c640990b1df7e")
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. 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 tensorflow as tf
import numpy as np

# Set seeds for reproducibility
np.random.seed(0)
tf.random.set_seed(0)

# Create small tensors for scaled_dot_product_attention
batch_size = 2
num_heads = 2
seq_len_q = 3
seq_len_k = 4
seq_len_v = 4
depth = 5
depth_v = 6

# q: (..., seq_len_q, depth)
q = tf.random.normal([batch_size, num_heads, seq_len_q, depth], dtype=tf.float32)

# k: (..., seq_len_k, depth)
k = tf.random.normal([batch_size, num_heads, seq_len_k, depth], dtype=tf.float32)

# v: (..., seq_len_v, depth_v)
v = tf.random.normal([batch_size, num_heads, seq_len_v, depth_v], dtype=tf.float32)

# top_k parameter
top_k = np.inf

ARGS = {
    "q": q,
    "k": k,
    "v": v,
    "top_k": top_k,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — 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: none by the harness; any seed is in the setup block
COMPRESSOR_SET Not yet run
unverified (harvested, no recorded run)
PwnerHarry/CP/components_CP.py
code served (permissive licence) · get_code("188def752b40547d")
How it ran

no invocation recorded.

SUBLAYER_TRANSFORMER_MHA Not yet run
unverified (harvested, no recorded run)
PwnerHarry/CP/components_CP.py
code served (permissive licence) · get_code("930c477c45a18563")
How it ran

no invocation recorded.

TRANSFORMER_AUGMENTED Not yet run
unverified (harvested, no recorded run)
PwnerHarry/CP/components_CP.py
code served (permissive licence) · get_code("e3dd893cf9205b0e")
How it ran

no invocation recorded.

Also present in other papers' code

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

We present an end-to-end, model-based deep reinforcement learning agent which dynamically attends to relevant parts of its state during planning. The agent uses a bottleneck mechanism over a set-based representation to force the number of entities to which the agent attends at each planning step to be small. In experiments, we investigate the bottleneck mechanism with several sets of customized environments featuring different challenges. We consistently observe that the design allows the planning agents to generalize their learned task-solving abilities in compatible unseen environments by attending to the relevant objects, leading to better out-of-distribution generalization performance.

For agents

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

get_harvested_code_for_paper("2106.02097")
get_code_for_paper("2106.02097")
have("2106.02097")

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

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

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

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

Connect an agent — have() is free.