SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.16984 · ICLR · 2024

Consistency Models as a Rich and Efficient Policy Class for Reinforcement Learning

Chi Jin, Zihan Ding

arXiv · PDF · Open in the Atlas

Code that ran

9 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 3 failures of our instrument; 2 no recorded run); 2 of them were also run on the host, not in the jail, by the peer-agreement lane that set their level, 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/2309.16984.json · badge: /api/ran/2309.16984.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
quantumiracle/consistency_model_for_reinforcement_learning canonical (classifier label)
classifier basis: classifier_2025
3 ran · 2 no recorded run
Aaditya-Prasad/consistency-policy canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
alexander-soare/consistency_policy extension (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
append_dims Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Aaditya-Prasad/consistency-policy/consistency_policy/utils.py
code served (permissive licence) · get_code("465f0a6ce0f5e20e")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 1, 1) as a later run recorded it. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-04T23:34:09Z). 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)

# Create a small tensor with 2 dimensions
x = torch.randn(2, 4)

# Set target_dims to a value greater than current ndim
target_dims = 4

ARGS = {
    "x": x,
    "target_dims": target_dims,
}
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 4, dtype family float, shape (2, 4, 1, 1) — shape (2, 4, 1, 1) 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
linear_schedule Ran
ran, honoured the contract we drafted
this paper's copy was not recorded; identical code first harvested from elicassion/sugarl
pointer only; the stored copy get_code serves, from elicassion/sugarl, is pointer only (licence: NONE) · get_code("4c60d8998b722013")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

Consistency Ran
ran on a synthesized input · constructed an object; no result was computed
quantumiracle/consistency_model_for_reinforcement_learning/agents/consistency.py
code served (permissive licence) · get_code("dead3c2b85bf0fc2")
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 an instance of its own class, Consistency: the run constructed the object and did not call it, so no result was computed. 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
import math

torch.manual_seed(0)

# Create a minimal model that satisfies the usage in Consistency
class DummyModel(nn.Module):
    def __init__(self, action_dim):
        super().__init__()
        self.action_dim = action_dim
        self.linear = nn.Linear(action_dim + 1, action_dim)  # action + t
    
    def forward(self, action, t, state):
        # action: [batch, action_dim]
        # t: [batch, 1]
        # state: [batch, state_dim]
        # Returns: [batch, action_dim]
        batch_size = action.shape[0]
        combined = torch.cat([action, t], dim=1)
        return self.linear(combined)

# Set up parameters
state_dim = 5
action_dim = 3
max_action = 1.0
model = DummyModel(action_dim)

