SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2504.08837 · 2025

VL-Rethinker: Incentivizing Self-Reflection of Vision-Language Models with Reinforcement Learning

arXiv · PDF · Open in the Atlas

Code that ran

8 of 12 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 4 have no contract verdict; 3 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/2504.08837.json · badge: /api/ran/2504.08837.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
tiger-ai-lab/vl-rethinker community (classifier label)
classifier basis not recorded on the link
8 ran · 4 no recorded run
FunctionStatusWhere it lives
compute_approx_kl Ran
ran; our contract draft was wrong, not the code
tiger-ai-lab/vl-rethinker/openrlhf/models/utils.py
code served (permissive licence) · get_code("de2fefc774bb0362")
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

torch.manual_seed(0)

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

# Create an action mask with the same shape
action_mask = torch.ones(2, 4)

ARGS = {
    "log_probs": log_probs,
    "log_probs_base": log_probs_base,
    "action_mask": action_mask,
    "use_kl_estimator_k3": False,
}
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 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
entropy_from_logits Ran
ran on a synthesized input
tiger-ai-lab/vl-rethinker/openrlhf/models/actor.py
code served (permissive licence) · get_code("c710eef68603bd62")
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 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
torch.manual_seed(0)

# The function takes logits as input and computes entropy
# logits should be a torch.Tensor of arbitrary shape with at least 1 dimension
# The function uses softmax and logsumexp on dim=-1, so we need at least 1D

logits = torch.randn(2, 4)

ARGS = {
    "logits": logits,
}
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 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
exist_and_not_none Ran
ran on a synthesized input
tiger-ai-lab/vl-rethinker/openrlhf/datasets/utils.py
code served (permissive licence) · get_code("71edf11f55693a58")
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 bool, ndim 0, dtype family float, 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

torch.manual_seed(0)

# The function checks:
# 1. if key exists in dictionary d
# 2. if the value at d[key] is not None

# Valid test case: dictionary with a key that maps to a non-None value
ARGS = {
    "d": {"key1": 42, "key2": None, "key3": "value"},
    "key": "key1"
}
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 bool, ndim 0, dtype family float, 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
log_probs_from_logits Ran
ran; our contract draft was wrong, not the code
tiger-ai-lab/vl-rethinker/openrlhf/models/utils.py
code served (permissive licence) · get_code("0612b61574b81472")
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 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=2, num_classes=4)
logits = torch.randn(2, 4, dtype=torch.float32)

# labels: shape (batch_size=2,) with class indices
labels = torch.tensor([1, 3], dtype=torch.long)

ARGS = {
    "logits": logits,
    "labels": labels,
}
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 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
preprocess_data Ran
ran on a synthesized input
tiger-ai-lab/vl-rethinker/openrlhf/datasets/prompts_dataset.py
code served (permissive licence) · get_code("8368fe60f5326faa")
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 str. 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

# Build a minimal chat template function that mimics transformers behavior
def mock_chat_template(messages, tokenize=False, add_generation_prompt=False):
    """Mock implementation of a chat template function"""
    prompt = ""
    for msg in messages:
        role = msg.get('role', 'user')
        content = msg.get('content', '')
        prompt += f"<{role}>{content}</{role}>"
    if add_generation_prompt:
        prompt += "<assistant>"
    return prompt

# Test case 1: with apply_chat_template
data_with_chat = {
    'input': "What is the capital of France?"
}

# Test case 2: without apply_chat_template but with input_template
data_with_template = {
    'input': "Paris"
}

input_template_str = "The answer is: {}"

# Test case 3: simple case with just input_key
data_simple = {
    'input': "Simple prompt"
}

