SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2112.06753 · NeurIPS · 2021

FinRL-Meta: A Universe of Near-Real Market Environments for Data-Driven Deep Reinforcement Learning in Quantitative Finance

Zhaoran Wang, Xiao-Yang Liu, Jingyang Rui, Jiechao Gao, Liuqing Yang, Hongyang Yang, Christina Wang, Jian Guo

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 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; 1 failure of our instrument; 2 no recorded run), measured 2026-11-22; 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/2112.06753.json · badge: /api/ran/2112.06753.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
AI4Finance-Foundation/FinRL-Meta canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
ai4finance-foundation/finrl-meta community
Papers with Code archive
3 ran · 2 no recorded run
FunctionStatusWhere it lives
ActorSAC Ran
ran on a synthesized input
ai4finance-foundation/finrl-meta/meta/env_future_trading/wt4elegantrl/elegantrl/agent.py
code served (permissive licence) · get_code("05a7350d4f48630c")
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 2, 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 numpy as np
import torch
import torch.nn as nn

# INIT_ARGS for ActorSAC.__init__(mid_dim, state_dim, action_dim, if_use_dn=False)
INIT_ARGS = {
    'mid_dim': 8,
    'state_dim': 6,
    'action_dim': 3,
    'if_use_dn': True
}

# ARGS for ActorSAC.forward(state)
# The forward method expects a state tensor
# state_dim must match INIT_ARGS['state_dim'] = 6
# Using batch size of 2
ARGS = {
    'state': torch.randn(2, 6)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 2, 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)
CriticTwin Ran
ran on a synthesized input
ai4finance-foundation/finrl-meta/meta/env_future_trading/wt4elegantrl/elegantrl/agent.py
code served (permissive licence) · get_code("80a344d9f1816c21")
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 2, dtype family float, shape (2, 1) 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 torch.nn as nn

class DenseNet(nn.Module):

    def __init__(self, lay_dim):
        super().__init__()
        self.dense1 = nn.Sequential(nn.Linear(lay_dim * 1, lay_dim * 1), nn.Hardswish())
        self.dense2 = nn.Sequential(nn.Linear(lay_dim * 2, lay_dim * 2), nn.Hardswish())
        self.inp_dim = lay_dim
        self.out_dim = lay_dim * 4

    def forward(self, x1):
        x2 = torch.cat((x1, self.dense1(x1)), dim=1)
        x3 = torch.cat((x2, self.dense2(x2)), dim=1)
        return x3

