SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.04811 · 2024

Simplifying Deep Temporal Difference Learning

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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 0 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/2407.04811.json · badge: /api/ran/2407.04811.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
mttga/purejaxql canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
create_compute_targets_fn Ran
ran; our contract draft was wrong, not the code
mttga/purejaxql/purejaxql/simplified/pqn_atari_simple.py
code served (permissive licence) · get_code("a46609c30d52e9e2")
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 jax
import jax.numpy as jnp
import flax.linen as nn
from flax.core import FrozenDict

# Define a simple network that matches what create_compute_targets_fn expects
class SimpleQNetwork(nn.Module):
    @nn.compact
    def __call__(self, x, train=False):
        # Output Q-values for 3 actions
        x = nn.Dense(8)(x)
        x = nn.relu(x)
        x = nn.Dense(3)(x)
        return x

# Create network instance
network = SimpleQNetwork()

# Initialize network parameters
key = jax.random.PRNGKey(0)
dummy_input = jnp.ones((2, 4))  # batch_size=2, input_dim=4
params = network.init(key, dummy_input, train=False)

# Create a mock train_state object with params and batch_stats
class TrainState:
    def __init__(self, params, batch_stats):
        self.params = params['params']
        self.batch_stats = params.get('batch_stats', {})

train_state = TrainState(params, params.get('batch_stats', {}))

# Create config dictionary
config = {
    'GAMMA': 0.99,
    'LAMBDA': 0.95,
}

# Create mock transitions dictionary
# The function expects:
# - transitions['next_obs'][-1]: last next observation
# - transitions['done'][-1]: last done flag
# - transitions['reward'][-1]: last reward
# - transitions['q_val']: Q-values for all but last transition
# All other leaf arrays should have the same first dimension
batch_size = 2
seq_len = 3
action_dim = 3

transitions = {
    'next_obs': jnp.ones((seq_len, batch_size, 4)),  # seq_len, batch, obs_dim
    'done': jnp.zeros((seq_len, batch_size)),  # seq_len, batch
    'reward': jnp.ones((seq_len, batch_size)) * 0.5,  # seq_len, batch
    'q_val': jnp.ones((seq_len - 1, batch_size, action_dim)),  # seq_len-1, batch, action_dim
}

