refactor(algorithms): separate rollout and reward requirements - #448
Open
yuetongz417 wants to merge 1 commit into
Open
refactor(algorithms): separate rollout and reward requirements#448yuetongz417 wants to merge 1 commit into
yuetongz417 wants to merge 1 commit into
Conversation
Add requires_reward to AlgorithmSpec so rollout-based algorithms can use non-reward supervision. Preserve reward validation for GSPO, GRPO, and PPO, and update CLI behavior, tests, inspection tooling, and documentation.
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
This PR separates an algorithm’s rollout requirement from its reward requirement.
Previously, the training CLI assumed that every algorithm with
requires_rollout=Truemust also provide either--reward-fn-pathor--reward-ckpt. This assumption is valid for the existing GSPO, GRPO, and PPO workflows, but it prevents rollout-based algorithms that use other forms of supervision, such as On-Policy Distillation.This PR adds an explicit
requires_rewardcapability toAlgorithmSpec.Motivation
Rollout and reward are related but distinct algorithm requirements.
For example:
Algorithm | Requires rollout | Requires reward -- | -- | -- SFT | No | No DPO | No | No GSPO | Yes | Yes GRPO | Yes | Yes PPO | Yes | Yes OPD | Yes | NoIn OPD, the student generates on-policy responses, but supervision comes from token-level teacher scores rather than a scalar reward function or reward model.
Separating these capabilities allows AReno to support this workflow without weakening validation for existing reinforcement-learning algorithms.
Changes
Add
requires_rewardtoAlgorithmSpec.Validate that an algorithm cannot require reward without also requiring rollout.
Preserve
requires_rewardwhen algorithm names are normalized.Mark GSPO, GRPO, and PPO as requiring reward.
Update CLI reward-source validation to use
requires_rewardinstead ofrequires_rollout.Display
requires_rewardin the resolved training configuration summary.Include the new capability in the algorithm inspection script.
Update contributor and architecture documentation.
Add tests for:
built-in algorithm reward metadata;
invalid reward-without-rollout registrations;
rollout algorithms that do not require reward;
training configuration summary output;
preservation of existing GSPO reward validation.
Behavior after this change
Existing reward-based algorithms continue to require:
or:
However, a future algorithm may now declare:
and use rollout configuration without being forced to provide an unrelated reward source.
Testing
Result:
The algorithm inspection script was also checked with:
Scope
This PR does not add the OPD algorithm itself. It introduces the registry and CLI capability separation needed for OPD and other rollout-based algorithms that use non-reward supervision.