SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2003.04108 · 2020

Stable Policy Optimization via Off-Policy Divergence Regularization

arXiv · PDF · Open in the Atlas

Code that ran

2 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; 2 failures of our instrument; 1 no recorded run), measured 2026-11-21; 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/2003.04108.json · badge: /api/ran/2003.04108.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
facebookresearch/ppo-dice canonical (classifier label)
classifier basis: census
2 ran · 1 no recorded run
FunctionStatusWhere it lives
conjugate_gradients Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
facebookresearch/ppo-dice/trpo/opt.py
code served (permissive licence) · get_code("918891131c62a121")
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) and returned Tensor, ndim 1, dtype family float, shape (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 torch

torch.manual_seed(0)

# The function expects:
# - Avp: a callable that takes a vector and returns a vector
# - b: a 1D tensor (the right-hand side vector)
# - nsteps: an integer (number of iterations)
# - residual_tol: a float (convergence tolerance, has default)

# Create a simple callable for Avp that applies a linear transformation
# It should take a vector and return a vector of the same shape
def avp_fn(p):
    # Simple matrix-vector product: multiply by a small matrix
    # Create a 4x4 matrix and apply it
    A = torch.tensor([[2.0, 0.1, 0.0, 0.0],
                      [0.1, 2.0, 0.1, 0.0],
                      [0.0, 0.1, 2.0, 0.1],
                      [0.0, 0.0, 0.1, 2.0]])
    return torch.matmul(A, p)

# Create a small right-hand side vector (1D tensor of size 4)
b = torch.tensor([1.0, 2.0, 3.0, 4.0])

# Number of conjugate gradient steps
nsteps = 10

# Residual tolerance for early stopping
residual_tol = 1e-10

ARGS = {
    "Avp": avp_fn,
    "b": b,
    "nsteps": nsteps,
    "residual_tol": residual_tol,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 1, dtype family float, shape (4,) — shape (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
get_render_func Ran
ran; our contract draft was wrong, not the code
facebookresearch/ppo-dice/agents/utils.py
code served (permissive licence) · get_code("108dc9c41448855e")
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 method. 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

class MockEnv:
    def render(self, mode='human'):
        return None

class MockVecEnv:
    def __init__(self):
        self.envs = [MockEnv()]

class MockWrapper:
    def __init__(self, env):
        self.env = env

class MockVecWrapper:
    def __init__(self, venv):
        self.venv = venv

# Test case 1: venv with envs attribute
venv_with_envs = MockVecEnv()

# Test case 2: venv with nested venv attribute
venv_nested = MockVecWrapper(MockVecEnv())

# Test case 3: venv with env attribute
venv_with_env = MockWrapper(MockVecEnv())

# For the function execution, we use the simplest case
ARGS = {
    'venv': venv_with_envs
}
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 method — a method output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a method 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
orthogonal_regularization Not yet run
unverified (harvested, no recorded run)
facebookresearch/ppo-dice/agents/utils.py
code served (permissive licence) · get_code("a2eec7bc0f26ec59")
How it ran

no invocation recorded.

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, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 later) and 1 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
get_render_func 6 other papers
1 dated earlier, 5 later
1905.04640 (2019-05)
Mega-Reward: Achieving Human-Level Play without Extrinsic Rewards
2006.09447 (2020-06)
Agent Modelling under Partial Observability for Deep Reinforcement Learning
2009.01439 (2020-09)
Learning Dexterous Grasping with Object-Centric Visual Affordances
and 3 more not named here
conjugate_gradients 2 other papers
1 dated earlier, 1 later
1502.05477 (2015-02)
Trust Region Policy Optimization
2103.05910 (2021-03)
Learning from Imperfect Demonstrations from Agents with Varying Dynamics

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

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Trust Region Policy Optimization (TRPO) and Proximal Policy Optimization (PPO) are among the most successful policy gradient approaches in deep reinforcement learning (RL). While these methods achieve state-of-the-art performance across a wide range of challenging tasks, there is room for improvement in the stabilization of the policy learning and how the off-policy data are used. In this paper we revisit the theoretical foundations of these algorithms and propose a new algorithm which stabilizes the policy improvement through a proximity term that constrains the discounted state-action visitation distribution induced by consecutive policies to be close to one another. This proximity term, expressed in terms of the divergence between the visitation distributions, is learned in an off-policy and adversarial manner. We empirically show that our proposed method can have a beneficial effect on stability and improve final performance in benchmark high-dimensional control tasks.

For agents

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

get_harvested_code_for_paper("2003.04108")
get_code_for_paper("2003.04108")
have("2003.04108")

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

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

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

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

Connect an agent — have() is free.