SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2009.04416 · 2020

Phasic Policy Gradient

arXiv · PDF · Open in the Atlas

Code that ran

7 of 13 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; 6 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/2009.04416.json · badge: /api/ran/2009.04416.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
openai/phasic-policy-gradient canonical (classifier label)
classifier basis: census
7 ran · 6 no recorded run
FunctionStatusWhere it lives
dict_mean Ran
ran on a synthesized input
openai/phasic-policy-gradient/phasic_policy_gradient/minibatch_optimize.py
code served (permissive licence) · get_code("80025f416c031ad6")
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 dict. 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 numpy as np

torch.manual_seed(0)

# dict_mean takes a list of dictionaries and computes the mean value for each key
# It iterates over ds[0].keys() and sums d[k] for each d in ds, then divides by len(ds)
# The values in the dictionaries should support addition and division

ds = [
    {"loss": 0.5, "accuracy": 0.8, "f1": 0.75},
    {"loss": 0.3, "accuracy": 0.9, "f1": 0.85},
    {"loss": 0.4, "accuracy": 0.85, "f1": 0.80},
]

ARGS = {
    "ds": ds
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
ema Ran
ran on a synthesized input
openai/phasic-policy-gradient/phasic_policy_gradient/graph_util.py
code served (permissive licence) · get_code("a362c435a091c0f4")
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, shape (5,) 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 sample input data for the EMA function
# The function expects a 1D or multi-dimensional array of numerical values
data_in = np.array([1.0, 2.0, 3.0, 4.0, 5.0], dtype=np.float32)

# Define the ARGS dictionary with all parameters
ARGS = {
    "data_in": data_in,
    "smoothing": 0.3
}
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 1, dtype family float, shape (5,) — shape (5,) 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
profile Ran
ran on a synthesized input
openai/phasic-policy-gradient/phasic_policy_gradient/logger.py
code served (permissive licence) · get_code("ca2c1a746094ca28")
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 partial. 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 time
from collections import defaultdict

# Mock implementation of a comm object for MPI
class MockComm:
    def __init__(self, rank=0):
        self.rank = rank
    
    def gather(self, local_data):
        return [local_data]

# Mock output format class
class MockOutputFormat:
    def writekvs(self, kvs):
        pass
    
    def close(self):
        pass

# Set up logger instance for the module
torch.manual_seed(0)

# Create a simple function to decorate
def simple_test_function(x, y):
    """Simple test function to be decorated"""
    return x + y

# Define ARGS for the profile decorator
ARGS = {
    'n': 'test_profile'
}
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 partial — a partial output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a partial 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
rcm Ran
ran on a synthesized input
openai/phasic-policy-gradient/phasic_policy_gradient/log_save_helper.py
code served (permissive licence) · get_code("fe74ca9ccc423b88")
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)

ARGS = {
    'start': 5,
    'stop': 15,
    'modulus': 3,
    'mode': '[)'
}
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
read_csv Ran
ran on a synthesized input
openai/phasic-policy-gradient/phasic_policy_gradient/graph_util.py
code served (permissive licence) · get_code("ed1d9f7bf3690847")
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, 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 csv
import numpy as np
import tempfile
import os

# Create a temporary CSV file with test data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.csv', newline='')
temp_filename = temp_file.name

try:
    writer = csv.writer(temp_file)
    # Write header row with lowercase key name
    writer.writerow(['Name', 'Score', 'Value'])
    # Write data rows
    writer.writerow(['Alice', '95.5', '10.2'])
    writer.writerow(['Bob', '87.3', '20.5'])
    writer.writerow(['Charlie', '92.1', ''])  # Empty value to test filtering
    writer.writerow(['David', '88.9', '15.3'])
    temp_file.close()
    
    ARGS = {
        'filename': temp_filename,
        'key_name': 'score'
    }
finally:
    # Clean up after defining ARGS
    pass
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 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
switch_to_outer_plot Ran
ran on a synthesized input
openai/phasic-policy-gradient/phasic_policy_gradient/graph_util.py
code served (permissive licence) · get_code("a080ad6d9c26a9e9")
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 Axes. 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 matplotlib.pyplot as plt

fig = plt.figure()

