SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.04463 · NeurIPS · 2025

Training Language Models to Reason Efficiently

Andrea Zanette, Daman Arora

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 1 failure of our instrument; 1 no recorded run), measured 2026-11-22; 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/2502.04463.json · badge: /api/ran/2502.04463.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
Zanette-Labs/efficient-reasoning marked official in Papers with Code
Papers with Code archive
3 ran · 1 no recorded run
stardewxxx/o1-pruner extension (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
DistributedSampler Ran
ran on a synthesized input · constructed an object; no result was computed
Zanette-Labs/efficient-reasoning/openrlhf/trainer/prm_trainer.py
code served (permissive licence) · get_code("65f94b094ae7a402")
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, DistributedSampler: 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 math
from torch.utils.data.dataset import Dataset

torch.manual_seed(0)

class SimpleDataset(Dataset):
    """Minimal dataset implementation"""
    def __init__(self, size=100):
        self.size = size
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        return torch.randn(4), idx

# Create a simple dataset
dataset = SimpleDataset(size=100)

# Define arguments for DistributedSampler
ARGS = {
    'dataset': dataset,
    'num_replicas': 2,
    'rank': 0,
    'shuffle': True,
    'seed': 0,
    'drop_last': False,
    'consumed_samples': 0
}
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 DistributedSampler — 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 DistributedSampler 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
PRMLoss Ran
ran on a synthesized input · constructed an object; no result was computed
Zanette-Labs/efficient-reasoning/openrlhf/trainer/prm_trainer.py
code served (permissive licence) · get_code("58a0d7213346fff5")
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, PRMLoss: 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

torch.manual_seed(0)

# Create small tensors for testing
batch_size = 2
seq_len = 4
vocab_size = 8
placeholder_token_id = 5
reward_token_ids = [6, 7]

# Create inputs tensor with some placeholder tokens
inputs = torch.randint(0, vocab_size, (batch_size, seq_len))
inputs[0, 1] = placeholder_token_id  # Add a placeholder token
inputs[1, 2] = placeholder_token_id  # Add another placeholder token

# Create logits tensor (batch_size, seq_len, vocab_size)
logits = torch.randn(batch_size, seq_len, vocab_size)

# Create labels tensor - use integer labels for hard label case
labels = torch.randint(0, vocab_size, (batch_size, seq_len))
labels[0, 1] = reward_token_ids[0]  # Set label to one of reward tokens
labels[1, 2] = reward_token_ids[1]  # Set label to other reward token

ARGS = {
    "placeholder_token_id": placeholder_token_id,
    "reward_token_ids": reward_token_ids,
}
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 PRMLoss — 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 PRMLoss 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
convert_token_to_id Ran
ran, honoured the contract we drafted
Zanette-Labs/efficient-reasoning/openrlhf/trainer/prm_trainer.py
code served (permissive licence) · get_code("3400fb51e6b3c78a")
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 int, ndim 0, dtype family int, shape () 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

class MockTokenizer:
    def encode(self, token, add_special_tokens=False):
        # Simple mock: map strings to single token IDs
        token_map = {
            'hello': [42],
            'world': [99],
            'test': [7],
            'a': [1],
        }
        return token_map.get(token, [0])

tokenizer = MockTokenizer()
token = 'hello'

ARGS = {
    'token': token,
    'tokenizer': tokenizer,
}
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 int, ndim 0, dtype family int, shape () — shape () 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
format_data Ran
ran; our contract draft was wrong, not the code
stardewxxx/o1-pruner/o1_scripts/construct_dataset.py
code served (permissive licence) · get_code("2818be86730dbfa8")
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 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

torch.manual_seed(0)

ARGS = {
    'item': {
        'problem': 'What is 2 + 2?',
        'solution': 'Step 1: Add the numbers. 2 + 2 = 4. \\boxed{4}',
        'weight': 1.5
    }
}
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 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
ProcessRewardModelTrainer Not yet run
unverified (harvested, no recorded run)
Zanette-Labs/efficient-reasoning/openrlhf/trainer/prm_trainer.py
code served (permissive licence) · get_code("aa503892158c57c0")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 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 4 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
PRMLoss
brick of this paper's assembly: loss
1 other paper
1 later
2505.02387 (2025-05)
RM-R1: Reward Modeling as Reasoning

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

Scaling model size and training data has led to great advances in the performance of Large Language Models (LLMs). However, the diminishing returns of this approach necessitate alternative methods to improve model capabilities, particularly in tasks requiring advanced reasoning. Large reasoning models, which leverage long chain-of-thoughts, bring unprecedented breakthroughs in problem-solving capabilities but at a substantial deployment cost associated to longer generations. Reducing inference costs is crucial for the economic feasibility, user experience, and environmental sustainability of these models. In this work, we propose to train large reasoning models to reason efficiently. Our method incentivizes models to minimize unnecessary computational overhead while largely maintaining accuracy, thereby achieving substantial deployment efficiency gains. It enables the derivation of a family of reasoning models with varying efficiency levels, controlled via a single hyperparameter. Experiments on two open-weight large reasoning models demonstrate significant reductions in inference cost while preserving most of the accuracy.

For agents

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

get_harvested_code_for_paper("2502.04463")
get_code_for_paper("2502.04463")
have("2502.04463")

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

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

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

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

Connect an agent — have() is free.