refactor(rl): clean IS with prox_forward#169
Merged
Hecate0821 merged 1 commit intomainfrom Mar 5, 2026
Merged
Conversation
06d896f to
10d16b2
Compare
Replace the legacy TIS system with two clean, always-on IS corrections:
1. PPO IS ratio: exp(pi_theta - pi_prox) with PPO-style clipping.
Proximal logprobs pre-computed via policy.forward("cross_entropy").
2. TIS (train-inference IS) weight: exp(pi_prox - pi_old) with capping.
Corrects for FP8/quantization gap between training and inference.
Supports token-level and sequence-level aggregation (geometric mean).
Add ppo_n_minibatches config: N forward_backward calls per optim_step.
With N=1 (default): ratio=1, only TIS weight matters.
With N>1: proper multi-minibatch PPO like AReaL/VERL.
Removed: old ISConfig (clip_high/clip_low), make_tis_weights_fn,
TISWeightsFn, tis_enabled, tis_weights_fn parameter from all losses.
Informed by AReaL (arXiv:2505.24298) decoupled PPO objective and
VERL rollout IS framework (github.com/verl-project/verl/pull/3694).
Made-with: Cursor
10d16b2 to
2678c5b
Compare
mayinghan
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
policy.forward("cross_entropy"), then use PPO ratio + behavioral weightArchitecture
flowchart TD A["ref_forward → ref_logprobs"] --> B["prox_forward\npolicy.forward → prox_logprobs"] B --> C["split data into N minibatches"] C --> D["for each minibatch:\nforward_backward_custom\nratio = exp(pi_theta - prox)\nbehave = clamp(exp(prox - inf), cap)"] D --> E["optim_step (once)"]Design references
compute_log_probforward pass for old_log_probs before multi-epoch PPOTest plan
Made with Cursor