feat(orchestrator): hierarchical GRPO for proposer-solver envs#3138
Draft
hallerite wants to merge 1 commit into
Draft
feat(orchestrator): hierarchical GRPO for proposer-solver envs#3138hallerite wants to merge 1 commit into
hallerite wants to merge 1 commit into
Conversation
Add the `hierarchical_grpo` algorithm: GRPO baselines at two levels of a task-generating env's episode tree. A group is group_size episodes of the same source task (the proposer asked group_size times); each episode holds the proposer's trace plus the n solver traces its minted task fanned out to. Agents in `episode_agents` (the solvers) mean-center against their own episode's same-agent traces — sibling attempts at the same minted task — and every other agent (the proposer) against its same-agent traces across the group. Rewards never mix across agents or minted tasks; singleton peer sets center to zero. configs/debug/algo/hierarchical_grpo.toml runs proposer-solver-v1 with Qwen3-4B (4 proposals per topic x 4 solvers per proposal, learnability reward on the proposer), both sides trainable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
Adds the
hierarchical_grpoalgorithm — two-level GRPO baselines for task-generating envs likeproposer-solver-v1, where the proposer is askedgroup_sizetimes to invent a problem and each proposal fans out toenv.nsolvers:HierarchicalGRPOAlgorithm(algo/hierarchical_grpo.py): every trainable trace is mean-centered against its peer set. Agents inepisode_agents(the solvers) center against the same-agent traces of their own episode — sibling attempts at the same minted task; every other agent (the proposer) centers against its same-agent traces across the group — parallel attempts at the same source task, each rewarded by what its minted problem did to the solvers (proposer-solver-v1's learnability,4p(1−p)). Rewards never mix across agents or minted tasks; singleton peer sets center to zero (GRPO's convention — the zero-advantage filter drops them).HierarchicalGRPOAlgoConfig(type = "hierarchical_grpo", requiredepisode_agents) in the discriminated union. The field is required on purpose: which agents are episode-scoped is env truth the algorithm must not guess.configs/debug/algo/hierarchical_grpo.toml—proposer-solver-v1with Qwen3-4B, 4 proposals per topic (group_size = 4) × 4 solvers per proposal (env.n = 4), both sides trainable, eval pinned totemperature = 1.0(at the model's greedy default the thinking proposer reliably fails to emit the JSON contract).algorithms.mdincl. a "Hierarchical Advantage (Proposer–Solver)" section,training.md) and the configs skill updated.Why
The proposer-solver episode tree breaks the flat-group assumption twice over: pooling solver rewards across episodes baselines them against attempts at different problems, and pooling proposer and solver traces mixes reward scales across agents (learnability vs. correctness). Plain GRPO does both silently. Hierarchical GRPO assigns each level its own GRPO baseline: solver advantages are computed GRPO-style within their proposed task, proposer advantages GRPO-style across its
group_sizeproposals.Stacked on #3137 (verifiers bump); like
rae(#3136), this is a namedAlgorithmof the kind #3108's single-trainable-agent gate points multi-agent envs toward. Touches the same docs/config tables as #3136 — whichever merges second has trivial one-line conflicts.Test plan
uv run pytest tests/unit/orchestrator tests/unit/test_configs.py -q— 204 passed, including 3 new tests (solver centering within episode vs. pooled mis-crediting, proposer centering across the group with no cross-agent leakage, the full 2×2 proposer-solver shape).uv run rl @ configs/debug/algo/hierarchical_grpo.toml --max-steps 3— 3 orchestrator + 3 trainer steps (train rewards 0.54 / 0.68 / 0.13), eval attemperature = 1.0healthy (reward 0.63, 17% episode errors vs. 100% at the greedy default), exit 0.🤖 Generated with Claude Code