SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2412.16145 · 2024

Offline Reinforcement Learning for LLM Multi-Step Reasoning

arXiv · PDF · Open in the Atlas

Code that ran

2 of 3 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 0 have no contract verdict; 1 failure 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/2412.16145.json · badge: /api/ran/2412.16145.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
jwhj/oreo canonical (classifier label)
classifier basis not recorded on the link
2 ran · 1 no recorded run
FunctionStatusWhere it lives
compute_approx_kl Ran
ran, honoured the contract we drafted
jwhj/oreo/openrlhf/models/utils.py
code served (permissive licence) · get_code("60d73ddf6afc1bc3")
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 Tensor, 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 torch
import numpy as np

torch.manual_seed(0)

# Create small tensors for log probabilities
# Shape: (batch_size=2, num_actions=4)
log_probs = torch.randn(2, 4, dtype=torch.float32)
log_probs_base = torch.randn(2, 4, dtype=torch.float32)

# Create action mask with same shape
# Using values of 1.0 to indicate valid actions, 0.0 for masked
action_mask = torch.ones(2, 4, dtype=torch.float32)

ARGS = {
    "log_probs": log_probs,
    "log_probs_base": log_probs_base,
    "action_mask": action_mask,
}
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 Tensor, 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
log_probs_from_logits Ran
ran; our contract draft was wrong, not the code
jwhj/oreo/openrlhf/models/utils.py
code served (permissive licence) · get_code("959df7824bf09cc1")
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 float, 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
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for testing
# logits: shape (batch_size, num_classes) = (2, 4)
logits = torch.randn(2, 4)

# labels: shape (batch_size,) with class indices in range [0, num_classes)
labels = torch.tensor([0, 2])

ARGS = {
    "logits": logits,
    "labels": labels,
}
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 float, 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
compute_reward Not yet run
unverified (harvested, no recorded run)
jwhj/oreo/openrlhf/models/utils.py
code served (permissive licence) · get_code("99a2d91ea5aed978")
How it ran

no invocation recorded.

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 3 later) and 0 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
log_probs_from_logits 8 other papers
3 dated earlier, 1 the same month, 4 later
2306.00398 (2023-06)
Preference-grounded Token-level Guidance for Language Model Fine-tuning
2404.18922 (2024-04)
DPO Meets PPO: Reinforced Token Optimization for RLHF
2410.20749 (2024-10)
Matryoshka Pilot: Learning to Drive Black-Box LLMs with LLMs
and 5 more not named here
compute_approx_kl 3 other papers
1 dated earlier, 2 later
2410.20749 (2024-10)
Matryoshka Pilot: Learning to Drive Black-Box LLMs with LLMs
2503.10990 (2025-03)
Statistical Impossibility and Possibility of Aligning LLMs with Human Preferences: From Condorcet Paradox to Nash Equilibrium
2606.09124 (2026-06)
A Regret Minimization Framework on Preference Learning in Large Language Models
compute_reward 3 other papers
1 dated earlier, 2 later
2410.20749 (2024-10)
Matryoshka Pilot: Learning to Drive Black-Box LLMs with LLMs
2503.10990 (2025-03)
Statistical Impossibility and Possibility of Aligning LLMs with Human Preferences: From Condorcet Paradox to Nash Equilibrium
2606.09124 (2026-06)
A Regret Minimization Framework on Preference Learning in Large Language Models

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

Improving the multi-step reasoning ability of large language models (LLMs) with offline reinforcement learning (RL) is essential for quickly adapting them to complex tasks. While Direct Preference Optimization (DPO) has shown promise in aligning LLMs with human preferences, it is less suitable for multi-step reasoning tasks because (1) DPO relies on paired preference data, which is not readily available for multi-step reasoning tasks, and (2) it treats all tokens uniformly, making it ineffective for credit assignment in multi-step reasoning tasks, which often come with sparse reward. In this work, we propose OREO (Offline Reasoning Optimization), an offline RL method for enhancing LLM multi-step reasoning. Building on insights from previous works of maximum entropy reinforcement learning, it jointly learns a policy model and value function by optimizing the soft Bellman Equation. We show in principle that it reduces the need to collect pairwise data and enables better credit assignment. Empirically, OREO surpasses existing offline learning methods on multi-step reasoning benchmarks, including mathematical reasoning tasks (GSM8K, MATH) and embodied agent control (ALFWorld). The approach can be extended to a multi-iteration framework when additional resources are available. Furthermore, the learned value function can be leveraged to guide the tree search for free, which can further boost performance during test time.

For agents

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

get_harvested_code_for_paper("2412.16145")
get_code_for_paper("2412.16145")
have("2412.16145")

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

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

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

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

Connect an agent — have() is free.