ARGS = {
    "fig": fig
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Axes — a Axes output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Axes 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
update_mean_var_count_from_moments Ran
ran on a synthesized input
openai/phasic-policy-gradient/phasic_policy_gradient/reward_normalizer.py
code served (permissive licence) · get_code("d501c1a9124aff24")
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 numpy as np

torch.manual_seed(0)

# Construct arguments for update_mean_var_count_from_moments
# The function performs running statistics updates using Welford's online algorithm
# Parameters are all numeric (tensors or scalars representing mean, variance, and counts)

mean = torch.tensor([0.5, 0.3, 0.2, 0.1], dtype=torch.float32)
var = torch.tensor([1.0, 0.8, 0.9, 0.7], dtype=torch.float32)
count = torch.tensor(100.0)

batch_mean = torch.tensor([0.6, 0.35, 0.25, 0.15], dtype=torch.float32)
batch_var = torch.tensor([1.1, 0.85, 0.95, 0.75], dtype=torch.float32)
batch_count = torch.tensor(50.0)

ARGS = {
    "mean": mean,
    "var": var,
    "count": count,
    "batch_mean": batch_mean,
    "batch_var": batch_var,
    "batch_count": batch_count,
}
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 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
compute_losses Not yet run
unverified (harvested, no recorded run)
openai/phasic-policy-gradient/phasic_policy_gradient/ppo.py
code served (permissive licence) · get_code("6d9e098f75a09f80")
How it ran

no invocation recorded.

make_output_format Not yet run
unverified (harvested, no recorded run)
openai/phasic-policy-gradient/phasic_policy_gradient/logger.py
code served (permissive licence) · get_code("6b6c572969663aab")
How it ran

no invocation recorded.

minibatch_optimize Not yet run
unverified (harvested, no recorded run)
openai/phasic-policy-gradient/phasic_policy_gradient/minibatch_optimize.py
code served (permissive licence) · get_code("98d06afb4dcd2228")
How it ran

no invocation recorded.

mpi_weighted_mean Not yet run
unverified (harvested, no recorded run)
openai/phasic-policy-gradient/phasic_policy_gradient/logger.py
code served (permissive licence) · get_code("fc70defdf687afcb")
How it ran

no invocation recorded.

sum_nonbatch Not yet run
unverified (harvested, no recorded run)
openai/phasic-policy-gradient/phasic_policy_gradient/ppg.py
code served (permissive licence) · get_code("8b47a7ede19e9b17")
How it ran

no invocation recorded.

to_th_device Not yet run
unverified (harvested, no recorded run)
openai/phasic-policy-gradient/phasic_policy_gradient/minibatch_optimize.py
code served (permissive licence) · get_code("f73c4143235d17d6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 1 later) and 10 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
make_output_format 73 other papers
14 dated earlier, 59 later
1611.05763 (2016-11)
Learning to reinforcement learn
1804.06459 (2018-04)
On Learning Intrinsic Rewards for Policy Gradient Methods
1806.02473 (2018-06)
Graph Convolutional Policy Network for Goal-Directed Molecular Graph Generation
and 70 more not named here
ema 1 other paper
1 dated earlier
1912.01588 (2019-12)
Leveraging Procedural Generation to Benchmark Reinforcement Learning
switch_to_outer_plot 1 other paper
1 dated earlier
1912.01588 (2019-12)
Leveraging Procedural Generation to Benchmark Reinforcement Learning

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

We introduce Phasic Policy Gradient (PPG), a reinforcement learning framework which modifies traditional on-policy actor-critic methods by separating policy and value function training into distinct phases. In prior methods, one must choose between using a shared network or separate networks to represent the policy and value function. Using separate networks avoids interference between objectives, while using a shared network allows useful features to be shared. PPG is able to achieve the best of both worlds by splitting optimization into two phases, one that advances training and one that distills features. PPG also enables the value function to be more aggressively optimized with a higher level of sample reuse. Compared to PPO, we find that PPG significantly improves sample efficiency on the challenging Procgen Benchmark.

For agents

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

get_harvested_code_for_paper("2009.04416")
get_code_for_paper("2009.04416")
have("2009.04416")

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

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

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

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

Connect an agent — have() is free.