Skip to content

feat(rl): plumb GRPO flags to the agentic learner - #5107

Open
entrpn wants to merge 1 commit into
mainfrom
jfacevedo/rl_force_on_policy_ratio
Open

feat(rl): plumb GRPO flags to the agentic learner#5107
entrpn wants to merge 1 commit into
mainfrom
jfacevedo/rl_force_on_policy_ratio

Conversation

@entrpn

@entrpn entrpn commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Description

Requires google/tunix#2061 to be merged first.

force_on_policy_ratio, use_rollout_logps, log_sampler_trainer_agreement
and loss_agg_mode were never passed into AgenticGrpoConfig, so setting
them on the command line had no effect and the learner silently used
dataclass defaults.

loss_agg_mode in particular was plumbed for the non-agentic branch only,
so any recent A/B of that flag through the agentic path was measuring the
default rather than the requested value.

Also logs the fully resolved GRPO config at startup, which is how the
above was found.

Tests

Measured on qwen3-4b (OpenMathInstruct-2, agentic rollout):

clipfrac 0.0006 -> 0.0000
log_ratio_abs 0.0157 -> 0.0000
step time 984s -> 742s (~24%)
Gradient magnitude is essentially unchanged; clipping was only firing on
~0.06% of tokens, all of it kernel noise rather than policy drift.

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds new configuration fields (use_rollout_logps, force_on_policy_ratio, and log_sampler_trainer_agreement) to the RL BaseModel and propagates them to the GRPO configuration in train_rl.py, along with logging the resolved GRPO configuration. The feedback suggests simplifying the multi-line formatting of the log_sampler_trainer_agreement argument in the GRPO configuration instantiation to a single line.

Comment on lines +631 to +633
log_sampler_trainer_agreement=(
trainer_config.rl.log_sampler_trainer_agreement
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The boolean argument log_sampler_trainer_agreement is unnecessarily wrapped in parentheses and split across multiple lines. It can be simplified to a single line to match the style of the other arguments in this call.

        log_sampler_trainer_agreement=trainer_config.rl.log_sampler_trainer_agreement,

@entrpn
entrpn force-pushed the jfacevedo/rl_force_on_policy_ratio branch from cabacb5 to f9d09b3 Compare September 2, 2026 17:32
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants