SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2507.02834 · NeurIPS · 2025

ExPO: Unlocking Hard Reasoning with Self-Explanation-Guided Reinforcement Learning

Amy Zhang, Liu Leqi, Shuozhe Li, Ruiyang Zhou

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 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; 4 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 3 no recorded run), measured 2026-11-23; 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/2507.02834.json · badge: /api/ran/2507.02834.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
dhcode-cpp/X-R1 canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
huggingface/open-r1 canonical (classifier label)
classifier basis: plan_row
2 ran · 2 no recorded run
FunctionStatusWhere it lives
extract_answer Ran
ran; our contract draft was wrong, not the code
dhcode-cpp/X-R1/src/x_r1/rewards.py
code served (permissive licence) · get_code("ebe018f39b3bb7d5")
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 re

def extract_answer(text):
    """Extract content between <answer> tags."""
    if text is None:
        return ''
    match = re.search('<answer>(.*?)</answer>', text, re.DOTALL)
    if match:
        return match.group(1).strip()
    return text.strip()


ARGS = {
    'text': '<answer>Hello World</answer>'
}
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 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
format_reward Ran
ran, honoured the contract we drafted
huggingface/open-r1/src/open_r1/rewards.py
code served (permissive licence) · get_code("ce353d566f3f2c9f")
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 re
import torch
import torch.nn as nn

torch.manual_seed(0)

# The function expects `completions` to be a list of lists of dicts
# Each completion is a list with at least one dict that has a 'content' key
# The content should be a string that may or may not match the pattern

# Create valid completions that match the pattern
valid_completion_1 = [{
    'content': '<think>\nThis is my reasoning\n</think>\n<answer>\nThe answer is 42\n</answer>'
}]

# Create valid completions that don't match the pattern
invalid_completion_1 = [{
    'content': 'This is just plain text without the required tags'
}]

# Create another valid one
valid_completion_2 = [{
    'content': '<think>\nLet me think about this problem\n</think>\n<answer>\nFinal answer\n</answer>'
}]

# Create another invalid one
invalid_completion_2 = [{
    'content': '<think>\nIncomplete structure'
}]

completions = [
    valid_completion_1,
    invalid_completion_1,
    valid_completion_2,
    invalid_completion_2
]

ARGS = {
    'completions': completions
}
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 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
format_reward Ran
ran, honoured the contract we drafted
dhcode-cpp/X-R1/src/x_r1/benchmark.py
code served (permissive licence) · get_code("2627a2d9d4808062")
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 float, 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 re

def format_reward(completion):
    """Reward function that checks if the completion has a specific format."""
    pattern = '^<think>.*?</think><answer>.*?</answer>$'
    matches = re.match(pattern, completion)
    rewards = 1.0 if matches else 0.0
    return rewards

# Valid completion with proper format
valid_completion = "<think>reasoning here</think><answer>final answer</answer>"

# Invalid completion without proper format
invalid_completion = "just some text without the required format"

ARGS = {
    "completion": valid_completion
}
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 float, 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
get_callbacks Ran
ran; our contract draft was wrong, not the code
dhcode-cpp/X-R1/src/x_r1/utils/callbacks.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from tuoyou-hao/BPD-GRPO, is pointer only (licence: NONE) · get_code("9b92c44e1bde6319")
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 tuoyou-hao/BPD-GRPO, 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.

get_param_count_from_repo_id Ran
ran, honoured the contract we drafted
dhcode-cpp/X-R1/src/x_r1/utils/hub.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from tuoyou-hao/BPD-GRPO, is pointer only (licence: NONE) · get_code("dcbd918d943fcaab")
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 tuoyou-hao/BPD-GRPO, 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.

normalize_text Ran
ran; our contract draft was wrong, not the code
dhcode-cpp/X-R1/src/x_r1/rewards.py
code served (permissive licence) · get_code("11f2676b13fb9f69")
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 re

def normalize_text(text):
    """Normalize text by removing extra whitespace, converting to lowercase."""
    if text is None:
        return ''
    text = re.sub('\\s+', ' ', text.strip().lower())
    return text

ARGS = {
    'text': '  Hello   World  \n  This  IS   a   TEST  '
}
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 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
tag_count_reward Ran
ran, honoured the contract we drafted
huggingface/open-r1/src/open_r1/rewards.py
code served (permissive licence) · get_code("0a5673b11c91e69d")
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 torch

torch.manual_seed(0)

ARGS = {
    "completions": [
        [{"content": "Let me think about this.\n<think>\nSome reasoning here\n</think>\nNow I have an answer.\n<answer>\nThe answer is 42\n</answer>"}],
        [{"content": "Another response\n<think>\nMore reasoning\n</think>\nFinal answer\n<answer>\nAnother answer\n</answer>"}],
    ]
}
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 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_gpu_count_for_vllm Not yet run
unverified (harvested, no recorded run)
huggingface/open-r1/src/open_r1/utils/hub.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from tuoyou-hao/BPD-GRPO, is pointer only (licence: NONE) · get_code("4b0eb1a9216422d3")
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 tuoyou-hao/BPD-GRPO, 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. No invocation recorded.

