SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1904.11439 · 2019

META-Learning State-based Eligibility Traces for More Sample-Efficient Policy Evaluation

arXiv · PDF · Open in the Atlas

Code that ran

3 of 14 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 3 have no contract verdict; 0 failures of our instrument; 11 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/1904.11439.json · badge: /api/ran/1904.11439.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/META canonical (classifier label)
classifier basis: census
3 ran · 11 no recorded run
FunctionStatusWhere it lives
decide Ran
ran on a synthesized input
PwnerHarry/META/utils.py
code served (permissive licence) · get_code("44fe7c9390bf642b")
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 int64, ndim 0, dtype family int, 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 numpy as np

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

# Create a small policy matrix
# Rows represent states, columns represent actions
# Each row must be a valid probability distribution (sums to 1)
num_states = 2
num_actions = 4

policy_matrix = np.array([
    [0.1, 0.2, 0.3, 0.4],  # state 0: probabilities over 4 actions
    [0.25, 0.25, 0.25, 0.25]  # state 1: uniform distribution
], dtype=np.float32)

state_id = 0

ARGS = {
    "state_id": state_id,
    "policy_matrix": policy_matrix
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
gym, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int64, ndim 0, dtype family int, 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
greedy Ran
ran on a synthesized input
PwnerHarry/META/greedy.py
code served (permissive licence) · get_code("5a96948f392f2d15")
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 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 gym
import numpy as np
from gym import spaces

class SimpleEncoder:
    """Simple encoder that converts observations to feature vectors"""
    def __call__(self, obs):
        if isinstance(obs, (int, np.integer)):
            # For discrete observations, create a one-hot encoding
            feat = np.zeros(4)
            feat[obs % 4] = 1.0
            return feat
        return np.array([obs] * 4, dtype=np.float32) if np.isscalar(obs) else obs

class SimpleLambda:
    """Simple lambda container for storing weights per observation"""
    def __init__(self):
        self.w = {}

class SimpleLeaner:
    """Minimal learner mock for TOGTD_LEARNER or TOTD_LEARNER"""
    def __init__(self, env, D):
        self.env = env
        self.D = D
        self.w_curr = np.zeros(D)
        self.w_next = np.zeros(D)
    
    def refresh(self):
        pass
    
    def next(self):
        self.w_curr = self.w_next.copy()
    
    def learn(self, r_next, done, gamma_next, gamma_curr, x_next, x_curr, 
              Lambda_next, Lambda_curr, rho_curr, **lr_dict):
        # Simple TD-like update
        delta = r_next + (1 - done) * gamma_next - gamma_curr
        self.w_next = self.w_curr + 0.01 * delta * x_curr

class SimpleEnv(gym.Env):
    """Minimal gym environment"""
    def __init__(self):
        self.observation_space = spaces.Discrete(5)
        self.action_space = spaces.Discrete(3)
        self._state = 0
        self._step_count = 0
    
    def reset(self):
        self._state = 0
        self._step_count = 0
        return self._state
    
    def step(self, action):
        self._step_count += 1
        self._state = (self._state + action) % 5
        reward = float(action) / 2.0
        done = self._step_count >= 10
        info = {}
        return self._state, reward, done, info

def mock_decide(obs, behavior):
    """Mock decision function"""
    return 0

def mock_importance_sampling_ratio(target, behavior, obs, action):
    """Mock importance sampling ratio"""
    return 1.0

def mock_evaluate(weights, eval_type):
    """Mock evaluation function"""
    return np.sum(weights)

TOGTD_LEARNER = SimpleLeaner
TOTD_LEARNER = SimpleLeaner

ARGS = {
    'env': SimpleEnv(),
    'steps': 5000,
    'target': mock_decide,
    'behavior': mock_decide,
    'evaluate': mock_evaluate,
    'Lambda': SimpleLambda(),
    'encoder': SimpleEncoder(),
    'learner_type': 'togtd',
    'gamma': lambda x: 0.95,
    'alpha': 0.05,
    'beta': 0.05,
}

# Inject the learner classes and helper functions into the module globals
import sys
current_module = sys.modules[__name__]
setattr(current_module, 'TOGTD_LEARNER', TOGTD_LEARNER)
setattr(current_module, 'TOTD_LEARNER', TOTD_LEARNER)
setattr(current_module, 'decide', mock_decide)
setattr(current_module, 'importance_sampling_ratio', mock_importance_sampling_ratio)
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
gym, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float — no output shape is stated: observe_signature.py could not observe it (fixture:KeyError)
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
islambda Ran
ran on a synthesized input
PwnerHarry/META/BACKUPS/methods.py
code served (permissive licence) · get_code("a17914a87ebbee6c")
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 torch

torch.manual_seed(0)

# The function islambda checks if v is a lambda function
# It does this by:
# 1. Creating a reference lambda: LAMBDA = lambda: 0
# 2. Checking isinstance(v, type(LAMBDA)) - v must be a function type
# 3. Checking v.__name__ == LAMBDA.__name__ - v's name must match the lambda's name (which is '<lambda>')

# Valid argument: a lambda function
valid_lambda = lambda: 42

# Invalid arguments to test the function handles them correctly:
# A regular function
def regular_function():
    return 0

# A non-callable
not_callable = 42

# A class
class MyClass:
    pass

# We need to provide an argument for parameter 'v'
# The function will return True for lambda functions, False otherwise
# Let's test with a lambda function (the primary use case)

ARGS = {
    "v": lambda: 0
}
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 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
AC Not yet run
unverified (harvested, no recorded run)
PwnerHarry/META/AC.py
code served (permissive licence) · get_code("cfb79e41dca854fb")
How it ran

no invocation recorded.

MC Not yet run
unverified (harvested, no recorded run)
PwnerHarry/META/MC.py
code served (permissive licence) · get_code("33e84958b7ee29a9")
How it ran

no invocation recorded.

MTA Not yet run
unverified (harvested, no recorded run)
PwnerHarry/META/mta.py
code served (permissive licence) · get_code("b85342e702c3deb1")
How it ran

no invocation recorded.

eval_AC Not yet run
unverified (harvested, no recorded run)
PwnerHarry/META/AC.py
code served (permissive licence) · get_code("45ba36007fd82d86")
How it ran

no invocation recorded.

eval_AC_per_run Not yet run
unverified (harvested, no recorded run)
PwnerHarry/META/AC.py
code served (permissive licence) · get_code("7fe8b90f604bea21")
How it ran

no invocation recorded.

eval_MTA Not yet run
unverified (harvested, no recorded run)
PwnerHarry/META/mta.py
code served (permissive licence) · get_code("cb2af316670acb7a")
How it ran

no invocation recorded.

eval_MTA_per_run Not yet run
unverified (harvested, no recorded run)
PwnerHarry/META/mta.py
code served (permissive licence) · get_code("7aa28e986811a6c4")
How it ran

no invocation recorded.

eval_greedy Not yet run
unverified (harvested, no recorded run)
PwnerHarry/META/greedy.py
code served (permissive licence) · get_code("08642331ca69bfe7")
How it ran

no invocation recorded.

eval_greedy_per_run Not yet run
unverified (harvested, no recorded run)
PwnerHarry/META/greedy.py
code served (permissive licence) · get_code("0dc689c2e98dd889")
How it ran

no invocation recorded.

gtd Not yet run
unverified (harvested, no recorded run)
PwnerHarry/META/BACKUPS/methods.py
code served (permissive licence) · get_code("5f8a9b449cd0889e")
How it ran

no invocation recorded.

monte_carlo Not yet run
unverified (harvested, no recorded run)
PwnerHarry/META/BACKUPS/methods.py
code served (permissive licence) · get_code("32214dc30cceff52")
How it ran

no invocation recorded.

Also present in other papers' code

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

Temporal-Difference (TD) learning is a standard and very successful reinforcement learning approach, at the core of both algorithms that learn the value of a given policy, as well as algorithms which learn how to improve policies. TD-learning with eligibility traces provides a way to boost sample efficiency by temporal credit assignment, i.e. deciding which portion of a reward should be assigned to predecessor states that occurred at different previous times, controlled by a parameter $λ$. However, tuning this parameter can be time-consuming, and not tuning it can lead to inefficient learning. For better sample efficiency of TD-learning, we propose a meta-learning method for adjusting the eligibility trace parameter, in a state-dependent manner. The adaptation is achieved with the help of auxiliary learners that learn distributional information about the update targets online, incurring roughly the same computational complexity per step as the usual value learner. Our approach can be used both in on-policy and off-policy learning. We prove that, under some assumptions, the proposed method improves the overall quality of the update targets, by minimizing the overall target error. This method can be viewed as a plugin to assist prediction with function approximation by meta-learning feature (observation)-based $λ$ online, or even in the control case to assist policy improvement. Our empirical evaluation demonstrates significant performance improvements, as well as improved robustness of the proposed algorithm to learning rate variation.

For agents

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

get_harvested_code_for_paper("1904.11439")
get_code_for_paper("1904.11439")
have("1904.11439")

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

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

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

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

Connect an agent — have() is free.