SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.07096 · ICML · 2025

Rejecting Hallucinated State Targets during Planning

Yoshua Bengio, Doina Precup, Tristan Sylvain, Romain Laroche, Mingde Harry, Zhao

arXiv · PDF · Open in the Atlas

Code that ran

3 of 3 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 1 has no contract verdict; 1 failure of our instrument; 0 no recorded run), measured 2026-11-22; 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/2410.07096.json · badge: /api/ran/2410.07096.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
mila-iqia/delusions canonical (classifier label)
classifier basis: census
3 ran · 0 no recorded run
FunctionStatusWhere it lives
bottlenecked_multi_head_attention_forward Ran
ran on a synthesized input
mila-iqia/delusions/experiments/Dyna/modules.py
code served (permissive licence) · get_code("b5fc0e5a8acc1363")
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 torch
import torch.nn as nn

torch.manual_seed(0)

# Set up basic dimensions
batch_size = 2
seq_len_query = 3
seq_len_key = 4
embed_dim = 8
num_heads = 2
head_dim = embed_dim // num_heads

# Create input tensors
query = torch.randn(seq_len_query, batch_size, embed_dim)
key = torch.randn(seq_len_key, batch_size, embed_dim)
value = torch.randn(seq_len_key, batch_size, embed_dim)

# Create projection weights
in_proj_weight = torch.randn(3 * embed_dim, embed_dim)
in_proj_bias = torch.randn(3 * embed_dim)

# Output projection weights
out_proj_weight = torch.randn(embed_dim, embed_dim)
out_proj_bias = torch.randn(embed_dim)

# Optional bias terms for key and value
bias_k = None
bias_v = None

# Attention masks and padding masks
key_padding_mask = None
attn_mask = None

# Static key/value for cross-attention (optional)
static_k = None
static_v = None

# Separate projection weights (when not using in_proj_weight)
q_proj_weight = None
k_proj_weight = None
v_proj_weight = None

# Attention output weights (for intermediate computation)
attn_output_weights = None

ARGS = {
    "query": query,
    "key": key,
    "value": value,
    "embed_dim_to_check": embed_dim,
    "num_heads": num_heads,
    "in_proj_weight": in_proj_weight,
    "in_proj_bias": in_proj_bias,
    "bias_k": bias_k,
    "bias_v": bias_v,
    "add_zero_attn": False,
    "dropout_p": 0.0,
    "out_proj_weight": out_proj_weight,
    "out_proj_bias": out_proj_bias,
    "no_out_proj": False,
    "training": True,
    "key_padding_mask": key_padding_mask,
    "need_weights": True,
    "attn_mask": attn_mask,
    "use_separate_proj_weight": False,
    "q_proj_weight": q_proj_weight,
    "k_proj_weight": k_proj_weight,
    "v_proj_weight": v_proj_weight,
    "static_k": static_k,
    "static_v": static_v,
    "average_attn_weights": False,
    "size_bottleneck": 8,
    "attn_output_weights": attn_output_weights,
}
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 — 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
dijkstra Ran
ran; our contract draft was wrong, not the code
mila-iqia/delusions/experiments/Dyna/RandDistShift.py
code served (permissive licence) · get_code("cbbf3a5fe2aa63f0")
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 list, 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 numpy as np

# Construct a valid graph for Dijkstra's algorithm
# The graph is represented as an adjacency matrix where graph[i][j] is the weight of edge from i to j
# 0 means no edge
graph = [
    [0, 4, 2, 0],
    [4, 0, 1, 5],
    [2, 1, 0, 8],
    [0, 5, 8, 0]
]

# Start node (must be a valid index in the graph)
start = 0

# Maximum distance parameter (default is infinity)
max_dist = float('inf')

# Define the ARGS dictionary with all parameters
ARGS = {
    'graph': graph,
    'start': start,
    'max_dist': max_dist
}
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 list, ndim 1, dtype family int — a list 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
floyd_warshall Ran
ran, honoured the contract we drafted
mila-iqia/delusions/experiments/Dyna/RandDistShift.py
code served (permissive licence) · get_code("7e3885e909729e31")
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 (4, 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 adjacency/distance matrix
# Floyd-Warshall expects a matrix where:
# - 0 on diagonal (distance from node to itself)
# - positive values for edges that exist
# - 0 for non-edges (which will be converted to inf, except diagonal)

A = np.array([
    [0, 5, 0, 10],
    [5, 0, 3, 0],
    [0, 3, 0, 2],
    [10, 0, 2, 0]
], dtype=np.int32)

ARGS = {
    "A": A
}
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 (4, 4) — shape (4, 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

Also present in other papers' code

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

In planning processes of computational decisionmaking agents, generative or predictive models are often used as "generators" to propose "targets" representing sets of expected or desirable states. Unfortunately, learned models inevitably hallucinate infeasible targets that can cause delusional behaviors and safety concerns. We first investigate the kinds of infeasible targets that generators can hallucinate. Then, we devise a strategy to identify and reject infeasible targets by learning a target feasibility evaluator. To ensure that the evaluator is robust and non-delusional, we adopted a design choice combining off-policy compatible learning rule, distributional architecture, and data augmentation based on hindsight relabeling. Attaching to a planning agent, the designed evaluator learns by observing the agent's interactions with the environment and the targets produced by its generator, without the need to change the agent or its generator. Our controlled experiments show significant reductions in delusional behaviors and performance improvements for various kinds of existing agents.

For agents

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

get_harvested_code_for_paper("2410.07096")
get_code_for_paper("2410.07096")
have("2410.07096")

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

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

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

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

Connect an agent — have() is free.