Policy optimization (PO) for Large Language Models faces a stability--exploration trade-off, currently mediated by an action-side Policy-KL regularizer. This puts practitioners in a double bind: keeping Policy-KL constrains response behavior and consumes the action-side exploration budget, while dropping it leaves the optimization without an explicit drift control. We argue for an alternative that breaks the dilemma by moving regularization to the input side. As training progresses, the distribution over training queries induced by the current policy drifts unchecked from its pre-RL reference distribution. Concretely, Environment-Regularized Policy Optimization (ERPO) introduces a Query-KL (QKL) term that bounds this query distribution shift, together with a dataset-static reference-derived per-query weight that biases each per-query update toward queries typical under the reference. The QKL gradient flows strictly through the query likelihood; the response score function used by policy-gradient estimators does not appear in the QKL term, so QKL exerts no direct gradient pressure on the response distribution---exploration is preserved. ERPO plugs into GRPO/PPO/REINFORCE-style pipelines without additional forward passes. On six mathematical reasoning benchmarks, ERPO replaces the standard Policy-KL regularizer while achieving effective control over query distribution drift, delivering stronger accuracy and substantially more stable behavior under high-temperature decoding and long-horizon training. Our source code are available at https://github.com/AlibabaResearch/ERPO
Figures & tables
Figure 1: KL losses during GRPO training. The Query-KL (dark) rises while the Policy-KL (light) stays low, showing action-only KL does not stabilize the query process.
Figure 2: Comparison of the GRPO and ERPO Computation Flows. Given a query q and its output o , the policy model θ and the reference model θ0 induce query distributions ρθ(q) and ρθ0(q) , as well as output distributions ρθ(o) and ρθ0(o) . The GRPO-like flow (red) applies policy-level KL regularization to the output distributions and optimizes the standard within-query advantage. In contrast, the ERPO-like flow (green) measures query-distribution drift through DKL(query) for environmental regularization and reweights the advantage at the query level using wB(q)=f(ρθ0(q)) (Section 4.2 ).
Figure 3: Avg@32 over Sampling Temperatures on Mathematical Reasoning Tasks
Mean Avg@32
Method
AIME24
AIME25
AMC
MATH500
Minerva
Olympiad
Avg.
Base
0.087
0.030
0.246
0.340
0.058
0.099
0.143
GRPO
0.174
0.072
0.398
0.528
0.207
0.266
0.274
ERPO
0.218
0.110
0.478
0.677
0.214
0.316
0.336
Mean Pass@32
Base
0.373
0.206
0.674
0.764
0.349
0.411
0.463
Table 1: Performance comparison across mathematical reasoning benchmarks. Best results per column are highlighted in bold.
Figure 4: Training Dynamics on ERPO
Figure 5: Training Dynamics on Long-term RL
Figure 6: Performance Variation Across Training Steps
Base Model
Method
α
w(s)
Rollout Count
Temperature Metrics
0.1
0.6
1
1.5
≤1.0
1.2–1.5
Baseline
—
—
—
—
52.40
46.80
32.80
0.40
44.44
6.15
Qwen-7B
GRPO
1×10−2
—
8
66.80
68.40
73.80
0.40
68.80
12.50
GRPO w/ w(s)
1×10−2
✓
8
78.20
76.80
71.20
7.60
76.14
23.79
GRPO w/ query-KL
1×10−2
—
8
81.60
81.60
79.00
2.60
80.90
38.00
ERPO
1×10−2
✓
8
79.40
80.60
75.20
8.60
78.74
37.90
Table 2: Performance Comparison Under Different Experimental Settings
Method
Query-KL
Policy-KL
Entropy
GRPO (Avg@3)
0.9679
0.0601
0.5063
GRPO w/ wB(s)
0.5933
0.0113
0.2782
GRPO w/Query-KL
0.0041
0.1001
0.5674
ERPO (Avg@3)
0.0828
0.0728
0.4244
Table 3: Influence of Query-KL and Query-Reweighting on Training Stability
Figure 7: Pass@1 accuracy and training dynamics under different settings: (a)–(c) Model performance at various temperatures on MATH500; (d) Policy - KL divergence variation with GRPO using only Query - KL.
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 8: Variation of Metrics with Temperature
Method
Avg. Train Acc
Avg. Eval@TP1
Avg. Eval@TP2
Gap@TP1
Gap@TP2
Avg. Gap
GRPO
77.3
69.8
70.1
7.5
5.5
6.47
ERPO
77.1
74.1
73.8
3.0
3.3
3.14
Improvement
–
–
–
↓4.5 (60%)
↓2.2 (40%)
↓3.33 (51%)
Appendix
Table 4: Quantification of Reward Hacking via Train–Inference Gap. The table compares the average accuracy during training sampling versus inference decoding. A larger gap indicates severe reward hacking (overfitting to training dynamics). ERPO reduces this gap by ≈51% , demonstrating robust generalization.
Model / Metric
Step-0
Step-40
Step-80
Step-120
Step-160
Step-200
Step-240
Avg.
GRPO (Baseline)
Train Acc
44.48
76.41
76.09
78.29
78.95
79.44
76.70
72.91
Eval@TP1
31.20
73.20
76.00
73.40
72.20
73.60
58.40
65.43
Eval@TP2
30.60
74.00
74.80
74.20
76.60
75.80
66.20
67.46
ERPO (Ours)
Train Acc
44.55
75.63
76.53
78.66
80.63
78.41
81.46
73.70
Appendix
Table 5: Trajectory of Train vs. Inference Accuracy. Detailed performance recorded at 40-step intervals. Note the divergence in GRPO at Step-240, where Eval accuracy drops significantly while Train accuracy remains high—a clear sign of reward hacking. ERPO maintains consistency throughout.
Figure 9: Likelihood Relationship between Query and Response
Base Model
Method
D_KL
Rollout
Temperature
0.1
0.6
1
1.5
≤ 1.0
1.2-1.5
Baseline
–
–
–
52.4
46.8
32.8
0.4
44.44
6.15
Qwen-7B
GRPO
Policy
8
66.8
68.4
73.8
0.4
68.8
12.5
16
73.0
79.2
75.0
10.6
75.22
39.75
ERPO
Query
8
79.4
80.6
75.2
8.6
78.74 (+9.94)
37.9
16
80.4
78.8
74.4
56.2
77.82 (+2.6)
66.25
Appendix
Table 6: Performance Comparison Under Different Experimental Settings