ARGS = {
    'state_dim': state_dim,
    'action_dim': action_dim,
    'model': model,
    'max_action': max_action,
    'n_timesteps': 10,
    'loss_type': 'l2',
    'clip_denoised': True,
    'action_norm': False,
    'eps': 0.002,
    'D': 128
}
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 Consistency — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Consistency 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
WeightedL1 Ran
ran on a synthesized input
quantumiracle/consistency_model_for_reinforcement_learning/agents/consistency.py
code served (permissive licence) · get_code("a195e5fbb1ffc8f2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, 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 torch
import torch.nn as nn

# INIT_ARGS for WeightedL1.__init__
# The __init__ method takes no parameters beyond self
INIT_ARGS = {}

# ARGS for WeightedL1.forward
# forward(self, pred, targ, weights=torch.tensor(1.0), take_mean=True)
batch_size = 2
action_dim = 3

ARGS = {
    'pred': torch.randn(batch_size, action_dim),
    'targ': torch.randn(batch_size, action_dim),
    'weights': torch.rand(batch_size, action_dim),
    'take_mean': True
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 0, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
WeightedL2 Ran
ran on a synthesized input
quantumiracle/consistency_model_for_reinforcement_learning/agents/consistency.py
code served (permissive licence) · get_code("04bd445ebe6af984")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, 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 torch
import torch.nn as nn
import torch.nn.functional as F

# The class is already provided, no need to redefine it
# We just need to construct INIT_ARGS and ARGS

# INIT_ARGS: WeightedL2.__init__ takes no parameters (only inherits from WeightedLoss)
INIT_ARGS = {}

# ARGS: forward method parameters
# forward(self, pred, targ, weights=torch.tensor(1.0), take_mean=True)
batch_size = 2
action_dim = 3

ARGS = {
    'pred': torch.randn(batch_size, action_dim),
    'targ': torch.randn(batch_size, action_dim),
    'weights': torch.rand(batch_size, action_dim),
    'take_mean': True
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 0, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
euler_to_quat Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Aaditya-Prasad/consistency-policy/consistency_policy/utils.py
code served (permissive licence) · get_code("eef3fefaf1daa0fb")
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 ndarray, ndim 2, dtype family float, shape (2, 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 scipy.spatial.transform import Rotation as R

# Create a small euler angle array (2 rotations, 3 euler angles each)
euler = np.array([
    [0.1, 0.2, 0.3],
    [0.4, 0.5, 0.6]
])

ARGS = {
    "euler": euler,
    "degrees": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy — 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, 4) — shape (2, 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
reduce_dims Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Aaditya-Prasad/consistency-policy/consistency_policy/utils.py
code served (permissive licence) · get_code("f2143ca43f9dc693")
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 4, dtype family float, shape (2, 4, 3, 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 torch

torch.manual_seed(0)

# Create a tensor with multiple dimensions that we can reduce
# Shape: (2, 4, 3, 5) - 4 dimensions
x = torch.randn(2, 4, 3, 5)

# Target dimensions - we want to reduce to 2 dimensions
target_dims = 2

ARGS = {
    "x": x,
    "target_dims": target_dims,
}
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 4, dtype family float, shape (2, 4, 3, 5) — shape (2, 4, 3, 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
sample_n_stratified Ran
ran, honoured the contract we drafted
alexander-soare/consistency_policy/consistency_policy/consistency_model.py
code served (permissive licence) · get_code("0ddc75bcecc6e03f")
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 int, shape (8,) 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
import numpy as np

torch.manual_seed(0)

ARGS = {
    "batch_size": 8,
    "N": 100,
    "n_strata": 4,
    "device": torch.device("cpu"),
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, 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 int, shape (8,) — shape (8,) 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
sample_n_uniform Ran
ran, honoured the contract we drafted
alexander-soare/consistency_policy/consistency_policy/consistency_model.py
code served (permissive licence) · get_code("c9631ffcefa55af9")
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 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 torch

torch.manual_seed(0)

ARGS = {
    "batch_size": 2,
    "N": 10,
    "device": torch.device("cpu"),
}
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 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
WeightedHuber Not yet run
unverified (harvested, no recorded run)
quantumiracle/consistency_model_for_reinforcement_learning/agents/consistency.py
code served (permissive licence) · get_code("c6104b52f96f7bc9")
How it ran

no invocation recorded.

WeightedLoss Not yet run
unverified (harvested, no recorded run)
quantumiracle/consistency_model_for_reinforcement_learning/agents/consistency.py
code served (permissive licence) · get_code("0749c0edc53a9387")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 4 later) and 6 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
WeightedL1
brick of this paper's assembly: helper
8 other papers
3 dated earlier, 5 later · 2 only as an assembly brick
2208.06193 (2022-08)
Diffusion Policies as an Expressive Policy Class for Offline Reinforcement Learning
2210.15629 (2022-10)
Language Control Diffusion: Efficiently Scaling through Space, Time, and Tasks
2305.18459 (2023-05)
Diffusion Model is an Effective Planner and Data Synthesizer for Multi-Task Reinforcement Learning
and 5 more not named here
WeightedL2
brick of this paper's assembly: helper
8 other papers
3 dated earlier, 5 later · 2 only as an assembly brick
2208.06193 (2022-08)
Diffusion Policies as an Expressive Policy Class for Offline Reinforcement Learning
2210.15629 (2022-10)
Language Control Diffusion: Efficiently Scaling through Space, Time, and Tasks
2305.18459 (2023-05)
Diffusion Model is an Effective Planner and Data Synthesizer for Multi-Task Reinforcement Learning
and 5 more not named here
linear_schedule 6 other papers
3 dated earlier, 3 later
1710.02298 (2017-10)
Rainbow: Combining Improvements in Deep Reinforcement Learning
2111.08819 (2021-11)
CleanRL: High-quality Single-file Implementations of Deep Reinforcement Learning Algorithms
2306.00975 (2023-06)
Active Vision Reinforcement Learning under Limited Visual Observability
and 3 more not named here
WeightedHuber
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 later
2208.06193 (2022-08)
Diffusion Policies as an Expressive Policy Class for Offline Reinforcement Learning
2510.11499 (2025-10)
Offline Reinforcement Learning with Generative Trajectory Policies
WeightedLoss
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
2208.06193 (2022-08)
Diffusion Policies as an Expressive Policy Class for Offline 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-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

Score-based generative models like the diffusion model have been testified to be effective in modeling multi-modal data from image generation to reinforcement learning (RL). However, the inference process of diffusion model can be slow, which hinders its usage in RL with iterative sampling. We propose to apply the consistency model as an efficient yet expressive policy representation, namely consistency policy, with an actor-critic style algorithm for three typical RL settings: offline, offline-to-online and online. For offline RL, we demonstrate the expressiveness of generative models as policies from multi-modal data. For offline-to-online RL, the consistency policy is shown to be more computational efficient than diffusion policy, with a comparable performance. For online RL, the consistency policy demonstrates significant speedup and even higher average performances than the diffusion policy.

For agents

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

get_harvested_code_for_paper("2309.16984")
get_code_for_paper("2309.16984")
have("2309.16984")

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

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

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

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

Connect an agent — have() is free.