SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.03926 · IJCAI · 2021

Reconciling Rewards with Predictive State Representations * †

Christopher Amato, Andrea Baisero

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 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, 0 violated it and 7 have no contract verdict; 0 failures 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/2106.03926.json · badge: /api/ran/2106.03926.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
abaisero/rl-rpsr canonical (classifier label)
classifier basis: census
7 ran · 1 no recorded run
FunctionStatusWhere it lives
D Ran
ran on a synthesized input
abaisero/rl-rpsr/rl_rpsr/matrices.py
code served (permissive licence) · get_code("b469c216587880cd")
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 4, dtype family float, shape (3, 5, 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
from functools import lru_cache

# Define a minimal stand-in class for env
class MockEnv:
    def __init__(self):
        # T: transition matrix with shape (num_states, num_actions, num_states)
        # Representing P(s'|s,a)
        self.T = np.random.rand(4, 3, 4)  # 4 states, 3 actions
        
        # O: observation matrix with shape (num_states, num_actions, num_states, num_obs)
        # Representing P(o|s',s,a)
        self.O = np.random.rand(4, 3, 4, 5)  # 4 states, 3 actions, 4 states, 5 observations

# Create an instance
env = MockEnv()

# Define ARGS dict
ARGS = {
    'env': env
}
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 4, dtype family float, shape (3, 5, 4, 4) — shape (3, 5, 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
G Ran
ran on a synthesized input
abaisero/rl-rpsr/rl_rpsr/matrices.py
code served (permissive licence) · get_code("134bb68b32e10eb8")
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 4, dtype family float, shape (3, 5, 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
from functools import lru_cache

class MockEnv:
    """Mock environment with T and O attributes for the generative matrix."""
    def __init__(self):
        # T: transition matrix with shape (num_states, num_actions, num_states)
        # env.T[s, a, s'] = probability of transitioning to s' from s under action a
        self.T = np.random.rand(4, 3, 4)  # 4 states, 3 actions
        
        # O: observation matrix with shape (num_states, num_actions, num_states, num_obs)
        # env.O[s, a, s', o] = probability of observing o given transition from s to s' under a
        self.O = np.random.rand(4, 3, 4, 5)  # 4 states, 3 actions, 4 states, 5 observations

env = MockEnv()

ARGS = {
    "env": env
}
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 4, dtype family float, shape (3, 5, 4, 4) — shape (3, 5, 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
R Ran
ran on a synthesized input
abaisero/rl-rpsr/rl_rpsr/matrices.py
code served (permissive licence) · get_code("ce1deaebbda0c6ff")
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, 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
from functools import lru_cache

class MockEnv:
    """Mock environment with transition, observation, and reward matrices."""
    def __init__(self):
        # T: transition matrix, shape (states, actions, next_states)
        self.T = np.random.randn(2, 3, 2)
        
        # O: observation matrix, shape (states, actions, next_states, observations)
        self.O = np.random.randn(2, 3, 2, 4)
        
        # R: reward matrix, shape (states, actions, next_states, observations)
        self.R = np.random.randn(2, 3, 2, 4)

env = MockEnv()

ARGS = {
    "env": env
}
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, 3) — shape (2, 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
cross_sum Ran
ran on a synthesized input
abaisero/rl-rpsr/rl_rpsr/linalg.py
code served (permissive licence) · get_code("4cf51c7b7b8221bc")
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 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 itertools as itt
from typing import Iterable, List
import numpy as np

# Create sample data for cross_sum
# vectors_list should be an Iterable of List[np.ndarray]
# The function computes the Cartesian product of the lists and sums vectors in each combination

# Create a list of lists of numpy arrays
vectors_list_1 = [
    np.array([1.0, 2.0, 3.0, 4.0]),
    np.array([5.0, 6.0, 7.0, 8.0])
]

vectors_list_2 = [
    np.array([10.0, 11.0, 12.0, 13.0]),
    np.array([14.0, 15.0, 16.0, 17.0]),
    np.array([18.0, 19.0, 20.0, 21.0])
]

# vectors_list is an Iterable[List[np.ndarray]]
# So it's an iterable containing multiple lists of arrays
vectors_list = [vectors_list_1, vectors_list_2]

ARGS = {
    "vectors_list": vectors_list
}
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 list, ndim 2, dtype family float — 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
dominationCheck Ran
ran on a synthesized input
abaisero/rl-rpsr/rl_rpsr/pruning.py
code served (permissive licence) · get_code("e716845efb7aa44d")
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 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
from typing import List, Optional, Callable, Any

# Define ArrayKey type
ArrayKey = Callable[[Any], np.ndarray]

# Create small numpy vectors for testing
vector1 = np.array([1.0, 2.0, 3.0, 4.0])
vector2 = np.array([0.5, 1.5, 2.5, 3.5])
vector3 = np.array([2.0, 3.0, 4.0, 5.0])

# Create objects - can be simple dicts or custom objects
objects = [
    {"id": 1, "data": vector1},
    {"id": 2, "data": vector2},
    {"id": 3, "data": vector3}
]

# Create a transformation matrix U (4x4 for 4-dimensional vectors)
U = np.array([
    [1.0, 0.0, 0.0, 0.0],
    [0.0, 1.0, 0.0, 0.0],
    [0.0, 0.0, 1.0, 0.0],
    [0.0, 0.0, 0.0, 1.0]
], dtype=np.float32)

# Define a key function that extracts vectors from objects
def key_func(obj: Any) -> np.ndarray:
    return obj["data"]

ARGS = {
    "objects": objects,
    "U": U,
    "key": key_func
}
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 list, ndim 1, dtype family float — 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
linearly_independent_pinv Ran
ran on a synthesized input
abaisero/rl-rpsr/rl_rpsr/linalg.py
code served (permissive licence) · get_code("0a49001202449c47")
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 logging
import numpy as np
import numpy.linalg as la

# Set up logging
logging.basicConfig(level=logging.INFO)

# Create test vectors that are linearly independent
# We'll create 3 linearly independent vectors in 4D space
vectors = [
    np.array([1.0, 0.0, 0.0, 0.0]),
    np.array([0.0, 1.0, 0.0, 0.0]),
    np.array([0.0, 0.0, 1.0, 0.0])
]

# Create a test vector that is NOT in the span of the vectors above
# (it has a non-zero component in the 4th dimension)
vector = np.array([0.1, 0.2, 0.3, 0.5])

ARGS = {
    "vectors": vectors,
    "vector": vector
}
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 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
max_bigraph_distance Ran
ran on a synthesized input
abaisero/rl-rpsr/rl_rpsr/linalg.py
code served (permissive licence) · get_code("b1dd92da64bdbe90")
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 float64, ndim 0, 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 logging
import numpy as np
from scipy.spatial import distance_matrix

logging.basicConfig(level=logging.DEBUG)

# Create two 2D numpy arrays with distinct dimensions
x = np.array([
    [0.0, 1.0, 2.0],
    [3.0, 4.0, 5.0]
], dtype=np.float64)

y = np.array([
    [0.5, 1.5, 2.5],
    [3.5, 4.5, 5.5],
    [6.0, 7.0, 8.0],
    [9.0, 10.0, 11.0]
], dtype=np.float64)

ARGS = {
    'x': x,
    'y': y
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
purge Not yet run
unverified (harvested, no recorded run)
abaisero/rl-rpsr/rl_rpsr/pruning.py
code served (permissive licence) · get_code("706103e7f0c49910")
How it ran

no invocation recorded.

Also present in other papers' code

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

Predictive state representations (PSRs) are models of controlled non-Markov observation sequences which exhibit the same generative process governing POMDP observations without relying on an underlying latent state. In that respect, a PSR is indistinguishable from the corresponding POMDP. However, PSRs notoriously ignore the notion of rewards, which undermines the general utility of PSR models for control, planning, or reinforcement learning. Therefore, we describe a sufficient and necessary accuracy condition which determines whether a PSR is able to accurately model POMDP rewards, we show that rewards can be approximated even when the accuracy condition is not satisfied, and we find that a non-trivial number of POMDPs taken from a well-known thirdparty repository do not satisfy the accuracy condition. We propose reward-predictive state representations (R-PSRs), a generalization of PSRs which accurately models both observations and rewards, and develop value iteration for R-PSRs. We show that there is a mismatch between optimal POMDP policies and the optimal PSR policies derived from approximate rewards. On the other hand, optimal R-PSR policies perfectly match optimal POMDP policies, reconfirming R-PSRs as accurate stateless generative models of observations and rewards.

For agents

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

get_harvested_code_for_paper("2106.03926")
get_code_for_paper("2106.03926")
have("2106.03926")

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

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

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

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

Connect an agent — have() is free.