class CriticTwin(nn.Module):

    def __init__(self, mid_dim, state_dim, action_dim, if_use_dn=False):
        super().__init__()
        if if_use_dn:
            nn_middle = DenseNet(mid_dim // 2)
            inp_dim = nn_middle.inp_dim
            out_dim = nn_middle.out_dim
        else:
            nn_middle = nn.Sequential(nn.Linear(mid_dim, mid_dim), nn.ReLU(), nn.Linear(mid_dim, mid_dim), nn.ReLU())
            inp_dim = mid_dim
            out_dim = mid_dim
        self.net_sa = nn.Sequential(nn.Linear(state_dim + action_dim, inp_dim), nn.ReLU(), nn_middle)
        self.net_q1 = nn.Sequential(nn.Linear(out_dim, mid_dim), nn.Hardswish(), nn.Linear(mid_dim, 1))
        self.net_q2 = nn.Sequential(nn.Linear(out_dim, mid_dim), nn.Hardswish(), nn.Linear(mid_dim, 1))

    def forward(self, state, action):
        tmp = self.net_sa(torch.cat((state, action), dim=1))
        return self.net_q1(tmp)

    def get_q1_q2(self, state, action):
        tmp = self.net_sa(torch.cat((state, action), dim=1))
        return (self.net_q1(tmp), self.net_q2(tmp))


INIT_ARGS = {
    'mid_dim': 8,
    'state_dim': 4,
    'action_dim': 3,
    'if_use_dn': False,
}

ARGS = {
    'state': torch.randn(2, 4),
    'action': torch.randn(2, 3),
}

if __name__ == '__main__':
    model = CriticTwin(**INIT_ARGS)
    output = model(**ARGS)
    print("Forward output shape:", output.shape)
    q1, q2 = model.get_q1_q2(**ARGS)
    print("Q1 shape:", q1.shape)
    print("Q2 shape:", q2.shape)
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 2, dtype family float, shape (2, 1) — shape (2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
DenseNet Ran
ran on a synthesized input
ai4finance-foundation/finrl-meta/meta/env_future_trading/wt4elegantrl/elegantrl/agent.py
code served (permissive licence) · get_code("6cf5ceb24c4e37a2")
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 2, dtype family float, shape (2, 16) 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 torch.nn as nn

class DenseNet(nn.Module):

    def __init__(self, lay_dim):
        super().__init__()
        self.dense1 = nn.Sequential(nn.Linear(lay_dim * 1, lay_dim * 1), nn.Hardswish())
        self.dense2 = nn.Sequential(nn.Linear(lay_dim * 2, lay_dim * 2), nn.Hardswish())
        self.inp_dim = lay_dim
        self.out_dim = lay_dim * 4

    def forward(self, x1):
        x2 = torch.cat((x1, self.dense1(x1)), dim=1)
        x3 = torch.cat((x2, self.dense2(x2)), dim=1)
        return x3


INIT_ARGS = {
    'lay_dim': 4
}

ARGS = {
    'x1': torch.randn(2, 4)
}

if __name__ == '__main__':
    model = DenseNet(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x1'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Expected output shape: (2, {INIT_ARGS['lay_dim'] * 4})")
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 2, dtype family float, shape (2, 16) — shape (2, 16) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
data_split Ran
ran; our contract draft was wrong, not the code
AI4Finance-Foundation/FinRL-Meta/examples/run_rl_portfolio_optimization.py
code served (permissive licence) · get_code("840792cc80b38e1a")
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 DataFrame. 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 pandas as pd
import numpy as np

# Create a sample dataframe with required columns
np.random.seed(0)
dates = pd.date_range('2023-01-01', periods=10, freq='D')
df = pd.DataFrame({
    'time': list(dates) * 2,  # Repeat dates for multiple tickers
    'tic': ['AAPL'] * 10 + ['GOOGL'] * 10,
    'price': np.random.rand(20),
    'volume': np.random.randint(1000, 5000, 20)
})

ARGS = {
    'df': df,
    'start': '2023-01-01',
    'end': '2023-01-08',
    'target_date_col': 'time'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
AgentBase Not yet run
unverified (harvested, no recorded run)
ai4finance-foundation/finrl-meta/meta/env_future_trading/wt4elegantrl/elegantrl/agent.py
code served (permissive licence) · get_code("492c64065af2e8d6")
How it ran

no invocation recorded.

AgentSAC Not yet run
unverified (harvested, no recorded run)
ai4finance-foundation/finrl-meta/meta/env_future_trading/wt4elegantrl/elegantrl/agent.py
code served (permissive licence) · get_code("ccc313c0162b6520")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 5 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
data_split 2 other papers
2 later
2211.03107 (2022-11)
FinRL-Meta: Market Environments and Benchmarks for Data-Driven Financial Reinforcement Learning
2304.13174 (2023-04)
Dynamic Datasets and Market Environments for Financial 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-22.

Repositories linked to this paper

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

Abstract

Deep reinforcement learning (DRL) has shown huge potentials in building financial market simulators recently. However, due to the highly complex and dynamic nature of real-world markets, raw historical financial data often involve large noise and may not reflect the future of markets, degrading the fidelity of DRL-based market simulators. Moreover, the accuracy of DRL-based market simulators heavily relies on numerous and diverse DRL agents, which increases demand for a universe of market environments and imposes a challenge on simulation speed. In this paper, we present a FinRL-Meta framework that builds a universe of market environments for data-driven financial reinforcement learning. First, FinRL-Meta separates financial data processing from the design pipeline of DRL-based strategy and provides open-source data engineering tools for financial big data. Second, FinRL-Meta provides hundreds of market environments for various trading tasks. Third, FinRL-Meta enables multiprocessing simulation and training by exploiting thousands of GPU cores. Our codes are available online at https://github.com/AI4Finance-Foundation/FinRL-Meta.

For agents

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

get_harvested_code_for_paper("2112.06753")
get_code_for_paper("2112.06753")
have("2112.06753")

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

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

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

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

Connect an agent — have() is free.