SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2311.18232 · 2023

LMRL Gym: Benchmarks for Multi-Turn Reinforcement Learning with Language Models

arXiv · PDF · Open in the Atlas

Code that ran

7 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 1 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/2311.18232.json · badge: /api/ran/2311.18232.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
abdulhaim/lmrl-gym canonical (classifier label)
classifier basis: census
7 ran · 1 no recorded run
FunctionStatusWhere it lives
filter_items Ran
ran; our contract draft was wrong, not the code
abdulhaim/lmrl-gym/LLM_RL/algorithms/bc/data.py
code served (permissive licence) · get_code("a279fdf4e1e2f56e")
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 list, ndim 1, 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
from typing import Any, Callable, List, Optional

# Define a simple score function that takes an item and returns a float
def score_fn(item: Any) -> float:
    """Simple score function that returns a numeric score for an item."""
    if isinstance(item, dict):
        return item.get('value', 0.0)
    elif isinstance(item, (int, float)):
        return float(item)
    else:
        return float(len(str(item)))

# Create a list of items to filter
items = [
    {'value': 0.5, 'id': 1},
    {'value': 0.8, 'id': 2},
    {'value': 0.3, 'id': 3},
    {'value': 0.9, 'id': 4},
    {'value': 0.6, 'id': 5},
]

# Define ARGS with all required parameters
ARGS = {
    'score_fn': score_fn,
    'items': items,
    'take_top': 40.0,  # Take top 40% of items
    'threshold': None,  # Must be None when take_top is not None
}
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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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_query_indicators Ran
ran, honoured the contract we drafted
abdulhaim/lmrl-gym/LLM_RL/algorithms/ilql/base_interface.py
code served (permissive licence) · get_code("c04433a04b87059b")
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 ArrayImpl, ndim 2, dtype family float, shape (8, 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 jax
import jax.numpy as jnp

# Create a small flat_mask array with some True values
# Shape: (8,) with some True values to test the function
flat_mask = jnp.array([True, False, True, False, False, True, False, False], dtype=jnp.bool_)

ARGS = {
    "flat_mask": flat_mask
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 2, dtype family float, shape (8, 8) — shape (8, 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
get_tensor_stats Ran
ran; our contract draft was wrong, not the code
abdulhaim/lmrl-gym/LLM_RL/utils.py
code served (permissive licence) · get_code("cb7f4af05dcf8ec4")
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 jax
import jax.numpy as jnp

# Create small JAX arrays for testing
xs = jnp.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]).reshape(2, 4)
mask = jnp.array([1.0, 1.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0]).reshape(2, 4)
n = 6

ARGS = {
    "xs": xs,
    "mask": mask,
    "n": n
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — 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
get_tensor_stats_np Ran
ran; our contract draft was wrong, not the code
abdulhaim/lmrl-gym/LLM_RL/utils.py
code served (permissive licence) · get_code("732e9b1128ba66a5")
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 numpy as np

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

# Create a small test tensor with shape (2, 4)
xs = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [5.0, 6.0, 7.0, 8.0]
], dtype=np.float32)

# Create a mask with the same shape
mask = np.array([
    [1.0, 1.0, 0.0, 1.0],
    [1.0, 0.0, 1.0, 1.0]
], dtype=np.float32)

# Count the number of True values in mask (for the n parameter)
n = int(np.sum(mask))

ARGS = {
    "xs": xs,
    "mask": mask,
    "n": n
}
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 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
label_logs Ran
ran; our contract draft was wrong, not the code
abdulhaim/lmrl-gym/LLM_RL/log_utils.py
code served (permissive licence) · get_code("472b4b2ee09e79f6")
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 torch.nn as nn
from typing import Any, Dict, List, Optional

torch.manual_seed(0)

# Create sample logs - can be any object since it's just passed through
logs = {
    "loss": 0.5,
    "accuracy": 0.95,
    "epoch": 1
}

# Create label string
label = "train"

# Create to_add dictionary with additional items
to_add = {
    "batch_size": 32,
    "learning_rate": 0.001,
    "model_name": "bert-base"
}

ARGS = {
    "logs": logs,
    "label": label,
    "to_add": to_add
}
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 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
pull_logs Ran
ran; our contract draft was wrong, not the code
abdulhaim/lmrl-gym/LLM_RL/log_utils.py
code served (permissive licence) · get_code("0010e3a7219eac47")
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 jax
import jax.numpy as jnp
import numpy as np
from collections import namedtuple

LogTuple = namedtuple('LogTuple', ['mean', 'count'])

# Test case 1: Simple scalar values
logs_scalar = {
    'loss': 0.5,
    'accuracy': 0.95
}

