SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2304.13426 · ICML · 2023

FLEX: an Adaptive Exploration Algorithm for Nonlinear Systems

Marc Lelarge, Matthieu Blanke

arXiv · PDF · Open in the Atlas

Code that ran

4 of 8 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; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 2 failures of our instrument; 4 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/2304.13426.json · badge: /api/ran/2304.13426.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
MB-29/exploration canonical (classifier label)
classifier basis: census
1 ran · 0 no recorded run
mb-29/exploration alias (classifier label)
classifier basis: classifier_2025
3 ran · 4 no recorded run
FunctionStatusWhere it lives
exploration Ran
ran on a synthesized input
MB-29/exploration/exploration.py
code served (permissive licence) · get_code("6c1192aa05d301cc")
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 torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Create minimal agent class
class MinimalAgent(nn.Module):
    def __init__(self, d, m):
        super().__init__()
        self.d = d
        self.m = m
        self.model = nn.Linear(d, m)
        self.step_count = 0
    
    def draw_random_control(self):
        return np.random.randn(self.m)
    
    def policy(self, x, t):
        x_tensor = torch.from_numpy(x).float()
        with torch.no_grad():
            u = self.model(x_tensor).numpy()
        return u
    
    def learning_step(self, x, u, dx_dt):
        self.step_count += 1

# Create minimal environment class
class MinimalEnvironment:
    def __init__(self, d, m):
        self.d = d
        self.m = m
        self.x = np.random.randn(d)
        self.dt = 0.1
    
    def reset(self):
        self.x = np.random.randn(self.d)
    
    def step(self, u, t):
        # Return change in state
        dx = np.random.randn(self.d) * self.dt
        self.x += dx
        return dx
    
    def plot_system(self, x, u, t):
        pass

# Create minimal evaluation class
class MinimalEvaluation:
    def evaluate(self, model, t):
        return float(np.random.randn())

# Create minimal animate function
def dummy_animate(model, u, t, z_values, error_values, plot=False):
    pass

# Build arguments
d = 4
m = 3
T = 5

environment = MinimalEnvironment(d, m)
agent = MinimalAgent(d, m)
evaluation = MinimalEvaluation()

ARGS = {
    'environment': environment,
    'agent': agent,
    'T': T,
    'evaluation': evaluation,
    'T_random': 1,
    'reset': True,
    'plot': False,
    'animate': None,
    'save_models': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, 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
lstsq_update Ran
ran, honoured the contract we drafted
mb-29/exploration/policies.py
code served (permissive licence) · get_code("25092c545b43ea9a")
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 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 numpy as np

# Construct valid arguments for lstsq_update
# The function performs a recursive least squares update
# prior_estimate: shape (n,) - current estimate of theta
# prior_gram: shape (n, n) - Gram matrix (X^T X)
# z: shape (n,) - feature vector for new observation
# y: scalar - target value for new observation

n = 4  # dimension of theta/features

# Initialize prior estimate (small random values)
prior_estimate = np.random.randn(n)

# Initialize prior Gram matrix (positive definite)
prior_gram = np.eye(n) * 0.1

# New feature vector
z = np.random.randn(n)

# New target value
y = np.random.randn()

ARGS = {
    "prior_estimate": prior_estimate,
    "prior_gram": prior_gram,
    "z": z,
    "y": y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — 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
minimize_quadratic_sphere Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mb-29/exploration/policies.py
code served (permissive licence) · get_code("dbc3dffc9bfe8463")
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 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 numpy as np
from scipy.optimize import brentq

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

# Create a small positive definite matrix Q (4x4)
# We'll use a symmetric matrix with known eigenvalues
A = np.random.randn(4, 4)
Q = A @ A.T + np.eye(4)  # Ensure positive definiteness

# Create a vector b (4,)
b = np.random.randn(4)

# Create a radius gamma (scalar, positive)
gamma = 2.5

ARGS = {
    "Q": Q,
    "b": b,
    "gamma": gamma,
}
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 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
solve_D_optimal Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mb-29/exploration/policies.py
code served (permissive licence) · get_code("39b2a6bd5776c7f3")
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 1, dtype family float, shape (3,) 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)

# Define dimensions
d = 4  # state dimension
m = 3  # control dimension

# Create M_inv: inverse of Gram matrix (d x d)
M_inv = np.random.randn(d, d)
M_inv = M_inv @ M_inv.T  # Make it positive definite and symmetric

# Create B: control matrix (d x m)
B = np.random.randn(d, m)

# Create v: current state vector (d,)
v = np.random.randn(d)

# Create gamma: constraint on control norm
gamma = 2.0

ARGS = {
    "M_inv": M_inv,
    "B": B,
    "v": v,
    "gamma": gamma,
}
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 1, dtype family float, shape (3,) — shape (3,) 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
Agent Not yet run
unverified (harvested, no recorded run)
mb-29/exploration/policies.py
code served (permissive licence) · get_code("11c4b78255fe10ce")
How it ran

no invocation recorded.

Flex Not yet run
unverified (harvested, no recorded run)
mb-29/exploration/policies.py
code served (permissive licence) · get_code("83f0d1c7272aedb1")
How it ran

no invocation recorded.

compute_gradient Not yet run
unverified (harvested, no recorded run)
mb-29/exploration/policies.py
code served (permissive licence) · get_code("0b1f3fb0f715e6b0")
How it ran

no invocation recorded.

jacobian Not yet run
unverified (harvested, no recorded run)
mb-29/exploration/policies.py
code served (permissive licence) · get_code("21db7871139de360")
How it ran

no invocation recorded.

Also present in other papers' code

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

Model-based reinforcement learning is a powerful tool, but collecting data to fit an accurate model of the system can be costly. Exploring an unknown environment in a sample-efficient manner is hence of great importance. However, the complexity of dynamics and the computational limitations of real systems make this task challenging. In this work, we introduce FLEX, an exploration algorithm for nonlinear dynamics based on optimal experimental design. Our policy maximizes the information of the next step and results in an adaptive exploration algorithm, compatible with generic parametric learning models and requiring minimal resources. We test our method on a number of nonlinear environments covering different settings, including time-varying dynamics. Keeping in mind that exploration is intended to serve an exploitation objective, we also test our algorithm on downstream model-based classical control tasks and compare it to other state-of-theart model-based and model-free approaches. The performance achieved by FLEX is competitive and its computational cost is low.

For agents

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

get_harvested_code_for_paper("2304.13426")
get_code_for_paper("2304.13426")
have("2304.13426")

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

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

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

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

Connect an agent — have() is free.