# Build ARGS - we need to test one path through the function
# Let's use the apply_chat_template path
ARGS = {
    'data': data_with_chat,
    'input_template': None,
    'input_key': 'input',
    'apply_chat_template': mock_chat_template
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
read_jsonl Ran
ran on a synthesized input
tiger-ai-lab/vl-rethinker/openrlhf/trainer/evaluator.py
code served (permissive licence) · get_code("059f7ea3562486c2")
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 json
import tempfile
import os

# Create a temporary jsonl file with valid test data
temp_dir = tempfile.mkdtemp()
temp_filepath = os.path.join(temp_dir, "test_data.jsonl")

# Write some test data to the jsonl file
test_data = [
    {"id": 1, "name": "Alice", "score": 95.5},
    {"id": 2, "name": "Bob", "score": 87.3},
    {"id": 3, "name": "Charlie", "score": 92.1},
]

with open(temp_filepath, 'w', encoding='utf-8') as f:
    for item in test_data:
        f.write(json.dumps(item) + '\n')

# Define the arguments dict
ARGS = {
    "filepath": temp_filepath
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
reward_fn Ran
ran; our contract draft was wrong, not the code
tiger-ai-lab/vl-rethinker/openrlhf/cli/eval_ray.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from miaoyuchun/inform, is pointer only (licence: NONE) · get_code("18ed61dcfadbbdf0")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from miaoyuchun/inform, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

zero_pad_sequences Ran
ran, honoured the contract we drafted
tiger-ai-lab/vl-rethinker/openrlhf/datasets/utils.py
code served (permissive licence) · get_code("c48a5c183e44469e")
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 3, dtype family float, shape (3, 2, 5) 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 sequences with different lengths
# The function iterates through sequences and accesses seq.size(-1)
# It then stacks them, so they need compatible shapes except for last dim
seq1 = torch.randn(2, 3)  # shape (2, 3)
seq2 = torch.randn(2, 5)  # shape (2, 5)
seq3 = torch.randn(2, 4)  # shape (2, 4)

sequences = [seq1, seq2, seq3]

ARGS = {
    'sequences': sequences,
    'side': 'left',
    'value': 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 Tensor, ndim 3, dtype family float, shape (3, 2, 5) — shape (3, 2, 5) 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)
tiger-ai-lab/vl-rethinker/openrlhf/models/utils.py
code served (permissive licence) · get_code("0d27f3b8c425d79f")
How it ran

no invocation recorded.

convert_ring_attn_params Not yet run
unverified (harvested, no recorded run)
tiger-ai-lab/vl-rethinker/openrlhf/models/ring_attn_utils.py
code served (permissive licence) · get_code("d66f259aaf6cd9c7")
How it ran

no invocation recorded.

get_print Not yet run
unverified (harvested, no recorded run)
tiger-ai-lab/vl-rethinker/openrlhf/models/loss.py
code served (permissive licence) · get_code("27ab2676fee3ce6a")
How it ran

no invocation recorded.

reset_ring_attn_position_ids Not yet run
unverified (harvested, no recorded run)
tiger-ai-lab/vl-rethinker/openrlhf/models/ring_attn_utils.py
code served (permissive licence) · get_code("e93117d99aa6b210")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 4 the same month, 6 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
reset_ring_attn_position_ids 15 other papers
8 dated earlier, 1 the same month, 6 later
2306.00398 (2023-06)
Preference-grounded Token-level Guidance for Language Model Fine-tuning
2402.09345 (2024-02)
InfoRM: Mitigating Reward Hacking in RLHF via Information-Theoretic Reward Modeling
2404.18922 (2024-04)
DPO Meets PPO: Reinforced Token Optimization for RLHF
and 12 more not named here
convert_ring_attn_params 9 other papers
6 dated earlier, 1 the same month, 2 later
2306.00398 (2023-06)
Preference-grounded Token-level Guidance for Language Model Fine-tuning
2402.09345 (2024-02)
InfoRM: Mitigating Reward Hacking in RLHF via Information-Theoretic Reward Modeling
2404.18922 (2024-04)
DPO Meets PPO: Reinforced Token Optimization for RLHF
and 6 more not named here
compute_reward 6 other papers
1 dated earlier, 1 the same month, 4 later
2402.09345 (2024-02)
InfoRM: Mitigating Reward Hacking in RLHF via Information-Theoretic Reward Modeling
2504.07912 (2025-04)
Echo Chamber: RL Post-training Amplifies Behaviors Learned in Pretraining
2505.15456 (2025-05)
Teaching Language Models to Evolve with Users: Dynamic Profile Modeling for Personalized Alignment
and 3 more not named here
reward_fn 4 other papers
2 dated earlier, 1 the same month, 1 later
2204.05862 (2022-04)
Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedback
2503.22828 (2025-03)
Learning to Reason for Long-Form Story Generation
2504.05185 (2025-04)
Concise Reasoning via Reinforcement Learning
and 1 more not named here
log_probs_from_logits 3 other papers
1 dated earlier, 2 later
2402.09345 (2024-02)
InfoRM: Mitigating Reward Hacking in RLHF via Information-Theoretic Reward Modeling
2506.08011 (2025-06)
Play to Generalize: Learning to Reason Through Game Play
2601.05073 (2026-01)
Milestones over Outcome: Unlocking Geometric Reasoning with Sub-Goal Verifiable Reward
compute_approx_kl 2 other papers
1 dated earlier, 1 later
2306.00398 (2023-06)
Preference-grounded Token-level Guidance for Language Model Fine-tuning
2601.17671 (2026-01)
Align to the Pivot: Dual Alignment with Self-Feedback for Multilingual Math Reasoning
zero_pad_sequences 1 other paper
1 dated earlier
2405.07667 (2024-05)
Simulate and Eliminate: Revoke Backdoors for Generative 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-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

Recently, slow-thinking systems like GPT-o1 and DeepSeek-R1 have demonstrated great potential in solving challenging problems through explicit reflection. They significantly outperform the best fast-thinking models, such as GPT-4o, on various math and science benchmarks. However, their multimodal reasoning capabilities remain on par with fast-thinking models. For instance, GPT-o1's performance on benchmarks like MathVista, MathVerse, and MathVision is similar to fast-thinking models. In this paper, we aim to enhance the slow-thinking capabilities of vision-language models using reinforcement learning (without relying on distillation) to advance the state of the art. First, we adapt the GRPO algorithm with a novel technique called Selective Sample Replay (SSR) to address the vanishing advantages problem. While this approach yields strong performance, the resulting RL-trained models exhibit limited self-reflection or self-verification. To further encourage slow-thinking, we introduce Forced Rethinking, which appends a rethinking trigger token to the end of rollouts in RL training, explicitly enforcing a self-reflection reasoning step. By combining these two techniques, our model, VL-Rethinker, advances state-of-the-art scores on MathVista, MathVerse to achieve 80.4%, 63.5% respectively. VL-Rethinker also achieves open-source SoTA on multi-disciplinary benchmarks such as MathVision, MMMU-Pro, EMMA, and MEGA-Bench, narrowing the gap with OpenAI-o1. Our empirical results show the effectiveness of our approaches.

For agents

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

get_harvested_code_for_paper("2504.08837")
get_code_for_paper("2504.08837")
have("2504.08837")

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

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

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

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

Connect an agent — have() is free.