feat(orchestrator): add curriculum examples - #3266
Conversation
c1053d5 to
7fa7dbe
Compare
b6ccbc3 to
825f622
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 825f622. Configure here.
| [[orchestrator.train.source]] | ||
| name = "swe" | ||
| ratio = 0.3 | ||
| curriculum = { import_path = "prime_rl.orchestrator.curricula.AdvantageRangeGate" } |
There was a problem hiding this comment.
Advantage gate hangs group_size=1
High Severity
Enabling default AdvantageRangeGate on intellect-3.1 with unset group_size (defaults to 1) makes every GRPO group have zero advantages, so every group is rejected. Rejected groups never enter pending_batch, so the train sink never fills a batch and training hangs without hitting the empty-batch abort.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 825f622. Configure here.
| if not rewards: | ||
| return True | ||
| self.task_rewards[result.task_key] = sum(rewards) / len(rewards) | ||
| return True |
There was a problem hiding this comment.
Failed tasks starve pool sampling
Medium Severity
DifficultyPools only records a task after a successful reward, so permanently failing tasks stay in the unseen set. Once every healthy task has been seen, sample only returns those failing tasks. Their groups never enter pending_batch, so training can hang.
Reviewed by Cursor Bugbot for commit 825f622. Configure here.
|
Superseded by #3261, which now contains the example implementations and the sampler-plus-admission-gates composition model. |


Stacked on #3261. This PR adds only two small policies on the user-space curriculum surface:
DifficultyPools: for finite tasksets, sample every task once, track each task's latest group-mean reward by stableTask.key, choose a nonempty named pool by its configured weight, then sample uniformly within the pool. RNG and pool state round-trip through checkpoints.AdvantageRangeGate: reject a group when all trainable-token advantages fall inside[reject_min, reject_max]. The default[0, 0]implements zero-advantage rejection; algorithms without an advantage stream pass through.The existing dynamic-sampling wiki-search and Intellect configs now select
AdvantageRangeGateper source. No weighting framework, posterior estimator, built-in component registry, rejection sampler, exploration floor, or custom mini-protocol is introduced—the examples are ordinaryCurriculumsubclasses intended to be copied or extended in user code.Validation
uv run ruff format src/prime_rl/orchestrator/curricula.py tests/unit/orchestrator/test_curriculum.pyuv run ruff check src/prime_rl/orchestrator/curricula.py tests/unit/orchestrator/test_curriculum.pyuv run pytest tests/unit/orchestrator --ignore=tests/unit/orchestrator/test_qwen3_vl_e2e.py -q— 79 passedtomllibgit diff --checkNote
Medium Risk
AdvantageRangeGate changes which groups train and increases resampling under oversampling; mis-tuned reject ranges could starve batches. DifficultyPools only affects task selection on finite tasksets.
Overview
Adds built-in curriculum policies in
prime_rl.orchestrator.curriculaand wires the advantage gate into example training configs.DifficultyPoolschanges finite-task sampling after each task has been seen once: it keeps the latest mean group reward per task, buckets tasks into named pools viathresholds, then picks a pool byweightsand a task uniformly inside it. Unseen tasks are still drawn first. Pool occupancy and checkpoint state (task_rewards) are exposed throughmetricsandstate_dict.AdvantageRangeGatechanges which rollout groups enter the training batch:on_resultrejects a group when every trainable-token advantage lies in[reject_min, reject_max](default[0, 0]drops all-zero-advantage groups). Groups with no advantage stream are still admitted.docs/algorithms.mddocuments both with TOML examples. Wiki-search and intellect-3.1 example sources (plus CI nightly wiki-search) now setcurriculum = { import_path = "prime_rl.orchestrator.curricula.AdvantageRangeGate" }. Unit tests cover pool metrics/checkpoint resume and gate behavior (tolerance band, trainable mask).Reviewed by Cursor Bugbot for commit 825f622. Bugbot is set up for automated code reviews on this repo. Configure here.