Repository navigation
fix(eval): preserve empty outcomes and exclude zero-turn traces from training - #3809
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66568a1cbc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e1585f76a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
a1672ea to
0c771bb
Compare
mikasenghaas
left a comment
There was a problem hiding this comment.
ya this makes sense to me
Keep successful empty environment outcomes in evaluation results. A trace-less episode or clean zero-turn trace retains the verdict returned by Verifiers, while training and curriculum logic exclude zero-turn traces.
Before
The dispatcher changed successful trace-less episodes into
EmptyEpisodefailures. Clean, non-timeout zero-turn traces becameEmptyTrajectoryfailures, marking both the trace and episode unsuccessful. Evaluation therefore recorded a failure even when the environment had returned success, while training and curriculum filters relied on those injected errors to exclude empty traces.flowchart TD Env["Verifiers returns an empty successful outcome"] --> Dispatch["Prime-RL dispatcher"] Dispatch --> Episode["No traces: inject EmptyEpisode"] Dispatch --> Trace["Clean zero-turn trace: inject EmptyTrajectory"] Episode --> Failed["Rewrite outcome as failed"] Trace --> Failed Failed --> Eval["Evaluation records a failure"] Failed --> Training["Training and curriculum filter injected errors"]After
flowchart TD Env["Verifiers environment returns an episode"] --> Dispatch["Prime-RL dispatcher preserves empty outcome verdicts"] Dispatch --> Eval["Evaluation records and metrics"] Dispatch --> Filter["Training trace eligibility"] Filter --> Empty["Zero turns: no training sample"] Filter --> Sample["Eligible trace with sampled tokens: training sample"] Dispatch --> Curriculum["Curriculum ignores zero-turn traces and admits only trainable groups"]Remove the synthetic
EmptyEpisodeandEmptyTrajectoryerrors.iter_trainable_traces()filters empty traces alongside failed and untrainable traces before advantages are assigned, so the advantage gate needs no separate zero-turn check. Difficulty sampling also excludes zero-turn traces. Empty groups finish without producing a trainer payload, and mixed groups retain their eligible traces. Curriculum admission also requires a trainable trace, so groups without training samples cannot inflate admission metrics. Sampler observations of completed turns are retained even when token metadata is unavailable. Verifiers' no-agent validation and training timeout handling remain in place.#3824 applies the same ownership rule to partially failed episodes: preserve environment results, then decide training eligibility explicitly.
Note
Medium Risk
Changes evaluation outcome recording and which rollouts feed training/curriculum admission, which can shift eval metrics and training batch composition without touching auth or data stores.
Overview
Stops the dispatcher from injecting
EmptyEpisode/EmptyTrajectoryerrors on successful trace-less or zero-turn outcomes, so evaluation keeps Verifiers’ success verdict instead of recording synthetic failures.Training and curriculum now exclude zero-turn traces explicitly:
iter_trainable_traces()skipsnum_turns == 0, difficulty-pool reward updates requirenum_turns > 0, and curriculum admission requires both passing gates and at least one trainable trace viaiter_trainable_traces(). Scored rollouts without token/advantage metadata can still update sampler difficulty; groups with no trainable samples no longer count as admitted.Tests cover mixed groups with non-trainable traces, empty-only groups, and reward-only observations for the sampler.
Reviewed by Cursor Bugbot for commit 8582fb8. Bugbot is set up for automated code reviews on this repo. Configure here.