ARGS = {
    'network': network,
    'config': config,
    'jit': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
flax, jax — 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
create_step_env_fn Ran
ran; our contract draft was wrong, not the code
mttga/purejaxql/purejaxql/simplified/pqn_atari_simple.py
code served (permissive licence) · get_code("adc64335cdac5c33")
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 jax
import jax.numpy as jnp
import jax.random as jr
from flax import linen as nn
from flax.training import train_state
import optax

class SimpleQNetwork(nn.Module):
    action_dim: int
    
    @nn.compact
    def __call__(self, x, train=False):
        x = nn.Dense(8)(x)
        x = nn.relu(x)
        x = nn.Dense(self.action_dim)(x)
        return x

class SimpleEnv:
    def __init__(self, num_envs, obs_dim, action_dim, num_test_envs=0):
        self.num_envs = num_envs
        self.obs_dim = obs_dim
        self.action_dim = action_dim
        self.num_test_envs = num_test_envs
        self.total_envs = num_envs + num_test_envs
    
    def step(self, env_state, actions):
        batch_size = actions.shape[0]
        new_obs = jnp.ones((batch_size, self.obs_dim), dtype=jnp.float32)
        new_env_state = env_state + 1
        reward = jnp.ones((batch_size,), dtype=jnp.float32)
        done = jnp.zeros((batch_size,), dtype=jnp.bool_)
        info = {}
        return new_obs, new_env_state, reward, done, info
    
    def reset(self):
        obs = jnp.ones((self.total_envs, self.obs_dim), dtype=jnp.float32)
        env_state = jnp.zeros(self.total_envs, dtype=jnp.int32)
        return obs, env_state

class SimpleTrainState:
    def __init__(self, params, batch_stats):
        self.params = params
        self.batch_stats = batch_stats

num_envs = 2
num_test_envs = 1
obs_dim = 4
action_dim = 3
num_steps = 2

network = SimpleQNetwork(action_dim=action_dim)

rng = jr.PRNGKey(0)
dummy_obs = jnp.ones((num_envs + num_test_envs, obs_dim), dtype=jnp.float32)
params = network.init(rng, dummy_obs, train=False)
batch_stats = {}

train_state_obj = SimpleTrainState(params, batch_stats)

env = SimpleEnv(num_envs=num_envs, obs_dim=obs_dim, action_dim=action_dim, num_test_envs=num_test_envs)

config = {
    'NUM_ENVS': num_envs,
    'NUM_STEPS': num_steps,
    'NUM_ACTIONS': action_dim,
    'REW_SCALE': 1.0,
    'TEST_DURING_TRAINING': True,
    'TEST_ENVS': num_test_envs,
}

last_obs = jnp.ones((num_envs + num_test_envs, obs_dim), dtype=jnp.float32)
env_state = jnp.zeros(num_envs + num_test_envs, dtype=jnp.int32)
rng = jr.PRNGKey(42)
eps = 0.1

ARGS = {
    'env': env,
    'network': network,
    'config': config,
    'total_envs': num_envs + num_test_envs,
    'jit': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
flax, jax, optax — 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
eps_greedy_exploration Ran
ran; our contract draft was wrong, not the code
mttga/purejaxql/purejaxql/simplified/pqn_atari_simple.py
code served (permissive licence) · get_code("e7957af4b713d6e0")
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 ArrayImpl, ndim 1, dtype family int, shape (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 jax
import jax.numpy as jnp

# Set seed for reproducibility
key = jax.random.PRNGKey(0)

# Create a batch of Q-values
# Shape: (batch_size=2, num_actions=4)
# This represents Q-values for 2 environments with 4 possible actions each
q_vals = jnp.array([
    [1.0, 2.5, 0.3, 1.8],
    [3.2, 0.5, 2.1, 0.9]
])

# Epsilon value for epsilon-greedy exploration
# 0.1 means 10% chance of random action, 90% chance of greedy action
eps = 0.1

# Create RNG key
rng = jax.random.PRNGKey(42)

ARGS = {
    "rng": rng,
    "q_vals": q_vals,
    "eps": eps
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 1, dtype family int, shape (2,) — shape (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

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-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

Q-learning played a foundational role in the field reinforcement learning (RL). However, TD algorithms with off-policy data, such as Q-learning, or nonlinear function approximation like deep neural networks require several additional tricks to stabilise training, primarily a large replay buffer and target networks. Unfortunately, the delayed updating of frozen network parameters in the target network harms the sample efficiency and, similarly, the large replay buffer introduces memory and implementation overheads. In this paper, we investigate whether it is possible to accelerate and simplify off-policy TD training while maintaining its stability. Our key theoretical result demonstrates for the first time that regularisation techniques such as LayerNorm can yield provably convergent TD algorithms without the need for a target network or replay buffer, even with off-policy data. Empirically, we find that online, parallelised sampling enabled by vectorised environments stabilises training without the need for a large replay buffer. Motivated by these findings, we propose PQN, our simplified deep online Q-Learning algorithm. Surprisingly, this simple algorithm is competitive with more complex methods like: Rainbow in Atari, PPO-RNN in Craftax, QMix in Smax, and can be up to 50x faster than traditional DQN without sacrificing sample efficiency. In an era where PPO has become the go-to RL algorithm, PQN reestablishes off-policy Q-learning as a viable alternative.

For agents

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

get_harvested_code_for_paper("2407.04811")
get_code_for_paper("2407.04811")
have("2407.04811")

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

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

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

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

Connect an agent — have() is free.