From P(y∣x) to P(y): Investigating Reinforcement Learning in Pre-train Space
Authors: Yuqiao Tan, Minzheng Wang, Bo Liu, Zichen Liu, Tian Liang, Shizhu He, Jun Zhao, Kang Liu
Organizations: Institute of Automation, Chinese Academy of Sciences · University of Chinese Academy of Sciences · National University of Singapore · Tencent AI Lab
While reinforcement learning with verifiable rewards (RLVR) significantly enhances LLM reasoning by optimizing the conditional distribution P(y|x), its potential is fundamentally bounded by the base model's existing output distribution. Optimizing the marginal distribution P(y) in the Pre-train Space addresses this bottleneck by encoding reasoning ability and preserving broad exploration capacity. Yet, conventional pre-training relies on static corpora for passive learning, leading to a distribution shift that hinders targeted reasoning enhancement. In this paper, we introduce PreRL (Pre-train Space RL), which applies reward-driven online updates directly to P(y). We theoretically and empirically validate the strong gradient alignment between log P(y) and log P(y|x), establishing PreRL as a viable surrogate for standard RL. Furthermore, we uncover a critical mechanism: Negative Sample Reinforcement (NSR) within PreRL serves as an exceptionally effective driver for reasoning. NSR-PreRL rapidly prunes incorrect reasoning spaces while stimulating endogenous reflective behaviors, increasing transition and reflection thoughts by 14.89x and 6.54x, respectively. Leveraging these insights, we propose Dual Space RL (DSRL), a Policy Reincarnation strategy that initializes models with NSR-PreRL to expand the reasoning horizon before transitioning to standard RL for fine-grained optimization. Extensive experiments demonstrate that DSRL consistently outperforms strong baselines, proving that pre-train space pruning effectively steers the policy toward a refined correct reasoning subspace.
Figures & tables
Figure 1: (a) Gradient objectives of Post-train Space RL, Pre-train Space RL and their combination in Dual Space RL. (b) Conceptual comparison between standard RL (trapped in local optima) and DSRL (broad exploration via NSR pruning toward a refined correct reasoning subspace) (c) Training dynamics of DSRL vs. GRPO, where DSRL achieves higher average accuracy with improved sample efficiency and sustained response length growth driven by NSR-PreRL’s exploration.
Figure 2: Synergistic effect analysis of logP(y∣x) and logP(y) using Qwen3-4B on AMC23. (a) Gradient dot product between ∇θlogπθ(y) and ∇θlogπθ(y∣x) . (b) Gradient cosine similarity. (c) Per-token log probability difference between logP(y∣x) and logP(y) .
Figure 3: (a) Training dynamics of PreRL v.s. RL. Effects on reward, response length and top-1 token log-probability. (b) Comparison of distinct reasoning thoughts. NSR-PreRL trains for 20 steps and GRPO for 25 steps. The backbone model is Qwen3-4B.
Methods
AMC
MATH500
AIME24
AIME25
Minerva
OlympiadBench
Avg.
Qwen3-4B
Vanilla
68.28
80.17
23.13
20.00
23.62
32.33
41.26
PPO
87.89
89.64
47.50
41.15
30.19
40.52
56.15
Reinforce++
79.37
86.88
35.83
30.00
27.30
38.15
49.59
RLOO
85.00
89.38
45.10
40.62
30.27
40.46
55.14
Dr.GRPO
87.58
89.22
51.04
42.60
31.05
40.75
57.04
Table 1: Avg@32 results on MATH500, AMC23, AIME24, AIME25, Minerva and OlympiadBench. Bold and underlined denote the best and second best.
Figure 4: Pass@ K performance comparison between DSRL and GRPO across LLMs.
Figure 6Figure 7
Methods
Avg.
Qwen3-4B
Vanilla
41.26
GRPO
55.79
NSR-RL Warmup
54.38
NSR-PreRL Warmup (DSRL)
57.54
Table 3: Ablation on warmup strategy.
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
Dimension
Pre-training
Continual Pre-training
PreRL (Ours)
Optimization Target
P(y)
P(y)
P(y)
Training Data
General web text
Task-specific corpora
Reasoning tasks
Data Format
Raw documents
Documents / QA pairs
Response-only trajectories
Learning Signal
Next-token prediction
Next-token prediction
Verifiable rewards
Learning Paradigm
Offline, passive
Offline, passive
Online, active
Task Alignment
Low
Moderate
High
Appendix
Table 4: Comparison of Pre-training, Continual Pre-training, and PreRL. All three paradigms optimize the marginal distribution P(y) in the pre-train space, but differ in data sources, learning signals, and training paradigms.
Dimension
RLPT Paradigm
PreRL (Ours)
Optimization Target
P(y∣x)
P(y)
Training Data
Pre-training corpora
Reasoning tasks
Data Format
Full Reasoning trajectories
Response-only trajectories
Learning Signal
Next-token prediction
Verifiable rewards
Learning Paradigm
Online, active
Online, active
Task Alignment
Moderate
High
Appendix
Table 5: Comparison of the Reinforcement Pre-Training (RLPT) paradigm and PreRL. PreRL distinguishes itself by operating on real reasoning tasks with truly verifiable rewards, strictly optimizing the marginal distribution P(y) through active online exploration.
Hyperparameter
Value
Optimizer
AdamW
Policy learning rate
1e−6
Training batch size
128
Samples per prompt
8
Mini-batch size
128
Training epochs
6
Appendix
Table 6: RL Hyperparameters
Figure 8: The Qwen3-NoThinking prompt template used for inference.
Category
Type
Keywords / Phrases
Transition
Prefix
Alternatively
Phrase
think differently, another way, another approach, another method, another solution, another strategy, another technique
Reflection
Prefix
Wait
Phrase
verify, make sure, hold on, think again, ’s correct, ’s incorrect, Let me check, seems right
Appendix
Table 7: Extraction of reflection, transition, and execution thoughts.
Figure 9: System prompt used to evaluate beneficial reasoning behaviors in model-generated chain-of-thought, targeting non-linear problem-solving patterns including backtracking, verification, subgoal setting, and enumeration.
Figure 10: Aligned case: Token probability distribution with and without input conditioning under the same context. x is a math problem and y is a partially generated answer. The two distributions P(y∣x) and P(y) show similar token rankings, suggesting the post-train space conditional distribution largely inherits the structure of the pre-train space marginal distribution.
Figure 11: Misaligned case: Token probability distribution with and without input conditioning under the same context. x is a math problem and y is a partially generated answer. The top-1 token ”total” under P(y∣x) receives near-zero probability under P(y) , indicating a significant discrepancy between the two distributions.
Figure 12: Comparison of token-level generation log-probabilities with and without input conditioning.
Figure 13: Training dynamics of NSR-PreRL warmup vs. NSR-RL warmup.
Reinforcement learning studies how agents learn sequential decisions from rewards and interaction, balancing exploration, performance, safety, and adaptation.
Reinforcement learning (RL) has become central to improving large language models (LLMs) on complex reasoning tasks, yet RL post-training is largely studied in isolation from the pretraining that precedes it. As a result, two basic questions remain open: (1) how do pretraining choices (model size, data) shape the returns to RL compute, and (2) what does RL actually do to the model? These questions are difficult to study in the standard LLM setting: pretraining corpora are vast and uncontrolled, making it hard to attribute behaviors to pretraining versus RL, and systematic compute sweeps across both stages are prohibitively expensive. To address these challenges, we use chess as a controlled testbed for studying reasoning across the full pretraining-to-post-training pipeline. We follow the standard LLM training pipeline by pretraining language models from 5M to 1B parameters on human chess games, supervised fine-tuning on synthetic reasoning traces, and running RL on chess puzzles with verifiable rewards. Using this framework, we find that the post-RL performance at given RL compute level is well-predicted from the pretraining loss, and slope of the RL reward curves improves approximately linearly with the pretraining tokens. Beyond scaling, we find that RL does not simply sharpen the SFT policy: on easy puzzles it amplifies correct moves the SFT policy already preferred, while on hard puzzles it surfaces correct moves that were nearly absent under SFT. We further test whether our findings transfer beyond chess by training a 1B language model on math-domain text, where the same predictive pattern emerges: longer-pretrained checkpoints reach higher post-RL performance and improve faster under RL. In sum, we provide a quantitative account of the pretraining-to-RL interface and a controlled testbed for studying the science of reasoning across the full pretraining-to-post-training pipeline.
Jingyan Shen, Ang Li, Salman Rahman +4
New York University · Columbia University · University of California, Los Angeles +2
Reinforcement learning with verifiable rewards (RLVR) has emerged as a powerful paradigm for enhancing the reasoning capabilities of large language models (LLMs). However, its effectiveness is substantially hindered by the prevalence of ineffective training data: many sampled prompts yield response groups that are either entirely correct or entirely incorrect, resulting in zero-variance rewards and limited learning signals. Recent state-of-the-art methods address this issue through extensive LLM rollouts to filter ineffective samples, but at the cost of considerable computational overhead. Alternative approaches, including predictive sampling and trajectory replay, aim to improve data efficiency but often remain insufficient and may introduce additional issues such as systematic bias or suboptimal constraints. To address these limitations, we propose Group Prioritized Off-Policy Optimization (POPO), a simple yet effective framework that fully exploits effective training batches without additional rollout overhead. POPO comprises two key components: prioritized group replay and decoupled off-policy optimization. The former replaces ineffective on-policy groups with effective off-policy groups via a recency-based replay mechanism that jointly considers sample quality and the degree of off-policiness. To further mitigate the off-policy gap, POPO employs decoupled importance sampling to correct off-policy bias while maintaining stable policy updates under consistent trust-region constraints. Empirical evaluations across diverse reasoning tasks, including mathematics, planning, and visual geometry, demonstrate that POPO substantially accelerates RL finetuning and achieves strong reasoning performance with significantly fewer rollouts.
Reinforcement Learning with Verifiable Rewards (RLVR) significantly improves LLM reasoning but often causes a drop in policy entropy, leading to narrowed reasoning coverage and degraded pass@k for large k. While existing methods mitigate this entropy collapse through algorithmic regularizations, cross-model non-parametric perturbation is also neglected. In this work, we propose a simple yet effective approach to preserve the generative diversity of LLMs during RLVR. Instead of relying solely on internal exploration, we force the target model to generate answers based on partial reasoning trajectories generated by a smaller, weaker language models. These unfamiliar prefixes effectively disrupt over-confidence and encourage the exploration of distinct reasoning paths. We empirically study the potential of outer prefixes, revealing the mechanism of the impact of distributional discrepancy to the exploration dynamics in RLVR training. Experiments across multiple mathematical benchmarks show that our method consistently outperforms vanilla RLVR. Notably, the performance gain becomes increasingly pronounced as k scales up, demonstrating a substantial expansion of reasoning coverage. Furthermore, our approach efficiently mitigates entropy collapse without requiring additional SFT, intricate reward designs, or complex prompting.
Xingyu Shen, Huishuai Zhang, Peng Li +2
Wangxuan Institute of Computer Technology, Peking University · National Engineering Research Center of New Electronic Publishing Technologies