SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2308.04836 · 2023

Beyond Surprise: Improving Exploration Through Surprise Novelty

arXiv · PDF · Open in the Atlas

Code that ran

5 of 5 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 0 have no contract verdict; 4 failures of our instrument; 0 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/2308.04836.json · badge: /api/ran/2308.04836.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
thaihungle/sm canonical (classifier label)
classifier basis: census
5 ran · 0 no recorded run
FunctionStatusWhere it lives
batched_index_select Ran
ran; our contract draft was wrong, not the code
thaihungle/sm/model.py
code served (permissive licence) · get_code("05b20074012b6168")
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 (2, 4, 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

torch.manual_seed(0)

# Analyze the function:
# - t: a tensor that needs .size(2) to work, and .gather(dim, dummy) method
# - dim: an integer dimension
# - inds: a tensor that needs .unsqueeze(2) and .expand() and .size(0), .size(1)
#
# The function expands inds to match t's third dimension, then gathers from t.
# For this to work:
# - inds should be 2D (batch_size, num_indices)
# - t should be 3D (batch_size, some_dim, feature_dim)
# - dim should be 1 (the dimension we're indexing into)

batch_size = 2
num_indices = 4
feature_dim = 3
t_middle_dim = 5

# Create tensor t with shape (batch_size, t_middle_dim, feature_dim)
t = torch.randn(batch_size, t_middle_dim, feature_dim)

# Create indices tensor with shape (batch_size, num_indices)
# Indices should be valid for dimension 1 of t (range 0 to t_middle_dim-1)
inds = torch.tensor([[0, 1, 2, 3], [4, 3, 2, 1]])

# dim should be 1 (the middle dimension we're gathering from)
dim = 1

ARGS = {
    "t": t,
    "dim": dim,
    "inds": inds,
}
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 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 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
init Ran
ran; our contract draft was wrong, not the code
thaihungle/sm/dist.py
pointer only (licence: MIT); the stored copy get_code serves, from ArnaudFickinger/adversarial-surprise, is pointer only (licence: NONE) · get_code("9de355e93051e4ad")
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 ArnaudFickinger/adversarial-surprise, 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.

make_train_data Ran
ran; our contract draft was wrong, not the code
thaihungle/sm/utils.py
code served (permissive licence) · get_code("14c30cad6d60b1b4")
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 2, dtype family float; 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 numpy as np

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

# Define parameters
num_worker = 2
num_step = 3
gamma = 0.99
lam = 0.95

# Create reward array: shape (num_worker, num_step)
reward = np.random.randn(num_worker, num_step).astype(np.float32)

# Create done array: shape (num_worker, num_step) with binary values
done = np.random.randint(0, 2, size=(num_worker, num_step)).astype(np.float32)

# Create value array: shape (num_worker, num_step + 1)
# The function accesses value[:, t+1] and value[:, :-1], so we need num_step+1 values
value = np.random.randn(num_worker, num_step + 1).astype(np.float32)

# Create args dictionary with required keys
args = {
    'UseGAE': True,
    'Lambda': lam,
    'TrainMethod': 'PPO'
}

# Construct ARGS dictionary with all function parameters
ARGS = {
    'reward': reward,
    'done': done,
    'value': value,
    'gamma': gamma,
    'num_step': num_step,
    'num_worker': num_worker,
    'args': args
}
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 tuple, ndim 2, dtype family float — 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
softmax Ran
ran, honoured the contract we drafted
thaihungle/sm/utils.py
code served (permissive licence) · get_code("011537d0bea7fe09")
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 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 numpy as np

# Create a small 2D numpy array (batch_size=2, features=4)
z = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [0.5, 1.5, 2.5, 3.5]
], dtype=np.float32)

ARGS = {
    "z": z
}
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 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
unwrap Ran
ran; our contract draft was wrong, not the code
thaihungle/sm/envs.py
code served (permissive licence) · get_code("f2e3732f89410bea")
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 SimpleEnv. 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.

class SimpleEnv:
    def __init__(self):
        pass

class WrappedEnvWithUnwrapped:
    def __init__(self, base_env):
        self.unwrapped = base_env

class WrappedEnvWithEnv:
    def __init__(self, base_env):
        self.env = base_env

class WrappedEnvWithLegEnv:
    def __init__(self, base_env):
        self.leg_env = base_env

# Create a simple base environment
base_env = SimpleEnv()

# Create test environments with different wrapping styles
env_with_unwrapped = WrappedEnvWithUnwrapped(base_env)

ARGS = {
    'env': env_with_unwrapped
}
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 SimpleEnv — a SimpleEnv output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleEnv 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 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 3 later) and 2 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
init 34 other papers
25 dated earlier, 9 later · 5 only as an assembly brick
1705.05363 (2017-05)
Curiosity-driven Exploration by Self-supervised Prediction
1706.02275 (2017-06)
Multi-Agent Actor-Critic for Mixed Cooperative-Competitive Environments
1810.12894 (2018-10)
Exploration by Random Network Distillation
and 31 more not named here
softmax 3 other papers
2 dated earlier, 1 later
1905.00641 (2019-05)
RetinaFace: Single-stage Dense Face Localisation in the Wild
2203.15565 (2022-03)
Killing Two Birds with One Stone: Efficient and Robust Training of Face Recognition CNNs by Partial FC
2401.09750 (2024-01)
Exploration and Anti-Exploration with Distributional Random Network Distillation
unwrap 2 other papers
1 dated earlier, 1 later
2104.07495 (2021-04)
Curiosity-Driven Exploration via Latent Bayesian Surprise
2401.09750 (2024-01)
Exploration and Anti-Exploration with Distributional Random Network Distillation

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 a new computing model for intrinsic rewards in reinforcement learning that addresses the limitations of existing surprise-driven explorations. The reward is the novelty of the surprise rather than the surprise norm. We estimate the surprise novelty as retrieval errors of a memory network wherein the memory stores and reconstructs surprises. Our surprise memory (SM) augments the capability of surprise-based intrinsic motivators, maintaining the agent's interest in exciting exploration while reducing unwanted attraction to unpredictable or noisy observations. Our experiments demonstrate that the SM combined with various surprise predictors exhibits efficient exploring behaviors and significantly boosts the final performance in sparse reward environments, including Noisy-TV, navigation and challenging Atari games.

For agents

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

get_harvested_code_for_paper("2308.04836")
get_code_for_paper("2308.04836")
have("2308.04836")

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

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

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

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

Connect an agent — have() is free.