get_gpu_count_for_vllm Not yet run
unverified (harvested, no recorded run)
dhcode-cpp/X-R1/src/x_r1/utils/hub.py
code served (permissive licence) · get_code("a368a670bd976fdc")
How it ran

no invocation recorded.

get_provider Not yet run
unverified (harvested, no recorded run)
huggingface/open-r1/src/open_r1/utils/code_providers.py
code served (permissive licence) · get_code("171250f85a491f40")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 6 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
format_reward 5 other papers
1 dated earlier, 4 later
2506.20639 (2025-06)
DiffuCoder: Understanding and Improving Masked Diffusion Models for Code Generation
2511.04902 (2025-11)
You Need Reasoning to Learn Reasoning: The Limitations of Label-Free RL in Weak Base Models
2602.02258 (2026-02)
Alignment-Aware Model Adaptation via Feedback-Guided Optimization
and 2 more not named here
get_callbacks 5 other papers
1 dated earlier, 4 later
2503.16219 (2025-03)
Reinforcement Learning for Reasoning in Small LLMs: What Works and What Doesn't
2511.04902 (2025-11)
You Need Reasoning to Learn Reasoning: The Limitations of Label-Free RL in Weak Base Models
2601.19404 (2026-01)
RPO:Reinforcement Fine-Tuning with Partial Reasoning Optimization
and 2 more not named here
tag_count_reward 4 other papers
1 dated earlier, 3 later
2506.20639 (2025-06)
DiffuCoder: Understanding and Improving Masked Diffusion Models for Code Generation
2602.02258 (2026-02)
Alignment-Aware Model Adaptation via Feedback-Guided Optimization
2602.03876 (2026-02)
GOPO: Policy Optimization using Ranked Rewards
and 1 more not named here
get_gpu_count_for_vllm 3 other papers
1 dated earlier, 2 later
2503.16219 (2025-03)
Reinforcement Learning for Reasoning in Small LLMs: What Works and What Doesn't
2511.04902 (2025-11)
You Need Reasoning to Learn Reasoning: The Limitations of Label-Free RL in Weak Base Models
2606.21498 (2026-06)
Balancing Performance and Diversity in GRPO Autoregressive Text-to-Image Post-Training
get_param_count_from_repo_id 3 other papers
1 dated earlier, 2 later
2503.16219 (2025-03)
Reinforcement Learning for Reasoning in Small LLMs: What Works and What Doesn't
2511.04902 (2025-11)
You Need Reasoning to Learn Reasoning: The Limitations of Label-Free RL in Weak Base Models
2606.21498 (2026-06)
Balancing Performance and Diversity in GRPO Autoregressive Text-to-Image Post-Training
get_provider 3 other papers
1 dated earlier, 2 later
2506.20639 (2025-06)
DiffuCoder: Understanding and Improving Masked Diffusion Models for Code Generation
2511.04902 (2025-11)
You Need Reasoning to Learn Reasoning: The Limitations of Label-Free RL in Weak Base Models
2606.12900 (2026-06)
Zero-source LLM Hallucination Detection with Human-like Criteria Probing

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

Self-improvement via RL often fails on complex reasoning tasks because GRPOstyle post-training methods rely on the model's initial ability to generate positive samples. Without guided exploration, these approaches merely reinforce what the model already knows (distribution-sharpening) rather than enabling the model to solve problems where it initially generates no correct solutions. To unlock reasoning ability in such settings, the model must explore new reasoning trajectories beyond its current output distribution. Such exploration requires access to sufficiently good positive samples to guide the learning. While expert demonstrations seem like a natural solution, we find that they are often ineffective in RL post-training. Instead, we identify two key properties of effective positive samples: they should (1) be likely under the current policy, and (2) increase the model's likelihood of predicting the correct answer. Based on these insights, we propose Self-Explanation Policy Optimization (ExPO)-a simple and modular framework that generates such samples by conditioning on the ground-truth answer. It can be integrated with popular RL training methods like GRPO and DPO. ExPO enables efficient exploration and guides the model to produce reasoning trajectories more aligned with its policy than expert-written CoTs, while ensuring higher quality than its own (incorrect) samples. Experiments show that ExPO improves both learning efficiency and final performance on reasoning benchmarks, surpassing expert-demonstration-based methods in challenging settings such as MATH level-5, where the model initially struggles the most. Code available in https://github. com/HumainLab/ExPO_rl_reasoning_by_explanation.

For agents

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

get_harvested_code_for_paper("2507.02834")
get_code_for_paper("2507.02834")
have("2507.02834")

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

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

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

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

Connect an agent — have() is free.