Skip to content

Commit 87c38c7

Browse files
halleriteclaude
andcommitted
refactor(algo): rename advantage component → algo.type
"advantage" was too general for a component that also fixes loss routing and the model role, so flatten the `algo` bundle into a discriminated union keyed on `type`: `[orchestrator.algo] type = "grpo"` instead of `[orchestrator.algo.advantage] type = ...`. - AlgorithmConfig is the union; each *AlgorithmConfig variant carries `type`, its params, and the shared sampling/teacher fields (BaseAlgorithmConfig). - `algo.teacher` shorthand preserved (folds into `model` for opd/opsd, `sampling.source` for sft); `algo.model` is opd/opsd's direct field. - Deleted the unused `advantage = {}` env/top-level shorthand + fold validator. - Runtime: Algorithm takes the algo config (self.config); build_algorithm dispatches on algo.type. Migrated 12 TOMLs, docs, and unit tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 9f4e8d2 commit 87c38c7

28 files changed

Lines changed: 317 additions & 379 deletions

File tree

configs/ci/integration/reverse_text_rl_opd/start.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ name = "ci-rl-opd"
1818
batch_size = 128
1919
group_size = 16
2020

21-
[orchestrator.algo.advantage]
21+
[orchestrator.algo]
2222
type = "opd"
2323

2424
[orchestrator.algo.teacher]

configs/ci/integration/reverse_text_rl_sft/start.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ name = "ci-rl-sft"
1818
batch_size = 128
1919
group_size = 16
2020

21-
[orchestrator.algo.advantage]
21+
[orchestrator.algo]
2222
type = "sft"
2323

2424
[orchestrator.algo.teacher]

configs/debug/algorithms/echo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ group_size = 4
1818

1919
# alphabet-sort's feedback arrives as user messages, so train the user role
2020
# instead of echo's tool default.
21-
[orchestrator.algo.advantage]
21+
[orchestrator.algo]
2222
type = "echo"
2323

24-
[orchestrator.algo.advantage.roles.user]
24+
[orchestrator.algo.roles.user]
2525
alpha = 0.1
2626

2727
[[orchestrator.train.env]]

configs/debug/algorithms/grpo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ name = "debug-rl"
1212
batch_size = 128
1313
group_size = 16
1414

15-
[orchestrator.algo.advantage]
15+
[orchestrator.algo]
1616
type = "grpo"
1717

1818
[orchestrator.renderer]

configs/debug/algorithms/max_rl.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ name = "debug-max-rl"
1212
batch_size = 128
1313
group_size = 16
1414

15-
[orchestrator.algo.advantage]
15+
[orchestrator.algo]
1616
type = "max_rl"
1717

1818
[orchestrator.renderer]

configs/debug/algorithms/mixed_grpo_opd.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ name = "debug-mixed-grpo-opd"
2222
batch_size = 128
2323
group_size = 16
2424

25-
[orchestrator.algo.advantage]
25+
[orchestrator.algo]
2626
type = "grpo"
2727

2828
[orchestrator.renderer]
@@ -39,7 +39,7 @@ name = "reverse-text-grpo"
3939
id = "reverse-text"
4040
name = "reverse-text-opd"
4141

42-
[orchestrator.train.env.algo.advantage]
42+
[orchestrator.train.env.algo]
4343
type = "opd"
4444

4545
[orchestrator.train.env.algo.teacher]

configs/debug/algorithms/opd.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ name = "debug-opd"
1919
batch_size = 128
2020
group_size = 16
2121

22-
[orchestrator.algo.advantage]
22+
[orchestrator.algo]
2323
type = "opd"
2424

2525
[orchestrator.algo.teacher]

configs/debug/algorithms/opd_lora.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ name = "debug-opd-lora"
1919
batch_size = 128
2020
group_size = 16
2121

22-
[orchestrator.algo.advantage]
22+
[orchestrator.algo]
2323
type = "opd"
2424

2525
[orchestrator.algo.teacher]

configs/debug/algorithms/self_distill.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ batch_size = 32
1919
group_size = 1
2020

2121
# reverse-text's demo lives in the "answer" column.
22-
[orchestrator.algo.advantage]
22+
[orchestrator.algo]
2323
type = "opsd"
2424
model = "policy"
2525
demo_key = "answer"

configs/debug/algorithms/sft_distill.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ name = "debug-sft"
1919
batch_size = 128
2020
group_size = 4
2121

22-
[orchestrator.algo.advantage]
22+
[orchestrator.algo]
2323
type = "sft"
2424

2525
[orchestrator.algo.teacher]

0 commit comments

Comments
 (0)