# Test case 2: JAX arrays (scalars)
logs_jax_scalars = {
    'loss': jnp.array(0.5),
    'accuracy': jnp.array(0.95)
}

# Test case 3: NumPy arrays (scalars)
logs_numpy_scalars = {
    'loss': np.array(0.5),
    'accuracy': np.array(0.95)
}

# Test case 4: JAX vectors
logs_jax_vectors = {
    'losses': jnp.array([0.1, 0.2, 0.3, 0.4]),
    'accuracies': jnp.array([0.9, 0.92, 0.94, 0.96])
}

# Test case 5: NumPy vectors
logs_numpy_vectors = {
    'losses': np.array([0.1, 0.2, 0.3, 0.4]),
    'accuracies': np.array([0.9, 0.92, 0.94, 0.96])
}

# Test case 6: LogTuple with scalar means
logs_with_logtuple_scalar = {
    'metric1': LogTuple(mean=jnp.array(0.5), count=jnp.array(10)),
    'metric2': LogTuple(mean=0.7, count=5)
}

# Test case 7: LogTuple with vector means
logs_with_logtuple_vector = {
    'metric1': LogTuple(mean=jnp.array([0.1, 0.2, 0.3, 0.4]), count=jnp.array([5, 5, 5, 5])),
    'metric2': LogTuple(mean=np.array([0.9, 0.92, 0.94, 0.96]), count=np.array([10, 10, 10, 10]))
}

# Test case 8: Mixed nested structure
logs_mixed = {
    'train': {
        'loss': 0.3,
        'metrics': {
            'accuracy': jnp.array(0.88),
            'f1': LogTuple(mean=jnp.array([0.85, 0.87, 0.89, 0.91]), count=jnp.array([20, 20, 20, 20]))
        }
    },
    'val': {
        'loss': jnp.array([0.35, 0.36, 0.37, 0.38]),
        'accuracy': LogTuple(mean=np.array(0.85), count=np.array(15))
    }
}

# Use the most comprehensive test case
ARGS = {
    'logs': logs_mixed
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, jaxtyping, numpy — 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
unpad_array Ran
ran, honoured the contract we drafted
abdulhaim/lmrl-gym/LLM_RL/utils.py
code served (permissive licence) · get_code("9e4eea7687d40ae5")
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 2, dtype family float, shape (3, 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
import jax.numpy as jnp

# Create a simple mask array where some positions are padding (0) and others are not (1)
# The function looks for the first position where mask is 0, then truncates xs up to that point
mask = np.array([1, 1, 1, 0, 0, 0], dtype=np.int32)

# Create a corresponding data array with matching length
# Using distinct dimensions: 6 samples, 4 features
xs = np.arange(24).reshape(6, 4).astype(np.float32)

ARGS = {
    "xs": xs,
    "mask": mask,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — 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 (3, 4) — shape (3, 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
combine_logs Not yet run
unverified (harvested, no recorded run)
abdulhaim/lmrl-gym/LLM_RL/log_utils.py
code served (permissive licence) · get_code("a6acdf2ec8531626")
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-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

Large language models (LLMs) provide excellent text-generation capabilities, but standard prompting and generation methods generally do not lead to intentional or goal-directed agents and might necessitate considerable prompt tuning. This becomes particularly apparent in multi-turn conversations: even the best current LLMs rarely ask clarifying questions, engage in explicit information gathering, or take actions now that lead to better decisions after multiple turns. Reinforcement learning has the potential to leverage the powerful modeling capabilities of LLMs, as well as their internal representation of textual interactions, to create capable goal-directed language agents. This can enable intentional and temporally extended interactions, such as with humans, through coordinated persuasion and carefully crafted questions, or in goal-directed play through text games to bring about desired final outcomes. However, enabling this requires the community to develop stable and reliable reinforcement learning algorithms that can effectively train LLMs. Developing such algorithms requires tasks that can gauge progress on algorithm design, provide accessible and reproducible evaluations for multi-turn interactions, and cover a range of task properties and challenges in improving reinforcement learning algorithms. Our paper introduces the LMRL-Gym benchmark for evaluating multi-turn RL for LLMs, together with an open-source research framework containing a basic toolkit for getting started on multi-turn RL with offline value-based and policy-based RL methods. Our benchmark consists of 8 different language tasks, which require multiple rounds of language interaction and cover a range of tasks in open-ended dialogue and text games.

For agents

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

get_harvested_code_for_paper("2311.18232")
get_code_for_paper("2311.18232")
have("2311.18232")

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

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

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

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

Connect an agent — have() is free.